From 8aa271fb560d869294660ab9665ba6db844eb130 Mon Sep 17 00:00:00 2001 From: semalaiappan <34613894+semalaiappan@users.noreply.github.com> Date: Fri, 8 Nov 2024 22:05:00 -0600 Subject: [PATCH] [ODS-6535] Bring in Assessment Registration domain DS 5.2 updates (#1181) --- .../5.2.0/Artifacts/Metadata/ApiModel.json | 6791 +- ...sessmentRegistration-security-metadata.sql | 2230 + ...sessmentRegistration-security-metadata.xml | 251 + .../MsSql/Structure/Ods/0020-Tables.sql | 374 + .../MsSql/Structure/Ods/0030-ForeignKeys.sql | 243 +- .../Ods/0040-IdColumnUniqueIndexes.sql | 42 + .../Structure/Ods/0050-ExtendedProperties.sql | 258 + ...x-EdOrgIdsRelationship-AuthPerformance.sql | 35 + .../Structure/Ods/1460-AggregateIdColumns.sql | 24 + .../0030-AddColumnChangeVersionForTables.sql | 48 + .../0070-AddIndexChangeVersionForTables.sql | 36 + .../0200-CreateTrackedChangeTables.sql | 116 + ...eTriggersForChangeVersionAndKeyChanges.sql | 78 + .../0220-CreateTriggersForDeleteTracking.sql | 151 +- .../0010-AddColumnOwnershipTokenForTable.sql | 12 + ...sessmentRegistration-security-metadata.sql | 2112 + ...sessmentRegistration-security-metadata.xml | 251 + .../PgSql/Structure/Ods/0020-Tables.sql | 237 +- .../PgSql/Structure/Ods/0030-ForeignKeys.sql | 220 +- .../Ods/0040-IdColumnUniqueIndexes.sql | 12 + .../Structure/Ods/0050-ExtendedProperties.sql | 145 + ...x-EdOrgIdsRelationship-AuthPerformance.sql | 14 + .../Structure/Ods/1460-AggregateIdColumns.sql | 30 + .../0030-AddColumnChangeVersionForTables.sql | 30 + .../0070-AddIndexChangeVersionForTables.sql | 12 + .../0200-CreateTrackedChangeTables.sql | 128 + ...eTriggersForChangeVersionAndKeyChanges.sql | 30 + .../0220-CreateTriggersForDeleteTracking.sql | 153 +- .../0010-AddColumnOwnershipTokenForTable.sql | 12 + .../5.2.0/Artifacts/Schemas/Ed-Fi-Core.xsd | 697 +- .../Schemas/Interchange-Descriptors.xsd | 1 + .../Artifacts/Schemas/SchemaAnnotation.xsd | 1 + ...ization Test Suite.postman_collection.json | 15 +- ...ated_File_List.Standard.5.1.0.approved.txt | 1 - ...ated_File_List.Standard.5.2.0.approved.txt | 1 - ...trollers_Controllers.generated.approved.cs | 295 + ...tityOrmMappings.generated.hbm.approved.xml | 864 +- ...pingsForQueries.generated.hbm.approved.xml | 1003 +- ...tityOrmMappings.generated.hbm.approved.xml | 864 +- ...pingsForQueries.generated.hbm.approved.xml | 1003 +- ...ing_DatabaseMetadata.generated.approved.cs | 58 +- ...ls_Entities_Entities.generated.approved.cs | 75617 ++++---- ...s_EntitiesForQueries.generated.approved.cs | 1008 +- ...ces_EntityInterfaces.generated.approved.cs | 1762 +- ...Mappers_EntityMapper.generated.approved.cs | 2755 +- ...ateOrUpdatePipelines.generated.approved.cs | 48 + ....0_Requests_Requests.generated.approved.cs | 423 + ..._Resources_Resources.generated.approved.cs | 146392 ++++++++------- ...tionContextProviders.generated.approved.cs | 288 + ...Tests.Should_Get_Dependencies.approved.txt | 64 + ...ould_Get_Dependencies_GraphML.approved.txt | 76 + 51 files changed, 141333 insertions(+), 105978 deletions(-) create mode 100644 Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql create mode 100644 Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml create mode 100644 Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql create mode 100644 Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml delete mode 100644 Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.1.0.approved.txt delete mode 100644 Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.2.0.approved.txt diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Metadata/ApiModel.json b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Metadata/ApiModel.json index d3317aec15..e5184245e9 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Metadata/ApiModel.json +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Metadata/ApiModel.json @@ -223,6 +223,42 @@ } ] }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "AssessmentAdministration" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "AssessmentAdministration" + }, + { + "schema": "edfi", + "name": "AssessmentAdministrationAssessmentAdminstrationPeriod" + }, + { + "schema": "edfi", + "name": "AssessmentAdministrationAssessmentBatteryPart" + } + ] + }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "AssessmentBatteryPart" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "AssessmentBatteryPart" + }, + { + "schema": "edfi", + "name": "AssessmentBatteryPartObjectiveAssessment" + } + ] + }, { "aggregateRootEntityName": { "schema": "edfi", @@ -331,6 +367,22 @@ } ] }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipation" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipation" + }, + { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipationAdministrationPointOfContact" + } + ] + }, { "aggregateRootEntityName": { "schema": "edfi", @@ -3563,6 +3615,18 @@ } ] }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "Section504DisabilityTypeDescriptor" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "Section504DisabilityTypeDescriptor" + } + ] + }, { "aggregateRootEntityName": { "schema": "edfi", @@ -4143,6 +4207,42 @@ } ] }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + { + "schema": "edfi", + "name": "StudentAssessmentRegistrationAssessmentAccommodation" + }, + { + "schema": "edfi", + "name": "StudentAssessmentRegistrationAssessmentCustomization" + } + ] + }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociation" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociation" + }, + { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociationAccommodation" + } + ] + }, { "aggregateRootEntityName": { "schema": "edfi", @@ -4251,6 +4351,22 @@ } ] }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodation" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodation" + }, + { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation" + } + ] + }, { "aggregateRootEntityName": { "schema": "edfi", @@ -4599,6 +4715,18 @@ } ] }, + { + "aggregateRootEntityName": { + "schema": "edfi", + "name": "StudentSection504ProgramAssociation" + }, + "aggregateEntityNames": [ + { + "schema": "edfi", + "name": "StudentSection504ProgramAssociation" + } + ] + }, { "aggregateRootEntityName": { "schema": "edfi", @@ -6053,6 +6181,246 @@ "postgreSql": "AssessmentAcademicSubject" } }, + { + "schema": "edfi", + "name": "AssessmentAdministration", + "locallyDefinedProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "Id", + "propertyType": { + "dbType": "Guid", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Id", + "postgreSql": "Id" + } + }, + { + "propertyName": "LastModifiedDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "LastModifiedDate", + "postgreSql": "LastModifiedDate" + } + } + ], + "identifiers": [ + { + "identifierName": "AssessmentAdministration_PK", + "identifyingPropertyNames": [ + "AdministrationIdentifier", + "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "Namespace" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssessmentAdministration_PK", + "postgreSql": "AssessmentAdministration_PK" + } + }, + { + "identifierName": "UX_AssessmentAdministration_Id", + "identifyingPropertyNames": [ + "Id" + ], + "isPrimary": false, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "UX_AssessmentAdministration_Id", + "postgreSql": "UX_c64558_Id" + } + } + ], + "isAbstract": false, + "description": "The anticipated administration of an assessment under the purview of an education organization.", + "tableNames": { + "sqlServer": "AssessmentAdministration", + "postgreSql": "AssessmentAdministration" + } + }, + { + "schema": "edfi", + "name": "AssessmentAdministrationAssessmentAdminstrationPeriod", + "locallyDefinedProperties": [ + { + "propertyName": "BeginDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "BeginDate", + "postgreSql": "BeginDate" + } + }, + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "EndDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EndDate", + "postgreSql": "EndDate" + } + } + ], + "identifiers": [ + { + "identifierName": "AssessmentAdministrationAssessmentAdminstrationPeriod_PK", + "identifyingPropertyNames": [ + "AdministrationIdentifier", + "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "Namespace", + "BeginDate" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssessmentAdministrationAssessmentAdminstrationPeriod_PK", + "postgreSql": "AssessmentAdministrationAssessmentAdminstrationPeriod_PK" + } + } + ], + "isAbstract": false, + "description": "The anticipated dates for the assessment or administration window.", + "tableNames": { + "sqlServer": "AssessmentAdministrationAssessmentAdminstrationPeriod", + "postgreSql": "AssessmentAdministrationAssessmentAdminstrationPeriod" + } + }, + { + "schema": "edfi", + "name": "AssessmentAdministrationAssessmentBatteryPart", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + } + ], + "identifiers": [ + { + "identifierName": "AssessmentAdministrationAssessmentBatteryPart_PK", + "identifyingPropertyNames": [ + "AdministrationIdentifier", + "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "Namespace", + "AssessmentBatteryPartName" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssessmentAdministrationAssessmentBatteryPart_PK", + "postgreSql": "AssessmentAdministrationAssessmentBatteryPart_PK" + } + } + ], + "isAbstract": false, + "description": "A reference to the parts of the assessment battery that are offered in this administration of the assessment.", + "tableNames": { + "sqlServer": "AssessmentAdministrationAssessmentBatteryPart", + "postgreSql": "AssessmentAdministrationAssessmentBatteryPart" + } + }, { "schema": "edfi", "name": "AssessmentAssessedGradeLevel", @@ -6098,6 +6466,161 @@ "postgreSql": "AssessmentAssessedGradeLevel" } }, + { + "schema": "edfi", + "name": "AssessmentBatteryPart", + "locallyDefinedProperties": [ + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "Id", + "propertyType": { + "dbType": "Guid", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Id", + "postgreSql": "Id" + } + }, + { + "propertyName": "LastModifiedDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "LastModifiedDate", + "postgreSql": "LastModifiedDate" + } + } + ], + "identifiers": [ + { + "identifierName": "AssessmentBatteryPart_PK", + "identifyingPropertyNames": [ + "AssessmentBatteryPartName", + "AssessmentIdentifier", + "Namespace" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssessmentBatteryPart_PK", + "postgreSql": "AssessmentBatteryPart_PK" + } + }, + { + "identifierName": "UX_AssessmentBatteryPart_Id", + "identifyingPropertyNames": [ + "Id" + ], + "isPrimary": false, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "UX_AssessmentBatteryPart_Id", + "postgreSql": "UX_6e22f2_Id" + } + } + ], + "isAbstract": false, + "description": "The parts organized for administering an assessessment which together provide a comprehensive assessment of the students.", + "tableNames": { + "sqlServer": "AssessmentBatteryPart", + "postgreSql": "AssessmentBatteryPart" + } + }, + { + "schema": "edfi", + "name": "AssessmentBatteryPartObjectiveAssessment", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + } + ], + "identifiers": [ + { + "identifierName": "AssessmentBatteryPartObjectiveAssessment_PK", + "identifyingPropertyNames": [ + "AssessmentBatteryPartName", + "AssessmentIdentifier", + "Namespace", + "IdentificationCode" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssessmentBatteryPartObjectiveAssessment_PK", + "postgreSql": "AssessmentBatteryPartObjectiveAssessment_PK" + } + } + ], + "isAbstract": false, + "description": "A reference to the objective assessment(s) that are administered by the assessment battery part.", + "tableNames": { + "sqlServer": "AssessmentBatteryPartObjectiveAssessment", + "postgreSql": "AssessmentBatteryPartObjectiveAssessment" + } + }, { "schema": "edfi", "name": "AssessmentCategoryDescriptor", @@ -7547,119 +8070,8 @@ }, { "schema": "edfi", - "name": "AssignmentLateStatusDescriptor", - "locallyDefinedProperties": [], - "identifiers": [ - { - "identifierName": "AssignmentLateStatusDescriptor_PK", - "identifyingPropertyNames": [ - "AssignmentLateStatusDescriptorId" - ], - "isPrimary": true, - "isUpdatable": false, - "constraintNames": { - "sqlServer": "AssignmentLateStatusDescriptor_PK", - "postgreSql": "AssignmentLateStatusDescriptor_PK" - } - } - ], - "isAbstract": false, - "description": "Status of whether the assignment was submitted after the due date and/or marked as late.", - "tableNames": { - "sqlServer": "AssignmentLateStatusDescriptor", - "postgreSql": "AssignmentLateStatusDescriptor" - } - }, - { - "schema": "edfi", - "name": "AttemptStatusDescriptor", - "locallyDefinedProperties": [], - "identifiers": [ - { - "identifierName": "AttemptStatusDescriptor_PK", - "identifyingPropertyNames": [ - "AttemptStatusDescriptorId" - ], - "isPrimary": true, - "isUpdatable": false, - "constraintNames": { - "sqlServer": "AttemptStatusDescriptor_PK", - "postgreSql": "AttemptStatusDescriptor_PK" - } - } - ], - "isAbstract": false, - "description": "This descriptor describes a student's completion status for a section.", - "tableNames": { - "sqlServer": "AttemptStatusDescriptor", - "postgreSql": "AttemptStatusDescriptor" - } - }, - { - "schema": "edfi", - "name": "AttendanceEventCategoryDescriptor", - "locallyDefinedProperties": [], - "identifiers": [ - { - "identifierName": "AttendanceEventCategoryDescriptor_PK", - "identifyingPropertyNames": [ - "AttendanceEventCategoryDescriptorId" - ], - "isPrimary": true, - "isUpdatable": false, - "constraintNames": { - "sqlServer": "AttendanceEventCategoryDescriptor_PK", - "postgreSql": "AttendanceEventCategoryDescriptor_PK" - } - } - ], - "isAbstract": false, - "description": "This descriptor holds the category of the attendance event (e.g., tardy).", - "tableNames": { - "sqlServer": "AttendanceEventCategoryDescriptor", - "postgreSql": "AttendanceEventCategoryDescriptor" - } - }, - { - "schema": "edfi", - "name": "BalanceSheetDimension", + "name": "AssesssmentAdministrationParticipation", "locallyDefinedProperties": [ - { - "propertyName": "Code", - "propertyType": { - "dbType": "String", - "minLength": 0, - "maxLength": 16, - "precision": 0, - "scale": 0, - "isNullable": false - }, - "description": "The code representation of the account balance sheet dimension.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "Code", - "postgreSql": "Code" - } - }, - { - "propertyName": "CodeName", - "propertyType": { - "dbType": "String", - "minLength": 0, - "maxLength": 100, - "precision": 0, - "scale": 0, - "isNullable": true - }, - "description": "A description of the account balance sheet dimension.", - "isIdentifying": false, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "CodeName", - "postgreSql": "CodeName" - } - }, { "propertyName": "CreateDate", "propertyType": { @@ -7677,25 +8089,350 @@ "postgreSql": "CreateDate" } }, - { - "propertyName": "FiscalYear", - "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false, - "minValue": 2020, - "maxValue": 2040 - }, - "description": "The fiscal year for which the account balance sheet dimension is valid.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "FiscalYear", - "postgreSql": "FiscalYear" - } - }, + { + "propertyName": "Id", + "propertyType": { + "dbType": "Guid", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Id", + "postgreSql": "Id" + } + }, + { + "propertyName": "LastModifiedDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "LastModifiedDate", + "postgreSql": "LastModifiedDate" + } + } + ], + "identifiers": [ + { + "identifierName": "AssesssmentAdministrationParticipation_PK", + "identifyingPropertyNames": [ + "AdministrationIdentifier", + "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "Namespace", + "ParticipatingEducationOrganizationId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssesssmentAdministrationParticipation_PK", + "postgreSql": "AssesssmentAdministrationParticipation_PK" + } + }, + { + "identifierName": "UX_AssesssmentAdministrationParticipation_Id", + "identifyingPropertyNames": [ + "Id" + ], + "isPrimary": false, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "UX_AssesssmentAdministrationParticipation_Id", + "postgreSql": "UX_0b52ab_Id" + } + } + ], + "isAbstract": false, + "description": "Identifies the point of contact for the administration of an assessment under the purview of an education organization.", + "tableNames": { + "sqlServer": "AssesssmentAdministrationParticipation", + "postgreSql": "AssesssmentAdministrationParticipation" + } + }, + { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipationAdministrationPointOfContact", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "ElectronicMailAddress", + "propertyType": { + "dbType": "String", + "minLength": 7, + "maxLength": 128, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The email address for the contact.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ElectronicMailAddress", + "postgreSql": "ElectronicMailAddress" + } + }, + { + "propertyName": "FirstName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 75, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The contact's first name.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "FirstName", + "postgreSql": "FirstName" + } + }, + { + "propertyName": "LastSurname", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 75, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The contact's last name.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "LastSurname", + "postgreSql": "LastSurname" + } + }, + { + "propertyName": "LoginId", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The login ID for the user; used for security access control interface.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "LoginId", + "postgreSql": "LoginId" + } + } + ], + "identifiers": [ + { + "identifierName": "AssesssmentAdministrationParticipationAdministrationPointOfContact_PK", + "identifyingPropertyNames": [ + "AdministrationIdentifier", + "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "Namespace", + "ParticipatingEducationOrganizationId", + "EducationOrganizationId", + "ElectronicMailAddress" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssesssmentAdministrationParticipationAdministrationPointOfContact_PK", + "postgreSql": "AssesssmentAdministrationParticipationAdministrati_c21adc_PK" + } + } + ], + "isAbstract": false, + "description": "Pre-identified contacts for education organizations administering the assessment.", + "tableNames": { + "sqlServer": "AssesssmentAdministrationParticipationAdministrationPointOfContact", + "postgreSql": "AssesssmentAdministrationParticipationAdministrationPoin_c21adc" + } + }, + { + "schema": "edfi", + "name": "AssignmentLateStatusDescriptor", + "locallyDefinedProperties": [], + "identifiers": [ + { + "identifierName": "AssignmentLateStatusDescriptor_PK", + "identifyingPropertyNames": [ + "AssignmentLateStatusDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AssignmentLateStatusDescriptor_PK", + "postgreSql": "AssignmentLateStatusDescriptor_PK" + } + } + ], + "isAbstract": false, + "description": "Status of whether the assignment was submitted after the due date and/or marked as late.", + "tableNames": { + "sqlServer": "AssignmentLateStatusDescriptor", + "postgreSql": "AssignmentLateStatusDescriptor" + } + }, + { + "schema": "edfi", + "name": "AttemptStatusDescriptor", + "locallyDefinedProperties": [], + "identifiers": [ + { + "identifierName": "AttemptStatusDescriptor_PK", + "identifyingPropertyNames": [ + "AttemptStatusDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AttemptStatusDescriptor_PK", + "postgreSql": "AttemptStatusDescriptor_PK" + } + } + ], + "isAbstract": false, + "description": "This descriptor describes a student's completion status for a section.", + "tableNames": { + "sqlServer": "AttemptStatusDescriptor", + "postgreSql": "AttemptStatusDescriptor" + } + }, + { + "schema": "edfi", + "name": "AttendanceEventCategoryDescriptor", + "locallyDefinedProperties": [], + "identifiers": [ + { + "identifierName": "AttendanceEventCategoryDescriptor_PK", + "identifyingPropertyNames": [ + "AttendanceEventCategoryDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "AttendanceEventCategoryDescriptor_PK", + "postgreSql": "AttendanceEventCategoryDescriptor_PK" + } + } + ], + "isAbstract": false, + "description": "This descriptor holds the category of the attendance event (e.g., tardy).", + "tableNames": { + "sqlServer": "AttendanceEventCategoryDescriptor", + "postgreSql": "AttendanceEventCategoryDescriptor" + } + }, + { + "schema": "edfi", + "name": "BalanceSheetDimension", + "locallyDefinedProperties": [ + { + "propertyName": "Code", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 16, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The code representation of the account balance sheet dimension.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Code", + "postgreSql": "Code" + } + }, + { + "propertyName": "CodeName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 100, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "A description of the account balance sheet dimension.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CodeName", + "postgreSql": "CodeName" + } + }, + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "FiscalYear", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false, + "minValue": 2020, + "maxValue": 2040 + }, + "description": "The fiscal year for which the account balance sheet dimension is valid.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "FiscalYear", + "postgreSql": "FiscalYear" + } + }, { "propertyName": "Id", "propertyType": { @@ -30301,6 +31038,31 @@ "postgreSql": "Section" } }, + { + "schema": "edfi", + "name": "Section504DisabilityTypeDescriptor", + "locallyDefinedProperties": [], + "identifiers": [ + { + "identifierName": "Section504DisabilityTypeDescriptor_PK", + "identifyingPropertyNames": [ + "Section504DisabilityTypeDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "Section504DisabilityTypeDescriptor_PK", + "postgreSql": "Section504DisabilityTypeDescriptor_PK" + } + } + ], + "isAbstract": false, + "description": "This descriptor defines the reason(s) why student qualifies for Section 504 consideration.", + "tableNames": { + "sqlServer": "Section504DisabilityTypeDescriptor", + "postgreSql": "Section504DisabilityTypeDescriptor" + } + }, { "schema": "edfi", "name": "SectionAttendanceTakenEvent", @@ -38120,7 +38882,7 @@ }, { "schema": "edfi", - "name": "StudentAssessmentScoreResult", + "name": "StudentAssessmentRegistration", "locallyDefinedProperties": [ { "propertyName": "CreateDate", @@ -38140,108 +38902,24 @@ } }, { - "propertyName": "Result", - "propertyType": { - "dbType": "String", - "minLength": 0, - "maxLength": 35, - "precision": 0, - "scale": 0, - "isNullable": false - }, - "description": "The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", - "isIdentifying": false, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "Result", - "postgreSql": "Result" - } - } - ], - "identifiers": [ - { - "identifierName": "StudentAssessmentScoreResult_PK", - "identifyingPropertyNames": [ - "AssessmentIdentifier", - "Namespace", - "StudentAssessmentIdentifier", - "StudentUSI", - "AssessmentReportingMethodDescriptorId" - ], - "isPrimary": true, - "isUpdatable": false, - "constraintNames": { - "sqlServer": "StudentAssessmentScoreResult_PK", - "postgreSql": "StudentAssessmentScoreResult_PK" - } - } - ], - "isAbstract": false, - "description": "A meaningful score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", - "tableNames": { - "sqlServer": "StudentAssessmentScoreResult", - "postgreSql": "StudentAssessmentScoreResult" - } - }, - { - "schema": "edfi", - "name": "StudentAssessmentStudentObjectiveAssessment", - "locallyDefinedProperties": [ - { - "propertyName": "AdministrationDate", - "propertyType": { - "dbType": "DateTime2", - "minLength": 0, - "maxLength": 0, - "precision": 0, - "scale": 0, - "isNullable": true - }, - "description": "The date and time an assessment was completed by the student. The use of ISO-8601 formats with a timezone designator (UTC or time offset) is recommended in order to prevent ambiguity due to time zones.", - "isIdentifying": false, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "AdministrationDate", - "postgreSql": "AdministrationDate" - } - }, - { - "propertyName": "AdministrationEndDate", + "propertyName": "Id", "propertyType": { - "dbType": "DateTime2", - "minLength": 0, + "dbType": "Guid", "maxLength": 0, "precision": 0, "scale": 0, - "isNullable": true - }, - "description": "The date and time an assessment administration ended.", - "isIdentifying": false, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "AdministrationEndDate", - "postgreSql": "AdministrationEndDate" - } - }, - { - "propertyName": "AssessedMinutes", - "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": true + "isNullable": false }, - "description": "Reported time student was assessed in minutes.", + "description": "", "isIdentifying": false, "isServerAssigned": false, "columnNames": { - "sqlServer": "AssessedMinutes", - "postgreSql": "AssessedMinutes" + "sqlServer": "Id", + "postgreSql": "Id" } }, { - "propertyName": "CreateDate", + "propertyName": "LastModifiedDate", "propertyType": { "dbType": "DateTime2", "maxLength": 0, @@ -38253,39 +38931,52 @@ "isIdentifying": false, "isServerAssigned": false, "columnNames": { - "sqlServer": "CreateDate", - "postgreSql": "CreateDate" + "sqlServer": "LastModifiedDate", + "postgreSql": "LastModifiedDate" } } ], "identifiers": [ { - "identifierName": "StudentAssessmentStudentObjectiveAssessment_PK", + "identifierName": "StudentAssessmentRegistration_PK", "identifyingPropertyNames": [ + "AdministrationIdentifier", "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "EducationOrganizationId", "Namespace", - "StudentAssessmentIdentifier", - "StudentUSI", - "IdentificationCode" + "StudentUSI" ], "isPrimary": true, "isUpdatable": false, "constraintNames": { - "sqlServer": "StudentAssessmentStudentObjectiveAssessment_PK", - "postgreSql": "StudentAssessmentStudentObjectiveAssessment_PK" + "sqlServer": "StudentAssessmentRegistration_PK", + "postgreSql": "StudentAssessmentRegistration_PK" + } + }, + { + "identifierName": "UX_StudentAssessmentRegistration_Id", + "identifyingPropertyNames": [ + "Id" + ], + "isPrimary": false, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "UX_StudentAssessmentRegistration_Id", + "postgreSql": "UX_79fd6b_Id" } } ], "isAbstract": false, - "description": "The student's score and/or performance levels earned for an objective assessment.", + "description": "Identifies an assessment registration that a student is expected to participate in including the testing organization, reporting organization and assessment delivery details.", "tableNames": { - "sqlServer": "StudentAssessmentStudentObjectiveAssessment", - "postgreSql": "StudentAssessmentStudentObjectiveAssessment" + "sqlServer": "StudentAssessmentRegistration", + "postgreSql": "StudentAssessmentRegistration" } }, { "schema": "edfi", - "name": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel", + "name": "StudentAssessmentRegistrationAssessmentAccommodation", "locallyDefinedProperties": [ { "propertyName": "CreateDate", @@ -38303,56 +38994,38 @@ "sqlServer": "CreateDate", "postgreSql": "CreateDate" } - }, - { - "propertyName": "PerformanceLevelIndicatorName", - "propertyType": { - "dbType": "String", - "minLength": 0, - "maxLength": 60, - "precision": 0, - "scale": 0, - "isNullable": true - }, - "description": "The name of the indicator being measured for a collection of performance level values.", - "isIdentifying": false, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "PerformanceLevelIndicatorName", - "postgreSql": "PerformanceLevelIndicatorName" - } } ], "identifiers": [ { - "identifierName": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel_PK", + "identifierName": "StudentAssessmentRegistrationAssessmentAccommodation_PK", "identifyingPropertyNames": [ + "AdministrationIdentifier", "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "EducationOrganizationId", "Namespace", - "StudentAssessmentIdentifier", "StudentUSI", - "IdentificationCode", - "AssessmentReportingMethodDescriptorId", - "PerformanceLevelDescriptorId" + "AccommodationDescriptorId" ], "isPrimary": true, "isUpdatable": false, "constraintNames": { - "sqlServer": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel_PK", - "postgreSql": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel_PK" + "sqlServer": "StudentAssessmentRegistrationAssessmentAccommodation_PK", + "postgreSql": "StudentAssessmentRegistrationAssessmentAccommodation_PK" } } ], "isAbstract": false, - "description": "The performance level(s) achieved for the objective assessment.", + "description": "The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.", "tableNames": { - "sqlServer": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel", - "postgreSql": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel" + "sqlServer": "StudentAssessmentRegistrationAssessmentAccommodation", + "postgreSql": "StudentAssessmentRegistrationAssessmentAccommodation" } }, { "schema": "edfi", - "name": "StudentAssessmentStudentObjectiveAssessmentScoreResult", + "name": "StudentAssessmentRegistrationAssessmentCustomization", "locallyDefinedProperties": [ { "propertyName": "CreateDate", @@ -38372,97 +39045,73 @@ } }, { - "propertyName": "Result", + "propertyName": "CustomizationKey", "propertyType": { "dbType": "String", "minLength": 0, - "maxLength": 35, + "maxLength": 60, "precision": 0, "scale": 0, "isNullable": false }, - "description": "The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", + "description": "An agreed upon identifier for the custom information.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CustomizationKey", + "postgreSql": "CustomizationKey" + } + }, + { + "propertyName": "CustomizationValue", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 1024, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Custom value for the indicated CustomizationKey.", "isIdentifying": false, "isServerAssigned": false, "columnNames": { - "sqlServer": "Result", - "postgreSql": "Result" + "sqlServer": "CustomizationValue", + "postgreSql": "CustomizationValue" } } ], "identifiers": [ { - "identifierName": "StudentAssessmentStudentObjectiveAssessmentScoreResult_PK", + "identifierName": "StudentAssessmentRegistrationAssessmentCustomization_PK", "identifyingPropertyNames": [ + "AdministrationIdentifier", "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "EducationOrganizationId", "Namespace", - "StudentAssessmentIdentifier", "StudentUSI", - "IdentificationCode", - "AssessmentReportingMethodDescriptorId" - ], - "isPrimary": true, - "isUpdatable": false, - "constraintNames": { - "sqlServer": "StudentAssessmentStudentObjectiveAssessmentScoreResult_PK", - "postgreSql": "StudentAssessmentStudentObjectiveAssessmentScoreResult_PK" - } - } - ], - "isAbstract": false, - "description": "A meaningful score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", - "tableNames": { - "sqlServer": "StudentAssessmentStudentObjectiveAssessmentScoreResult", - "postgreSql": "StudentAssessmentStudentObjectiveAssessmentScoreResult" - } - }, - { - "schema": "edfi", - "name": "StudentCharacteristicDescriptor", - "locallyDefinedProperties": [], - "identifiers": [ - { - "identifierName": "StudentCharacteristicDescriptor_PK", - "identifyingPropertyNames": [ - "StudentCharacteristicDescriptorId" + "CustomizationKey" ], "isPrimary": true, "isUpdatable": false, "constraintNames": { - "sqlServer": "StudentCharacteristicDescriptor_PK", - "postgreSql": "StudentCharacteristicDescriptor_PK" + "sqlServer": "StudentAssessmentRegistrationAssessmentCustomization_PK", + "postgreSql": "StudentAssessmentRegistrationAssessmentCustomization_PK" } } ], "isAbstract": false, - "description": "This descriptor captures important characteristics of the student's environment or situation. Generally used for non-program-based student characteristics.", + "description": "Key/value pairs which may be used to facilitate customization of an assessment or to support vendor reporting/analysis.", "tableNames": { - "sqlServer": "StudentCharacteristicDescriptor", - "postgreSql": "StudentCharacteristicDescriptor" + "sqlServer": "StudentAssessmentRegistrationAssessmentCustomization", + "postgreSql": "StudentAssessmentRegistrationAssessmentCustomization" } }, { "schema": "edfi", - "name": "StudentCohortAssociation", + "name": "StudentAssessmentRegistrationBatteryPartAssociation", "locallyDefinedProperties": [ - { - "propertyName": "BeginDate", - "propertyType": { - "dbType": "Date", - "minLength": 0, - "maxLength": 0, - "precision": 0, - "scale": 0, - "isNullable": false - }, - "description": "The month, day, and year on which the student was first identified as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "BeginDate", - "postgreSql": "BeginDate" - } - }, { "propertyName": "CreateDate", "propertyType": { @@ -38480,24 +39129,510 @@ "postgreSql": "CreateDate" } }, - { - "propertyName": "EndDate", - "propertyType": { - "dbType": "Date", - "minLength": 0, - "maxLength": 0, - "precision": 0, - "scale": 0, - "isNullable": true - }, - "description": "The month, day, and year on which the student was removed as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", - "isIdentifying": false, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "EndDate", - "postgreSql": "EndDate" - } - }, + { + "propertyName": "Id", + "propertyType": { + "dbType": "Guid", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Id", + "postgreSql": "Id" + } + }, + { + "propertyName": "LastModifiedDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "LastModifiedDate", + "postgreSql": "LastModifiedDate" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentAssessmentRegistrationBatteryPartAssociation_PK", + "identifyingPropertyNames": [ + "AdministrationIdentifier", + "AssessmentBatteryPartName", + "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "EducationOrganizationId", + "Namespace", + "StudentUSI" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentAssessmentRegistrationBatteryPartAssociation_PK", + "postgreSql": "StudentAssessmentRegistrationBatteryPartAssociation_PK" + } + }, + { + "identifierName": "UX_StudentAssessmentRegistrationBatteryPartAssociation_Id", + "identifyingPropertyNames": [ + "Id" + ], + "isPrimary": false, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "UX_StudentAssessmentRegistrationBatteryPartAssociation_Id", + "postgreSql": "UX_3bb369_Id" + } + } + ], + "isAbstract": false, + "description": "The association to the part(s) of the assessment battery that the student is to be tested for this administration of the assessment.", + "tableNames": { + "sqlServer": "StudentAssessmentRegistrationBatteryPartAssociation", + "postgreSql": "StudentAssessmentRegistrationBatteryPartAssociation" + } + }, + { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociationAccommodation", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentAssessmentRegistrationBatteryPartAssociationAccommodation_PK", + "identifyingPropertyNames": [ + "AdministrationIdentifier", + "AssessmentBatteryPartName", + "AssessmentIdentifier", + "AssigningEducationOrganizationId", + "EducationOrganizationId", + "Namespace", + "StudentUSI", + "AccommodationDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentAssessmentRegistrationBatteryPartAssociationAccommodation_PK", + "postgreSql": "StudentAssessmentRegistrationBatteryPartAssociatio_c87694_PK" + } + } + ], + "isAbstract": false, + "description": "The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond.", + "tableNames": { + "sqlServer": "StudentAssessmentRegistrationBatteryPartAssociationAccommodation", + "postgreSql": "StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694" + } + }, + { + "schema": "edfi", + "name": "StudentAssessmentScoreResult", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "Result", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 35, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Result", + "postgreSql": "Result" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentAssessmentScoreResult_PK", + "identifyingPropertyNames": [ + "AssessmentIdentifier", + "Namespace", + "StudentAssessmentIdentifier", + "StudentUSI", + "AssessmentReportingMethodDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentAssessmentScoreResult_PK", + "postgreSql": "StudentAssessmentScoreResult_PK" + } + } + ], + "isAbstract": false, + "description": "A meaningful score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", + "tableNames": { + "sqlServer": "StudentAssessmentScoreResult", + "postgreSql": "StudentAssessmentScoreResult" + } + }, + { + "schema": "edfi", + "name": "StudentAssessmentStudentObjectiveAssessment", + "locallyDefinedProperties": [ + { + "propertyName": "AdministrationDate", + "propertyType": { + "dbType": "DateTime2", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The date and time an assessment was completed by the student. The use of ISO-8601 formats with a timezone designator (UTC or time offset) is recommended in order to prevent ambiguity due to time zones.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationDate", + "postgreSql": "AdministrationDate" + } + }, + { + "propertyName": "AdministrationEndDate", + "propertyType": { + "dbType": "DateTime2", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The date and time an assessment administration ended.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationEndDate", + "postgreSql": "AdministrationEndDate" + } + }, + { + "propertyName": "AssessedMinutes", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": true + }, + "description": "Reported time student was assessed in minutes.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessedMinutes", + "postgreSql": "AssessedMinutes" + } + }, + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentAssessmentStudentObjectiveAssessment_PK", + "identifyingPropertyNames": [ + "AssessmentIdentifier", + "Namespace", + "StudentAssessmentIdentifier", + "StudentUSI", + "IdentificationCode" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentAssessmentStudentObjectiveAssessment_PK", + "postgreSql": "StudentAssessmentStudentObjectiveAssessment_PK" + } + } + ], + "isAbstract": false, + "description": "The student's score and/or performance levels earned for an objective assessment.", + "tableNames": { + "sqlServer": "StudentAssessmentStudentObjectiveAssessment", + "postgreSql": "StudentAssessmentStudentObjectiveAssessment" + } + }, + { + "schema": "edfi", + "name": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "PerformanceLevelIndicatorName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The name of the indicator being measured for a collection of performance level values.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "PerformanceLevelIndicatorName", + "postgreSql": "PerformanceLevelIndicatorName" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel_PK", + "identifyingPropertyNames": [ + "AssessmentIdentifier", + "Namespace", + "StudentAssessmentIdentifier", + "StudentUSI", + "IdentificationCode", + "AssessmentReportingMethodDescriptorId", + "PerformanceLevelDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel_PK", + "postgreSql": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel_PK" + } + } + ], + "isAbstract": false, + "description": "The performance level(s) achieved for the objective assessment.", + "tableNames": { + "sqlServer": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel", + "postgreSql": "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel" + } + }, + { + "schema": "edfi", + "name": "StudentAssessmentStudentObjectiveAssessmentScoreResult", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "Result", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 35, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Result", + "postgreSql": "Result" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentAssessmentStudentObjectiveAssessmentScoreResult_PK", + "identifyingPropertyNames": [ + "AssessmentIdentifier", + "Namespace", + "StudentAssessmentIdentifier", + "StudentUSI", + "IdentificationCode", + "AssessmentReportingMethodDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentAssessmentStudentObjectiveAssessmentScoreResult_PK", + "postgreSql": "StudentAssessmentStudentObjectiveAssessmentScoreResult_PK" + } + } + ], + "isAbstract": false, + "description": "A meaningful score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.", + "tableNames": { + "sqlServer": "StudentAssessmentStudentObjectiveAssessmentScoreResult", + "postgreSql": "StudentAssessmentStudentObjectiveAssessmentScoreResult" + } + }, + { + "schema": "edfi", + "name": "StudentCharacteristicDescriptor", + "locallyDefinedProperties": [], + "identifiers": [ + { + "identifierName": "StudentCharacteristicDescriptor_PK", + "identifyingPropertyNames": [ + "StudentCharacteristicDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentCharacteristicDescriptor_PK", + "postgreSql": "StudentCharacteristicDescriptor_PK" + } + } + ], + "isAbstract": false, + "description": "This descriptor captures important characteristics of the student's environment or situation. Generally used for non-program-based student characteristics.", + "tableNames": { + "sqlServer": "StudentCharacteristicDescriptor", + "postgreSql": "StudentCharacteristicDescriptor" + } + }, + { + "schema": "edfi", + "name": "StudentCohortAssociation", + "locallyDefinedProperties": [ + { + "propertyName": "BeginDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The month, day, and year on which the student was first identified as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "BeginDate", + "postgreSql": "BeginDate" + } + }, + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "EndDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The month, day, and year on which the student was removed as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EndDate", + "postgreSql": "EndDate" + } + }, { "propertyName": "Id", "propertyType": { @@ -39524,6 +40659,141 @@ "postgreSql": "StudentDisciplineIncidentNonOffenderAssociationDisciplin_4c979a" } }, + { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodation", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + }, + { + "propertyName": "Id", + "propertyType": { + "dbType": "Guid", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Id", + "postgreSql": "Id" + } + }, + { + "propertyName": "LastModifiedDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "LastModifiedDate", + "postgreSql": "LastModifiedDate" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentEducationOrganizationAssessmentAccommodation_PK", + "identifyingPropertyNames": [ + "EducationOrganizationId", + "StudentUSI" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentEducationOrganizationAssessmentAccommodation_PK", + "postgreSql": "StudentEducationOrganizationAssessmentAccommodation_PK" + } + }, + { + "identifierName": "UX_StudentEducationOrganizationAssessmentAccommodation_Id", + "identifyingPropertyNames": [ + "Id" + ], + "isPrimary": false, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "UX_StudentEducationOrganizationAssessmentAccommodation_Id", + "postgreSql": "UX_5f4481_Id" + } + } + ], + "isAbstract": false, + "description": "The accommodation(s) required or expected for administering assessments as determined by the education organization.", + "tableNames": { + "sqlServer": "StudentEducationOrganizationAssessmentAccommodation", + "postgreSql": "StudentEducationOrganizationAssessmentAccommodation" + } + }, + { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation", + "locallyDefinedProperties": [ + { + "propertyName": "CreateDate", + "propertyType": { + "dbType": "DateTime2", + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "CreateDate", + "postgreSql": "CreateDate" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_PK", + "identifyingPropertyNames": [ + "EducationOrganizationId", + "StudentUSI", + "AccommodationDescriptorId" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_PK", + "postgreSql": "StudentEducationOrganizationAssessmentAccommodatio_d1d10a_PK" + } + } + ], + "isAbstract": false, + "description": "The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.", + "tableNames": { + "sqlServer": "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation", + "postgreSql": "StudentEducationOrganizationAssessmentAccommodationGener_d1d10a" + } + }, { "schema": "edfi", "name": "StudentEducationOrganizationAssociation", @@ -45025,6 +46295,109 @@ "postgreSql": "StudentSchoolFoodServiceProgramAssociationSchoolFoodServ_85a0eb" } }, + { + "schema": "edfi", + "name": "StudentSection504ProgramAssociation", + "locallyDefinedProperties": [ + { + "propertyName": "AccommodationPlan", + "propertyType": { + "dbType": "Boolean", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "Indicates whether student has a Section 504 accommodation plan.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AccommodationPlan", + "postgreSql": "AccommodationPlan" + } + }, + { + "propertyName": "Section504Eligibility", + "propertyType": { + "dbType": "Boolean", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Indicates whether student has a disability, either temporary or permenant, that qualifies student for Section 504 consideration. Selection of FALSE for this boolean is equivalent to marking student as 'Did Not Qualify'.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Section504Eligibility", + "postgreSql": "Section504Eligibility" + } + }, + { + "propertyName": "Section504EligibilityDecisionDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The month, day, and year on which the Section 504 eligibility decision is made.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Section504EligibilityDecisionDate", + "postgreSql": "Section504EligibilityDecisionDate" + } + }, + { + "propertyName": "Section504MeetingDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": true + }, + "description": "The month, day, and year on which the meeting with student's parent/guardian held to discuss the 504 eligibility of the student.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Section504MeetingDate", + "postgreSql": "Section504MeetingDate" + } + } + ], + "identifiers": [ + { + "identifierName": "StudentSection504ProgramAssociation_PK", + "identifyingPropertyNames": [ + "BeginDate", + "EducationOrganizationId", + "ProgramEducationOrganizationId", + "ProgramName", + "ProgramTypeDescriptorId", + "StudentUSI" + ], + "isPrimary": true, + "isUpdatable": false, + "constraintNames": { + "sqlServer": "StudentSection504ProgramAssociation_PK", + "postgreSql": "StudentSection504ProgramAssociation_PK" + } + } + ], + "isAbstract": false, + "description": "This association identifies student that qualifies for the Section 504 of the Rehabilitation Act of 1973.", + "tableNames": { + "sqlServer": "StudentSection504ProgramAssociation", + "postgreSql": "StudentSection504ProgramAssociation" + } + }, { "schema": "edfi", "name": "StudentSectionAssociation", @@ -46377,6 +47750,7 @@ "identifyingPropertyNames": [ "ConsentToEvaluationReceivedDate", "EducationOrganizationId", + "ProgramEducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId", "StudentUSI" @@ -50442,7 +51816,7 @@ { "fullName": { "schema": "edfi", - "name": "FK_AssessmentAssessedGradeLevel_Assessment" + "name": "FK_AssessmentAdministration_Assessment" }, "cardinality": "OneToZeroOrMore", "primaryEntityFullName": { @@ -50489,7 +51863,7 @@ ], "secondaryEntityFullName": { "schema": "edfi", - "name": "AssessmentAssessedGradeLevel" + "name": "AssessmentAdministration" }, "secondaryEntityProperties": [ { @@ -50532,142 +51906,100 @@ "isIdentifying": true, "isRequired": true, "constraintNames": { - "sqlServer": "FK_AssessmentAssessedGradeLevel_Assessment", - "postgreSql": "FK_e83625_Assessment" + "sqlServer": "FK_AssessmentAdministration_Assessment", + "postgreSql": "FK_c64558_Assessment" }, "potentiallyLogical": false }, { "fullName": { "schema": "edfi", - "name": "FK_AssessmentAssessedGradeLevel_GradeLevelDescriptor" + "name": "FK_AssessmentAdministration_EducationOrganization" }, "cardinality": "OneToZeroOrMore", "primaryEntityFullName": { "schema": "edfi", - "name": "GradeLevelDescriptor" + "name": "EducationOrganization" }, "primaryEntityProperties": [ { - "propertyName": "GradeLevelDescriptorId", + "propertyName": "EducationOrganizationId", "propertyType": { - "dbType": "Int32", + "dbType": "Int64", "maxLength": 0, "precision": 10, "scale": 0, "isNullable": false }, - "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "description": "The identifier assigned to an education organization.", "isIdentifying": true, "isServerAssigned": false, "columnNames": { - "sqlServer": "GradeLevelDescriptorId", - "postgreSql": "GradeLevelDescriptorId" + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" } } ], "secondaryEntityFullName": { "schema": "edfi", - "name": "AssessmentAssessedGradeLevel" + "name": "AssessmentAdministration" }, "secondaryEntityProperties": [ { - "propertyName": "GradeLevelDescriptorId", + "propertyName": "AssigningEducationOrganizationId", "propertyType": { - "dbType": "Int32", + "dbType": "Int64", "maxLength": 0, "precision": 10, "scale": 0, "isNullable": false }, - "description": "The grade level(s) for which an assessment is designed. The semantics of null is assumed to mean that the assessment is not associated with any grade level.", + "description": "The identifier assigned to an education organization.", "isIdentifying": true, "isServerAssigned": false, "columnNames": { - "sqlServer": "GradeLevelDescriptorId", - "postgreSql": "GradeLevelDescriptorId" + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" } } ], "isIdentifying": true, "isRequired": true, "constraintNames": { - "sqlServer": "FK_AssessmentAssessedGradeLevel_GradeLevelDescriptor", - "postgreSql": "FK_e83625_GradeLevelDescriptor" + "sqlServer": "FK_AssessmentAdministration_EducationOrganization", + "postgreSql": "FK_c64558_EducationOrganization" }, "potentiallyLogical": false }, { "fullName": { "schema": "edfi", - "name": "FK_AssessmentCategoryDescriptor_Descriptor" + "name": "FK_AssessmentAdministrationAssessmentAdminstrationPeriod_AssessmentAdministration" }, - "cardinality": "OneToOneInheritance", + "cardinality": "OneToZeroOrMore", "primaryEntityFullName": { "schema": "edfi", - "name": "Descriptor" + "name": "AssessmentAdministration" }, "primaryEntityProperties": [ { - "propertyName": "DescriptorId", + "propertyName": "AdministrationIdentifier", "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", - "isIdentifying": true, - "isServerAssigned": true, - "columnNames": { - "sqlServer": "DescriptorId", - "postgreSql": "DescriptorId" - } - } - ], - "secondaryEntityFullName": { - "schema": "edfi", - "name": "AssessmentCategoryDescriptor" - }, - "secondaryEntityProperties": [ - { - "propertyName": "AssessmentCategoryDescriptorId", - "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, "scale": 0, "isNullable": false }, - "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "description": "The title or name of the assessment in the context of its administration.", "isIdentifying": true, - "isServerAssigned": true, + "isServerAssigned": false, "columnNames": { - "sqlServer": "AssessmentCategoryDescriptorId", - "postgreSql": "AssessmentCategoryDescriptorId" + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" } - } - ], - "isIdentifying": true, - "isRequired": true, - "constraintNames": { - "sqlServer": "FK_AssessmentCategoryDescriptor_Descriptor", - "postgreSql": "FK_20e875_Descriptor" - }, - "potentiallyLogical": false - }, - { - "fullName": { - "schema": "edfi", - "name": "FK_AssessmentContentStandard_Assessment" - }, - "cardinality": "OneToZeroOrOne", - "primaryEntityFullName": { - "schema": "edfi", - "name": "Assessment" - }, - "primaryEntityProperties": [ + }, { "propertyName": "AssessmentIdentifier", "propertyType": { @@ -50686,6 +52018,23 @@ "postgreSql": "AssessmentIdentifier" } }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, { "propertyName": "Namespace", "propertyType": { @@ -50707,7 +52056,1026 @@ ], "secondaryEntityFullName": { "schema": "edfi", - "name": "AssessmentContentStandard" + "name": "AssessmentAdministrationAssessmentAdminstrationPeriod" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentAdministrationAssessmentAdminstrationPeriod_AssessmentAdministration", + "postgreSql": "FK_77cf17_AssessmentAdministration" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentAdministration" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentAdministration" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentAdministrationAssessmentBatteryPart" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentAdministration", + "postgreSql": "FK_1d6852_AssessmentAdministration" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentBatteryPart" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentBatteryPart" + }, + "primaryEntityProperties": [ + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentAdministrationAssessmentBatteryPart" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentBatteryPart", + "postgreSql": "FK_1d6852_AssessmentBatteryPart" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentAssessedGradeLevel_Assessment" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "Assessment" + }, + "primaryEntityProperties": [ + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentAssessedGradeLevel" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentAssessedGradeLevel_Assessment", + "postgreSql": "FK_e83625_Assessment" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentAssessedGradeLevel_GradeLevelDescriptor" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "GradeLevelDescriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "GradeLevelDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "GradeLevelDescriptorId", + "postgreSql": "GradeLevelDescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentAssessedGradeLevel" + }, + "secondaryEntityProperties": [ + { + "propertyName": "GradeLevelDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The grade level(s) for which an assessment is designed. The semantics of null is assumed to mean that the assessment is not associated with any grade level.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "GradeLevelDescriptorId", + "postgreSql": "GradeLevelDescriptorId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentAssessedGradeLevel_GradeLevelDescriptor", + "postgreSql": "FK_e83625_GradeLevelDescriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentBatteryPart_Assessment" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "Assessment" + }, + "primaryEntityProperties": [ + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentBatteryPart" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentBatteryPart_Assessment", + "postgreSql": "FK_6e22f2_Assessment" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentBatteryPartObjectiveAssessment_AssessmentBatteryPart" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentBatteryPart" + }, + "primaryEntityProperties": [ + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentBatteryPartObjectiveAssessment" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentBatteryPartObjectiveAssessment_AssessmentBatteryPart", + "postgreSql": "FK_8ab121_AssessmentBatteryPart" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentBatteryPartObjectiveAssessment_ObjectiveAssessment" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "ObjectiveAssessment" + }, + "primaryEntityProperties": [ + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "IdentificationCode", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "IdentificationCode", + "postgreSql": "IdentificationCode" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentBatteryPartObjectiveAssessment" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "IdentificationCode", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "IdentificationCode", + "postgreSql": "IdentificationCode" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentBatteryPartObjectiveAssessment_ObjectiveAssessment", + "postgreSql": "FK_8ab121_ObjectiveAssessment" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentCategoryDescriptor_Descriptor" + }, + "cardinality": "OneToOneInheritance", + "primaryEntityFullName": { + "schema": "edfi", + "name": "Descriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "DescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": true, + "columnNames": { + "sqlServer": "DescriptorId", + "postgreSql": "DescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentCategoryDescriptor" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentCategoryDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": true, + "columnNames": { + "sqlServer": "AssessmentCategoryDescriptorId", + "postgreSql": "AssessmentCategoryDescriptorId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssessmentCategoryDescriptor_Descriptor", + "postgreSql": "FK_20e875_Descriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssessmentContentStandard_Assessment" + }, + "cardinality": "OneToZeroOrOne", + "primaryEntityFullName": { + "schema": "edfi", + "name": "Assessment" + }, + "primaryEntityProperties": [ + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentContentStandard" }, "secondaryEntityProperties": [ { @@ -53905,6 +56273,496 @@ }, "potentiallyLogical": false }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssesssmentAdministrationParticipation_AssessmentAdministration" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentAdministration" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssesssmentAdministrationParticipation_AssessmentAdministration", + "postgreSql": "FK_0b52ab_AssessmentAdministration" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssesssmentAdministrationParticipation_EducationOrganization" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "EducationOrganization" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "ParticipatingEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ParticipatingEducationOrganizationId", + "postgreSql": "ParticipatingEducationOrganizationId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssesssmentAdministrationParticipation_EducationOrganization", + "postgreSql": "FK_0b52ab_EducationOrganization" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_AssesssmentAdministrationParticipation" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipation" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "ParticipatingEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ParticipatingEducationOrganizationId", + "postgreSql": "ParticipatingEducationOrganizationId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipationAdministrationPointOfContact" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "ParticipatingEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ParticipatingEducationOrganizationId", + "postgreSql": "ParticipatingEducationOrganizationId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_AssesssmentAdministrationParticipation", + "postgreSql": "FK_c21adc_AssesssmentAdministrationParticipation" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_EducationOrganization" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "EducationOrganization" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "AssesssmentAdministrationParticipationAdministrationPointOfContact" + }, + "secondaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_EducationOrganization", + "postgreSql": "FK_c21adc_EducationOrganization" + }, + "potentiallyLogical": false + }, { "fullName": { "schema": "edfi", @@ -101923,6 +104781,66 @@ }, "potentiallyLogical": false }, + { + "fullName": { + "schema": "edfi", + "name": "FK_Section504DisabilityTypeDescriptor_Descriptor" + }, + "cardinality": "OneToOneInheritance", + "primaryEntityFullName": { + "schema": "edfi", + "name": "Descriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "DescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": true, + "columnNames": { + "sqlServer": "DescriptorId", + "postgreSql": "DescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "Section504DisabilityTypeDescriptor" + }, + "secondaryEntityProperties": [ + { + "propertyName": "Section504DisabilityTypeDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": true, + "columnNames": { + "sqlServer": "Section504DisabilityTypeDescriptorId", + "postgreSql": "Section504DisabilityTypeDescriptorId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_Section504DisabilityTypeDescriptor_Descriptor", + "postgreSql": "FK_e7f766_Descriptor" + }, + "potentiallyLogical": false + }, { "fullName": { "schema": "edfi", @@ -117724,8 +120642,1968 @@ "isIdentifying": true, "isRequired": true, "constraintNames": { - "sqlServer": "FK_StudentAssessmentPeriod_StudentAssessment", - "postgreSql": "FK_02ddd8_StudentAssessment" + "sqlServer": "FK_StudentAssessmentPeriod_StudentAssessment", + "postgreSql": "FK_02ddd8_StudentAssessment" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_AssessmentAdministration" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentAdministration" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_AssessmentAdministration", + "postgreSql": "FK_79fd6b_AssessmentAdministration" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_EducationOrganization" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "EducationOrganization" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "ReportingEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": true + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ReportingEducationOrganizationId", + "postgreSql": "ReportingEducationOrganizationId" + } + } + ], + "isIdentifying": false, + "isRequired": false, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_EducationOrganization", + "postgreSql": "FK_79fd6b_EducationOrganization" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_EducationOrganization1" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "EducationOrganization" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "TestingEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": true + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "TestingEducationOrganizationId", + "postgreSql": "TestingEducationOrganizationId" + } + } + ], + "isIdentifying": false, + "isRequired": false, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_EducationOrganization1", + "postgreSql": "FK_79fd6b_EducationOrganization1" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_GradeLevelDescriptor" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "GradeLevelDescriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "GradeLevelDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "GradeLevelDescriptorId", + "postgreSql": "GradeLevelDescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentGradeLevelDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": true + }, + "description": "The grade level or primary instructional level at which the student is to be assessed.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentGradeLevelDescriptorId", + "postgreSql": "AssessmentGradeLevelDescriptorId" + } + } + ], + "isIdentifying": false, + "isRequired": false, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_GradeLevelDescriptor", + "postgreSql": "FK_79fd6b_GradeLevelDescriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_PlatformTypeDescriptor" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "PlatformTypeDescriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "PlatformTypeDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "PlatformTypeDescriptorId", + "postgreSql": "PlatformTypeDescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "PlatformTypeDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": true + }, + "description": "The environment or format in which the assessment is expected to be administered.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "PlatformTypeDescriptorId", + "postgreSql": "PlatformTypeDescriptorId" + } + } + ], + "isIdentifying": false, + "isRequired": false, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_PlatformTypeDescriptor", + "postgreSql": "FK_79fd6b_PlatformTypeDescriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssessmentAccommodation" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodation" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssessmentAccommodation", + "postgreSql": "FK_79fd6b_StudentEducationOrganizationAssessmentAccommodation" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssociation" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssociation" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssociation", + "postgreSql": "FK_79fd6b_StudentEducationOrganizationAssociation" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistration_StudentSchoolAssociation" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentSchoolAssociation" + }, + "primaryEntityProperties": [ + { + "propertyName": "EntryDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The month, day, and year on which an individual enters and begins to receive instructional services in a school for each school year. The EntryDate value should be the date the student enrolled, or when the student's enrollment materially changed, such as with a grade promotion. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EntryDate", + "postgreSql": "EntryDate" + } + }, + { + "propertyName": "SchoolId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "SchoolId", + "postgreSql": "SchoolId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "secondaryEntityProperties": [ + { + "propertyName": "EntryDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The month, day, and year on which an individual enters and begins to receive instructional services in a school for each school year. The EntryDate value should be the date the student enrolled, or when the student's enrollment materially changed, such as with a grade promotion. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EntryDate", + "postgreSql": "EntryDate" + } + }, + { + "propertyName": "SchoolId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "SchoolId", + "postgreSql": "SchoolId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": false, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": false, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistration_StudentSchoolAssociation", + "postgreSql": "FK_79fd6b_StudentSchoolAssociation" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistrationAssessmentAccommodation_AccommodationDescriptor" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AccommodationDescriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "AccommodationDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AccommodationDescriptorId", + "postgreSql": "AccommodationDescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationAssessmentAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AccommodationDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AccommodationDescriptorId", + "postgreSql": "AccommodationDescriptorId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistrationAssessmentAccommodation_AccommodationDescriptor", + "postgreSql": "FK_8f1b98_AccommodationDescriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistrationAssessmentAccommodation_StudentAssessmentRegistration" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationAssessmentAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistrationAssessmentAccommodation_StudentAssessmentRegistration", + "postgreSql": "FK_8f1b98_StudentAssessmentRegistration" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistrationAssessmentCustomization_StudentAssessmentRegistration" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationAssessmentCustomization" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistrationAssessmentCustomization_StudentAssessmentRegistration", + "postgreSql": "FK_869535_StudentAssessmentRegistration" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistrationBatteryPartAssociation_AssessmentBatteryPart" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AssessmentBatteryPart" + }, + "primaryEntityProperties": [ + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistrationBatteryPartAssociation_AssessmentBatteryPart", + "postgreSql": "FK_3bb369_AssessmentBatteryPart" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistrationBatteryPartAssociation_StudentAssessmentRegistration" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistration" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistrationBatteryPartAssociation_StudentAssessmentRegistration", + "postgreSql": "FK_3bb369_StudentAssessmentRegistration" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_AccommodationDescriptor" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AccommodationDescriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "AccommodationDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AccommodationDescriptorId", + "postgreSql": "AccommodationDescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociationAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AccommodationDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AccommodationDescriptorId", + "postgreSql": "AccommodationDescriptorId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_AccommodationDescriptor", + "postgreSql": "FK_c87694_AccommodationDescriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_StudentAssessmentRegistrationBatteryPartAssociation" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociation" + }, + "primaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentAssessmentRegistrationBatteryPartAssociationAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AdministrationIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The title or name of the assessment in the context of its administration.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AdministrationIdentifier", + "postgreSql": "AdministrationIdentifier" + } + }, + { + "propertyName": "AssessmentBatteryPartName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 65, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The name of the part of an assessment battery.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentBatteryPartName", + "postgreSql": "AssessmentBatteryPartName" + } + }, + { + "propertyName": "AssessmentIdentifier", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "A unique number or alphanumeric code assigned to an assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssessmentIdentifier", + "postgreSql": "AssessmentIdentifier" + } + }, + { + "propertyName": "AssigningEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AssigningEducationOrganizationId", + "postgreSql": "AssigningEducationOrganizationId" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "Namespace", + "propertyType": { + "dbType": "String", + "minLength": 5, + "maxLength": 255, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "Namespace for the assessment.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "Namespace", + "postgreSql": "Namespace" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_StudentAssessmentRegistrationBatteryPartAssociation", + "postgreSql": "FK_c87694_StudentAssessmentRegistrationBatteryPartAssociation" }, "potentiallyLogical": false }, @@ -122628,6 +127506,280 @@ }, "potentiallyLogical": false }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentEducationOrganizationAssessmentAccommodation_EducationOrganization" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "EducationOrganization" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentEducationOrganizationAssessmentAccommodation_EducationOrganization", + "postgreSql": "FK_5f4481_EducationOrganization" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentEducationOrganizationAssessmentAccommodation_Student" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "Student" + }, + "primaryEntityProperties": [ + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": true, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentEducationOrganizationAssessmentAccommodation_Student", + "postgreSql": "FK_5f4481_Student" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_AccommodationDescriptor" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "AccommodationDescriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "AccommodationDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AccommodationDescriptorId", + "postgreSql": "AccommodationDescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "AccommodationDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "AccommodationDescriptorId", + "postgreSql": "AccommodationDescriptorId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_AccommodationDescriptor", + "postgreSql": "FK_d1d10a_AccommodationDescriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_StudentEducationOrganizationAssessmentAccommodation" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodation" + }, + "primaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_StudentEducationOrganizationAssessmentAccommodation", + "postgreSql": "FK_d1d10a_StudentEducationOrganizationAssessmentAccommodation" + }, + "potentiallyLogical": false + }, { "fullName": { "schema": "edfi", @@ -137442,23 +142594,550 @@ "isIdentifying": true, "isRequired": true, "constraintNames": { - "sqlServer": "FK_StudentSchoolFoodServiceProgramAssociation_GeneralStudentProgramAssociation", - "postgreSql": "FK_82e1e5_GeneralStudentProgramAssociation" + "sqlServer": "FK_StudentSchoolFoodServiceProgramAssociation_GeneralStudentProgramAssociation", + "postgreSql": "FK_82e1e5_GeneralStudentProgramAssociation" + } + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_SchoolFoodServiceProgramServiceDescriptor" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "SchoolFoodServiceProgramServiceDescriptor" + }, + "primaryEntityProperties": [ + { + "propertyName": "SchoolFoodServiceProgramServiceDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "SchoolFoodServiceProgramServiceDescriptorId", + "postgreSql": "SchoolFoodServiceProgramServiceDescriptorId" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService" + }, + "secondaryEntityProperties": [ + { + "propertyName": "SchoolFoodServiceProgramServiceDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "Indicates the service being provided to the student by the school food service program.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "SchoolFoodServiceProgramServiceDescriptorId", + "postgreSql": "SchoolFoodServiceProgramServiceDescriptorId" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_SchoolFoodServiceProgramServiceDescriptor", + "postgreSql": "FK_85a0eb_SchoolFoodServiceProgramServiceDescriptor" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_StudentSchoolFoodServiceProgramAssociation" + }, + "cardinality": "OneToZeroOrMore", + "primaryEntityFullName": { + "schema": "edfi", + "name": "StudentSchoolFoodServiceProgramAssociation" + }, + "primaryEntityProperties": [ + { + "propertyName": "BeginDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "BeginDate", + "postgreSql": "BeginDate" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "ProgramEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramEducationOrganizationId", + "postgreSql": "ProgramEducationOrganizationId" + } + }, + { + "propertyName": "ProgramName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramName", + "postgreSql": "ProgramName" + } + }, + { + "propertyName": "ProgramTypeDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The type of program.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramTypeDescriptorId", + "postgreSql": "ProgramTypeDescriptorId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService" + }, + "secondaryEntityProperties": [ + { + "propertyName": "BeginDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "BeginDate", + "postgreSql": "BeginDate" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "ProgramEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramEducationOrganizationId", + "postgreSql": "ProgramEducationOrganizationId" + } + }, + { + "propertyName": "ProgramName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramName", + "postgreSql": "ProgramName" + } + }, + { + "propertyName": "ProgramTypeDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The type of program.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramTypeDescriptorId", + "postgreSql": "ProgramTypeDescriptorId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_StudentSchoolFoodServiceProgramAssociation", + "postgreSql": "FK_85a0eb_StudentSchoolFoodServiceProgramAssociation" + }, + "potentiallyLogical": false + }, + { + "fullName": { + "schema": "edfi", + "name": "FK_StudentSection504ProgramAssociation_GeneralStudentProgramAssociation" + }, + "cardinality": "OneToOneInheritance", + "primaryEntityFullName": { + "schema": "edfi", + "name": "GeneralStudentProgramAssociation" + }, + "primaryEntityProperties": [ + { + "propertyName": "BeginDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "BeginDate", + "postgreSql": "BeginDate" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "ProgramEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramEducationOrganizationId", + "postgreSql": "ProgramEducationOrganizationId" + } + }, + { + "propertyName": "ProgramName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramName", + "postgreSql": "ProgramName" + } + }, + { + "propertyName": "ProgramTypeDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The type of program.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramTypeDescriptorId", + "postgreSql": "ProgramTypeDescriptorId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "secondaryEntityFullName": { + "schema": "edfi", + "name": "StudentSection504ProgramAssociation" + }, + "secondaryEntityProperties": [ + { + "propertyName": "BeginDate", + "propertyType": { + "dbType": "Date", + "minLength": 0, + "maxLength": 0, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "BeginDate", + "postgreSql": "BeginDate" + } + }, + { + "propertyName": "EducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "EducationOrganizationId", + "postgreSql": "EducationOrganizationId" + } + }, + { + "propertyName": "ProgramEducationOrganizationId", + "propertyType": { + "dbType": "Int64", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The identifier assigned to an education organization.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramEducationOrganizationId", + "postgreSql": "ProgramEducationOrganizationId" + } + }, + { + "propertyName": "ProgramName", + "propertyType": { + "dbType": "String", + "minLength": 0, + "maxLength": 60, + "precision": 0, + "scale": 0, + "isNullable": false + }, + "description": "The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramName", + "postgreSql": "ProgramName" + } + }, + { + "propertyName": "ProgramTypeDescriptorId", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "The type of program.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "ProgramTypeDescriptorId", + "postgreSql": "ProgramTypeDescriptorId" + } + }, + { + "propertyName": "StudentUSI", + "propertyType": { + "dbType": "Int32", + "maxLength": 0, + "precision": 10, + "scale": 0, + "isNullable": false + }, + "description": "A unique alphanumeric code assigned to a student.", + "isIdentifying": true, + "isServerAssigned": false, + "columnNames": { + "sqlServer": "StudentUSI", + "postgreSql": "StudentUSI" + } + } + ], + "isIdentifying": true, + "isRequired": true, + "constraintNames": { + "sqlServer": "FK_StudentSection504ProgramAssociation_GeneralStudentProgramAssociation", + "postgreSql": "FK_6e41ee_GeneralStudentProgramAssociation" } }, { "fullName": { "schema": "edfi", - "name": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_SchoolFoodServiceProgramServiceDescriptor" + "name": "FK_StudentSection504ProgramAssociation_Section504DisabilityTypeDescriptor" }, "cardinality": "OneToZeroOrMore", "primaryEntityFullName": { "schema": "edfi", - "name": "SchoolFoodServiceProgramServiceDescriptor" + "name": "Section504DisabilityTypeDescriptor" }, "primaryEntityProperties": [ { - "propertyName": "SchoolFoodServiceProgramServiceDescriptorId", + "propertyName": "Section504DisabilityTypeDescriptorId", "propertyType": { "dbType": "Int32", "maxLength": 0, @@ -137467,276 +143146,42 @@ "isNullable": false }, "description": "A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "SchoolFoodServiceProgramServiceDescriptorId", - "postgreSql": "SchoolFoodServiceProgramServiceDescriptorId" - } - } - ], - "secondaryEntityFullName": { - "schema": "edfi", - "name": "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService" - }, - "secondaryEntityProperties": [ - { - "propertyName": "SchoolFoodServiceProgramServiceDescriptorId", - "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "Indicates the service being provided to the student by the school food service program.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "SchoolFoodServiceProgramServiceDescriptorId", - "postgreSql": "SchoolFoodServiceProgramServiceDescriptorId" - } - } - ], - "isIdentifying": true, - "isRequired": true, - "constraintNames": { - "sqlServer": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_SchoolFoodServiceProgramServiceDescriptor", - "postgreSql": "FK_85a0eb_SchoolFoodServiceProgramServiceDescriptor" - }, - "potentiallyLogical": false - }, - { - "fullName": { - "schema": "edfi", - "name": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_StudentSchoolFoodServiceProgramAssociation" - }, - "cardinality": "OneToZeroOrMore", - "primaryEntityFullName": { - "schema": "edfi", - "name": "StudentSchoolFoodServiceProgramAssociation" - }, - "primaryEntityProperties": [ - { - "propertyName": "BeginDate", - "propertyType": { - "dbType": "Date", - "minLength": 0, - "maxLength": 0, - "precision": 0, - "scale": 0, - "isNullable": false - }, - "description": "The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "BeginDate", - "postgreSql": "BeginDate" - } - }, - { - "propertyName": "EducationOrganizationId", - "propertyType": { - "dbType": "Int64", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "The identifier assigned to an education organization.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "EducationOrganizationId", - "postgreSql": "EducationOrganizationId" - } - }, - { - "propertyName": "ProgramEducationOrganizationId", - "propertyType": { - "dbType": "Int64", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "The identifier assigned to an education organization.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "ProgramEducationOrganizationId", - "postgreSql": "ProgramEducationOrganizationId" - } - }, - { - "propertyName": "ProgramName", - "propertyType": { - "dbType": "String", - "minLength": 0, - "maxLength": 60, - "precision": 0, - "scale": 0, - "isNullable": false - }, - "description": "The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "ProgramName", - "postgreSql": "ProgramName" - } - }, - { - "propertyName": "ProgramTypeDescriptorId", - "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "The type of program.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "ProgramTypeDescriptorId", - "postgreSql": "ProgramTypeDescriptorId" - } - }, - { - "propertyName": "StudentUSI", - "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "A unique alphanumeric code assigned to a student.", - "isIdentifying": true, + "isIdentifying": false, "isServerAssigned": false, "columnNames": { - "sqlServer": "StudentUSI", - "postgreSql": "StudentUSI" + "sqlServer": "Section504DisabilityTypeDescriptorId", + "postgreSql": "Section504DisabilityTypeDescriptorId" } } ], "secondaryEntityFullName": { "schema": "edfi", - "name": "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService" + "name": "StudentSection504ProgramAssociation" }, "secondaryEntityProperties": [ { - "propertyName": "BeginDate", - "propertyType": { - "dbType": "Date", - "minLength": 0, - "maxLength": 0, - "precision": 0, - "scale": 0, - "isNullable": false - }, - "description": "The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "BeginDate", - "postgreSql": "BeginDate" - } - }, - { - "propertyName": "EducationOrganizationId", - "propertyType": { - "dbType": "Int64", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "The identifier assigned to an education organization.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "EducationOrganizationId", - "postgreSql": "EducationOrganizationId" - } - }, - { - "propertyName": "ProgramEducationOrganizationId", - "propertyType": { - "dbType": "Int64", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "The identifier assigned to an education organization.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "ProgramEducationOrganizationId", - "postgreSql": "ProgramEducationOrganizationId" - } - }, - { - "propertyName": "ProgramName", - "propertyType": { - "dbType": "String", - "minLength": 0, - "maxLength": 60, - "precision": 0, - "scale": 0, - "isNullable": false - }, - "description": "The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "ProgramName", - "postgreSql": "ProgramName" - } - }, - { - "propertyName": "ProgramTypeDescriptorId", - "propertyType": { - "dbType": "Int32", - "maxLength": 0, - "precision": 10, - "scale": 0, - "isNullable": false - }, - "description": "The type of program.", - "isIdentifying": true, - "isServerAssigned": false, - "columnNames": { - "sqlServer": "ProgramTypeDescriptorId", - "postgreSql": "ProgramTypeDescriptorId" - } - }, - { - "propertyName": "StudentUSI", + "propertyName": "Section504DisabilityTypeDescriptorId", "propertyType": { "dbType": "Int32", "maxLength": 0, "precision": 10, "scale": 0, - "isNullable": false + "isNullable": true }, - "description": "A unique alphanumeric code assigned to a student.", - "isIdentifying": true, + "description": "Defines one or more disabilities student has that qualifies them for a Section 504 plan.", + "isIdentifying": false, "isServerAssigned": false, "columnNames": { - "sqlServer": "StudentUSI", - "postgreSql": "StudentUSI" + "sqlServer": "Section504DisabilityTypeDescriptorId", + "postgreSql": "Section504DisabilityTypeDescriptorId" } } ], - "isIdentifying": true, - "isRequired": true, + "isIdentifying": false, + "isRequired": false, "constraintNames": { - "sqlServer": "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_StudentSchoolFoodServiceProgramAssociation", - "postgreSql": "FK_85a0eb_StudentSchoolFoodServiceProgramAssociation" + "sqlServer": "FK_StudentSection504ProgramAssociation_Section504DisabilityTypeDescriptor", + "postgreSql": "FK_6e41ee_Section504DisabilityTypeDescriptor" }, "potentiallyLogical": false }, @@ -141629,7 +147074,7 @@ }, "secondaryEntityProperties": [ { - "propertyName": "EducationOrganizationId", + "propertyName": "ProgramEducationOrganizationId", "propertyType": { "dbType": "Int64", "maxLength": 0, @@ -141641,8 +147086,8 @@ "isIdentifying": true, "isServerAssigned": false, "columnNames": { - "sqlServer": "EducationOrganizationId", - "postgreSql": "EducationOrganizationId" + "sqlServer": "ProgramEducationOrganizationId", + "postgreSql": "ProgramEducationOrganizationId" } }, { diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql new file mode 100644 index 0000000000..a2dabcdbf2 --- /dev/null +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql @@ -0,0 +1,2230 @@ + +-- SPDX-License-Identifier: Apache-2.0 +-- Licensed to the Ed-Fi Alliance under one or more agreements. +-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +-- See the LICENSE and NOTICES files in the project root for more information. + +BEGIN + DECLARE + @claimId AS INT, + @claimName AS nvarchar(max), + @parentResourceClaimId AS INT, + @existingParentResourceClaimId AS INT, + @claimSetId AS INT, + @claimSetName AS nvarchar(max), + @authorizationStrategyId AS INT, + @msg AS nvarchar(max), + @createActionId AS INT, + @readActionId AS INT, + @updateActionId AS INT, + @deleteActionId AS INT, + @readChangesActionId AS INT, + @resourceClaimActionId AS INT, + @claimSetResourceClaimActionId AS INT + + DECLARE @claimIdStack AS TABLE (Id INT IDENTITY, ResourceClaimId INT) + + SELECT @createActionId = ActionId + FROM [dbo].[Actions] WHERE ActionName = 'Create'; + + SELECT @readActionId = ActionId + FROM [dbo].[Actions] WHERE ActionName = 'Read'; + + SELECT @updateActionId = ActionId + FROM [dbo].[Actions] WHERE ActionName = 'Update'; + + SELECT @deleteActionId = ActionId + FROM [dbo].[Actions] WHERE ActionName = 'Delete'; + + SELECT @readChangesActionId = ActionId + FROM [dbo].[Actions] WHERE ActionName = 'ReadChanges'; + + BEGIN TRANSACTION + + -- Push claimId to the stack + INSERT INTO @claimIdStack (ResourceClaimId) VALUES (@claimId) + + -- Processing children of root + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentMetadata', 'http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + -- Setting default authorization metadata + PRINT 'Deleting default action authorizations for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = @claimId); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = @claimId + + -- Default Create authorization + PRINT 'Creating action ''Create'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @CreateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Read authorization + PRINT 'Creating action ''Read'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @ReadActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Update authorization + PRINT 'Creating action ''Update'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @UpdateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Delete authorization + PRINT 'Creating action ''Delete'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @DeleteActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Processing claim sets for http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Ed-Fi Sandbox' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Assessment Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Assessment Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'District Hosted SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + -- Push claimId to the stack + INSERT INTO @claimIdStack (ResourceClaimId) VALUES (@claimId) + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentAdministration' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/assessmentAdministration' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentAdministration', 'http://ed-fi.org/ods/identity/claims/assessmentAdministration', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentAdminstrationPeriod' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentAdminstrationPeriod' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentAdministrationAssessmentAdminstrationPeriod', 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentAdminstrationPeriod', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentBatteryPart' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentBatteryPart' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentAdministrationAssessmentBatteryPart', 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentBatteryPart', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPart' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPart' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentBatteryPart', 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPart', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPartObjectiveAssessment' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPartObjectiveAssessment' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentBatteryPartObjectiveAssessment', 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPartObjectiveAssessment', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipation' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipation' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assesssmentAdministrationParticipation', 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipation', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipationAdministrationPointOfContact' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipationAdministrationPointOfContact' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assesssmentAdministrationParticipationAdministrationPointOfContact', 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipationAdministrationPointOfContact', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistration' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistration' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistration', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistration', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentAccommodation' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationAssessmentAccommodation', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentAccommodation', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentCustomization' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentCustomization' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationAssessmentCustomization', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentCustomization', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociation' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociation' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationBatteryPartAssociation', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociation', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociationAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociationAccommodation' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationBatteryPartAssociationAccommodation', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociationAccommodation', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + + -- Pop the stack + DELETE FROM @claimIdStack WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('systemDescriptors', 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + -- Setting default authorization metadata + PRINT 'Deleting default action authorizations for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = @claimId); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = @claimId + + -- Default Create authorization + PRINT 'Creating action ''Create'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @CreateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Read authorization + PRINT 'Creating action ''Read'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @ReadActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NoFurtherAuthorizationRequired' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NoFurtherAuthorizationRequired'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NoFurtherAuthorizationRequired'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Update authorization + PRINT 'Creating action ''Update'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @UpdateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Delete authorization + PRINT 'Creating action ''Delete'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @DeleteActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Processing claim sets for http://ed-fi.org/ods/identity/claims/domains/systemDescriptors + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Ed-Fi Sandbox' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Assessment Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Assessment Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Bootstrap Descriptors and EdOrgs' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Bootstrap Descriptors and EdOrgs' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NoFurtherAuthorizationRequired' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''NoFurtherAuthorizationRequired'''; + THROW 50000, @msg, 1 + END + + PRINT 'Creating authorization strategy override entry of ''NoFurtherAuthorizationRequired''' + '(authorizationStrategyId = ' + CONVERT(nvarchar, @authorizationStrategyId) + ' for ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides(ClaimSetResourceClaimActionId, AuthorizationStrategyId) + VALUES (@claimSetResourceClaimActionId, @authorizationStrategyId) + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'District Hosted SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + -- Push claimId to the stack + INSERT INTO @claimIdStack (ResourceClaimId) VALUES (@claimId) + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/systemDescriptors + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/Section504DisabilityTypeDescriptor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/Section504DisabilityTypeDescriptor' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('Section504DisabilityTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/Section504DisabilityTypeDescriptor', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + + -- Pop the stack + DELETE FROM @claimIdStack WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('relationshipBasedData', 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + -- Setting default authorization metadata + PRINT 'Deleting default action authorizations for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = @claimId); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = @claimId + + -- Default Create authorization + PRINT 'Creating action ''Create'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @CreateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Read authorization + PRINT 'Creating action ''Read'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @ReadActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Update authorization + PRINT 'Creating action ''Update'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @UpdateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Delete authorization + PRINT 'Creating action ''Delete'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @DeleteActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Processing claim sets for http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Ed-Fi Sandbox' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'District Hosted SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + -- Push claimId to the stack + INSERT INTO @claimIdStack (ResourceClaimId) VALUES (@claimId) + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentSection504ProgramAssociation' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentSection504ProgramAssociation' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentSection504ProgramAssociation', 'http://ed-fi.org/ods/identity/claims/studentSection504ProgramAssociation', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + + -- Pop the stack + DELETE FROM @claimIdStack WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('relationshipBasedData', 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + -- Setting default authorization metadata + PRINT 'Deleting default action authorizations for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = @claimId); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = @claimId + + -- Default Create authorization + PRINT 'Creating action ''Create'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @CreateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Read authorization + PRINT 'Creating action ''Read'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @ReadActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Update authorization + PRINT 'Creating action ''Update'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @UpdateActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Default Delete authorization + PRINT 'Creating action ''Delete'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (@claimId, @DeleteActionId) + + SET @resourceClaimActionId = SCOPE_IDENTITY() + + + SET @authorizationStrategyId = NULL + + SELECT @authorizationStrategyId = a.AuthorizationStrategyId + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople' + + IF @authorizationStrategyId IS NULL + BEGIN + SET @msg = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + THROW 50000, @msg, 1 + END + + PRINT 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' + @claimName + ''' (claimId=' + CONVERT(nvarchar, @claimId) + ').' + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (@resourceClaimActionId, @authorizationStrategyId) + + + -- Processing claim sets for http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Ed-Fi Sandbox' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'District Hosted SIS Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Create authorization + PRINT 'Creating ''Create'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @CreateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @CreateActionId) -- Create + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Update authorization + PRINT 'Creating ''Update'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @UpdateActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @UpdateActionId) -- Update + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + + -- Claim set-specific Delete authorization + PRINT 'Creating ''Delete'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @DeleteActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @DeleteActionId) -- Delete + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Assessment Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimSetName = 'Assessment Vendor' + SET @claimSetId = NULL + + SELECT @claimSetId = ClaimSetId + FROM dbo.ClaimSets + WHERE ClaimSetName = @claimSetName + + IF @claimSetId IS NULL + BEGIN + PRINT 'Creating new claim set: ' + @claimSetName + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (@claimSetName) + + SET @claimSetId = SCOPE_IDENTITY() + END + + PRINT 'Deleting existing actions for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ') on resource claim ''' + @claimName + '''.' + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN (SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId) + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = @claimSetId AND ResourceClaimId = @claimId + + + -- Claim set-specific Read authorization + PRINT 'Creating ''Read'' action for claim set ''' + @claimSetName + ''' (claimSetId=' + CONVERT(nvarchar, @claimSetId) + ', actionId = ' + CONVERT(nvarchar, @ReadActionId) + ').' + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (@claimId, @claimSetId, @ReadActionId) -- Read + + SET @claimSetResourceClaimActionId = SCOPE_IDENTITY() + + + + -- Push claimId to the stack + INSERT INTO @claimIdStack (ResourceClaimId) VALUES (@claimId) + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodation' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentEducationOrganizationAssessmentAccommodation', 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodation', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodationGeneralAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + SET @claimName = 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodationGeneralAccommodation' + SET @claimId = NULL + + SELECT @claimId = ResourceClaimId, @existingParentResourceClaimId = ParentResourceClaimId + FROM dbo.ResourceClaims + WHERE ClaimName = @claimName + + SELECT @parentResourceClaimId = ResourceClaimId + FROM @claimIdStack + WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + IF @claimId IS NULL + BEGIN + PRINT 'Creating new claim: ' + @claimName + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentEducationOrganizationAssessmentAccommodationGeneralAccommodation', 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodationGeneralAccommodation', @parentResourceClaimId) + + SET @claimId = SCOPE_IDENTITY() + END + ELSE + BEGIN + IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL) + BEGIN + PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')' + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = @parentResourceClaimId + WHERE ResourceClaimId = @claimId + END + END + + + -- Pop the stack + DELETE FROM @claimIdStack WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + + -- Pop the stack + DELETE FROM @claimIdStack WHERE Id = (SELECT Max(Id) FROM @claimIdStack) + + + COMMIT TRANSACTION +END diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml new file mode 100644 index 0000000000..a42736fe8f --- /dev/null +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0020-Tables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0020-Tables.sql index 0fe9ba63e0..916d0c540b 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0020-Tables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0020-Tables.sql @@ -200,6 +200,72 @@ GO ALTER TABLE [edfi].[AssessmentAcademicSubject] ADD CONSTRAINT [AssessmentAcademicSubject_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] GO +-- Table [edfi].[AssessmentAdministration] -- +CREATE TABLE [edfi].[AssessmentAdministration] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [Discriminator] [NVARCHAR](128) NULL, + [CreateDate] [DATETIME2] NOT NULL, + [LastModifiedDate] [DATETIME2] NOT NULL, + [Id] [UNIQUEIDENTIFIER] NOT NULL, + CONSTRAINT [AssessmentAdministration_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [Namespace] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[AssessmentAdministration] ADD CONSTRAINT [AssessmentAdministration_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO +ALTER TABLE [edfi].[AssessmentAdministration] ADD CONSTRAINT [AssessmentAdministration_DF_Id] DEFAULT (newid()) FOR [Id] +GO +ALTER TABLE [edfi].[AssessmentAdministration] ADD CONSTRAINT [AssessmentAdministration_DF_LastModifiedDate] DEFAULT (getutcdate()) FOR [LastModifiedDate] +GO + +-- Table [edfi].[AssessmentAdministrationAssessmentAdminstrationPeriod] -- +CREATE TABLE [edfi].[AssessmentAdministrationAssessmentAdminstrationPeriod] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [BeginDate] [DATE] NOT NULL, + [EndDate] [DATE] NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [AssessmentAdministrationAssessmentAdminstrationPeriod_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [Namespace] ASC, + [BeginDate] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[AssessmentAdministrationAssessmentAdminstrationPeriod] ADD CONSTRAINT [AssessmentAdministrationAssessmentAdminstrationPeriod_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + +-- Table [edfi].[AssessmentAdministrationAssessmentBatteryPart] -- +CREATE TABLE [edfi].[AssessmentAdministrationAssessmentBatteryPart] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [AssessmentBatteryPartName] [NVARCHAR](65) NOT NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [AssessmentAdministrationAssessmentBatteryPart_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [Namespace] ASC, + [AssessmentBatteryPartName] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[AssessmentAdministrationAssessmentBatteryPart] ADD CONSTRAINT [AssessmentAdministrationAssessmentBatteryPart_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + -- Table [edfi].[AssessmentAssessedGradeLevel] -- CREATE TABLE [edfi].[AssessmentAssessedGradeLevel] ( [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, @@ -216,6 +282,47 @@ GO ALTER TABLE [edfi].[AssessmentAssessedGradeLevel] ADD CONSTRAINT [AssessmentAssessedGradeLevel_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] GO +-- Table [edfi].[AssessmentBatteryPart] -- +CREATE TABLE [edfi].[AssessmentBatteryPart] ( + [AssessmentBatteryPartName] [NVARCHAR](65) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [Discriminator] [NVARCHAR](128) NULL, + [CreateDate] [DATETIME2] NOT NULL, + [LastModifiedDate] [DATETIME2] NOT NULL, + [Id] [UNIQUEIDENTIFIER] NOT NULL, + CONSTRAINT [AssessmentBatteryPart_PK] PRIMARY KEY CLUSTERED ( + [AssessmentBatteryPartName] ASC, + [AssessmentIdentifier] ASC, + [Namespace] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[AssessmentBatteryPart] ADD CONSTRAINT [AssessmentBatteryPart_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO +ALTER TABLE [edfi].[AssessmentBatteryPart] ADD CONSTRAINT [AssessmentBatteryPart_DF_Id] DEFAULT (newid()) FOR [Id] +GO +ALTER TABLE [edfi].[AssessmentBatteryPart] ADD CONSTRAINT [AssessmentBatteryPart_DF_LastModifiedDate] DEFAULT (getutcdate()) FOR [LastModifiedDate] +GO + +-- Table [edfi].[AssessmentBatteryPartObjectiveAssessment] -- +CREATE TABLE [edfi].[AssessmentBatteryPartObjectiveAssessment] ( + [AssessmentBatteryPartName] [NVARCHAR](65) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [IdentificationCode] [NVARCHAR](60) NOT NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [AssessmentBatteryPartObjectiveAssessment_PK] PRIMARY KEY CLUSTERED ( + [AssessmentBatteryPartName] ASC, + [AssessmentIdentifier] ASC, + [Namespace] ASC, + [IdentificationCode] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[AssessmentBatteryPartObjectiveAssessment] ADD CONSTRAINT [AssessmentBatteryPartObjectiveAssessment_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + -- Table [edfi].[AssessmentCategoryDescriptor] -- CREATE TABLE [edfi].[AssessmentCategoryDescriptor] ( [AssessmentCategoryDescriptorId] [INT] NOT NULL, @@ -574,6 +681,60 @@ GO ALTER TABLE [edfi].[AssessmentSection] ADD CONSTRAINT [AssessmentSection_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] GO +-- Table [edfi].[AssesssmentAdministrationParticipation] -- +CREATE TABLE [edfi].[AssesssmentAdministrationParticipation] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [ParticipatingEducationOrganizationId] [BIGINT] NOT NULL, + [Discriminator] [NVARCHAR](128) NULL, + [CreateDate] [DATETIME2] NOT NULL, + [LastModifiedDate] [DATETIME2] NOT NULL, + [Id] [UNIQUEIDENTIFIER] NOT NULL, + CONSTRAINT [AssesssmentAdministrationParticipation_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [Namespace] ASC, + [ParticipatingEducationOrganizationId] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ADD CONSTRAINT [AssesssmentAdministrationParticipation_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ADD CONSTRAINT [AssesssmentAdministrationParticipation_DF_Id] DEFAULT (newid()) FOR [Id] +GO +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ADD CONSTRAINT [AssesssmentAdministrationParticipation_DF_LastModifiedDate] DEFAULT (getutcdate()) FOR [LastModifiedDate] +GO + +-- Table [edfi].[AssesssmentAdministrationParticipationAdministrationPointOfContact] -- +CREATE TABLE [edfi].[AssesssmentAdministrationParticipationAdministrationPointOfContact] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [ParticipatingEducationOrganizationId] [BIGINT] NOT NULL, + [EducationOrganizationId] [BIGINT] NOT NULL, + [ElectronicMailAddress] [NVARCHAR](128) NOT NULL, + [FirstName] [NVARCHAR](75) NOT NULL, + [LastSurname] [NVARCHAR](75) NOT NULL, + [LoginId] [NVARCHAR](60) NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [AssesssmentAdministrationParticipationAdministrationPointOfContact_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [Namespace] ASC, + [ParticipatingEducationOrganizationId] ASC, + [EducationOrganizationId] ASC, + [ElectronicMailAddress] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[AssesssmentAdministrationParticipationAdministrationPointOfContact] ADD CONSTRAINT [AssesssmentAdministrationParticipationAdministrationPointOfContact_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + -- Table [edfi].[AssignmentLateStatusDescriptor] -- CREATE TABLE [edfi].[AssignmentLateStatusDescriptor] ( [AssignmentLateStatusDescriptorId] [INT] NOT NULL, @@ -6231,6 +6392,15 @@ GO ALTER TABLE [edfi].[Section] ADD CONSTRAINT [Section_DF_LastModifiedDate] DEFAULT (getutcdate()) FOR [LastModifiedDate] GO +-- Table [edfi].[Section504DisabilityTypeDescriptor] -- +CREATE TABLE [edfi].[Section504DisabilityTypeDescriptor] ( + [Section504DisabilityTypeDescriptorId] [INT] NOT NULL, + CONSTRAINT [Section504DisabilityTypeDescriptor_PK] PRIMARY KEY CLUSTERED ( + [Section504DisabilityTypeDescriptorId] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO + -- Table [edfi].[SectionAttendanceTakenEvent] -- CREATE TABLE [edfi].[SectionAttendanceTakenEvent] ( [CalendarCode] [NVARCHAR](60) NOT NULL, @@ -7835,6 +8005,147 @@ GO ALTER TABLE [edfi].[StudentAssessmentPeriod] ADD CONSTRAINT [StudentAssessmentPeriod_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] GO +-- Table [edfi].[StudentAssessmentRegistration] -- +CREATE TABLE [edfi].[StudentAssessmentRegistration] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [EducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [StudentUSI] [INT] NOT NULL, + [AssessmentGradeLevelDescriptorId] [INT] NULL, + [EntryDate] [DATE] NOT NULL, + [PlatformTypeDescriptorId] [INT] NULL, + [ReportingEducationOrganizationId] [BIGINT] NULL, + [SchoolId] [BIGINT] NOT NULL, + [TestingEducationOrganizationId] [BIGINT] NULL, + [Discriminator] [NVARCHAR](128) NULL, + [CreateDate] [DATETIME2] NOT NULL, + [LastModifiedDate] [DATETIME2] NOT NULL, + [Id] [UNIQUEIDENTIFIER] NOT NULL, + CONSTRAINT [StudentAssessmentRegistration_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [EducationOrganizationId] ASC, + [Namespace] ASC, + [StudentUSI] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistration] ADD CONSTRAINT [StudentAssessmentRegistration_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistration] ADD CONSTRAINT [StudentAssessmentRegistration_DF_Id] DEFAULT (newid()) FOR [Id] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistration] ADD CONSTRAINT [StudentAssessmentRegistration_DF_LastModifiedDate] DEFAULT (getutcdate()) FOR [LastModifiedDate] +GO + +-- Table [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] -- +CREATE TABLE [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [EducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [StudentUSI] [INT] NOT NULL, + [AccommodationDescriptorId] [INT] NOT NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [StudentAssessmentRegistrationAssessmentAccommodation_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [EducationOrganizationId] ASC, + [Namespace] ASC, + [StudentUSI] ASC, + [AccommodationDescriptorId] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] ADD CONSTRAINT [StudentAssessmentRegistrationAssessmentAccommodation_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + +-- Table [edfi].[StudentAssessmentRegistrationAssessmentCustomization] -- +CREATE TABLE [edfi].[StudentAssessmentRegistrationAssessmentCustomization] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [EducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [StudentUSI] [INT] NOT NULL, + [CustomizationKey] [NVARCHAR](60) NOT NULL, + [CustomizationValue] [NVARCHAR](1024) NOT NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [StudentAssessmentRegistrationAssessmentCustomization_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [EducationOrganizationId] ASC, + [Namespace] ASC, + [StudentUSI] ASC, + [CustomizationKey] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistrationAssessmentCustomization] ADD CONSTRAINT [StudentAssessmentRegistrationAssessmentCustomization_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + +-- Table [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] -- +CREATE TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentBatteryPartName] [NVARCHAR](65) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [EducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [StudentUSI] [INT] NOT NULL, + [Discriminator] [NVARCHAR](128) NULL, + [CreateDate] [DATETIME2] NOT NULL, + [LastModifiedDate] [DATETIME2] NOT NULL, + [Id] [UNIQUEIDENTIFIER] NOT NULL, + CONSTRAINT [StudentAssessmentRegistrationBatteryPartAssociation_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentBatteryPartName] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [EducationOrganizationId] ASC, + [Namespace] ASC, + [StudentUSI] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ADD CONSTRAINT [StudentAssessmentRegistrationBatteryPartAssociation_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ADD CONSTRAINT [StudentAssessmentRegistrationBatteryPartAssociation_DF_Id] DEFAULT (newid()) FOR [Id] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ADD CONSTRAINT [StudentAssessmentRegistrationBatteryPartAssociation_DF_LastModifiedDate] DEFAULT (getutcdate()) FOR [LastModifiedDate] +GO + +-- Table [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccommodation] -- +CREATE TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccommodation] ( + [AdministrationIdentifier] [NVARCHAR](255) NOT NULL, + [AssessmentBatteryPartName] [NVARCHAR](65) NOT NULL, + [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, + [AssigningEducationOrganizationId] [BIGINT] NOT NULL, + [EducationOrganizationId] [BIGINT] NOT NULL, + [Namespace] [NVARCHAR](255) NOT NULL, + [StudentUSI] [INT] NOT NULL, + [AccommodationDescriptorId] [INT] NOT NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [StudentAssessmentRegistrationBatteryPartAssociationAccommodation_PK] PRIMARY KEY CLUSTERED ( + [AdministrationIdentifier] ASC, + [AssessmentBatteryPartName] ASC, + [AssessmentIdentifier] ASC, + [AssigningEducationOrganizationId] ASC, + [EducationOrganizationId] ASC, + [Namespace] ASC, + [StudentUSI] ASC, + [AccommodationDescriptorId] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccommodation] ADD CONSTRAINT [StudentAssessmentRegistrationBatteryPartAssociationAccommodation_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + -- Table [edfi].[StudentAssessmentScoreResult] -- CREATE TABLE [edfi].[StudentAssessmentScoreResult] ( [AssessmentIdentifier] [NVARCHAR](60) NOT NULL, @@ -8266,6 +8577,43 @@ GO ALTER TABLE [edfi].[StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode] ADD CONSTRAINT [StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] GO +-- Table [edfi].[StudentEducationOrganizationAssessmentAccommodation] -- +CREATE TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ( + [EducationOrganizationId] [BIGINT] NOT NULL, + [StudentUSI] [INT] NOT NULL, + [Discriminator] [NVARCHAR](128) NULL, + [CreateDate] [DATETIME2] NOT NULL, + [LastModifiedDate] [DATETIME2] NOT NULL, + [Id] [UNIQUEIDENTIFIER] NOT NULL, + CONSTRAINT [StudentEducationOrganizationAssessmentAccommodation_PK] PRIMARY KEY CLUSTERED ( + [EducationOrganizationId] ASC, + [StudentUSI] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ADD CONSTRAINT [StudentEducationOrganizationAssessmentAccommodation_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ADD CONSTRAINT [StudentEducationOrganizationAssessmentAccommodation_DF_Id] DEFAULT (newid()) FOR [Id] +GO +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ADD CONSTRAINT [StudentEducationOrganizationAssessmentAccommodation_DF_LastModifiedDate] DEFAULT (getutcdate()) FOR [LastModifiedDate] +GO + +-- Table [edfi].[StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation] -- +CREATE TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation] ( + [EducationOrganizationId] [BIGINT] NOT NULL, + [StudentUSI] [INT] NOT NULL, + [AccommodationDescriptorId] [INT] NOT NULL, + [CreateDate] [DATETIME2] NOT NULL, + CONSTRAINT [StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_PK] PRIMARY KEY CLUSTERED ( + [EducationOrganizationId] ASC, + [StudentUSI] ASC, + [AccommodationDescriptorId] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation] ADD CONSTRAINT [StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] +GO + -- Table [edfi].[StudentEducationOrganizationAssociation] -- CREATE TABLE [edfi].[StudentEducationOrganizationAssociation] ( [EducationOrganizationId] [BIGINT] NOT NULL, @@ -9587,6 +9935,30 @@ GO ALTER TABLE [edfi].[StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService] ADD CONSTRAINT [StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_DF_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] GO +-- Table [edfi].[StudentSection504ProgramAssociation] -- +CREATE TABLE [edfi].[StudentSection504ProgramAssociation] ( + [BeginDate] [DATE] NOT NULL, + [EducationOrganizationId] [BIGINT] NOT NULL, + [ProgramEducationOrganizationId] [BIGINT] NOT NULL, + [ProgramName] [NVARCHAR](60) NOT NULL, + [ProgramTypeDescriptorId] [INT] NOT NULL, + [StudentUSI] [INT] NOT NULL, + [AccommodationPlan] [BIT] NULL, + [Section504DisabilityTypeDescriptorId] [INT] NULL, + [Section504Eligibility] [BIT] NOT NULL, + [Section504EligibilityDecisionDate] [DATE] NULL, + [Section504MeetingDate] [DATE] NULL, + CONSTRAINT [StudentSection504ProgramAssociation_PK] PRIMARY KEY CLUSTERED ( + [BeginDate] ASC, + [EducationOrganizationId] ASC, + [ProgramEducationOrganizationId] ASC, + [ProgramName] ASC, + [ProgramTypeDescriptorId] ASC, + [StudentUSI] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO + -- Table [edfi].[StudentSectionAssociation] -- CREATE TABLE [edfi].[StudentSectionAssociation] ( [BeginDate] [DATE] NOT NULL, @@ -9888,6 +10260,7 @@ GO CREATE TABLE [edfi].[StudentSpecialEducationProgramEligibilityAssociation] ( [ConsentToEvaluationReceivedDate] [DATE] NOT NULL, [EducationOrganizationId] [BIGINT] NOT NULL, + [ProgramEducationOrganizationId] [BIGINT] NOT NULL, [ProgramName] [NVARCHAR](60) NOT NULL, [ProgramTypeDescriptorId] [INT] NOT NULL, [StudentUSI] [INT] NOT NULL, @@ -9913,6 +10286,7 @@ CREATE TABLE [edfi].[StudentSpecialEducationProgramEligibilityAssociation] ( CONSTRAINT [StudentSpecialEducationProgramEligibilityAssociation_PK] PRIMARY KEY CLUSTERED ( [ConsentToEvaluationReceivedDate] ASC, [EducationOrganizationId] ASC, + [ProgramEducationOrganizationId] ASC, [ProgramName] ASC, [ProgramTypeDescriptorId] ASC, [StudentUSI] ASC diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0030-ForeignKeys.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0030-ForeignKeys.sql index 8e5588d368..6f170a070b 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0030-ForeignKeys.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0030-ForeignKeys.sql @@ -99,6 +99,40 @@ REFERENCES [edfi].[Assessment] ([AssessmentIdentifier], [Namespace]) ON DELETE CASCADE GO +ALTER TABLE [edfi].[AssessmentAdministration] WITH CHECK ADD CONSTRAINT [FK_AssessmentAdministration_Assessment] FOREIGN KEY ([AssessmentIdentifier], [Namespace]) +REFERENCES [edfi].[Assessment] ([AssessmentIdentifier], [Namespace]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssessmentAdministration_Assessment] +ON [edfi].[AssessmentAdministration] ([AssessmentIdentifier] ASC, [Namespace] ASC) +GO + +ALTER TABLE [edfi].[AssessmentAdministration] WITH CHECK ADD CONSTRAINT [FK_AssessmentAdministration_EducationOrganization] FOREIGN KEY ([AssigningEducationOrganizationId]) +REFERENCES [edfi].[EducationOrganization] ([EducationOrganizationId]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssessmentAdministration_EducationOrganization] +ON [edfi].[AssessmentAdministration] ([AssigningEducationOrganizationId] ASC) +GO + +ALTER TABLE [edfi].[AssessmentAdministrationAssessmentAdminstrationPeriod] WITH CHECK ADD CONSTRAINT [FK_AssessmentAdministrationAssessmentAdminstrationPeriod_AssessmentAdministration] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +REFERENCES [edfi].[AssessmentAdministration] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +ON DELETE CASCADE +GO + +ALTER TABLE [edfi].[AssessmentAdministrationAssessmentBatteryPart] WITH CHECK ADD CONSTRAINT [FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentAdministration] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +REFERENCES [edfi].[AssessmentAdministration] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +ON DELETE CASCADE +GO + +ALTER TABLE [edfi].[AssessmentAdministrationAssessmentBatteryPart] WITH CHECK ADD CONSTRAINT [FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentBatteryPart] FOREIGN KEY ([AssessmentBatteryPartName], [AssessmentIdentifier], [Namespace]) +REFERENCES [edfi].[AssessmentBatteryPart] ([AssessmentBatteryPartName], [AssessmentIdentifier], [Namespace]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentBatteryPart] +ON [edfi].[AssessmentAdministrationAssessmentBatteryPart] ([AssessmentBatteryPartName] ASC, [AssessmentIdentifier] ASC, [Namespace] ASC) +GO + ALTER TABLE [edfi].[AssessmentAssessedGradeLevel] WITH CHECK ADD CONSTRAINT [FK_AssessmentAssessedGradeLevel_Assessment] FOREIGN KEY ([AssessmentIdentifier], [Namespace]) REFERENCES [edfi].[Assessment] ([AssessmentIdentifier], [Namespace]) ON DELETE CASCADE @@ -112,6 +146,27 @@ CREATE NONCLUSTERED INDEX [FK_AssessmentAssessedGradeLevel_GradeLevelDescriptor] ON [edfi].[AssessmentAssessedGradeLevel] ([GradeLevelDescriptorId] ASC) GO +ALTER TABLE [edfi].[AssessmentBatteryPart] WITH CHECK ADD CONSTRAINT [FK_AssessmentBatteryPart_Assessment] FOREIGN KEY ([AssessmentIdentifier], [Namespace]) +REFERENCES [edfi].[Assessment] ([AssessmentIdentifier], [Namespace]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssessmentBatteryPart_Assessment] +ON [edfi].[AssessmentBatteryPart] ([AssessmentIdentifier] ASC, [Namespace] ASC) +GO + +ALTER TABLE [edfi].[AssessmentBatteryPartObjectiveAssessment] WITH CHECK ADD CONSTRAINT [FK_AssessmentBatteryPartObjectiveAssessment_AssessmentBatteryPart] FOREIGN KEY ([AssessmentBatteryPartName], [AssessmentIdentifier], [Namespace]) +REFERENCES [edfi].[AssessmentBatteryPart] ([AssessmentBatteryPartName], [AssessmentIdentifier], [Namespace]) +ON DELETE CASCADE +GO + +ALTER TABLE [edfi].[AssessmentBatteryPartObjectiveAssessment] WITH CHECK ADD CONSTRAINT [FK_AssessmentBatteryPartObjectiveAssessment_ObjectiveAssessment] FOREIGN KEY ([AssessmentIdentifier], [IdentificationCode], [Namespace]) +REFERENCES [edfi].[ObjectiveAssessment] ([AssessmentIdentifier], [IdentificationCode], [Namespace]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssessmentBatteryPartObjectiveAssessment_ObjectiveAssessment] +ON [edfi].[AssessmentBatteryPartObjectiveAssessment] ([AssessmentIdentifier] ASC, [IdentificationCode] ASC, [Namespace] ASC) +GO + ALTER TABLE [edfi].[AssessmentCategoryDescriptor] WITH CHECK ADD CONSTRAINT [FK_AssessmentCategoryDescriptor_Descriptor] FOREIGN KEY ([AssessmentCategoryDescriptorId]) REFERENCES [edfi].[Descriptor] ([DescriptorId]) ON DELETE CASCADE @@ -368,6 +423,35 @@ CREATE NONCLUSTERED INDEX [FK_AssessmentSection_Section] ON [edfi].[AssessmentSection] ([LocalCourseCode] ASC, [SchoolId] ASC, [SchoolYear] ASC, [SectionIdentifier] ASC, [SessionName] ASC) GO +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] WITH CHECK ADD CONSTRAINT [FK_AssesssmentAdministrationParticipation_AssessmentAdministration] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +REFERENCES [edfi].[AssessmentAdministration] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssesssmentAdministrationParticipation_AssessmentAdministration] +ON [edfi].[AssesssmentAdministrationParticipation] ([AdministrationIdentifier] ASC, [AssessmentIdentifier] ASC, [AssigningEducationOrganizationId] ASC, [Namespace] ASC) +GO + +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] WITH CHECK ADD CONSTRAINT [FK_AssesssmentAdministrationParticipation_EducationOrganization] FOREIGN KEY ([ParticipatingEducationOrganizationId]) +REFERENCES [edfi].[EducationOrganization] ([EducationOrganizationId]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssesssmentAdministrationParticipation_EducationOrganization] +ON [edfi].[AssesssmentAdministrationParticipation] ([ParticipatingEducationOrganizationId] ASC) +GO + +ALTER TABLE [edfi].[AssesssmentAdministrationParticipationAdministrationPointOfContact] WITH CHECK ADD CONSTRAINT [FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_AssesssmentAdministrationParticipation] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace], [ParticipatingEducationOrganizationId]) +REFERENCES [edfi].[AssesssmentAdministrationParticipation] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace], [ParticipatingEducationOrganizationId]) +ON DELETE CASCADE +GO + +ALTER TABLE [edfi].[AssesssmentAdministrationParticipationAdministrationPointOfContact] WITH CHECK ADD CONSTRAINT [FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_EducationOrganization] FOREIGN KEY ([EducationOrganizationId]) +REFERENCES [edfi].[EducationOrganization] ([EducationOrganizationId]) +GO + +CREATE NONCLUSTERED INDEX [FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_EducationOrganization] +ON [edfi].[AssesssmentAdministrationParticipationAdministrationPointOfContact] ([EducationOrganizationId] ASC) +GO + ALTER TABLE [edfi].[AssignmentLateStatusDescriptor] WITH CHECK ADD CONSTRAINT [FK_AssignmentLateStatusDescriptor_Descriptor] FOREIGN KEY ([AssignmentLateStatusDescriptorId]) REFERENCES [edfi].[Descriptor] ([DescriptorId]) ON DELETE CASCADE @@ -4286,6 +4370,11 @@ CREATE NONCLUSTERED INDEX [FK_Section_SectionTypeDescriptor] ON [edfi].[Section] ([SectionTypeDescriptorId] ASC) GO +ALTER TABLE [edfi].[Section504DisabilityTypeDescriptor] WITH CHECK ADD CONSTRAINT [FK_Section504DisabilityTypeDescriptor_Descriptor] FOREIGN KEY ([Section504DisabilityTypeDescriptorId]) +REFERENCES [edfi].[Descriptor] ([DescriptorId]) +ON DELETE CASCADE +GO + ALTER TABLE [edfi].[SectionAttendanceTakenEvent] WITH CHECK ADD CONSTRAINT [FK_SectionAttendanceTakenEvent_CalendarDate] FOREIGN KEY ([CalendarCode], [Date], [SchoolId], [SchoolYear]) REFERENCES [edfi].[CalendarDate] ([CalendarCode], [Date], [SchoolId], [SchoolYear]) GO @@ -5566,6 +5655,118 @@ REFERENCES [edfi].[StudentAssessment] ([AssessmentIdentifier], [Namespace], [Stu ON DELETE CASCADE GO +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_AssessmentAdministration] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +REFERENCES [edfi].[AssessmentAdministration] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [Namespace]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_AssessmentAdministration] +ON [edfi].[StudentAssessmentRegistration] ([AdministrationIdentifier] ASC, [AssessmentIdentifier] ASC, [AssigningEducationOrganizationId] ASC, [Namespace] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_EducationOrganization] FOREIGN KEY ([ReportingEducationOrganizationId]) +REFERENCES [edfi].[EducationOrganization] ([EducationOrganizationId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_EducationOrganization] +ON [edfi].[StudentAssessmentRegistration] ([ReportingEducationOrganizationId] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_EducationOrganization1] FOREIGN KEY ([TestingEducationOrganizationId]) +REFERENCES [edfi].[EducationOrganization] ([EducationOrganizationId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_EducationOrganization1] +ON [edfi].[StudentAssessmentRegistration] ([TestingEducationOrganizationId] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_GradeLevelDescriptor] FOREIGN KEY ([AssessmentGradeLevelDescriptorId]) +REFERENCES [edfi].[GradeLevelDescriptor] ([GradeLevelDescriptorId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_GradeLevelDescriptor] +ON [edfi].[StudentAssessmentRegistration] ([AssessmentGradeLevelDescriptorId] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_PlatformTypeDescriptor] FOREIGN KEY ([PlatformTypeDescriptorId]) +REFERENCES [edfi].[PlatformTypeDescriptor] ([PlatformTypeDescriptorId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_PlatformTypeDescriptor] +ON [edfi].[StudentAssessmentRegistration] ([PlatformTypeDescriptorId] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_StudentEducationOrganizationAssessmentAccommodation] FOREIGN KEY ([EducationOrganizationId], [StudentUSI]) +REFERENCES [edfi].[StudentEducationOrganizationAssessmentAccommodation] ([EducationOrganizationId], [StudentUSI]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_StudentEducationOrganizationAssessmentAccommodation] +ON [edfi].[StudentAssessmentRegistration] ([EducationOrganizationId] ASC, [StudentUSI] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_StudentEducationOrganizationAssociation] FOREIGN KEY ([EducationOrganizationId], [StudentUSI]) +REFERENCES [edfi].[StudentEducationOrganizationAssociation] ([EducationOrganizationId], [StudentUSI]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_StudentEducationOrganizationAssociation] +ON [edfi].[StudentAssessmentRegistration] ([EducationOrganizationId] ASC, [StudentUSI] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistration_StudentSchoolAssociation] FOREIGN KEY ([EntryDate], [SchoolId], [StudentUSI]) +REFERENCES [edfi].[StudentSchoolAssociation] ([EntryDate], [SchoolId], [StudentUSI]) +ON UPDATE CASCADE +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistration_StudentSchoolAssociation] +ON [edfi].[StudentAssessmentRegistration] ([EntryDate] ASC, [SchoolId] ASC, [StudentUSI] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistrationAssessmentAccommodation_AccommodationDescriptor] FOREIGN KEY ([AccommodationDescriptorId]) +REFERENCES [edfi].[AccommodationDescriptor] ([AccommodationDescriptorId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistrationAssessmentAccommodation_AccommodationDescriptor] +ON [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] ([AccommodationDescriptorId] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistrationAssessmentAccommodation_StudentAssessmentRegistration] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +REFERENCES [edfi].[StudentAssessmentRegistration] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +ON DELETE CASCADE +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationAssessmentCustomization] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistrationAssessmentCustomization_StudentAssessmentRegistration] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +REFERENCES [edfi].[StudentAssessmentRegistration] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +ON DELETE CASCADE +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistrationBatteryPartAssociation_AssessmentBatteryPart] FOREIGN KEY ([AssessmentBatteryPartName], [AssessmentIdentifier], [Namespace]) +REFERENCES [edfi].[AssessmentBatteryPart] ([AssessmentBatteryPartName], [AssessmentIdentifier], [Namespace]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistrationBatteryPartAssociation_AssessmentBatteryPart] +ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ([AssessmentBatteryPartName] ASC, [AssessmentIdentifier] ASC, [Namespace] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistrationBatteryPartAssociation_StudentAssessmentRegistration] FOREIGN KEY ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +REFERENCES [edfi].[StudentAssessmentRegistration] ([AdministrationIdentifier], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistrationBatteryPartAssociation_StudentAssessmentRegistration] +ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ([AdministrationIdentifier] ASC, [AssessmentIdentifier] ASC, [AssigningEducationOrganizationId] ASC, [EducationOrganizationId] ASC, [Namespace] ASC, [StudentUSI] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_AccommodationDescriptor] FOREIGN KEY ([AccommodationDescriptorId]) +REFERENCES [edfi].[AccommodationDescriptor] ([AccommodationDescriptorId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_AccommodationDescriptor] +ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccommodation] ([AccommodationDescriptorId] ASC) +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_StudentAssessmentRegistrationBatteryPartAssociation] FOREIGN KEY ([AdministrationIdentifier], [AssessmentBatteryPartName], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +REFERENCES [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ([AdministrationIdentifier], [AssessmentBatteryPartName], [AssessmentIdentifier], [AssigningEducationOrganizationId], [EducationOrganizationId], [Namespace], [StudentUSI]) +ON DELETE CASCADE +GO + ALTER TABLE [edfi].[StudentAssessmentScoreResult] WITH CHECK ADD CONSTRAINT [FK_StudentAssessmentScoreResult_AssessmentReportingMethodDescriptor] FOREIGN KEY ([AssessmentReportingMethodDescriptorId]) REFERENCES [edfi].[AssessmentReportingMethodDescriptor] ([AssessmentReportingMethodDescriptorId]) GO @@ -5852,6 +6053,31 @@ REFERENCES [edfi].[StudentDisciplineIncidentNonOffenderAssociation] ([IncidentId ON DELETE CASCADE GO +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentEducationOrganizationAssessmentAccommodation_EducationOrganization] FOREIGN KEY ([EducationOrganizationId]) +REFERENCES [edfi].[EducationOrganization] ([EducationOrganizationId]) +GO + +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentEducationOrganizationAssessmentAccommodation_Student] FOREIGN KEY ([StudentUSI]) +REFERENCES [edfi].[Student] ([StudentUSI]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentEducationOrganizationAssessmentAccommodation_Student] +ON [edfi].[StudentEducationOrganizationAssessmentAccommodation] ([StudentUSI] ASC) +GO + +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_AccommodationDescriptor] FOREIGN KEY ([AccommodationDescriptorId]) +REFERENCES [edfi].[AccommodationDescriptor] ([AccommodationDescriptorId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_AccommodationDescriptor] +ON [edfi].[StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation] ([AccommodationDescriptorId] ASC) +GO + +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation] WITH CHECK ADD CONSTRAINT [FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_StudentEducationOrganizationAssessmentAccommodation] FOREIGN KEY ([EducationOrganizationId], [StudentUSI]) +REFERENCES [edfi].[StudentEducationOrganizationAssessmentAccommodation] ([EducationOrganizationId], [StudentUSI]) +ON DELETE CASCADE +GO + ALTER TABLE [edfi].[StudentEducationOrganizationAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentEducationOrganizationAssociation_BarrierToInternetAccessInResidenceDescriptor] FOREIGN KEY ([BarrierToInternetAccessInResidenceDescriptorId]) REFERENCES [edfi].[BarrierToInternetAccessInResidenceDescriptor] ([BarrierToInternetAccessInResidenceDescriptorId]) GO @@ -6978,6 +7204,19 @@ REFERENCES [edfi].[StudentSchoolFoodServiceProgramAssociation] ([BeginDate], [Ed ON DELETE CASCADE GO +ALTER TABLE [edfi].[StudentSection504ProgramAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentSection504ProgramAssociation_GeneralStudentProgramAssociation] FOREIGN KEY ([BeginDate], [EducationOrganizationId], [ProgramEducationOrganizationId], [ProgramName], [ProgramTypeDescriptorId], [StudentUSI]) +REFERENCES [edfi].[GeneralStudentProgramAssociation] ([BeginDate], [EducationOrganizationId], [ProgramEducationOrganizationId], [ProgramName], [ProgramTypeDescriptorId], [StudentUSI]) +ON DELETE CASCADE +GO + +ALTER TABLE [edfi].[StudentSection504ProgramAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentSection504ProgramAssociation_Section504DisabilityTypeDescriptor] FOREIGN KEY ([Section504DisabilityTypeDescriptorId]) +REFERENCES [edfi].[Section504DisabilityTypeDescriptor] ([Section504DisabilityTypeDescriptorId]) +GO + +CREATE NONCLUSTERED INDEX [FK_StudentSection504ProgramAssociation_Section504DisabilityTypeDescriptor] +ON [edfi].[StudentSection504ProgramAssociation] ([Section504DisabilityTypeDescriptorId] ASC) +GO + ALTER TABLE [edfi].[StudentSectionAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentSectionAssociation_AttemptStatusDescriptor] FOREIGN KEY ([AttemptStatusDescriptorId]) REFERENCES [edfi].[AttemptStatusDescriptor] ([AttemptStatusDescriptorId]) GO @@ -7203,12 +7442,12 @@ CREATE NONCLUSTERED INDEX [FK_StudentSpecialEducationProgramEligibilityAssociati ON [edfi].[StudentSpecialEducationProgramEligibilityAssociation] ([IDEAPartDescriptorId] ASC) GO -ALTER TABLE [edfi].[StudentSpecialEducationProgramEligibilityAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentSpecialEducationProgramEligibilityAssociation_Program] FOREIGN KEY ([EducationOrganizationId], [ProgramName], [ProgramTypeDescriptorId]) +ALTER TABLE [edfi].[StudentSpecialEducationProgramEligibilityAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentSpecialEducationProgramEligibilityAssociation_Program] FOREIGN KEY ([ProgramEducationOrganizationId], [ProgramName], [ProgramTypeDescriptorId]) REFERENCES [edfi].[Program] ([EducationOrganizationId], [ProgramName], [ProgramTypeDescriptorId]) GO CREATE NONCLUSTERED INDEX [FK_StudentSpecialEducationProgramEligibilityAssociation_Program] -ON [edfi].[StudentSpecialEducationProgramEligibilityAssociation] ([EducationOrganizationId] ASC, [ProgramName] ASC, [ProgramTypeDescriptorId] ASC) +ON [edfi].[StudentSpecialEducationProgramEligibilityAssociation] ([ProgramEducationOrganizationId] ASC, [ProgramName] ASC, [ProgramTypeDescriptorId] ASC) GO ALTER TABLE [edfi].[StudentSpecialEducationProgramEligibilityAssociation] WITH CHECK ADD CONSTRAINT [FK_StudentSpecialEducationProgramEligibilityAssociation_Student] FOREIGN KEY ([StudentUSI]) diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql index 087a9af577..dd3ea99cff 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql @@ -24,6 +24,20 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssessmentAdministration') AND name = N'UX_AssessmentAdministration_Id') + CREATE UNIQUE NONCLUSTERED INDEX UX_AssessmentAdministration_Id ON [edfi].[AssessmentAdministration] + (Id) WITH (PAD_INDEX = ON, FILLFACTOR = 75, STATISTICS_NORECOMPUTE = OFF) ON [PRIMARY] + GO +COMMIT + +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssessmentBatteryPart') AND name = N'UX_AssessmentBatteryPart_Id') + CREATE UNIQUE NONCLUSTERED INDEX UX_AssessmentBatteryPart_Id ON [edfi].[AssessmentBatteryPart] + (Id) WITH (PAD_INDEX = ON, FILLFACTOR = 75, STATISTICS_NORECOMPUTE = OFF) ON [PRIMARY] + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssessmentItem') AND name = N'UX_AssessmentItem_Id') CREATE UNIQUE NONCLUSTERED INDEX UX_AssessmentItem_Id ON [edfi].[AssessmentItem] @@ -38,6 +52,13 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssesssmentAdministrationParticipation') AND name = N'UX_AssesssmentAdministrationParticipation_Id') + CREATE UNIQUE NONCLUSTERED INDEX UX_AssesssmentAdministrationParticipation_Id ON [edfi].[AssesssmentAdministrationParticipation] + (Id) WITH (PAD_INDEX = ON, FILLFACTOR = 75, STATISTICS_NORECOMPUTE = OFF) ON [PRIMARY] + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.BalanceSheetDimension') AND name = N'UX_BalanceSheetDimension_Id') CREATE UNIQUE NONCLUSTERED INDEX UX_BalanceSheetDimension_Id ON [edfi].[BalanceSheetDimension] @@ -591,6 +612,20 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentAssessmentRegistration') AND name = N'UX_StudentAssessmentRegistration_Id') + CREATE UNIQUE NONCLUSTERED INDEX UX_StudentAssessmentRegistration_Id ON [edfi].[StudentAssessmentRegistration] + (Id) WITH (PAD_INDEX = ON, FILLFACTOR = 75, STATISTICS_NORECOMPUTE = OFF) ON [PRIMARY] + GO +COMMIT + +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentAssessmentRegistrationBatteryPartAssociation') AND name = N'UX_StudentAssessmentRegistrationBatteryPartAssociation_Id') + CREATE UNIQUE NONCLUSTERED INDEX UX_StudentAssessmentRegistrationBatteryPartAssociation_Id ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] + (Id) WITH (PAD_INDEX = ON, FILLFACTOR = 75, STATISTICS_NORECOMPUTE = OFF) ON [PRIMARY] + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentCohortAssociation') AND name = N'UX_StudentCohortAssociation_Id') CREATE UNIQUE NONCLUSTERED INDEX UX_StudentCohortAssociation_Id ON [edfi].[StudentCohortAssociation] @@ -626,6 +661,13 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentEducationOrganizationAssessmentAccommodation') AND name = N'UX_StudentEducationOrganizationAssessmentAccommodation_Id') + CREATE UNIQUE NONCLUSTERED INDEX UX_StudentEducationOrganizationAssessmentAccommodation_Id ON [edfi].[StudentEducationOrganizationAssessmentAccommodation] + (Id) WITH (PAD_INDEX = ON, FILLFACTOR = 75, STATISTICS_NORECOMPUTE = OFF) ON [PRIMARY] + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentEducationOrganizationAssociation') AND name = N'UX_StudentEducationOrganizationAssociation_Id') CREATE UNIQUE NONCLUSTERED INDEX UX_StudentEducationOrganizationAssociation_Id ON [edfi].[StudentEducationOrganizationAssociation] diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0050-ExtendedProperties.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0050-ExtendedProperties.sql index 7735d6080d..ba2a82426e 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0050-ExtendedProperties.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/0050-ExtendedProperties.sql @@ -139,6 +139,48 @@ GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The description of the content or subject area (e.g., arts, mathematics, reading, stenography, or a foreign language) of an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAcademicSubject', @level2type=N'COLUMN', @level2name=N'AcademicSubjectDescriptorId' GO +-- Extended Properties [edfi].[AssessmentAdministration] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The anticipated administration of an assessment under the purview of an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministration' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministration', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministration', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministration', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministration', @level2type=N'COLUMN', @level2name=N'Namespace' +GO + +-- Extended Properties [edfi].[AssessmentAdministrationAssessmentAdminstrationPeriod] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The anticipated dates for the assessment or administration window.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentAdminstrationPeriod' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentAdminstrationPeriod', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentAdminstrationPeriod', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentAdminstrationPeriod', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentAdminstrationPeriod', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentAdminstrationPeriod', @level2type=N'COLUMN', @level2name=N'BeginDate' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentAdminstrationPeriod', @level2type=N'COLUMN', @level2name=N'EndDate' +GO + +-- Extended Properties [edfi].[AssessmentAdministrationAssessmentBatteryPart] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A reference to the parts of the assessment battery that are offered in this administration of the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentBatteryPart' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the part of an assessment battery.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAdministrationAssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'AssessmentBatteryPartName' +GO + -- Extended Properties [edfi].[AssessmentAssessedGradeLevel] -- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The grade level(s) for which an assessment is designed. The semantics of null is assumed to mean that the assessment is not associated with any grade level.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAssessedGradeLevel' GO @@ -149,6 +191,28 @@ GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The grade level(s) for which an assessment is designed. The semantics of null is assumed to mean that the assessment is not associated with any grade level.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentAssessedGradeLevel', @level2type=N'COLUMN', @level2name=N'GradeLevelDescriptorId' GO +-- Extended Properties [edfi].[AssessmentBatteryPart] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The parts organized for administering an assessessment which together provide a comprehensive assessment of the students.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPart' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the part of an assessment battery.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'AssessmentBatteryPartName' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPart', @level2type=N'COLUMN', @level2name=N'Namespace' +GO + +-- Extended Properties [edfi].[AssessmentBatteryPartObjectiveAssessment] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A reference to the objective assessment(s) that are administered by the assessment battery part.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPartObjectiveAssessment' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the part of an assessment battery.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPartObjectiveAssessment', @level2type=N'COLUMN', @level2name=N'AssessmentBatteryPartName' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPartObjectiveAssessment', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPartObjectiveAssessment', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentBatteryPartObjectiveAssessment', @level2type=N'COLUMN', @level2name=N'IdentificationCode' +GO + -- Extended Properties [edfi].[AssessmentCategoryDescriptor] -- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'This descriptor holds the category of an assessment based on format and content.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentCategoryDescriptor' GO @@ -421,6 +485,44 @@ GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier for the calendar for the academic session.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssessmentSection', @level2type=N'COLUMN', @level2name=N'SessionName' GO +-- Extended Properties [edfi].[AssesssmentAdministrationParticipation] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Identifies the point of contact for the administration of an assessment under the purview of an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipation' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipation', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipation', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipation', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipation', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipation', @level2type=N'COLUMN', @level2name=N'ParticipatingEducationOrganizationId' +GO + +-- Extended Properties [edfi].[AssesssmentAdministrationParticipationAdministrationPointOfContact] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Pre-identified contacts for education organizations administering the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'ParticipatingEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The email address for the contact.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'ElectronicMailAddress' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The contact''s first name.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'FirstName' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The contact''s last name.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'LastSurname' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The login ID for the user; used for security access control interface.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssesssmentAdministrationParticipationAdministrationPointOfContact', @level2type=N'COLUMN', @level2name=N'LoginId' +GO + -- Extended Properties [edfi].[AssignmentLateStatusDescriptor] -- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Status of whether the assignment was submitted after the due date and/or marked as late.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'AssignmentLateStatusDescriptor' GO @@ -4457,6 +4559,12 @@ GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'When a section is part of a sequence of parts for a course, the number of the sequence. If the course has only one part, the value of this section attribute should be 1.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'Section', @level2type=N'COLUMN', @level2name=N'SequenceOfCourse' GO +-- Extended Properties [edfi].[Section504DisabilityTypeDescriptor] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'This descriptor defines the reason(s) why student qualifies for Section 504 consideration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'Section504DisabilityTypeDescriptor' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'Section504DisabilityTypeDescriptor', @level2type=N'COLUMN', @level2name=N'Section504DisabilityTypeDescriptorId' +GO + -- Extended Properties [edfi].[SectionAttendanceTakenEvent] -- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Captures attendance taken event for given section.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'SectionAttendanceTakenEvent' GO @@ -5757,6 +5865,110 @@ GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The last date the assessment is to be administered. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentPeriod', @level2type=N'COLUMN', @level2name=N'EndDate' GO +-- Extended Properties [edfi].[StudentAssessmentRegistration] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Identifies an assessment registration that a student is expected to participate in including the testing organization, reporting organization and assessment delivery details.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The grade level or primary instructional level at which the student is to be assessed.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'AssessmentGradeLevelDescriptorId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The month, day, and year on which an individual enters and begins to receive instructional services in a school for each school year. The EntryDate value should be the date the student enrolled, or when the student''s enrollment materially changed, such as with a grade promotion. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'EntryDate' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The environment or format in which the assessment is expected to be administered.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'PlatformTypeDescriptorId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'ReportingEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'SchoolId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistration', @level2type=N'COLUMN', @level2name=N'TestingEducationOrganizationId' +GO + +-- Extended Properties [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'AccommodationDescriptorId' +GO + +-- Extended Properties [edfi].[StudentAssessmentRegistrationAssessmentCustomization] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Key/value pairs which may be used to facilitate customization of an assessment or to support vendor reporting/analysis.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'An agreed upon identifier for the custom information.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'CustomizationKey' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Custom value for the indicated CustomizationKey.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationAssessmentCustomization', @level2type=N'COLUMN', @level2name=N'CustomizationValue' +GO + +-- Extended Properties [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The association to the part(s) of the assessment battery that the student is to be tested for this administration of the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the part of an assessment battery.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation', @level2type=N'COLUMN', @level2name=N'AssessmentBatteryPartName' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociation', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO + +-- Extended Properties [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccommodation] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title or name of the assessment in the context of its administration.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'AdministrationIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the part of an assessment battery.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'AssessmentBatteryPartName' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique number or alphanumeric code assigned to an assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'AssessmentIdentifier' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'AssigningEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Namespace for the assessment.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'Namespace' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentRegistrationBatteryPartAssociationAccommodation', @level2type=N'COLUMN', @level2name=N'AccommodationDescriptorId' +GO + -- Extended Properties [edfi].[StudentAssessmentScoreResult] -- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A meaningful score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentAssessmentScoreResult' GO @@ -6083,6 +6295,24 @@ GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The role or type of participation of a student in a discipline incident.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode', @level2type=N'COLUMN', @level2name=N'DisciplineIncidentParticipationCodeDescriptorId' GO +-- Extended Properties [edfi].[StudentEducationOrganizationAssessmentAccommodation] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The accommodation(s) required or expected for administering assessments as determined by the education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssessmentAccommodation' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssessmentAccommodation', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO + +-- Extended Properties [edfi].[StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation', @level2type=N'COLUMN', @level2name=N'AccommodationDescriptorId' +GO + -- Extended Properties [edfi].[StudentEducationOrganizationAssociation] -- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'This association represents student information as reported in the context of the student''s relationship to the education organization. Enrollment relationship semantics are covered by StudentSchoolAssociation.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentEducationOrganizationAssociation' GO @@ -7207,6 +7437,32 @@ GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Last date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService', @level2type=N'COLUMN', @level2name=N'ServiceEndDate' GO +-- Extended Properties [edfi].[StudentSection504ProgramAssociation] -- +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'This association identifies student that qualifies for the Section 504 of the Rehabilitation Act of 1973.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'BeginDate' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'ProgramEducationOrganizationId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'ProgramName' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The type of program.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'ProgramTypeDescriptorId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A unique alphanumeric code assigned to a student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'StudentUSI' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Indicates whether student has a Section 504 accommodation plan.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'AccommodationPlan' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Defines one or more disabilities student has that qualifies them for a Section 504 plan.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'Section504DisabilityTypeDescriptorId' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Indicates whether student has a disability, either temporary or permenant, that qualifies student for Section 504 consideration. Selection of FALSE for this boolean is equivalent to marking student as ''Did Not Qualify''.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'Section504Eligibility' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The month, day, and year on which the Section 504 eligibility decision is made.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'Section504EligibilityDecisionDate' +GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The month, day, and year on which the meeting with student''s parent/guardian held to discuss the 504 eligibility of the student.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSection504ProgramAssociation', @level2type=N'COLUMN', @level2name=N'Section504MeetingDate' +GO + -- Extended Properties [edfi].[StudentSectionAssociation] -- EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'This association indicates the course sections to which a student is assigned.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSectionAssociation' GO @@ -7480,6 +7736,8 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Indicates the GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSpecialEducationProgramEligibilityAssociation', @level2type=N'COLUMN', @level2name=N'EducationOrganizationId' GO +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The identifier assigned to an education organization.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSpecialEducationProgramEligibilityAssociation', @level2type=N'COLUMN', @level2name=N'ProgramEducationOrganizationId' +GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSpecialEducationProgramEligibilityAssociation', @level2type=N'COLUMN', @level2name=N'ProgramName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The type of program.', @level0type=N'SCHEMA', @level0name=N'edfi', @level1type=N'TABLE', @level1name=N'StudentSpecialEducationProgramEligibilityAssociation', @level2type=N'COLUMN', @level2name=N'ProgramTypeDescriptorId' diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql index 7f1e468880..ba2e20c19a 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql @@ -19,6 +19,11 @@ BEGIN CREATE INDEX IX_Assessment_EducationOrganizationId ON [edfi].[Assessment](EducationOrganizationId) INCLUDE (Id) END; +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_AssesssmentAdministrationParticipation_AssigningEducationOrganizationId' AND object_id = OBJECT_ID('edfi.AssesssmentAdministrationParticipation')) +BEGIN + CREATE INDEX IX_AssesssmentAdministrationParticipation_AssigningEducationOrganizationId ON [edfi].[AssesssmentAdministrationParticipation](AssigningEducationOrganizationId) INCLUDE (Id) +END; + IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_BellSchedule_SchoolId' AND object_id = OBJECT_ID('edfi.BellSchedule')) BEGIN CREATE INDEX IX_BellSchedule_SchoolId ON [edfi].[BellSchedule](SchoolId) INCLUDE (Id) @@ -284,6 +289,31 @@ BEGIN CREATE INDEX IX_StudentAssessmentEducationOrganizationAssociation_EducationOrganizationId ON [edfi].[StudentAssessmentEducationOrganizationAssociation](EducationOrganizationId) INCLUDE (Id) END; +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentAssessmentRegistration_AssigningEducationOrganizationId' AND object_id = OBJECT_ID('edfi.StudentAssessmentRegistration')) +BEGIN + CREATE INDEX IX_StudentAssessmentRegistration_AssigningEducationOrganizationId ON [edfi].[StudentAssessmentRegistration](AssigningEducationOrganizationId) INCLUDE (Id) +END; + +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentAssessmentRegistration_EducationOrganizationId' AND object_id = OBJECT_ID('edfi.StudentAssessmentRegistration')) +BEGIN + CREATE INDEX IX_StudentAssessmentRegistration_EducationOrganizationId ON [edfi].[StudentAssessmentRegistration](EducationOrganizationId) INCLUDE (Id) +END; + +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentAssessmentRegistration_SchoolId' AND object_id = OBJECT_ID('edfi.StudentAssessmentRegistration')) +BEGIN + CREATE INDEX IX_StudentAssessmentRegistration_SchoolId ON [edfi].[StudentAssessmentRegistration](SchoolId) INCLUDE (Id) +END; + +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentAssessmentRegistrationBatteryPartAssociation_AssigningEducationOrganizationId' AND object_id = OBJECT_ID('edfi.StudentAssessmentRegistrationBatteryPartAssociation')) +BEGIN + CREATE INDEX IX_StudentAssessmentRegistrationBatteryPartAssociation_AssigningEducationOrganizationId ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation](AssigningEducationOrganizationId) INCLUDE (Id) +END; + +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentAssessmentRegistrationBatteryPartAssociation_EducationOrganizationId' AND object_id = OBJECT_ID('edfi.StudentAssessmentRegistrationBatteryPartAssociation')) +BEGIN + CREATE INDEX IX_StudentAssessmentRegistrationBatteryPartAssociation_EducationOrganizationId ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation](EducationOrganizationId) INCLUDE (Id) +END; + IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentCohortAssociation_EducationOrganizationId' AND object_id = OBJECT_ID('edfi.StudentCohortAssociation')) BEGIN CREATE INDEX IX_StudentCohortAssociation_EducationOrganizationId ON [edfi].[StudentCohortAssociation](EducationOrganizationId) INCLUDE (Id) @@ -299,6 +329,11 @@ BEGIN CREATE INDEX IX_StudentDisciplineIncidentNonOffenderAssociation_SchoolId ON [edfi].[StudentDisciplineIncidentNonOffenderAssociation](SchoolId) INCLUDE (Id) END; +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentEducationOrganizationAssessmentAccommodation_EducationOrganizationId' AND object_id = OBJECT_ID('edfi.StudentEducationOrganizationAssessmentAccommodation')) +BEGIN + CREATE INDEX IX_StudentEducationOrganizationAssessmentAccommodation_EducationOrganizationId ON [edfi].[StudentEducationOrganizationAssessmentAccommodation](EducationOrganizationId) INCLUDE (Id) +END; + IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_StudentEducationOrganizationAssociation_EducationOrganizationId' AND object_id = OBJECT_ID('edfi.StudentEducationOrganizationAssociation')) BEGIN CREATE INDEX IX_StudentEducationOrganizationAssociation_EducationOrganizationId ON [edfi].[StudentEducationOrganizationAssociation](EducationOrganizationId) INCLUDE (Id) diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1460-AggregateIdColumns.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1460-AggregateIdColumns.sql index 19235d275e..92d37e466d 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1460-AggregateIdColumns.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/1460-AggregateIdColumns.sql @@ -15,6 +15,14 @@ CREATE SEQUENCE [edfi].[Assessment_AggSeq] START WITH -2147483648 INCREMENT BY 1 ALTER TABLE [edfi].[Assessment] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[Assessment_AggSeq]; CREATE INDEX [IX_Assessment_AggregateId] ON [edfi].[Assessment] (AggregateId); +CREATE SEQUENCE [edfi].[AssessmentAdministration_AggSeq] START WITH -2147483648 INCREMENT BY 1; +ALTER TABLE [edfi].[AssessmentAdministration] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[AssessmentAdministration_AggSeq]; +CREATE INDEX [IX_AssessmentAdministration_AggregateId] ON [edfi].[AssessmentAdministration] (AggregateId); + +CREATE SEQUENCE [edfi].[AssessmentBatteryPart_AggSeq] START WITH -2147483648 INCREMENT BY 1; +ALTER TABLE [edfi].[AssessmentBatteryPart] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[AssessmentBatteryPart_AggSeq]; +CREATE INDEX [IX_AssessmentBatteryPart_AggregateId] ON [edfi].[AssessmentBatteryPart] (AggregateId); + CREATE SEQUENCE [edfi].[AssessmentItem_AggSeq] START WITH -2147483648 INCREMENT BY 1; ALTER TABLE [edfi].[AssessmentItem] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[AssessmentItem_AggSeq]; CREATE INDEX [IX_AssessmentItem_AggregateId] ON [edfi].[AssessmentItem] (AggregateId); @@ -23,6 +31,10 @@ CREATE SEQUENCE [edfi].[AssessmentScoreRangeLearningStandard_AggSeq] START WITH ALTER TABLE [edfi].[AssessmentScoreRangeLearningStandard] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[AssessmentScoreRangeLearningStandard_AggSeq]; CREATE INDEX [IX_AssessmentScoreRangeLearningStandard_AggregateId] ON [edfi].[AssessmentScoreRangeLearningStandard] (AggregateId); +CREATE SEQUENCE [edfi].[AssesssmentAdministrationParticipation_AggSeq] START WITH -2147483648 INCREMENT BY 1; +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[AssesssmentAdministrationParticipation_AggSeq]; +CREATE INDEX [IX_AssesssmentAdministrationParticipation_AggregateId] ON [edfi].[AssesssmentAdministrationParticipation] (AggregateId); + CREATE SEQUENCE [edfi].[BalanceSheetDimension_AggSeq] START WITH -2147483648 INCREMENT BY 1; ALTER TABLE [edfi].[BalanceSheetDimension] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[BalanceSheetDimension_AggSeq]; CREATE INDEX [IX_BalanceSheetDimension_AggregateId] ON [edfi].[BalanceSheetDimension] (AggregateId); @@ -339,6 +351,14 @@ CREATE SEQUENCE [edfi].[StudentAssessmentEducationOrganizationAssociation_AggSeq ALTER TABLE [edfi].[StudentAssessmentEducationOrganizationAssociation] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[StudentAssessmentEducationOrganizationAssociation_AggSeq]; CREATE INDEX [IX_StudentAssessmentEducationOrganizationAssociation_AggregateId] ON [edfi].[StudentAssessmentEducationOrganizationAssociation] (AggregateId); +CREATE SEQUENCE [edfi].[StudentAssessmentRegistration_AggSeq] START WITH -2147483648 INCREMENT BY 1; +ALTER TABLE [edfi].[StudentAssessmentRegistration] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[StudentAssessmentRegistration_AggSeq]; +CREATE INDEX [IX_StudentAssessmentRegistration_AggregateId] ON [edfi].[StudentAssessmentRegistration] (AggregateId); + +CREATE SEQUENCE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation_AggSeq] START WITH -2147483648 INCREMENT BY 1; +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[StudentAssessmentRegistrationBatteryPartAssociation_AggSeq]; +CREATE INDEX [IX_StudentAssessmentRegistrationBatteryPartAssociation_AggregateId] ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] (AggregateId); + CREATE SEQUENCE [edfi].[StudentCohortAssociation_AggSeq] START WITH -2147483648 INCREMENT BY 1; ALTER TABLE [edfi].[StudentCohortAssociation] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[StudentCohortAssociation_AggSeq]; CREATE INDEX [IX_StudentCohortAssociation_AggregateId] ON [edfi].[StudentCohortAssociation] (AggregateId); @@ -359,6 +379,10 @@ CREATE SEQUENCE [edfi].[StudentDisciplineIncidentNonOffenderAssociation_AggSeq] ALTER TABLE [edfi].[StudentDisciplineIncidentNonOffenderAssociation] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[StudentDisciplineIncidentNonOffenderAssociation_AggSeq]; CREATE INDEX [IX_StudentDisciplineIncidentNonOffenderAssociation_AggregateId] ON [edfi].[StudentDisciplineIncidentNonOffenderAssociation] (AggregateId); +CREATE SEQUENCE [edfi].[StudentEducationOrganizationAssessmentAccommodation_AggSeq] START WITH -2147483648 INCREMENT BY 1; +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[StudentEducationOrganizationAssessmentAccommodation_AggSeq]; +CREATE INDEX [IX_StudentEducationOrganizationAssessmentAccommodation_AggregateId] ON [edfi].[StudentEducationOrganizationAssessmentAccommodation] (AggregateId); + CREATE SEQUENCE [edfi].[StudentEducationOrganizationAssociation_AggSeq] START WITH -2147483648 INCREMENT BY 1; ALTER TABLE [edfi].[StudentEducationOrganizationAssociation] ADD AggregateId int NOT NULL DEFAULT NEXT VALUE FOR [edfi].[StudentEducationOrganizationAssociation_AggSeq]; CREATE INDEX [IX_StudentEducationOrganizationAssociation_AggregateId] ON [edfi].[StudentEducationOrganizationAssociation] (AggregateId); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql index 4e90433982..d8f6b17366 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql @@ -29,6 +29,22 @@ ALTER TABLE [edfi].[Assessment] ADD CONSTRAINT Assessment_DF_ChangeVersion DEFAU END +IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[AssessmentAdministration]') AND name = 'ChangeVersion') +BEGIN +ALTER TABLE [edfi].[AssessmentAdministration] ADD [ChangeVersion] [BIGINT] CONSTRAINT AssessmentAdministration_DF_ChangeVersion DEFAULT (0) NOT NULL; +ALTER TABLE [edfi].[AssessmentAdministration] DROP CONSTRAINT AssessmentAdministration_DF_ChangeVersion; +ALTER TABLE [edfi].[AssessmentAdministration] ADD CONSTRAINT AssessmentAdministration_DF_ChangeVersion DEFAULT (NEXT VALUE FOR [changes].[ChangeVersionSequence]) For [ChangeVersion]; +END + + +IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[AssessmentBatteryPart]') AND name = 'ChangeVersion') +BEGIN +ALTER TABLE [edfi].[AssessmentBatteryPart] ADD [ChangeVersion] [BIGINT] CONSTRAINT AssessmentBatteryPart_DF_ChangeVersion DEFAULT (0) NOT NULL; +ALTER TABLE [edfi].[AssessmentBatteryPart] DROP CONSTRAINT AssessmentBatteryPart_DF_ChangeVersion; +ALTER TABLE [edfi].[AssessmentBatteryPart] ADD CONSTRAINT AssessmentBatteryPart_DF_ChangeVersion DEFAULT (NEXT VALUE FOR [changes].[ChangeVersionSequence]) For [ChangeVersion]; +END + + IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[AssessmentItem]') AND name = 'ChangeVersion') BEGIN ALTER TABLE [edfi].[AssessmentItem] ADD [ChangeVersion] [BIGINT] CONSTRAINT AssessmentItem_DF_ChangeVersion DEFAULT (0) NOT NULL; @@ -45,6 +61,14 @@ ALTER TABLE [edfi].[AssessmentScoreRangeLearningStandard] ADD CONSTRAINT Assessm END +IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[AssesssmentAdministrationParticipation]') AND name = 'ChangeVersion') +BEGIN +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ADD [ChangeVersion] [BIGINT] CONSTRAINT AssesssmentAdministrationParticipation_DF_ChangeVersion DEFAULT (0) NOT NULL; +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] DROP CONSTRAINT AssesssmentAdministrationParticipation_DF_ChangeVersion; +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ADD CONSTRAINT AssesssmentAdministrationParticipation_DF_ChangeVersion DEFAULT (NEXT VALUE FOR [changes].[ChangeVersionSequence]) For [ChangeVersion]; +END + + IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[BalanceSheetDimension]') AND name = 'ChangeVersion') BEGIN ALTER TABLE [edfi].[BalanceSheetDimension] ADD [ChangeVersion] [BIGINT] CONSTRAINT BalanceSheetDimension_DF_ChangeVersion DEFAULT (0) NOT NULL; @@ -677,6 +701,22 @@ ALTER TABLE [edfi].[StudentAssessmentEducationOrganizationAssociation] ADD CONST END +IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[StudentAssessmentRegistration]') AND name = 'ChangeVersion') +BEGIN +ALTER TABLE [edfi].[StudentAssessmentRegistration] ADD [ChangeVersion] [BIGINT] CONSTRAINT StudentAssessmentRegistration_DF_ChangeVersion DEFAULT (0) NOT NULL; +ALTER TABLE [edfi].[StudentAssessmentRegistration] DROP CONSTRAINT StudentAssessmentRegistration_DF_ChangeVersion; +ALTER TABLE [edfi].[StudentAssessmentRegistration] ADD CONSTRAINT StudentAssessmentRegistration_DF_ChangeVersion DEFAULT (NEXT VALUE FOR [changes].[ChangeVersionSequence]) For [ChangeVersion]; +END + + +IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[StudentAssessmentRegistrationBatteryPartAssociation]') AND name = 'ChangeVersion') +BEGIN +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ADD [ChangeVersion] [BIGINT] CONSTRAINT StudentAssessmentRegistrationBatteryPartAssociation_DF_ChangeVersion DEFAULT (0) NOT NULL; +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] DROP CONSTRAINT StudentAssessmentRegistrationBatteryPartAssociation_DF_ChangeVersion; +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ADD CONSTRAINT StudentAssessmentRegistrationBatteryPartAssociation_DF_ChangeVersion DEFAULT (NEXT VALUE FOR [changes].[ChangeVersionSequence]) For [ChangeVersion]; +END + + IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[StudentCohortAssociation]') AND name = 'ChangeVersion') BEGIN ALTER TABLE [edfi].[StudentCohortAssociation] ADD [ChangeVersion] [BIGINT] CONSTRAINT StudentCohortAssociation_DF_ChangeVersion DEFAULT (0) NOT NULL; @@ -717,6 +757,14 @@ ALTER TABLE [edfi].[StudentDisciplineIncidentNonOffenderAssociation] ADD CONSTRA END +IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[StudentEducationOrganizationAssessmentAccommodation]') AND name = 'ChangeVersion') +BEGIN +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ADD [ChangeVersion] [BIGINT] CONSTRAINT StudentEducationOrganizationAssessmentAccommodation_DF_ChangeVersion DEFAULT (0) NOT NULL; +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] DROP CONSTRAINT StudentEducationOrganizationAssessmentAccommodation_DF_ChangeVersion; +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ADD CONSTRAINT StudentEducationOrganizationAssessmentAccommodation_DF_ChangeVersion DEFAULT (NEXT VALUE FOR [changes].[ChangeVersionSequence]) For [ChangeVersion]; +END + + IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[edfi].[StudentEducationOrganizationAssociation]') AND name = 'ChangeVersion') BEGIN ALTER TABLE [edfi].[StudentEducationOrganizationAssociation] ADD [ChangeVersion] [BIGINT] CONSTRAINT StudentEducationOrganizationAssociation_DF_ChangeVersion DEFAULT (0) NOT NULL; diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql index 39e0cc7cb7..5d1c5c94f2 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql @@ -21,6 +21,18 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssessmentAdministration') AND name = N'UX_AssessmentAdministration_ChangeVersion') + CREATE INDEX [UX_AssessmentAdministration_ChangeVersion] ON [edfi].[AssessmentAdministration] ([ChangeVersion] ASC) + GO +COMMIT + +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssessmentBatteryPart') AND name = N'UX_AssessmentBatteryPart_ChangeVersion') + CREATE INDEX [UX_AssessmentBatteryPart_ChangeVersion] ON [edfi].[AssessmentBatteryPart] ([ChangeVersion] ASC) + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssessmentItem') AND name = N'UX_AssessmentItem_ChangeVersion') CREATE INDEX [UX_AssessmentItem_ChangeVersion] ON [edfi].[AssessmentItem] ([ChangeVersion] ASC) @@ -33,6 +45,12 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.AssesssmentAdministrationParticipation') AND name = N'UX_AssesssmentAdministrationParticipation_ChangeVersion') + CREATE INDEX [UX_AssesssmentAdministrationParticipation_ChangeVersion] ON [edfi].[AssesssmentAdministrationParticipation] ([ChangeVersion] ASC) + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.BalanceSheetDimension') AND name = N'UX_BalanceSheetDimension_ChangeVersion') CREATE INDEX [UX_BalanceSheetDimension_ChangeVersion] ON [edfi].[BalanceSheetDimension] ([ChangeVersion] ASC) @@ -507,6 +525,18 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentAssessmentRegistration') AND name = N'UX_StudentAssessmentRegistration_ChangeVersion') + CREATE INDEX [UX_StudentAssessmentRegistration_ChangeVersion] ON [edfi].[StudentAssessmentRegistration] ([ChangeVersion] ASC) + GO +COMMIT + +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentAssessmentRegistrationBatteryPartAssociation') AND name = N'UX_StudentAssessmentRegistrationBatteryPartAssociation_ChangeVersion') + CREATE INDEX [UX_StudentAssessmentRegistrationBatteryPartAssociation_ChangeVersion] ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ([ChangeVersion] ASC) + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentCohortAssociation') AND name = N'UX_StudentCohortAssociation_ChangeVersion') CREATE INDEX [UX_StudentCohortAssociation_ChangeVersion] ON [edfi].[StudentCohortAssociation] ([ChangeVersion] ASC) @@ -537,6 +567,12 @@ BEGIN TRANSACTION GO COMMIT +BEGIN TRANSACTION + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentEducationOrganizationAssessmentAccommodation') AND name = N'UX_StudentEducationOrganizationAssessmentAccommodation_ChangeVersion') + CREATE INDEX [UX_StudentEducationOrganizationAssessmentAccommodation_ChangeVersion] ON [edfi].[StudentEducationOrganizationAssessmentAccommodation] ([ChangeVersion] ASC) + GO +COMMIT + BEGIN TRANSACTION IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'edfi.StudentEducationOrganizationAssociation') AND name = N'UX_StudentEducationOrganizationAssociation_ChangeVersion') CREATE INDEX [UX_StudentEducationOrganizationAssociation_ChangeVersion] ON [edfi].[StudentEducationOrganizationAssociation] ([ChangeVersion] ASC) diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql index 8375b013f8..1603f8fd6a 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql @@ -48,6 +48,38 @@ CREATE TABLE [tracked_changes_edfi].[Assessment] CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), CONSTRAINT PK_Assessment PRIMARY KEY CLUSTERED (ChangeVersion) ) +IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[AssessmentAdministration]')) +CREATE TABLE [tracked_changes_edfi].[AssessmentAdministration] +( + OldAdministrationIdentifier [NVARCHAR](255) NOT NULL, + OldAssessmentIdentifier [NVARCHAR](60) NOT NULL, + OldAssigningEducationOrganizationId [BIGINT] NOT NULL, + OldNamespace [NVARCHAR](255) NOT NULL, + NewAdministrationIdentifier [NVARCHAR](255) NULL, + NewAssessmentIdentifier [NVARCHAR](60) NULL, + NewAssigningEducationOrganizationId [BIGINT] NULL, + NewNamespace [NVARCHAR](255) NULL, + Id uniqueidentifier NOT NULL, + ChangeVersion bigint NOT NULL, + Discriminator [NVARCHAR](128) NULL, + CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), + CONSTRAINT PK_AssessmentAdministration PRIMARY KEY CLUSTERED (ChangeVersion) +) +IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[AssessmentBatteryPart]')) +CREATE TABLE [tracked_changes_edfi].[AssessmentBatteryPart] +( + OldAssessmentBatteryPartName [NVARCHAR](65) NOT NULL, + OldAssessmentIdentifier [NVARCHAR](60) NOT NULL, + OldNamespace [NVARCHAR](255) NOT NULL, + NewAssessmentBatteryPartName [NVARCHAR](65) NULL, + NewAssessmentIdentifier [NVARCHAR](60) NULL, + NewNamespace [NVARCHAR](255) NULL, + Id uniqueidentifier NOT NULL, + ChangeVersion bigint NOT NULL, + Discriminator [NVARCHAR](128) NULL, + CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), + CONSTRAINT PK_AssessmentBatteryPart PRIMARY KEY CLUSTERED (ChangeVersion) +) IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[AssessmentItem]')) CREATE TABLE [tracked_changes_edfi].[AssessmentItem] ( @@ -78,6 +110,25 @@ CREATE TABLE [tracked_changes_edfi].[AssessmentScoreRangeLearningStandard] CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), CONSTRAINT PK_AssessmentScoreRangeLearningStandard PRIMARY KEY CLUSTERED (ChangeVersion) ) +IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[AssesssmentAdministrationParticipation]')) +CREATE TABLE [tracked_changes_edfi].[AssesssmentAdministrationParticipation] +( + OldAdministrationIdentifier [NVARCHAR](255) NOT NULL, + OldAssessmentIdentifier [NVARCHAR](60) NOT NULL, + OldAssigningEducationOrganizationId [BIGINT] NOT NULL, + OldNamespace [NVARCHAR](255) NOT NULL, + OldParticipatingEducationOrganizationId [BIGINT] NOT NULL, + NewAdministrationIdentifier [NVARCHAR](255) NULL, + NewAssessmentIdentifier [NVARCHAR](60) NULL, + NewAssigningEducationOrganizationId [BIGINT] NULL, + NewNamespace [NVARCHAR](255) NULL, + NewParticipatingEducationOrganizationId [BIGINT] NULL, + Id uniqueidentifier NOT NULL, + ChangeVersion bigint NOT NULL, + Discriminator [NVARCHAR](128) NULL, + CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), + CONSTRAINT PK_AssesssmentAdministrationParticipation PRIMARY KEY CLUSTERED (ChangeVersion) +) IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[BalanceSheetDimension]')) CREATE TABLE [tracked_changes_edfi].[BalanceSheetDimension] ( @@ -1500,6 +1551,54 @@ CREATE TABLE [tracked_changes_edfi].[StudentAssessmentEducationOrganizationAssoc CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), CONSTRAINT PK_StudentAssessmentEducationOrganizationAssociation PRIMARY KEY CLUSTERED (ChangeVersion) ) +IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[StudentAssessmentRegistration]')) +CREATE TABLE [tracked_changes_edfi].[StudentAssessmentRegistration] +( + OldAdministrationIdentifier [NVARCHAR](255) NOT NULL, + OldAssessmentIdentifier [NVARCHAR](60) NOT NULL, + OldAssigningEducationOrganizationId [BIGINT] NOT NULL, + OldEducationOrganizationId [BIGINT] NOT NULL, + OldNamespace [NVARCHAR](255) NOT NULL, + OldStudentUSI [INT] NOT NULL, + OldStudentUniqueId [NVARCHAR](32) NOT NULL, + NewAdministrationIdentifier [NVARCHAR](255) NULL, + NewAssessmentIdentifier [NVARCHAR](60) NULL, + NewAssigningEducationOrganizationId [BIGINT] NULL, + NewEducationOrganizationId [BIGINT] NULL, + NewNamespace [NVARCHAR](255) NULL, + NewStudentUSI [INT] NULL, + NewStudentUniqueId [NVARCHAR](32) NULL, + Id uniqueidentifier NOT NULL, + ChangeVersion bigint NOT NULL, + Discriminator [NVARCHAR](128) NULL, + CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), + CONSTRAINT PK_StudentAssessmentRegistration PRIMARY KEY CLUSTERED (ChangeVersion) +) +IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[StudentAssessmentRegistrationBatteryPartAssociation]')) +CREATE TABLE [tracked_changes_edfi].[StudentAssessmentRegistrationBatteryPartAssociation] +( + OldAdministrationIdentifier [NVARCHAR](255) NOT NULL, + OldAssessmentBatteryPartName [NVARCHAR](65) NOT NULL, + OldAssessmentIdentifier [NVARCHAR](60) NOT NULL, + OldAssigningEducationOrganizationId [BIGINT] NOT NULL, + OldEducationOrganizationId [BIGINT] NOT NULL, + OldNamespace [NVARCHAR](255) NOT NULL, + OldStudentUSI [INT] NOT NULL, + OldStudentUniqueId [NVARCHAR](32) NOT NULL, + NewAdministrationIdentifier [NVARCHAR](255) NULL, + NewAssessmentBatteryPartName [NVARCHAR](65) NULL, + NewAssessmentIdentifier [NVARCHAR](60) NULL, + NewAssigningEducationOrganizationId [BIGINT] NULL, + NewEducationOrganizationId [BIGINT] NULL, + NewNamespace [NVARCHAR](255) NULL, + NewStudentUSI [INT] NULL, + NewStudentUniqueId [NVARCHAR](32) NULL, + Id uniqueidentifier NOT NULL, + ChangeVersion bigint NOT NULL, + Discriminator [NVARCHAR](128) NULL, + CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), + CONSTRAINT PK_StudentAssessmentRegistrationBatteryPartAssociation PRIMARY KEY CLUSTERED (ChangeVersion) +) IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[StudentCohortAssociation]')) CREATE TABLE [tracked_changes_edfi].[StudentCohortAssociation] ( @@ -1611,6 +1710,21 @@ CREATE TABLE [tracked_changes_edfi].[StudentDisciplineIncidentNonOffenderAssocia CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), CONSTRAINT PK_StudentDisciplineIncidentNonOffenderAssociation PRIMARY KEY CLUSTERED (ChangeVersion) ) +IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[StudentEducationOrganizationAssessmentAccommodation]')) +CREATE TABLE [tracked_changes_edfi].[StudentEducationOrganizationAssessmentAccommodation] +( + OldEducationOrganizationId [BIGINT] NOT NULL, + OldStudentUSI [INT] NOT NULL, + OldStudentUniqueId [NVARCHAR](32) NOT NULL, + NewEducationOrganizationId [BIGINT] NULL, + NewStudentUSI [INT] NULL, + NewStudentUniqueId [NVARCHAR](32) NULL, + Id uniqueidentifier NOT NULL, + ChangeVersion bigint NOT NULL, + Discriminator [NVARCHAR](128) NULL, + CreateDate DateTime2 NOT NULL DEFAULT (getutcdate()), + CONSTRAINT PK_StudentEducationOrganizationAssessmentAccommodation PRIMARY KEY CLUSTERED (ChangeVersion) +) IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[tracked_changes_edfi].[StudentEducationOrganizationAssociation]')) CREATE TABLE [tracked_changes_edfi].[StudentEducationOrganizationAssociation] ( @@ -1900,6 +2014,7 @@ CREATE TABLE [tracked_changes_edfi].[StudentSpecialEducationProgramEligibilityAs ( OldConsentToEvaluationReceivedDate [DATE] NOT NULL, OldEducationOrganizationId [BIGINT] NOT NULL, + OldProgramEducationOrganizationId [BIGINT] NOT NULL, OldProgramName [NVARCHAR](60) NOT NULL, OldProgramTypeDescriptorId [INT] NOT NULL, OldProgramTypeDescriptorNamespace [NVARCHAR](255) NOT NULL, @@ -1908,6 +2023,7 @@ CREATE TABLE [tracked_changes_edfi].[StudentSpecialEducationProgramEligibilityAs OldStudentUniqueId [NVARCHAR](32) NOT NULL, NewConsentToEvaluationReceivedDate [DATE] NULL, NewEducationOrganizationId [BIGINT] NULL, + NewProgramEducationOrganizationId [BIGINT] NULL, NewProgramName [NVARCHAR](60) NULL, NewProgramTypeDescriptorId [INT] NULL, NewProgramTypeDescriptorNamespace [NVARCHAR](255) NULL, diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql index 7569ad3b10..067c7bd4b2 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql @@ -42,6 +42,32 @@ BEGIN END GO +DROP TRIGGER IF EXISTS [edfi].[edfi_AssessmentAdministration_TR_UpdateChangeVersion] +GO + +CREATE TRIGGER [edfi].[edfi_AssessmentAdministration_TR_UpdateChangeVersion] ON [edfi].[AssessmentAdministration] AFTER UPDATE AS +BEGIN + SET NOCOUNT ON; + UPDATE [edfi].[AssessmentAdministration] + SET ChangeVersion = (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM [edfi].[AssessmentAdministration] u + WHERE EXISTS (SELECT 1 FROM inserted i WHERE i.id = u.id); +END +GO + +DROP TRIGGER IF EXISTS [edfi].[edfi_AssessmentBatteryPart_TR_UpdateChangeVersion] +GO + +CREATE TRIGGER [edfi].[edfi_AssessmentBatteryPart_TR_UpdateChangeVersion] ON [edfi].[AssessmentBatteryPart] AFTER UPDATE AS +BEGIN + SET NOCOUNT ON; + UPDATE [edfi].[AssessmentBatteryPart] + SET ChangeVersion = (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM [edfi].[AssessmentBatteryPart] u + WHERE EXISTS (SELECT 1 FROM inserted i WHERE i.id = u.id); +END +GO + DROP TRIGGER IF EXISTS [edfi].[edfi_AssessmentItem_TR_UpdateChangeVersion] GO @@ -68,6 +94,19 @@ BEGIN END GO +DROP TRIGGER IF EXISTS [edfi].[edfi_AssesssmentAdministrationParticipation_TR_UpdateChangeVersion] +GO + +CREATE TRIGGER [edfi].[edfi_AssesssmentAdministrationParticipation_TR_UpdateChangeVersion] ON [edfi].[AssesssmentAdministrationParticipation] AFTER UPDATE AS +BEGIN + SET NOCOUNT ON; + UPDATE [edfi].[AssesssmentAdministrationParticipation] + SET ChangeVersion = (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM [edfi].[AssesssmentAdministrationParticipation] u + WHERE EXISTS (SELECT 1 FROM inserted i WHERE i.id = u.id); +END +GO + DROP TRIGGER IF EXISTS [edfi].[edfi_BalanceSheetDimension_TR_UpdateChangeVersion] GO @@ -1273,6 +1312,32 @@ BEGIN END GO +DROP TRIGGER IF EXISTS [edfi].[edfi_StudentAssessmentRegistration_TR_UpdateChangeVersion] +GO + +CREATE TRIGGER [edfi].[edfi_StudentAssessmentRegistration_TR_UpdateChangeVersion] ON [edfi].[StudentAssessmentRegistration] AFTER UPDATE AS +BEGIN + SET NOCOUNT ON; + UPDATE [edfi].[StudentAssessmentRegistration] + SET ChangeVersion = (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM [edfi].[StudentAssessmentRegistration] u + WHERE EXISTS (SELECT 1 FROM inserted i WHERE i.id = u.id); +END +GO + +DROP TRIGGER IF EXISTS [edfi].[edfi_StudentAssessmentRegistrationBatteryPartAssociation_TR_UpdateChangeVersion] +GO + +CREATE TRIGGER [edfi].[edfi_StudentAssessmentRegistrationBatteryPartAssociation_TR_UpdateChangeVersion] ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] AFTER UPDATE AS +BEGIN + SET NOCOUNT ON; + UPDATE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] + SET ChangeVersion = (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] u + WHERE EXISTS (SELECT 1 FROM inserted i WHERE i.id = u.id); +END +GO + DROP TRIGGER IF EXISTS [edfi].[edfi_StudentCohortAssociation_TR_UpdateChangeVersion] GO @@ -1338,6 +1403,19 @@ BEGIN END GO +DROP TRIGGER IF EXISTS [edfi].[edfi_StudentEducationOrganizationAssessmentAccommodation_TR_UpdateChangeVersion] +GO + +CREATE TRIGGER [edfi].[edfi_StudentEducationOrganizationAssessmentAccommodation_TR_UpdateChangeVersion] ON [edfi].[StudentEducationOrganizationAssessmentAccommodation] AFTER UPDATE AS +BEGIN + SET NOCOUNT ON; + UPDATE [edfi].[StudentEducationOrganizationAssessmentAccommodation] + SET ChangeVersion = (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM [edfi].[StudentEducationOrganizationAssessmentAccommodation] u + WHERE EXISTS (SELECT 1 FROM inserted i WHERE i.id = u.id); +END +GO + DROP TRIGGER IF EXISTS [edfi].[edfi_StudentEducationOrganizationAssociation_TR_UpdateChangeVersion] GO diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql index 465a4a56d9..a25dc6223c 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql @@ -294,6 +294,46 @@ ALTER TABLE [edfi].[Assessment] ENABLE TRIGGER [edfi_Assessment_TR_DeleteTrackin GO +DROP TRIGGER IF EXISTS [edfi].[edfi_AssessmentAdministration_TR_DeleteTracking] +GO + +CREATE TRIGGER [edfi].[edfi_AssessmentAdministration_TR_DeleteTracking] ON [edfi].[AssessmentAdministration] AFTER DELETE AS +BEGIN + IF @@rowcount = 0 + RETURN + + SET NOCOUNT ON + + INSERT INTO [tracked_changes_edfi].[AssessmentAdministration](OldAdministrationIdentifier, OldAssessmentIdentifier, OldAssigningEducationOrganizationId, OldNamespace, Id, Discriminator, ChangeVersion) + SELECT d.AdministrationIdentifier, d.AssessmentIdentifier, d.AssigningEducationOrganizationId, d.Namespace, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM deleted d +END +GO + +ALTER TABLE [edfi].[AssessmentAdministration] ENABLE TRIGGER [edfi_AssessmentAdministration_TR_DeleteTracking] +GO + + +DROP TRIGGER IF EXISTS [edfi].[edfi_AssessmentBatteryPart_TR_DeleteTracking] +GO + +CREATE TRIGGER [edfi].[edfi_AssessmentBatteryPart_TR_DeleteTracking] ON [edfi].[AssessmentBatteryPart] AFTER DELETE AS +BEGIN + IF @@rowcount = 0 + RETURN + + SET NOCOUNT ON + + INSERT INTO [tracked_changes_edfi].[AssessmentBatteryPart](OldAssessmentBatteryPartName, OldAssessmentIdentifier, OldNamespace, Id, Discriminator, ChangeVersion) + SELECT d.AssessmentBatteryPartName, d.AssessmentIdentifier, d.Namespace, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM deleted d +END +GO + +ALTER TABLE [edfi].[AssessmentBatteryPart] ENABLE TRIGGER [edfi_AssessmentBatteryPart_TR_DeleteTracking] +GO + + DROP TRIGGER IF EXISTS [edfi].[edfi_AssessmentCategoryDescriptor_TR_DeleteTracking] GO @@ -460,6 +500,26 @@ ALTER TABLE [edfi].[AssessmentScoreRangeLearningStandard] ENABLE TRIGGER [edfi_A GO +DROP TRIGGER IF EXISTS [edfi].[edfi_AssesssmentAdministrationParticipation_TR_DeleteTracking] +GO + +CREATE TRIGGER [edfi].[edfi_AssesssmentAdministrationParticipation_TR_DeleteTracking] ON [edfi].[AssesssmentAdministrationParticipation] AFTER DELETE AS +BEGIN + IF @@rowcount = 0 + RETURN + + SET NOCOUNT ON + + INSERT INTO [tracked_changes_edfi].[AssesssmentAdministrationParticipation](OldAdministrationIdentifier, OldAssessmentIdentifier, OldAssigningEducationOrganizationId, OldNamespace, OldParticipatingEducationOrganizationId, Id, Discriminator, ChangeVersion) + SELECT d.AdministrationIdentifier, d.AssessmentIdentifier, d.AssigningEducationOrganizationId, d.Namespace, d.ParticipatingEducationOrganizationId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM deleted d +END +GO + +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ENABLE TRIGGER [edfi_AssesssmentAdministrationParticipation_TR_DeleteTracking] +GO + + DROP TRIGGER IF EXISTS [edfi].[edfi_AssignmentLateStatusDescriptor_TR_DeleteTracking] GO @@ -4984,6 +5044,27 @@ ALTER TABLE [edfi].[SchoolYearType] ENABLE TRIGGER [edfi_SchoolYearType_TR_Delet GO +DROP TRIGGER IF EXISTS [edfi].[edfi_Section504DisabilityTypeDescriptor_TR_DeleteTracking] +GO + +CREATE TRIGGER [edfi].[edfi_Section504DisabilityTypeDescriptor_TR_DeleteTracking] ON [edfi].[Section504DisabilityTypeDescriptor] AFTER DELETE AS +BEGIN + IF @@rowcount = 0 + RETURN + + SET NOCOUNT ON + + INSERT INTO [tracked_changes_edfi].[Descriptor](OldDescriptorId, OldCodeValue, OldNamespace, Id, Discriminator, ChangeVersion) + SELECT d.Section504DisabilityTypeDescriptorId, b.CodeValue, b.Namespace, b.Id, 'edfi.Section504DisabilityTypeDescriptor', (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM deleted d + INNER JOIN edfi.Descriptor b ON d.Section504DisabilityTypeDescriptorId = b.DescriptorId +END +GO + +ALTER TABLE [edfi].[Section504DisabilityTypeDescriptor] ENABLE TRIGGER [edfi_Section504DisabilityTypeDescriptor_TR_DeleteTracking] +GO + + DROP TRIGGER IF EXISTS [edfi].[edfi_Section_TR_DeleteTracking] GO @@ -5700,6 +5781,50 @@ ALTER TABLE [edfi].[StudentAssessmentEducationOrganizationAssociation] ENABLE TR GO +DROP TRIGGER IF EXISTS [edfi].[edfi_StudentAssessmentRegistration_TR_DeleteTracking] +GO + +CREATE TRIGGER [edfi].[edfi_StudentAssessmentRegistration_TR_DeleteTracking] ON [edfi].[StudentAssessmentRegistration] AFTER DELETE AS +BEGIN + IF @@rowcount = 0 + RETURN + + SET NOCOUNT ON + + INSERT INTO [tracked_changes_edfi].[StudentAssessmentRegistration](OldAdministrationIdentifier, OldAssessmentIdentifier, OldAssigningEducationOrganizationId, OldEducationOrganizationId, OldNamespace, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion) + SELECT d.AdministrationIdentifier, d.AssessmentIdentifier, d.AssigningEducationOrganizationId, d.EducationOrganizationId, d.Namespace, d.StudentUSI, j0.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM deleted d + INNER JOIN edfi.Student j0 + ON d.StudentUSI = j0.StudentUSI +END +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistration] ENABLE TRIGGER [edfi_StudentAssessmentRegistration_TR_DeleteTracking] +GO + + +DROP TRIGGER IF EXISTS [edfi].[edfi_StudentAssessmentRegistrationBatteryPartAssociation_TR_DeleteTracking] +GO + +CREATE TRIGGER [edfi].[edfi_StudentAssessmentRegistrationBatteryPartAssociation_TR_DeleteTracking] ON [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] AFTER DELETE AS +BEGIN + IF @@rowcount = 0 + RETURN + + SET NOCOUNT ON + + INSERT INTO [tracked_changes_edfi].[StudentAssessmentRegistrationBatteryPartAssociation](OldAdministrationIdentifier, OldAssessmentBatteryPartName, OldAssessmentIdentifier, OldAssigningEducationOrganizationId, OldEducationOrganizationId, OldNamespace, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion) + SELECT d.AdministrationIdentifier, d.AssessmentBatteryPartName, d.AssessmentIdentifier, d.AssigningEducationOrganizationId, d.EducationOrganizationId, d.Namespace, d.StudentUSI, j0.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM deleted d + INNER JOIN edfi.Student j0 + ON d.StudentUSI = j0.StudentUSI +END +GO + +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ENABLE TRIGGER [edfi_StudentAssessmentRegistrationBatteryPartAssociation_TR_DeleteTracking] +GO + + DROP TRIGGER IF EXISTS [edfi].[edfi_StudentCharacteristicDescriptor_TR_DeleteTracking] GO @@ -5839,6 +5964,28 @@ ALTER TABLE [edfi].[StudentDisciplineIncidentNonOffenderAssociation] ENABLE TRIG GO +DROP TRIGGER IF EXISTS [edfi].[edfi_StudentEducationOrganizationAssessmentAccommodation_TR_DeleteTracking] +GO + +CREATE TRIGGER [edfi].[edfi_StudentEducationOrganizationAssessmentAccommodation_TR_DeleteTracking] ON [edfi].[StudentEducationOrganizationAssessmentAccommodation] AFTER DELETE AS +BEGIN + IF @@rowcount = 0 + RETURN + + SET NOCOUNT ON + + INSERT INTO [tracked_changes_edfi].[StudentEducationOrganizationAssessmentAccommodation](OldEducationOrganizationId, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion) + SELECT d.EducationOrganizationId, d.StudentUSI, j0.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + FROM deleted d + INNER JOIN edfi.Student j0 + ON d.StudentUSI = j0.StudentUSI +END +GO + +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ENABLE TRIGGER [edfi_StudentEducationOrganizationAssessmentAccommodation_TR_DeleteTracking] +GO + + DROP TRIGGER IF EXISTS [edfi].[edfi_StudentEducationOrganizationAssociation_TR_DeleteTracking] GO @@ -6152,8 +6299,8 @@ BEGIN SET NOCOUNT ON - INSERT INTO [tracked_changes_edfi].[StudentSpecialEducationProgramEligibilityAssociation](OldConsentToEvaluationReceivedDate, OldEducationOrganizationId, OldProgramName, OldProgramTypeDescriptorId, OldProgramTypeDescriptorNamespace, OldProgramTypeDescriptorCodeValue, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion) - SELECT d.ConsentToEvaluationReceivedDate, d.EducationOrganizationId, d.ProgramName, d.ProgramTypeDescriptorId, j0.Namespace, j0.CodeValue, d.StudentUSI, j1.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) + INSERT INTO [tracked_changes_edfi].[StudentSpecialEducationProgramEligibilityAssociation](OldConsentToEvaluationReceivedDate, OldEducationOrganizationId, OldProgramEducationOrganizationId, OldProgramName, OldProgramTypeDescriptorId, OldProgramTypeDescriptorNamespace, OldProgramTypeDescriptorCodeValue, OldStudentUSI, OldStudentUniqueId, Id, Discriminator, ChangeVersion) + SELECT d.ConsentToEvaluationReceivedDate, d.EducationOrganizationId, d.ProgramEducationOrganizationId, d.ProgramName, d.ProgramTypeDescriptorId, j0.Namespace, j0.CodeValue, d.StudentUSI, j1.StudentUniqueId, d.Id, d.Discriminator, (NEXT VALUE FOR [changes].[ChangeVersionSequence]) FROM deleted d INNER JOIN edfi.Descriptor j0 ON d.ProgramTypeDescriptorId = j0.DescriptorId diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql index 313f79ecef..31e97c18fc 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/MsSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql @@ -9,10 +9,16 @@ ALTER TABLE [edfi].[AccountabilityRating] ADD [CreatedByOwnershipTokenId] SMALLI ALTER TABLE [edfi].[Assessment] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; +ALTER TABLE [edfi].[AssessmentAdministration] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; + +ALTER TABLE [edfi].[AssessmentBatteryPart] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; + ALTER TABLE [edfi].[AssessmentItem] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; ALTER TABLE [edfi].[AssessmentScoreRangeLearningStandard] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; +ALTER TABLE [edfi].[AssesssmentAdministrationParticipation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; + ALTER TABLE [edfi].[BalanceSheetDimension] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; ALTER TABLE [edfi].[BellSchedule] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; @@ -171,6 +177,10 @@ ALTER TABLE [edfi].[StudentAssessment] ADD [CreatedByOwnershipTokenId] SMALLINT ALTER TABLE [edfi].[StudentAssessmentEducationOrganizationAssociation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; +ALTER TABLE [edfi].[StudentAssessmentRegistration] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; + +ALTER TABLE [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; + ALTER TABLE [edfi].[StudentCohortAssociation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; ALTER TABLE [edfi].[StudentCompetencyObjective] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; @@ -181,6 +191,8 @@ ALTER TABLE [edfi].[StudentDisciplineIncidentBehaviorAssociation] ADD [CreatedBy ALTER TABLE [edfi].[StudentDisciplineIncidentNonOffenderAssociation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; +ALTER TABLE [edfi].[StudentEducationOrganizationAssessmentAccommodation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; + ALTER TABLE [edfi].[StudentEducationOrganizationAssociation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; ALTER TABLE [edfi].[StudentEducationOrganizationResponsibilityAssociation] ADD [CreatedByOwnershipTokenId] SMALLINT NULL; diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql new file mode 100644 index 0000000000..296124dceb --- /dev/null +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.sql @@ -0,0 +1,2112 @@ + +-- SPDX-License-Identifier: Apache-2.0 +-- Licensed to the Ed-Fi Alliance under one or more agreements. +-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +-- See the LICENSE and NOTICES files in the project root for more information. + +DO $$ +DECLARE + claim_id INTEGER; + claim_name VARCHAR(2048); + parent_resource_claim_id INTEGER; + existing_parent_resource_claim_id INTEGER; + claim_set_id INTEGER; + claim_set_name VARCHAR(255); + authorization_strategy_id INTEGER; + create_action_id INTEGER; + read_action_id INTEGER; + update_action_id INTEGER; + delete_action_id INTEGER; + readchanges_action_id INTEGER; + resource_claim_action_id INTEGER; + claim_set_resource_claim_action_id INTEGER; + claim_id_stack INTEGER ARRAY; +BEGIN + SELECT actionid INTO create_action_id + FROM dbo.actions WHERE ActionName = 'Create'; + + SELECT actionid INTO read_action_id + FROM dbo.actions WHERE ActionName = 'Read'; + + SELECT actionid INTO update_action_id + FROM dbo.actions WHERE ActionName = 'Update'; + + SELECT actionid INTO delete_action_id + FROM dbo.actions WHERE ActionName = 'Delete'; + + SELECT actionid INTO readchanges_action_id + FROM dbo.actions WHERE ActionName = 'ReadChanges'; + + + -- Push claimId to the stack + claim_id_stack := array_append(claim_id_stack, claim_id); + + -- Processing children of root + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentMetadata', 'http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + -- Setting default authorization metadata + RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = claim_id); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = claim_id; + + + -- Default Create authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Create'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Create_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Read authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Read'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Read_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Update authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Update'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Update_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Delete'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Delete_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Processing claimsets for http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Ed-Fi Sandbox'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Assessment Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Assessment Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'District Hosted SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + -- Push claimId to the stack + claim_id_stack := array_append(claim_id_stack, claim_id); + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/assessmentMetadata + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentAdministration' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/assessmentAdministration'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentAdministration', 'http://ed-fi.org/ods/identity/claims/assessmentAdministration', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentAdminstrationPeriod' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentAdminstrationPeriod'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentAdministrationAssessmentAdminstrationPeriod', 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentAdminstrationPeriod', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentBatteryPart' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentBatteryPart'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentAdministrationAssessmentBatteryPart', 'http://ed-fi.org/ods/identity/claims/assessmentAdministrationAssessmentBatteryPart', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPart' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPart'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentBatteryPart', 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPart', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPartObjectiveAssessment' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPartObjectiveAssessment'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assessmentBatteryPartObjectiveAssessment', 'http://ed-fi.org/ods/identity/claims/assessmentBatteryPartObjectiveAssessment', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipation' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipation'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assesssmentAdministrationParticipation', 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipation', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipationAdministrationPointOfContact' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipationAdministrationPointOfContact'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('assesssmentAdministrationParticipationAdministrationPointOfContact', 'http://ed-fi.org/ods/identity/claims/assesssmentAdministrationParticipationAdministrationPointOfContact', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistration' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistration'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistration', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistration', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentAccommodation'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationAssessmentAccommodation', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentAccommodation', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentCustomization' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentCustomization'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationAssessmentCustomization', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationAssessmentCustomization', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociation' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociation'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationBatteryPartAssociation', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociation', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociationAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociationAccommodation'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentAssessmentRegistrationBatteryPartAssociationAccommodation', 'http://ed-fi.org/ods/identity/claims/studentAssessmentRegistrationBatteryPartAssociationAccommodation', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + + -- Pop the stack + claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('systemDescriptors', 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + -- Setting default authorization metadata + RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = claim_id); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = claim_id; + + + -- Default Create authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Create'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Create_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Read authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Read'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Read_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NoFurtherAuthorizationRequired'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NoFurtherAuthorizationRequired'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NoFurtherAuthorizationRequired'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Update authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Update'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Update_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Delete'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Delete_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NamespaceBased'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NamespaceBased'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''NamespaceBased'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Processing claimsets for http://ed-fi.org/ods/identity/claims/domains/systemDescriptors + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Ed-Fi Sandbox'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Assessment Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Assessment Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Bootstrap Descriptors and EdOrgs' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Bootstrap Descriptors and EdOrgs'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'NoFurtherAuthorizationRequired'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''NoFurtherAuthorizationRequired'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Creating authorization strategy override entry of ''NoFurtherAuthorizationRequired''' || '(authorizationStrategyId = ' || authorization_strategy_id || ' for ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides(ClaimSetResourceClaimActionId, AuthorizationStrategyId) + VALUES (claim_set_resource_claim_action_id, authorization_strategy_id); + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'District Hosted SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + -- Push claimId to the stack + claim_id_stack := array_append(claim_id_stack, claim_id); + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/systemDescriptors + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/Section504DisabilityTypeDescriptor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/Section504DisabilityTypeDescriptor'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('Section504DisabilityTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/Section504DisabilityTypeDescriptor', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + + -- Pop the stack + claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('relationshipBasedData', 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + -- Setting default authorization metadata + RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = claim_id); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = claim_id; + + + -- Default Create authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Create'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Create_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Read authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Read'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Read_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Update authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Update'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Update_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Delete'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Delete_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Processing claimsets for http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Ed-Fi Sandbox'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'District Hosted SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + -- Push claimId to the stack + claim_id_stack := array_append(claim_id_stack, claim_id); + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentSection504ProgramAssociation' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentSection504ProgramAssociation'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentSection504ProgramAssociation', 'http://ed-fi.org/ods/identity/claims/studentSection504ProgramAssociation', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + + -- Pop the stack + claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('relationshipBasedData', 'http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + -- Setting default authorization metadata + RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + DELETE FROM dbo.ResourceClaimActionAuthorizationStrategies + WHERE ResourceClaimActionId IN (SELECT ResourceClaimActionId FROM dbo.ResourceClaimActions WHERE ResourceClaimId = claim_id); + + DELETE FROM dbo.ResourceClaimActions + WHERE ResourceClaimId = claim_id; + + + -- Default Create authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Create'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Create_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Read authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Read'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Read_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Update authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Update'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Update_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Default Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating action ''Delete'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + + INSERT INTO dbo.ResourceClaimActions(ResourceClaimId, ActionId) + VALUES (claim_id, Delete_action_id) + RETURNING ResourceClaimActionId + INTO resource_claim_action_id; + + + authorization_strategy_id := NULL; + + SELECT a.AuthorizationStrategyId INTO authorization_strategy_id + FROM dbo.AuthorizationStrategies a + WHERE a.AuthorizationStrategyName = 'RelationshipsWithEdOrgsAndPeople'; + + IF authorization_strategy_id IS NULL THEN + RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''RelationshipsWithEdOrgsAndPeople'''; + END IF; + + RAISE NOTICE USING MESSAGE = 'Adding authorization strategy ''RelationshipsWithEdOrgsAndPeople'' for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; + INSERT INTO dbo.ResourceClaimActionAuthorizationStrategies(ResourceClaimActionId, AuthorizationStrategyId) + VALUES (resource_claim_action_id, authorization_strategy_id); + + -- Processing claimsets for http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Ed-Fi Sandbox' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Ed-Fi Sandbox'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'District Hosted SIS Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'District Hosted SIS Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Create authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Create_action_id) -- Create + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Update authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Update_action_id) -- Update + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + + -- Claim set-specific Delete authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Delete_action_id) -- Delete + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + ---------------------------------------------------------------------------------------------------------------------------- + -- Claim set: 'Assessment Vendor' + ---------------------------------------------------------------------------------------------------------------------------- + claim_set_name := 'Assessment Vendor'; + claim_set_id := NULL; + + SELECT ClaimSetId INTO claim_set_id + FROM dbo.ClaimSets + WHERE ClaimSetName = claim_set_name; + + IF claim_set_id IS NULL THEN + RAISE NOTICE 'Creating new claim set: %', claim_set_name; + + INSERT INTO dbo.ClaimSets(ClaimSetName) + VALUES (claim_set_name) + RETURNING ClaimSetId + INTO claim_set_id; + END IF; + + + RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; + + DELETE FROM dbo.ClaimSetResourceClaimActionAuthorizationStrategyOverrides + WHERE ClaimSetResourceClaimActionId IN ( + SELECT ClaimSetResourceClaimActionId FROM dbo.ClaimSetResourceClaimActions WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id); + + DELETE FROM dbo.ClaimSetResourceClaimActions + WHERE ClaimSetId = claim_set_id AND ResourceClaimId = claim_id; + + + + -- Claim set-specific Read authorization + RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; + + INSERT INTO dbo.ClaimSetResourceClaimActions(ResourceClaimId, ClaimSetId, ActionId) + VALUES (claim_id, claim_set_id, Read_action_id) -- Read + RETURNING ClaimSetResourceClaimActionId + INTO claim_set_resource_claim_action_id; + + + + -- Push claimId to the stack + claim_id_stack := array_append(claim_id_stack, claim_id); + + -- Processing children of http://ed-fi.org/ods/identity/claims/domains/relationshipBasedData + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodation'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentEducationOrganizationAssessmentAccommodation', 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodation', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + ---------------------------------------------------------------------------------------------------------------------------- + -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodationGeneralAccommodation' + ---------------------------------------------------------------------------------------------------------------------------- + claim_name := 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodationGeneralAccommodation'; + claim_id := NULL; + + SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id + FROM dbo.ResourceClaims + WHERE ClaimName = claim_name; + + parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; + + IF claim_id IS NULL THEN + RAISE NOTICE 'Creating new claim: %', claim_name; + + INSERT INTO dbo.ResourceClaims(ResourceName, ClaimName, ParentResourceClaimId) + VALUES ('studentEducationOrganizationAssessmentAccommodationGeneralAccommodation', 'http://ed-fi.org/ods/identity/claims/studentEducationOrganizationAssessmentAccommodationGeneralAccommodation', parent_resource_claim_id) + RETURNING ResourceClaimId + INTO claim_id; + ELSE + IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN + RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')'; + + UPDATE dbo.ResourceClaims + SET ParentResourceClaimId = parent_resource_claim_id + WHERE ResourceClaimId = claim_id; + END IF; + END IF; + + + -- Pop the stack + claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); + + + -- Pop the stack + claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); + + COMMIT; + + -- TODO: Remove - For interactive development only + -- SELECT dbo.GetAuthorizationMetadataDocument(); + -- ROLLBACK; +END $$; diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml new file mode 100644 index 0000000000..a42736fe8f --- /dev/null +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Data/Security/2200-AssessmentRegistration-security-metadata.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0020-Tables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0020-Tables.sql index 7011836bfd..f115061185 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0020-Tables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0020-Tables.sql @@ -139,6 +139,47 @@ CREATE TABLE edfi.AssessmentAcademicSubject ( ); ALTER TABLE edfi.AssessmentAcademicSubject ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +-- Table edfi.AssessmentAdministration -- +CREATE TABLE edfi.AssessmentAdministration ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + Discriminator VARCHAR(128) NULL, + CreateDate TIMESTAMP NOT NULL, + LastModifiedDate TIMESTAMP NOT NULL, + Id UUID NOT NULL, + CONSTRAINT AssessmentAdministration_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +); +ALTER TABLE edfi.AssessmentAdministration ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +ALTER TABLE edfi.AssessmentAdministration ALTER COLUMN Id SET DEFAULT gen_random_uuid(); +ALTER TABLE edfi.AssessmentAdministration ALTER COLUMN LastModifiedDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.AssessmentAdministrationAssessmentAdminstrationPeriod -- +CREATE TABLE edfi.AssessmentAdministrationAssessmentAdminstrationPeriod ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + BeginDate DATE NOT NULL, + EndDate DATE NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT AssessmentAdministrationAssessmentAdminstrationPeriod_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace, BeginDate) +); +ALTER TABLE edfi.AssessmentAdministrationAssessmentAdminstrationPeriod ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.AssessmentAdministrationAssessmentBatteryPart -- +CREATE TABLE edfi.AssessmentAdministrationAssessmentBatteryPart ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + AssessmentBatteryPartName VARCHAR(65) NOT NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT AssessmentAdministrationAssessmentBatteryPart_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace, AssessmentBatteryPartName) +); +ALTER TABLE edfi.AssessmentAdministrationAssessmentBatteryPart ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + -- Table edfi.AssessmentAssessedGradeLevel -- CREATE TABLE edfi.AssessmentAssessedGradeLevel ( AssessmentIdentifier VARCHAR(60) NOT NULL, @@ -149,6 +190,32 @@ CREATE TABLE edfi.AssessmentAssessedGradeLevel ( ); ALTER TABLE edfi.AssessmentAssessedGradeLevel ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +-- Table edfi.AssessmentBatteryPart -- +CREATE TABLE edfi.AssessmentBatteryPart ( + AssessmentBatteryPartName VARCHAR(65) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + Namespace VARCHAR(255) NOT NULL, + Discriminator VARCHAR(128) NULL, + CreateDate TIMESTAMP NOT NULL, + LastModifiedDate TIMESTAMP NOT NULL, + Id UUID NOT NULL, + CONSTRAINT AssessmentBatteryPart_PK PRIMARY KEY (AssessmentBatteryPartName, AssessmentIdentifier, Namespace) +); +ALTER TABLE edfi.AssessmentBatteryPart ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +ALTER TABLE edfi.AssessmentBatteryPart ALTER COLUMN Id SET DEFAULT gen_random_uuid(); +ALTER TABLE edfi.AssessmentBatteryPart ALTER COLUMN LastModifiedDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.AssessmentBatteryPartObjectiveAssessment -- +CREATE TABLE edfi.AssessmentBatteryPartObjectiveAssessment ( + AssessmentBatteryPartName VARCHAR(65) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + Namespace VARCHAR(255) NOT NULL, + IdentificationCode VARCHAR(60) NOT NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT AssessmentBatteryPartObjectiveAssessment_PK PRIMARY KEY (AssessmentBatteryPartName, AssessmentIdentifier, Namespace, IdentificationCode) +); +ALTER TABLE edfi.AssessmentBatteryPartObjectiveAssessment ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + -- Table edfi.AssessmentCategoryDescriptor -- CREATE TABLE edfi.AssessmentCategoryDescriptor ( AssessmentCategoryDescriptorId INT NOT NULL, @@ -386,6 +453,40 @@ CREATE TABLE edfi.AssessmentSection ( ); ALTER TABLE edfi.AssessmentSection ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +-- Table edfi.AssesssmentAdministrationParticipation -- +CREATE TABLE edfi.AssesssmentAdministrationParticipation ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + ParticipatingEducationOrganizationId BIGINT NOT NULL, + Discriminator VARCHAR(128) NULL, + CreateDate TIMESTAMP NOT NULL, + LastModifiedDate TIMESTAMP NOT NULL, + Id UUID NOT NULL, + CONSTRAINT AssesssmentAdministrationParticipation_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace, ParticipatingEducationOrganizationId) +); +ALTER TABLE edfi.AssesssmentAdministrationParticipation ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +ALTER TABLE edfi.AssesssmentAdministrationParticipation ALTER COLUMN Id SET DEFAULT gen_random_uuid(); +ALTER TABLE edfi.AssesssmentAdministrationParticipation ALTER COLUMN LastModifiedDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc -- +CREATE TABLE edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + ParticipatingEducationOrganizationId BIGINT NOT NULL, + EducationOrganizationId BIGINT NOT NULL, + ElectronicMailAddress VARCHAR(128) NOT NULL, + FirstName VARCHAR(75) NOT NULL, + LastSurname VARCHAR(75) NOT NULL, + LoginId VARCHAR(60) NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT AssesssmentAdministrationParticipationAdministrati_c21adc_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace, ParticipatingEducationOrganizationId, EducationOrganizationId, ElectronicMailAddress) +); +ALTER TABLE edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + -- Table edfi.AssignmentLateStatusDescriptor -- CREATE TABLE edfi.AssignmentLateStatusDescriptor ( AssignmentLateStatusDescriptorId INT NOT NULL, @@ -4149,6 +4250,12 @@ ALTER TABLE edfi.Section ALTER COLUMN CreateDate SET DEFAULT current_timestamp A ALTER TABLE edfi.Section ALTER COLUMN Id SET DEFAULT gen_random_uuid(); ALTER TABLE edfi.Section ALTER COLUMN LastModifiedDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +-- Table edfi.Section504DisabilityTypeDescriptor -- +CREATE TABLE edfi.Section504DisabilityTypeDescriptor ( + Section504DisabilityTypeDescriptorId INT NOT NULL, + CONSTRAINT Section504DisabilityTypeDescriptor_PK PRIMARY KEY (Section504DisabilityTypeDescriptorId) +); + -- Table edfi.SectionAttendanceTakenEvent -- CREATE TABLE edfi.SectionAttendanceTakenEvent ( CalendarCode VARCHAR(60) NOT NULL, @@ -5241,6 +5348,93 @@ CREATE TABLE edfi.StudentAssessmentPeriod ( ); ALTER TABLE edfi.StudentAssessmentPeriod ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +-- Table edfi.StudentAssessmentRegistration -- +CREATE TABLE edfi.StudentAssessmentRegistration ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + EducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + StudentUSI INT NOT NULL, + AssessmentGradeLevelDescriptorId INT NULL, + EntryDate DATE NOT NULL, + PlatformTypeDescriptorId INT NULL, + ReportingEducationOrganizationId BIGINT NULL, + SchoolId BIGINT NOT NULL, + TestingEducationOrganizationId BIGINT NULL, + Discriminator VARCHAR(128) NULL, + CreateDate TIMESTAMP NOT NULL, + LastModifiedDate TIMESTAMP NOT NULL, + Id UUID NOT NULL, + CONSTRAINT StudentAssessmentRegistration_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +); +ALTER TABLE edfi.StudentAssessmentRegistration ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +ALTER TABLE edfi.StudentAssessmentRegistration ALTER COLUMN Id SET DEFAULT gen_random_uuid(); +ALTER TABLE edfi.StudentAssessmentRegistration ALTER COLUMN LastModifiedDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.StudentAssessmentRegistrationAssessmentAccommodation -- +CREATE TABLE edfi.StudentAssessmentRegistrationAssessmentAccommodation ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + EducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + StudentUSI INT NOT NULL, + AccommodationDescriptorId INT NOT NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT StudentAssessmentRegistrationAssessmentAccommodation_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI, AccommodationDescriptorId) +); +ALTER TABLE edfi.StudentAssessmentRegistrationAssessmentAccommodation ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.StudentAssessmentRegistrationAssessmentCustomization -- +CREATE TABLE edfi.StudentAssessmentRegistrationAssessmentCustomization ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + EducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + StudentUSI INT NOT NULL, + CustomizationKey VARCHAR(60) NOT NULL, + CustomizationValue VARCHAR(1024) NOT NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT StudentAssessmentRegistrationAssessmentCustomization_PK PRIMARY KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI, CustomizationKey) +); +ALTER TABLE edfi.StudentAssessmentRegistrationAssessmentCustomization ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.StudentAssessmentRegistrationBatteryPartAssociation -- +CREATE TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentBatteryPartName VARCHAR(65) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + EducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + StudentUSI INT NOT NULL, + Discriminator VARCHAR(128) NULL, + CreateDate TIMESTAMP NOT NULL, + LastModifiedDate TIMESTAMP NOT NULL, + Id UUID NOT NULL, + CONSTRAINT StudentAssessmentRegistrationBatteryPartAssociation_PK PRIMARY KEY (AdministrationIdentifier, AssessmentBatteryPartName, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +); +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ALTER COLUMN Id SET DEFAULT gen_random_uuid(); +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ALTER COLUMN LastModifiedDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694 -- +CREATE TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694 ( + AdministrationIdentifier VARCHAR(255) NOT NULL, + AssessmentBatteryPartName VARCHAR(65) NOT NULL, + AssessmentIdentifier VARCHAR(60) NOT NULL, + AssigningEducationOrganizationId BIGINT NOT NULL, + EducationOrganizationId BIGINT NOT NULL, + Namespace VARCHAR(255) NOT NULL, + StudentUSI INT NOT NULL, + AccommodationDescriptorId INT NOT NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT StudentAssessmentRegistrationBatteryPartAssociatio_c87694_PK PRIMARY KEY (AdministrationIdentifier, AssessmentBatteryPartName, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI, AccommodationDescriptorId) +); +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694 ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + -- Table edfi.StudentAssessmentScoreResult -- CREATE TABLE edfi.StudentAssessmentScoreResult ( AssessmentIdentifier VARCHAR(60) NOT NULL, @@ -5510,6 +5704,30 @@ CREATE TABLE edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplin_4c979 ); ALTER TABLE edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplin_4c979a ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +-- Table edfi.StudentEducationOrganizationAssessmentAccommodation -- +CREATE TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ( + EducationOrganizationId BIGINT NOT NULL, + StudentUSI INT NOT NULL, + Discriminator VARCHAR(128) NULL, + CreateDate TIMESTAMP NOT NULL, + LastModifiedDate TIMESTAMP NOT NULL, + Id UUID NOT NULL, + CONSTRAINT StudentEducationOrganizationAssessmentAccommodation_PK PRIMARY KEY (EducationOrganizationId, StudentUSI) +); +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ALTER COLUMN Id SET DEFAULT gen_random_uuid(); +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ALTER COLUMN LastModifiedDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + +-- Table edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a -- +CREATE TABLE edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a ( + EducationOrganizationId BIGINT NOT NULL, + StudentUSI INT NOT NULL, + AccommodationDescriptorId INT NOT NULL, + CreateDate TIMESTAMP NOT NULL, + CONSTRAINT StudentEducationOrganizationAssessmentAccommodatio_d1d10a_PK PRIMARY KEY (EducationOrganizationId, StudentUSI, AccommodationDescriptorId) +); +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; + -- Table edfi.StudentEducationOrganizationAssociation -- CREATE TABLE edfi.StudentEducationOrganizationAssociation ( EducationOrganizationId BIGINT NOT NULL, @@ -6382,6 +6600,22 @@ CREATE TABLE edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServ_85a0e ); ALTER TABLE edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServ_85a0eb ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; +-- Table edfi.StudentSection504ProgramAssociation -- +CREATE TABLE edfi.StudentSection504ProgramAssociation ( + BeginDate DATE NOT NULL, + EducationOrganizationId BIGINT NOT NULL, + ProgramEducationOrganizationId BIGINT NOT NULL, + ProgramName VARCHAR(60) NOT NULL, + ProgramTypeDescriptorId INT NOT NULL, + StudentUSI INT NOT NULL, + AccommodationPlan BOOLEAN NULL, + Section504DisabilityTypeDescriptorId INT NULL, + Section504Eligibility BOOLEAN NOT NULL, + Section504EligibilityDecisionDate DATE NULL, + Section504MeetingDate DATE NULL, + CONSTRAINT StudentSection504ProgramAssociation_PK PRIMARY KEY (BeginDate, EducationOrganizationId, ProgramEducationOrganizationId, ProgramName, ProgramTypeDescriptorId, StudentUSI) +); + -- Table edfi.StudentSectionAssociation -- CREATE TABLE edfi.StudentSectionAssociation ( BeginDate DATE NOT NULL, @@ -6573,6 +6807,7 @@ ALTER TABLE edfi.StudentSpecialEducationProgramAssociationSpecialEducatio_bcba5c CREATE TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation ( ConsentToEvaluationReceivedDate DATE NOT NULL, EducationOrganizationId BIGINT NOT NULL, + ProgramEducationOrganizationId BIGINT NOT NULL, ProgramName VARCHAR(60) NOT NULL, ProgramTypeDescriptorId INT NOT NULL, StudentUSI INT NOT NULL, @@ -6595,7 +6830,7 @@ CREATE TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation ( CreateDate TIMESTAMP NOT NULL, LastModifiedDate TIMESTAMP NOT NULL, Id UUID NOT NULL, - CONSTRAINT StudentSpecialEducationProgramEligibilityAssociation_PK PRIMARY KEY (ConsentToEvaluationReceivedDate, EducationOrganizationId, ProgramName, ProgramTypeDescriptorId, StudentUSI) + CONSTRAINT StudentSpecialEducationProgramEligibilityAssociation_PK PRIMARY KEY (ConsentToEvaluationReceivedDate, EducationOrganizationId, ProgramEducationOrganizationId, ProgramName, ProgramTypeDescriptorId, StudentUSI) ); ALTER TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation ALTER COLUMN CreateDate SET DEFAULT current_timestamp AT TIME ZONE 'UTC'; ALTER TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation ALTER COLUMN Id SET DEFAULT gen_random_uuid(); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0030-ForeignKeys.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0030-ForeignKeys.sql index 3021bab4c7..1645ba785a 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0030-ForeignKeys.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0030-ForeignKeys.sql @@ -96,6 +96,37 @@ REFERENCES edfi.Assessment (AssessmentIdentifier, Namespace) ON DELETE CASCADE ; +ALTER TABLE edfi.AssessmentAdministration ADD CONSTRAINT FK_c64558_Assessment FOREIGN KEY (AssessmentIdentifier, Namespace) +REFERENCES edfi.Assessment (AssessmentIdentifier, Namespace) +; + +CREATE INDEX FK_c64558_Assessment +ON edfi.AssessmentAdministration (AssessmentIdentifier ASC, Namespace ASC); + +ALTER TABLE edfi.AssessmentAdministration ADD CONSTRAINT FK_c64558_EducationOrganization FOREIGN KEY (AssigningEducationOrganizationId) +REFERENCES edfi.EducationOrganization (EducationOrganizationId) +; + +CREATE INDEX FK_c64558_EducationOrganization +ON edfi.AssessmentAdministration (AssigningEducationOrganizationId ASC); + +ALTER TABLE edfi.AssessmentAdministrationAssessmentAdminstrationPeriod ADD CONSTRAINT FK_77cf17_AssessmentAdministration FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +REFERENCES edfi.AssessmentAdministration (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +ON DELETE CASCADE +; + +ALTER TABLE edfi.AssessmentAdministrationAssessmentBatteryPart ADD CONSTRAINT FK_1d6852_AssessmentAdministration FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +REFERENCES edfi.AssessmentAdministration (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +ON DELETE CASCADE +; + +ALTER TABLE edfi.AssessmentAdministrationAssessmentBatteryPart ADD CONSTRAINT FK_1d6852_AssessmentBatteryPart FOREIGN KEY (AssessmentBatteryPartName, AssessmentIdentifier, Namespace) +REFERENCES edfi.AssessmentBatteryPart (AssessmentBatteryPartName, AssessmentIdentifier, Namespace) +; + +CREATE INDEX FK_1d6852_AssessmentBatteryPart +ON edfi.AssessmentAdministrationAssessmentBatteryPart (AssessmentBatteryPartName ASC, AssessmentIdentifier ASC, Namespace ASC); + ALTER TABLE edfi.AssessmentAssessedGradeLevel ADD CONSTRAINT FK_e83625_Assessment FOREIGN KEY (AssessmentIdentifier, Namespace) REFERENCES edfi.Assessment (AssessmentIdentifier, Namespace) ON DELETE CASCADE @@ -108,6 +139,25 @@ REFERENCES edfi.GradeLevelDescriptor (GradeLevelDescriptorId) CREATE INDEX FK_e83625_GradeLevelDescriptor ON edfi.AssessmentAssessedGradeLevel (GradeLevelDescriptorId ASC); +ALTER TABLE edfi.AssessmentBatteryPart ADD CONSTRAINT FK_6e22f2_Assessment FOREIGN KEY (AssessmentIdentifier, Namespace) +REFERENCES edfi.Assessment (AssessmentIdentifier, Namespace) +; + +CREATE INDEX FK_6e22f2_Assessment +ON edfi.AssessmentBatteryPart (AssessmentIdentifier ASC, Namespace ASC); + +ALTER TABLE edfi.AssessmentBatteryPartObjectiveAssessment ADD CONSTRAINT FK_8ab121_AssessmentBatteryPart FOREIGN KEY (AssessmentBatteryPartName, AssessmentIdentifier, Namespace) +REFERENCES edfi.AssessmentBatteryPart (AssessmentBatteryPartName, AssessmentIdentifier, Namespace) +ON DELETE CASCADE +; + +ALTER TABLE edfi.AssessmentBatteryPartObjectiveAssessment ADD CONSTRAINT FK_8ab121_ObjectiveAssessment FOREIGN KEY (AssessmentIdentifier, IdentificationCode, Namespace) +REFERENCES edfi.ObjectiveAssessment (AssessmentIdentifier, IdentificationCode, Namespace) +; + +CREATE INDEX FK_8ab121_ObjectiveAssessment +ON edfi.AssessmentBatteryPartObjectiveAssessment (AssessmentIdentifier ASC, IdentificationCode ASC, Namespace ASC); + ALTER TABLE edfi.AssessmentCategoryDescriptor ADD CONSTRAINT FK_20e875_Descriptor FOREIGN KEY (AssessmentCategoryDescriptorId) REFERENCES edfi.Descriptor (DescriptorId) ON DELETE CASCADE @@ -344,6 +394,32 @@ ON UPDATE CASCADE CREATE INDEX FK_22ceba_Section ON edfi.AssessmentSection (LocalCourseCode ASC, SchoolId ASC, SchoolYear ASC, SectionIdentifier ASC, SessionName ASC); +ALTER TABLE edfi.AssesssmentAdministrationParticipation ADD CONSTRAINT FK_0b52ab_AssessmentAdministration FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +REFERENCES edfi.AssessmentAdministration (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +; + +CREATE INDEX FK_0b52ab_AssessmentAdministration +ON edfi.AssesssmentAdministrationParticipation (AdministrationIdentifier ASC, AssessmentIdentifier ASC, AssigningEducationOrganizationId ASC, Namespace ASC); + +ALTER TABLE edfi.AssesssmentAdministrationParticipation ADD CONSTRAINT FK_0b52ab_EducationOrganization FOREIGN KEY (ParticipatingEducationOrganizationId) +REFERENCES edfi.EducationOrganization (EducationOrganizationId) +; + +CREATE INDEX FK_0b52ab_EducationOrganization +ON edfi.AssesssmentAdministrationParticipation (ParticipatingEducationOrganizationId ASC); + +ALTER TABLE edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc ADD CONSTRAINT FK_c21adc_AssesssmentAdministrationParticipation FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace, ParticipatingEducationOrganizationId) +REFERENCES edfi.AssesssmentAdministrationParticipation (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace, ParticipatingEducationOrganizationId) +ON DELETE CASCADE +; + +ALTER TABLE edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc ADD CONSTRAINT FK_c21adc_EducationOrganization FOREIGN KEY (EducationOrganizationId) +REFERENCES edfi.EducationOrganization (EducationOrganizationId) +; + +CREATE INDEX FK_c21adc_EducationOrganization +ON edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc (EducationOrganizationId ASC); + ALTER TABLE edfi.AssignmentLateStatusDescriptor ADD CONSTRAINT FK_518b3c_Descriptor FOREIGN KEY (AssignmentLateStatusDescriptorId) REFERENCES edfi.Descriptor (DescriptorId) ON DELETE CASCADE @@ -3970,6 +4046,11 @@ REFERENCES edfi.SectionTypeDescriptor (SectionTypeDescriptorId) CREATE INDEX FK_dfca5d_SectionTypeDescriptor ON edfi.Section (SectionTypeDescriptorId ASC); +ALTER TABLE edfi.Section504DisabilityTypeDescriptor ADD CONSTRAINT FK_e7f766_Descriptor FOREIGN KEY (Section504DisabilityTypeDescriptorId) +REFERENCES edfi.Descriptor (DescriptorId) +ON DELETE CASCADE +; + ALTER TABLE edfi.SectionAttendanceTakenEvent ADD CONSTRAINT FK_7bbbe7_CalendarDate FOREIGN KEY (CalendarCode, Date, SchoolId, SchoolYear) REFERENCES edfi.CalendarDate (CalendarCode, Date, SchoolId, SchoolYear) ; @@ -5131,6 +5212,106 @@ REFERENCES edfi.StudentAssessment (AssessmentIdentifier, Namespace, StudentAsses ON DELETE CASCADE ; +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_AssessmentAdministration FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +REFERENCES edfi.AssessmentAdministration (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, Namespace) +; + +CREATE INDEX FK_79fd6b_AssessmentAdministration +ON edfi.StudentAssessmentRegistration (AdministrationIdentifier ASC, AssessmentIdentifier ASC, AssigningEducationOrganizationId ASC, Namespace ASC); + +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_EducationOrganization FOREIGN KEY (ReportingEducationOrganizationId) +REFERENCES edfi.EducationOrganization (EducationOrganizationId) +; + +CREATE INDEX FK_79fd6b_EducationOrganization +ON edfi.StudentAssessmentRegistration (ReportingEducationOrganizationId ASC); + +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_EducationOrganization1 FOREIGN KEY (TestingEducationOrganizationId) +REFERENCES edfi.EducationOrganization (EducationOrganizationId) +; + +CREATE INDEX FK_79fd6b_EducationOrganization1 +ON edfi.StudentAssessmentRegistration (TestingEducationOrganizationId ASC); + +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_GradeLevelDescriptor FOREIGN KEY (AssessmentGradeLevelDescriptorId) +REFERENCES edfi.GradeLevelDescriptor (GradeLevelDescriptorId) +; + +CREATE INDEX FK_79fd6b_GradeLevelDescriptor +ON edfi.StudentAssessmentRegistration (AssessmentGradeLevelDescriptorId ASC); + +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_PlatformTypeDescriptor FOREIGN KEY (PlatformTypeDescriptorId) +REFERENCES edfi.PlatformTypeDescriptor (PlatformTypeDescriptorId) +; + +CREATE INDEX FK_79fd6b_PlatformTypeDescriptor +ON edfi.StudentAssessmentRegistration (PlatformTypeDescriptorId ASC); + +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_StudentEducationOrganizationAssessmentAccommodation FOREIGN KEY (EducationOrganizationId, StudentUSI) +REFERENCES edfi.StudentEducationOrganizationAssessmentAccommodation (EducationOrganizationId, StudentUSI) +; + +CREATE INDEX FK_79fd6b_StudentEducationOrganizationAssessmentAccommodation +ON edfi.StudentAssessmentRegistration (EducationOrganizationId ASC, StudentUSI ASC); + +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_StudentEducationOrganizationAssociation FOREIGN KEY (EducationOrganizationId, StudentUSI) +REFERENCES edfi.StudentEducationOrganizationAssociation (EducationOrganizationId, StudentUSI) +; + +CREATE INDEX FK_79fd6b_StudentEducationOrganizationAssociation +ON edfi.StudentAssessmentRegistration (EducationOrganizationId ASC, StudentUSI ASC); + +ALTER TABLE edfi.StudentAssessmentRegistration ADD CONSTRAINT FK_79fd6b_StudentSchoolAssociation FOREIGN KEY (EntryDate, SchoolId, StudentUSI) +REFERENCES edfi.StudentSchoolAssociation (EntryDate, SchoolId, StudentUSI) +ON UPDATE CASCADE +; + +CREATE INDEX FK_79fd6b_StudentSchoolAssociation +ON edfi.StudentAssessmentRegistration (EntryDate ASC, SchoolId ASC, StudentUSI ASC); + +ALTER TABLE edfi.StudentAssessmentRegistrationAssessmentAccommodation ADD CONSTRAINT FK_8f1b98_AccommodationDescriptor FOREIGN KEY (AccommodationDescriptorId) +REFERENCES edfi.AccommodationDescriptor (AccommodationDescriptorId) +; + +CREATE INDEX FK_8f1b98_AccommodationDescriptor +ON edfi.StudentAssessmentRegistrationAssessmentAccommodation (AccommodationDescriptorId ASC); + +ALTER TABLE edfi.StudentAssessmentRegistrationAssessmentAccommodation ADD CONSTRAINT FK_8f1b98_StudentAssessmentRegistration FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +REFERENCES edfi.StudentAssessmentRegistration (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +ON DELETE CASCADE +; + +ALTER TABLE edfi.StudentAssessmentRegistrationAssessmentCustomization ADD CONSTRAINT FK_869535_StudentAssessmentRegistration FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +REFERENCES edfi.StudentAssessmentRegistration (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +ON DELETE CASCADE +; + +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ADD CONSTRAINT FK_3bb369_AssessmentBatteryPart FOREIGN KEY (AssessmentBatteryPartName, AssessmentIdentifier, Namespace) +REFERENCES edfi.AssessmentBatteryPart (AssessmentBatteryPartName, AssessmentIdentifier, Namespace) +; + +CREATE INDEX FK_3bb369_AssessmentBatteryPart +ON edfi.StudentAssessmentRegistrationBatteryPartAssociation (AssessmentBatteryPartName ASC, AssessmentIdentifier ASC, Namespace ASC); + +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ADD CONSTRAINT FK_3bb369_StudentAssessmentRegistration FOREIGN KEY (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +REFERENCES edfi.StudentAssessmentRegistration (AdministrationIdentifier, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +; + +CREATE INDEX FK_3bb369_StudentAssessmentRegistration +ON edfi.StudentAssessmentRegistrationBatteryPartAssociation (AdministrationIdentifier ASC, AssessmentIdentifier ASC, AssigningEducationOrganizationId ASC, EducationOrganizationId ASC, Namespace ASC, StudentUSI ASC); + +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694 ADD CONSTRAINT FK_c87694_AccommodationDescriptor FOREIGN KEY (AccommodationDescriptorId) +REFERENCES edfi.AccommodationDescriptor (AccommodationDescriptorId) +; + +CREATE INDEX FK_c87694_AccommodationDescriptor +ON edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694 (AccommodationDescriptorId ASC); + +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694 ADD CONSTRAINT FK_c87694_StudentAssessmentRegistrationBatteryPartAssociation FOREIGN KEY (AdministrationIdentifier, AssessmentBatteryPartName, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +REFERENCES edfi.StudentAssessmentRegistrationBatteryPartAssociation (AdministrationIdentifier, AssessmentBatteryPartName, AssessmentIdentifier, AssigningEducationOrganizationId, EducationOrganizationId, Namespace, StudentUSI) +ON DELETE CASCADE +; + ALTER TABLE edfi.StudentAssessmentScoreResult ADD CONSTRAINT FK_0fceba_AssessmentReportingMethodDescriptor FOREIGN KEY (AssessmentReportingMethodDescriptorId) REFERENCES edfi.AssessmentReportingMethodDescriptor (AssessmentReportingMethodDescriptorId) ; @@ -5389,6 +5570,29 @@ REFERENCES edfi.StudentDisciplineIncidentNonOffenderAssociation (IncidentIdentif ON DELETE CASCADE ; +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ADD CONSTRAINT FK_5f4481_EducationOrganization FOREIGN KEY (EducationOrganizationId) +REFERENCES edfi.EducationOrganization (EducationOrganizationId) +; + +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ADD CONSTRAINT FK_5f4481_Student FOREIGN KEY (StudentUSI) +REFERENCES edfi.Student (StudentUSI) +; + +CREATE INDEX FK_5f4481_Student +ON edfi.StudentEducationOrganizationAssessmentAccommodation (StudentUSI ASC); + +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a ADD CONSTRAINT FK_d1d10a_AccommodationDescriptor FOREIGN KEY (AccommodationDescriptorId) +REFERENCES edfi.AccommodationDescriptor (AccommodationDescriptorId) +; + +CREATE INDEX FK_d1d10a_AccommodationDescriptor +ON edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a (AccommodationDescriptorId ASC); + +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a ADD CONSTRAINT FK_d1d10a_StudentEducationOrganizationAssessmentAccommodation FOREIGN KEY (EducationOrganizationId, StudentUSI) +REFERENCES edfi.StudentEducationOrganizationAssessmentAccommodation (EducationOrganizationId, StudentUSI) +ON DELETE CASCADE +; + ALTER TABLE edfi.StudentEducationOrganizationAssociation ADD CONSTRAINT FK_8e1257_BarrierToInternetAccessInResidenceDescriptor FOREIGN KEY (BarrierToInternetAccessInResidenceDescriptorId) REFERENCES edfi.BarrierToInternetAccessInResidenceDescriptor (BarrierToInternetAccessInResidenceDescriptorId) ; @@ -6407,6 +6611,18 @@ REFERENCES edfi.StudentSchoolFoodServiceProgramAssociation (BeginDate, Education ON DELETE CASCADE ; +ALTER TABLE edfi.StudentSection504ProgramAssociation ADD CONSTRAINT FK_6e41ee_GeneralStudentProgramAssociation FOREIGN KEY (BeginDate, EducationOrganizationId, ProgramEducationOrganizationId, ProgramName, ProgramTypeDescriptorId, StudentUSI) +REFERENCES edfi.GeneralStudentProgramAssociation (BeginDate, EducationOrganizationId, ProgramEducationOrganizationId, ProgramName, ProgramTypeDescriptorId, StudentUSI) +ON DELETE CASCADE +; + +ALTER TABLE edfi.StudentSection504ProgramAssociation ADD CONSTRAINT FK_6e41ee_Section504DisabilityTypeDescriptor FOREIGN KEY (Section504DisabilityTypeDescriptorId) +REFERENCES edfi.Section504DisabilityTypeDescriptor (Section504DisabilityTypeDescriptorId) +; + +CREATE INDEX FK_6e41ee_Section504DisabilityTypeDescriptor +ON edfi.StudentSection504ProgramAssociation (Section504DisabilityTypeDescriptorId ASC); + ALTER TABLE edfi.StudentSectionAssociation ADD CONSTRAINT FK_39aa3c_AttemptStatusDescriptor FOREIGN KEY (AttemptStatusDescriptorId) REFERENCES edfi.AttemptStatusDescriptor (AttemptStatusDescriptorId) ; @@ -6610,12 +6826,12 @@ REFERENCES edfi.IDEAPartDescriptor (IDEAPartDescriptorId) CREATE INDEX FK_fcb699_IDEAPartDescriptor ON edfi.StudentSpecialEducationProgramEligibilityAssociation (IDEAPartDescriptorId ASC); -ALTER TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation ADD CONSTRAINT FK_fcb699_Program FOREIGN KEY (EducationOrganizationId, ProgramName, ProgramTypeDescriptorId) +ALTER TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation ADD CONSTRAINT FK_fcb699_Program FOREIGN KEY (ProgramEducationOrganizationId, ProgramName, ProgramTypeDescriptorId) REFERENCES edfi.Program (EducationOrganizationId, ProgramName, ProgramTypeDescriptorId) ; CREATE INDEX FK_fcb699_Program -ON edfi.StudentSpecialEducationProgramEligibilityAssociation (EducationOrganizationId ASC, ProgramName ASC, ProgramTypeDescriptorId ASC); +ON edfi.StudentSpecialEducationProgramEligibilityAssociation (ProgramEducationOrganizationId ASC, ProgramName ASC, ProgramTypeDescriptorId ASC); ALTER TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation ADD CONSTRAINT FK_fcb699_Student FOREIGN KEY (StudentUSI) REFERENCES edfi.Student (StudentUSI) diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql index dabaccb56f..14b679170e 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0040-IdColumnUniqueIndexes.sql @@ -9,10 +9,16 @@ CREATE UNIQUE INDEX IF NOT EXISTS UX_2d3c0c_Id ON edfi.AccountabilityRating(Id); CREATE UNIQUE INDEX IF NOT EXISTS UX_7808ee_Id ON edfi.Assessment(Id); +CREATE UNIQUE INDEX IF NOT EXISTS UX_c64558_Id ON edfi.AssessmentAdministration(Id); + +CREATE UNIQUE INDEX IF NOT EXISTS UX_6e22f2_Id ON edfi.AssessmentBatteryPart(Id); + CREATE UNIQUE INDEX IF NOT EXISTS UX_dc3dcf_Id ON edfi.AssessmentItem(Id); CREATE UNIQUE INDEX IF NOT EXISTS UX_a20588_Id ON edfi.AssessmentScoreRangeLearningStandard(Id); +CREATE UNIQUE INDEX IF NOT EXISTS UX_0b52ab_Id ON edfi.AssesssmentAdministrationParticipation(Id); + CREATE UNIQUE INDEX IF NOT EXISTS UX_e52c9c_Id ON edfi.BalanceSheetDimension(Id); CREATE UNIQUE INDEX IF NOT EXISTS UX_9bbaf5_Id ON edfi.BellSchedule(Id); @@ -171,6 +177,10 @@ CREATE UNIQUE INDEX IF NOT EXISTS UX_ee3b2a_Id ON edfi.StudentAssessment(Id); CREATE UNIQUE INDEX IF NOT EXISTS UX_afb8b8_Id ON edfi.StudentAssessmentEducationOrganizationAssociation(Id); +CREATE UNIQUE INDEX IF NOT EXISTS UX_79fd6b_Id ON edfi.StudentAssessmentRegistration(Id); + +CREATE UNIQUE INDEX IF NOT EXISTS UX_3bb369_Id ON edfi.StudentAssessmentRegistrationBatteryPartAssociation(Id); + CREATE UNIQUE INDEX IF NOT EXISTS UX_369ddc_Id ON edfi.StudentCohortAssociation(Id); CREATE UNIQUE INDEX IF NOT EXISTS UX_395c07_Id ON edfi.StudentCompetencyObjective(Id); @@ -181,6 +191,8 @@ CREATE UNIQUE INDEX IF NOT EXISTS UX_f4934f_Id ON edfi.StudentDisciplineIncident CREATE UNIQUE INDEX IF NOT EXISTS UX_4b43da_Id ON edfi.StudentDisciplineIncidentNonOffenderAssociation(Id); +CREATE UNIQUE INDEX IF NOT EXISTS UX_5f4481_Id ON edfi.StudentEducationOrganizationAssessmentAccommodation(Id); + CREATE UNIQUE INDEX IF NOT EXISTS UX_8e1257_Id ON edfi.StudentEducationOrganizationAssociation(Id); CREATE UNIQUE INDEX IF NOT EXISTS UX_42aa64_Id ON edfi.StudentEducationOrganizationResponsibilityAssociation(Id); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0050-ExtendedProperties.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0050-ExtendedProperties.sql index e6904b43ea..8a8c9a70f7 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0050-ExtendedProperties.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/0050-ExtendedProperties.sql @@ -86,12 +86,49 @@ COMMENT ON COLUMN edfi.AssessmentAcademicSubject.AssessmentIdentifier IS 'A uniq COMMENT ON COLUMN edfi.AssessmentAcademicSubject.Namespace IS 'Namespace for the assessment.'; COMMENT ON COLUMN edfi.AssessmentAcademicSubject.AcademicSubjectDescriptorId IS 'The description of the content or subject area (e.g., arts, mathematics, reading, stenography, or a foreign language) of an assessment.'; +-- Extended Properties [edfi].[AssessmentAdministration] -- +COMMENT ON TABLE edfi.AssessmentAdministration IS 'The anticipated administration of an assessment under the purview of an education organization.'; +COMMENT ON COLUMN edfi.AssessmentAdministration.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.AssessmentAdministration.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.AssessmentAdministration.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.AssessmentAdministration.Namespace IS 'Namespace for the assessment.'; + +-- Extended Properties [edfi].[AssessmentAdministrationAssessmentAdminstrationPeriod] -- +COMMENT ON TABLE edfi.AssessmentAdministrationAssessmentAdminstrationPeriod IS 'The anticipated dates for the assessment or administration window.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentAdminstrationPeriod.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentAdminstrationPeriod.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentAdminstrationPeriod.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentAdminstrationPeriod.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentAdminstrationPeriod.BeginDate IS 'The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentAdminstrationPeriod.EndDate IS 'The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; + +-- Extended Properties [edfi].[AssessmentAdministrationAssessmentBatteryPart] -- +COMMENT ON TABLE edfi.AssessmentAdministrationAssessmentBatteryPart IS 'A reference to the parts of the assessment battery that are offered in this administration of the assessment.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentBatteryPart.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentBatteryPart.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentBatteryPart.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentBatteryPart.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.AssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartName IS 'The name of the part of an assessment battery.'; + -- Extended Properties [edfi].[AssessmentAssessedGradeLevel] -- COMMENT ON TABLE edfi.AssessmentAssessedGradeLevel IS 'The grade level(s) for which an assessment is designed. The semantics of null is assumed to mean that the assessment is not associated with any grade level.'; COMMENT ON COLUMN edfi.AssessmentAssessedGradeLevel.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; COMMENT ON COLUMN edfi.AssessmentAssessedGradeLevel.Namespace IS 'Namespace for the assessment.'; COMMENT ON COLUMN edfi.AssessmentAssessedGradeLevel.GradeLevelDescriptorId IS 'The grade level(s) for which an assessment is designed. The semantics of null is assumed to mean that the assessment is not associated with any grade level.'; +-- Extended Properties [edfi].[AssessmentBatteryPart] -- +COMMENT ON TABLE edfi.AssessmentBatteryPart IS 'The parts organized for administering an assessessment which together provide a comprehensive assessment of the students.'; +COMMENT ON COLUMN edfi.AssessmentBatteryPart.AssessmentBatteryPartName IS 'The name of the part of an assessment battery.'; +COMMENT ON COLUMN edfi.AssessmentBatteryPart.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.AssessmentBatteryPart.Namespace IS 'Namespace for the assessment.'; + +-- Extended Properties [edfi].[AssessmentBatteryPartObjectiveAssessment] -- +COMMENT ON TABLE edfi.AssessmentBatteryPartObjectiveAssessment IS 'A reference to the objective assessment(s) that are administered by the assessment battery part.'; +COMMENT ON COLUMN edfi.AssessmentBatteryPartObjectiveAssessment.AssessmentBatteryPartName IS 'The name of the part of an assessment battery.'; +COMMENT ON COLUMN edfi.AssessmentBatteryPartObjectiveAssessment.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.AssessmentBatteryPartObjectiveAssessment.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.AssessmentBatteryPartObjectiveAssessment.IdentificationCode IS 'A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity.'; + -- Extended Properties [edfi].[AssessmentCategoryDescriptor] -- COMMENT ON TABLE edfi.AssessmentCategoryDescriptor IS 'This descriptor holds the category of an assessment based on format and content.'; COMMENT ON COLUMN edfi.AssessmentCategoryDescriptor.AssessmentCategoryDescriptorId IS 'A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.'; @@ -251,6 +288,27 @@ COMMENT ON COLUMN edfi.AssessmentSection.SchoolYear IS 'The identifier for the s COMMENT ON COLUMN edfi.AssessmentSection.SectionIdentifier IS 'The local identifier assigned to a section.'; COMMENT ON COLUMN edfi.AssessmentSection.SessionName IS 'The identifier for the calendar for the academic session.'; +-- Extended Properties [edfi].[AssesssmentAdministrationParticipation] -- +COMMENT ON TABLE edfi.AssesssmentAdministrationParticipation IS 'Identifies the point of contact for the administration of an assessment under the purview of an education organization.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipation.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipation.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipation.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipation.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipation.ParticipatingEducationOrganizationId IS 'The identifier assigned to an education organization.'; + +-- Extended Properties [edfi].[AssesssmentAdministrationParticipationAdministrationPoin_c21adc] -- +COMMENT ON TABLE edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc IS 'Pre-identified contacts for education organizations administering the assessment.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.ParticipatingEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.ElectronicMailAddress IS 'The email address for the contact.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.FirstName IS 'The contact''s first name.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.LastSurname IS 'The contact''s last name.'; +COMMENT ON COLUMN edfi.AssesssmentAdministrationParticipationAdministrationPoin_c21adc.LoginId IS 'The login ID for the user; used for security access control interface.'; + -- Extended Properties [edfi].[AssignmentLateStatusDescriptor] -- COMMENT ON TABLE edfi.AssignmentLateStatusDescriptor IS 'Status of whether the assignment was submitted after the due date and/or marked as late.'; COMMENT ON COLUMN edfi.AssignmentLateStatusDescriptor.AssignmentLateStatusDescriptorId IS 'A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.'; @@ -2622,6 +2680,10 @@ COMMENT ON COLUMN edfi.Section.SectionName IS 'A locally-defined name for the se COMMENT ON COLUMN edfi.Section.SectionTypeDescriptorId IS 'Specifies whether the section is for attendance only, credit only, or both.'; COMMENT ON COLUMN edfi.Section.SequenceOfCourse IS 'When a section is part of a sequence of parts for a course, the number of the sequence. If the course has only one part, the value of this section attribute should be 1.'; +-- Extended Properties [edfi].[Section504DisabilityTypeDescriptor] -- +COMMENT ON TABLE edfi.Section504DisabilityTypeDescriptor IS 'This descriptor defines the reason(s) why student qualifies for Section 504 consideration.'; +COMMENT ON COLUMN edfi.Section504DisabilityTypeDescriptor.Section504DisabilityTypeDescriptorId IS 'A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table.'; + -- Extended Properties [edfi].[SectionAttendanceTakenEvent] -- COMMENT ON TABLE edfi.SectionAttendanceTakenEvent IS 'Captures attendance taken event for given section.'; COMMENT ON COLUMN edfi.SectionAttendanceTakenEvent.CalendarCode IS 'The identifier for the calendar.'; @@ -3348,6 +3410,63 @@ COMMENT ON COLUMN edfi.StudentAssessmentPeriod.AssessmentPeriodDescriptorId IS ' COMMENT ON COLUMN edfi.StudentAssessmentPeriod.BeginDate IS 'The first date the assessment is to be administered. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; COMMENT ON COLUMN edfi.StudentAssessmentPeriod.EndDate IS 'The last date the assessment is to be administered. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; +-- Extended Properties [edfi].[StudentAssessmentRegistration] -- +COMMENT ON TABLE edfi.StudentAssessmentRegistration IS 'Identifies an assessment registration that a student is expected to participate in including the testing organization, reporting organization and assessment delivery details.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.AssessmentGradeLevelDescriptorId IS 'The grade level or primary instructional level at which the student is to be assessed.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.EntryDate IS 'The month, day, and year on which an individual enters and begins to receive instructional services in a school for each school year. The EntryDate value should be the date the student enrolled, or when the student''s enrollment materially changed, such as with a grade promotion. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.PlatformTypeDescriptorId IS 'The environment or format in which the assessment is expected to be administered.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.ReportingEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.SchoolId IS 'The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistration.TestingEducationOrganizationId IS 'The identifier assigned to an education organization.'; + +-- Extended Properties [edfi].[StudentAssessmentRegistrationAssessmentAccommodation] -- +COMMENT ON TABLE edfi.StudentAssessmentRegistrationAssessmentAccommodation IS 'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentAccommodation.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentAccommodation.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentAccommodation.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentAccommodation.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentAccommodation.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentAccommodation.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentAccommodation.AccommodationDescriptorId IS 'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.'; + +-- Extended Properties [edfi].[StudentAssessmentRegistrationAssessmentCustomization] -- +COMMENT ON TABLE edfi.StudentAssessmentRegistrationAssessmentCustomization IS 'Key/value pairs which may be used to facilitate customization of an assessment or to support vendor reporting/analysis.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.CustomizationKey IS 'An agreed upon identifier for the custom information.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationAssessmentCustomization.CustomizationValue IS 'Custom value for the indicated CustomizationKey.'; + +-- Extended Properties [edfi].[StudentAssessmentRegistrationBatteryPartAssociation] -- +COMMENT ON TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation IS 'The association to the part(s) of the assessment battery that the student is to be tested for this administration of the assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociation.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociation.AssessmentBatteryPartName IS 'The name of the part of an assessment battery.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociation.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociation.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociation.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociation.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociation.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; + +-- Extended Properties [edfi].[StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694] -- +COMMENT ON TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694 IS 'The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.AdministrationIdentifier IS 'The title or name of the assessment in the context of its administration.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.AssessmentBatteryPartName IS 'The name of the part of an assessment battery.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.AssigningEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.Namespace IS 'Namespace for the assessment.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; +COMMENT ON COLUMN edfi.StudentAssessmentRegistrationBatteryPartAssociationAccom_c87694.AccommodationDescriptorId IS 'The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond.'; + -- Extended Properties [edfi].[StudentAssessmentScoreResult] -- COMMENT ON TABLE edfi.StudentAssessmentScoreResult IS 'A meaningful score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc.'; COMMENT ON COLUMN edfi.StudentAssessmentScoreResult.AssessmentIdentifier IS 'A unique number or alphanumeric code assigned to an assessment.'; @@ -3528,6 +3647,17 @@ COMMENT ON COLUMN edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplin_ COMMENT ON COLUMN edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplin_4c979a.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; COMMENT ON COLUMN edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplin_4c979a.DisciplineIncidentParticipationCodeDescriptorId IS 'The role or type of participation of a student in a discipline incident.'; +-- Extended Properties [edfi].[StudentEducationOrganizationAssessmentAccommodation] -- +COMMENT ON TABLE edfi.StudentEducationOrganizationAssessmentAccommodation IS 'The accommodation(s) required or expected for administering assessments as determined by the education organization.'; +COMMENT ON COLUMN edfi.StudentEducationOrganizationAssessmentAccommodation.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentEducationOrganizationAssessmentAccommodation.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; + +-- Extended Properties [edfi].[StudentEducationOrganizationAssessmentAccommodationGener_d1d10a] -- +COMMENT ON TABLE edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a IS 'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.'; +COMMENT ON COLUMN edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; +COMMENT ON COLUMN edfi.StudentEducationOrganizationAssessmentAccommodationGener_d1d10a.AccommodationDescriptorId IS 'The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria.'; + -- Extended Properties [edfi].[StudentEducationOrganizationAssociation] -- COMMENT ON TABLE edfi.StudentEducationOrganizationAssociation IS 'This association represents student information as reported in the context of the student''s relationship to the education organization. Enrollment relationship semantics are covered by StudentSchoolAssociation.'; COMMENT ON COLUMN edfi.StudentEducationOrganizationAssociation.EducationOrganizationId IS 'The identifier assigned to an education organization.'; @@ -4152,6 +4282,20 @@ COMMENT ON COLUMN edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServ_ COMMENT ON COLUMN edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServ_85a0eb.ServiceBeginDate IS 'First date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; COMMENT ON COLUMN edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServ_85a0eb.ServiceEndDate IS 'Last date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; +-- Extended Properties [edfi].[StudentSection504ProgramAssociation] -- +COMMENT ON TABLE edfi.StudentSection504ProgramAssociation IS 'This association identifies student that qualifies for the Section 504 of the Rehabilitation Act of 1973.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.BeginDate IS 'The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.ProgramEducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.ProgramName IS 'The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.ProgramTypeDescriptorId IS 'The type of program.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.AccommodationPlan IS 'Indicates whether student has a Section 504 accommodation plan.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.Section504DisabilityTypeDescriptorId IS 'Defines one or more disabilities student has that qualifies them for a Section 504 plan.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.Section504Eligibility IS 'Indicates whether student has a disability, either temporary or permenant, that qualifies student for Section 504 consideration. Selection of FALSE for this boolean is equivalent to marking student as ''Did Not Qualify''.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.Section504EligibilityDecisionDate IS 'The month, day, and year on which the Section 504 eligibility decision is made.'; +COMMENT ON COLUMN edfi.StudentSection504ProgramAssociation.Section504MeetingDate IS 'The month, day, and year on which the meeting with student''s parent/guardian held to discuss the 504 eligibility of the student.'; + -- Extended Properties [edfi].[StudentSectionAssociation] -- COMMENT ON TABLE edfi.StudentSectionAssociation IS 'This association indicates the course sections to which a student is assigned.'; COMMENT ON COLUMN edfi.StudentSectionAssociation.BeginDate IS 'Month, day, and year of the student''s entry or assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines.'; @@ -4303,6 +4447,7 @@ COMMENT ON COLUMN edfi.StudentSpecialEducationProgramAssociationSpecialEducatio_ COMMENT ON TABLE edfi.StudentSpecialEducationProgramEligibilityAssociation IS 'Captures details regarding the evaluation process for eligibility of students for special education services under IDEA Part C or Part B.'; COMMENT ON COLUMN edfi.StudentSpecialEducationProgramEligibilityAssociation.ConsentToEvaluationReceivedDate IS 'Indicates the date on which the local education agency received written consent for the evaluation from the student''s parent or guardian. This is the first day of the evaluation timeframe.'; COMMENT ON COLUMN edfi.StudentSpecialEducationProgramEligibilityAssociation.EducationOrganizationId IS 'The identifier assigned to an education organization.'; +COMMENT ON COLUMN edfi.StudentSpecialEducationProgramEligibilityAssociation.ProgramEducationOrganizationId IS 'The identifier assigned to an education organization.'; COMMENT ON COLUMN edfi.StudentSpecialEducationProgramEligibilityAssociation.ProgramName IS 'The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies.'; COMMENT ON COLUMN edfi.StudentSpecialEducationProgramEligibilityAssociation.ProgramTypeDescriptorId IS 'The type of program.'; COMMENT ON COLUMN edfi.StudentSpecialEducationProgramEligibilityAssociation.StudentUSI IS 'A unique alphanumeric code assigned to a student.'; diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql index 4a5f20860c..dad9fa2345 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1410-CreateIndex-EdOrgIdsRelationship-AuthPerformance.sql @@ -10,6 +10,8 @@ CREATE INDEX IF NOT EXISTS IX_AccountabilityRating_EducationOrganizationId ON ed CREATE INDEX IF NOT EXISTS IX_Assessment_EducationOrganizationId ON edfi.Assessment(EducationOrganizationId) INCLUDE (Id); +CREATE INDEX IF NOT EXISTS IX_AssesssmentAdministrationParticipation_AssigningEducationOrganizationId ON edfi.AssesssmentAdministrationParticipation(AssigningEducationOrganizationId) INCLUDE (Id); + CREATE INDEX IF NOT EXISTS IX_BellSchedule_SchoolId ON edfi.BellSchedule(SchoolId) INCLUDE (Id); CREATE INDEX IF NOT EXISTS IX_Calendar_SchoolId ON edfi.Calendar(SchoolId) INCLUDE (Id); @@ -116,12 +118,24 @@ CREATE INDEX IF NOT EXISTS IX_StudentAcademicRecord_EducationOrganizationId ON e CREATE INDEX IF NOT EXISTS IX_StudentAssessmentEducationOrganizationAssociation_EducationOrganizationId ON edfi.StudentAssessmentEducationOrganizationAssociation(EducationOrganizationId) INCLUDE (Id); +CREATE INDEX IF NOT EXISTS IX_StudentAssessmentRegistration_AssigningEducationOrganizationId ON edfi.StudentAssessmentRegistration(AssigningEducationOrganizationId) INCLUDE (Id); + +CREATE INDEX IF NOT EXISTS IX_StudentAssessmentRegistration_EducationOrganizationId ON edfi.StudentAssessmentRegistration(EducationOrganizationId) INCLUDE (Id); + +CREATE INDEX IF NOT EXISTS IX_StudentAssessmentRegistration_SchoolId ON edfi.StudentAssessmentRegistration(SchoolId) INCLUDE (Id); + +CREATE INDEX IF NOT EXISTS IX_StudentAssessmentRegistrationBatteryPartAssociation_AssigningEducationOrganizationId ON edfi.StudentAssessmentRegistrationBatteryPartAssociation(AssigningEducationOrganizationId) INCLUDE (Id); + +CREATE INDEX IF NOT EXISTS IX_StudentAssessmentRegistrationBatteryPartAssociation_EducationOrganizationId ON edfi.StudentAssessmentRegistrationBatteryPartAssociation(EducationOrganizationId) INCLUDE (Id); + CREATE INDEX IF NOT EXISTS IX_StudentCohortAssociation_EducationOrganizationId ON edfi.StudentCohortAssociation(EducationOrganizationId) INCLUDE (Id); CREATE INDEX IF NOT EXISTS IX_StudentDisciplineIncidentBehaviorAssociation_SchoolId ON edfi.StudentDisciplineIncidentBehaviorAssociation(SchoolId) INCLUDE (Id); CREATE INDEX IF NOT EXISTS IX_StudentDisciplineIncidentNonOffenderAssociation_SchoolId ON edfi.StudentDisciplineIncidentNonOffenderAssociation(SchoolId) INCLUDE (Id); +CREATE INDEX IF NOT EXISTS IX_StudentEducationOrganizationAssessmentAccommodation_EducationOrganizationId ON edfi.StudentEducationOrganizationAssessmentAccommodation(EducationOrganizationId) INCLUDE (Id); + CREATE INDEX IF NOT EXISTS IX_StudentEducationOrganizationAssociation_EducationOrganizationId ON edfi.StudentEducationOrganizationAssociation(EducationOrganizationId) INCLUDE (Id); CREATE INDEX IF NOT EXISTS IX_StudentEducationOrganizationResponsibilityAssociation_EducationOrganizationId ON edfi.StudentEducationOrganizationResponsibilityAssociation(EducationOrganizationId) INCLUDE (Id); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1460-AggregateIdColumns.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1460-AggregateIdColumns.sql index 07ab39a490..4d9cac0926 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1460-AggregateIdColumns.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/1460-AggregateIdColumns.sql @@ -19,6 +19,16 @@ ALTER TABLE edfi.Assessment ADD COLUMN AggregateId int NOT NULL DEFAULT nextval( CREATE INDEX ix_Assessment_aggid ON edfi.Assessment (AggregateId); +CREATE SEQUENCE edfi.AssessmentAdministration_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; +ALTER TABLE edfi.AssessmentAdministration ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.AssessmentAdministration_aggseq'); +CREATE INDEX ix_AssessmentAdministration_aggid ON edfi.AssessmentAdministration (AggregateId); + + +CREATE SEQUENCE edfi.AssessmentBatteryPart_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; +ALTER TABLE edfi.AssessmentBatteryPart ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.AssessmentBatteryPart_aggseq'); +CREATE INDEX ix_AssessmentBatteryPart_aggid ON edfi.AssessmentBatteryPart (AggregateId); + + CREATE SEQUENCE edfi.AssessmentItem_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; ALTER TABLE edfi.AssessmentItem ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.AssessmentItem_aggseq'); CREATE INDEX ix_AssessmentItem_aggid ON edfi.AssessmentItem (AggregateId); @@ -29,6 +39,11 @@ ALTER TABLE edfi.AssessmentScoreRangeLearningStandard ADD COLUMN AggregateId int CREATE INDEX ix_AssessmentScoreRangeLearningStandard_aggid ON edfi.AssessmentScoreRangeLearningStandard (AggregateId); +CREATE SEQUENCE edfi.AssesssmentAdministrationParticipation_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; +ALTER TABLE edfi.AssesssmentAdministrationParticipation ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.AssesssmentAdministrationParticipation_aggseq'); +CREATE INDEX ix_AssesssmentAdministrationParticipation_aggid ON edfi.AssesssmentAdministrationParticipation (AggregateId); + + CREATE SEQUENCE edfi.BalanceSheetDimension_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; ALTER TABLE edfi.BalanceSheetDimension ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.BalanceSheetDimension_aggseq'); CREATE INDEX ix_BalanceSheetDimension_aggid ON edfi.BalanceSheetDimension (AggregateId); @@ -424,6 +439,16 @@ ALTER TABLE edfi.StudentAssessmentEducationOrganizationAssociation ADD COLUMN Ag CREATE INDEX ix_StudentAssessmentEducationOrganizationAssociation_aggid ON edfi.StudentAssessmentEducationOrganizationAssociation (AggregateId); +CREATE SEQUENCE edfi.StudentAssessmentRegistration_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; +ALTER TABLE edfi.StudentAssessmentRegistration ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.StudentAssessmentRegistration_aggseq'); +CREATE INDEX ix_StudentAssessmentRegistration_aggid ON edfi.StudentAssessmentRegistration (AggregateId); + + +CREATE SEQUENCE edfi.StudentAssessmentRegistrationBatteryPartAssociation_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.StudentAssessmentRegistrationBatteryPartAssociation_aggseq'); +CREATE INDEX ix_StudentAssessmentRegistrationBatteryPartAssociation_aggid ON edfi.StudentAssessmentRegistrationBatteryPartAssociation (AggregateId); + + CREATE SEQUENCE edfi.StudentCohortAssociation_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; ALTER TABLE edfi.StudentCohortAssociation ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.StudentCohortAssociation_aggseq'); CREATE INDEX ix_StudentCohortAssociation_aggid ON edfi.StudentCohortAssociation (AggregateId); @@ -449,6 +474,11 @@ ALTER TABLE edfi.StudentDisciplineIncidentNonOffenderAssociation ADD COLUMN Aggr CREATE INDEX ix_StudentDisciplineIncidentNonOffenderAssociation_aggid ON edfi.StudentDisciplineIncidentNonOffenderAssociation (AggregateId); +CREATE SEQUENCE edfi.StudentEducationOrganizationAssessmentAccommodation_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.StudentEducationOrganizationAssessmentAccommodation_aggseq'); +CREATE INDEX ix_StudentEducationOrganizationAssessmentAccommodation_aggid ON edfi.StudentEducationOrganizationAssessmentAccommodation (AggregateId); + + CREATE SEQUENCE edfi.StudentEducationOrganizationAssociation_aggseq START WITH -2147483648 INCREMENT BY 1 MINVALUE -2147483648; ALTER TABLE edfi.StudentEducationOrganizationAssociation ADD COLUMN AggregateId int NOT NULL DEFAULT nextval('edfi.StudentEducationOrganizationAssociation_aggseq'); CREATE INDEX ix_StudentEducationOrganizationAssociation_aggid ON edfi.StudentEducationOrganizationAssociation (AggregateId); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql index 76e4ba289a..3b6c4dd15a 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0030-AddColumnChangeVersionForTables.sql @@ -21,6 +21,16 @@ ALTER TABLE edfi.Assessment ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; ALTER TABLE edfi.Assessment ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='assessmentadministration' AND column_name='changeversion') THEN +ALTER TABLE edfi.AssessmentAdministration ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; +ALTER TABLE edfi.AssessmentAdministration ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); +END IF; + +IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='assessmentbatterypart' AND column_name='changeversion') THEN +ALTER TABLE edfi.AssessmentBatteryPart ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; +ALTER TABLE edfi.AssessmentBatteryPart ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='assessmentitem' AND column_name='changeversion') THEN ALTER TABLE edfi.AssessmentItem ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; ALTER TABLE edfi.AssessmentItem ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); @@ -31,6 +41,11 @@ ALTER TABLE edfi.AssessmentScoreRangeLearningStandard ADD ChangeVersion BIGINT D ALTER TABLE edfi.AssessmentScoreRangeLearningStandard ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='assesssmentadministrationparticipation' AND column_name='changeversion') THEN +ALTER TABLE edfi.AssesssmentAdministrationParticipation ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; +ALTER TABLE edfi.AssesssmentAdministrationParticipation ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='balancesheetdimension' AND column_name='changeversion') THEN ALTER TABLE edfi.BalanceSheetDimension ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; ALTER TABLE edfi.BalanceSheetDimension ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); @@ -426,6 +441,16 @@ ALTER TABLE edfi.StudentAssessmentEducationOrganizationAssociation ADD ChangeVer ALTER TABLE edfi.StudentAssessmentEducationOrganizationAssociation ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='studentassessmentregistration' AND column_name='changeversion') THEN +ALTER TABLE edfi.StudentAssessmentRegistration ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; +ALTER TABLE edfi.StudentAssessmentRegistration ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); +END IF; + +IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='studentassessmentregistrationbatterypartassociation' AND column_name='changeversion') THEN +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='studentcohortassociation' AND column_name='changeversion') THEN ALTER TABLE edfi.StudentCohortAssociation ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; ALTER TABLE edfi.StudentCohortAssociation ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); @@ -451,6 +476,11 @@ ALTER TABLE edfi.StudentDisciplineIncidentNonOffenderAssociation ADD ChangeVersi ALTER TABLE edfi.StudentDisciplineIncidentNonOffenderAssociation ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='studenteducationorganizationassessmentaccommodation' AND column_name='changeversion') THEN +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='edfi' AND table_name='studenteducationorganizationassociation' AND column_name='changeversion') THEN ALTER TABLE edfi.StudentEducationOrganizationAssociation ADD ChangeVersion BIGINT DEFAULT (0) NOT NULL; ALTER TABLE edfi.StudentEducationOrganizationAssociation ALTER ChangeVersion SET DEFAULT nextval('changes.ChangeVersionSequence'); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql index 05edf38725..57d9cf0bb1 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0070-AddIndexChangeVersionForTables.sql @@ -9,10 +9,16 @@ CREATE INDEX IF NOT EXISTS UX_2d3c0c_ChangeVersion ON edfi.AccountabilityRating( CREATE INDEX IF NOT EXISTS UX_7808ee_ChangeVersion ON edfi.Assessment(ChangeVersion); +CREATE INDEX IF NOT EXISTS UX_c64558_ChangeVersion ON edfi.AssessmentAdministration(ChangeVersion); + +CREATE INDEX IF NOT EXISTS UX_6e22f2_ChangeVersion ON edfi.AssessmentBatteryPart(ChangeVersion); + CREATE INDEX IF NOT EXISTS UX_dc3dcf_ChangeVersion ON edfi.AssessmentItem(ChangeVersion); CREATE INDEX IF NOT EXISTS UX_a20588_ChangeVersion ON edfi.AssessmentScoreRangeLearningStandard(ChangeVersion); +CREATE INDEX IF NOT EXISTS UX_0b52ab_ChangeVersion ON edfi.AssesssmentAdministrationParticipation(ChangeVersion); + CREATE INDEX IF NOT EXISTS UX_e52c9c_ChangeVersion ON edfi.BalanceSheetDimension(ChangeVersion); CREATE INDEX IF NOT EXISTS UX_9bbaf5_ChangeVersion ON edfi.BellSchedule(ChangeVersion); @@ -171,6 +177,10 @@ CREATE INDEX IF NOT EXISTS UX_ee3b2a_ChangeVersion ON edfi.StudentAssessment(Cha CREATE INDEX IF NOT EXISTS UX_afb8b8_ChangeVersion ON edfi.StudentAssessmentEducationOrganizationAssociation(ChangeVersion); +CREATE INDEX IF NOT EXISTS UX_79fd6b_ChangeVersion ON edfi.StudentAssessmentRegistration(ChangeVersion); + +CREATE INDEX IF NOT EXISTS UX_3bb369_ChangeVersion ON edfi.StudentAssessmentRegistrationBatteryPartAssociation(ChangeVersion); + CREATE INDEX IF NOT EXISTS UX_369ddc_ChangeVersion ON edfi.StudentCohortAssociation(ChangeVersion); CREATE INDEX IF NOT EXISTS UX_395c07_ChangeVersion ON edfi.StudentCompetencyObjective(ChangeVersion); @@ -181,6 +191,8 @@ CREATE INDEX IF NOT EXISTS UX_f4934f_ChangeVersion ON edfi.StudentDisciplineInci CREATE INDEX IF NOT EXISTS UX_4b43da_ChangeVersion ON edfi.StudentDisciplineIncidentNonOffenderAssociation(ChangeVersion); +CREATE INDEX IF NOT EXISTS UX_5f4481_ChangeVersion ON edfi.StudentEducationOrganizationAssessmentAccommodation(ChangeVersion); + CREATE INDEX IF NOT EXISTS UX_8e1257_ChangeVersion ON edfi.StudentEducationOrganizationAssociation(ChangeVersion); CREATE INDEX IF NOT EXISTS UX_42aa64_ChangeVersion ON edfi.StudentEducationOrganizationResponsibilityAssociation(ChangeVersion); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql index 93d670d393..2dc5a0de01 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0200-CreateTrackedChangeTables.sql @@ -57,6 +57,42 @@ CREATE TABLE tracked_changes_edfi.assessment ); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'assessmentadministration') THEN +CREATE TABLE tracked_changes_edfi.assessmentadministration +( + oldadministrationidentifier VARCHAR(255) NOT NULL, + oldassessmentidentifier VARCHAR(60) NOT NULL, + oldassigningeducationorganizationid BIGINT NOT NULL, + oldnamespace VARCHAR(255) NOT NULL, + newadministrationidentifier VARCHAR(255) NULL, + newassessmentidentifier VARCHAR(60) NULL, + newassigningeducationorganizationid BIGINT NULL, + newnamespace VARCHAR(255) NULL, + id uuid NOT NULL, + changeversion bigint NOT NULL, + discriminator varchar(128) NULL, + createdate timestamp NOT NULL DEFAULT (now()), + CONSTRAINT assessmentadministration_pk PRIMARY KEY (ChangeVersion) +); +END IF; + +IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'assessmentbatterypart') THEN +CREATE TABLE tracked_changes_edfi.assessmentbatterypart +( + oldassessmentbatterypartname VARCHAR(65) NOT NULL, + oldassessmentidentifier VARCHAR(60) NOT NULL, + oldnamespace VARCHAR(255) NOT NULL, + newassessmentbatterypartname VARCHAR(65) NULL, + newassessmentidentifier VARCHAR(60) NULL, + newnamespace VARCHAR(255) NULL, + id uuid NOT NULL, + changeversion bigint NOT NULL, + discriminator varchar(128) NULL, + createdate timestamp NOT NULL DEFAULT (now()), + CONSTRAINT assessmentbatterypart_pk PRIMARY KEY (ChangeVersion) +); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'assessmentitem') THEN CREATE TABLE tracked_changes_edfi.assessmentitem ( @@ -91,6 +127,27 @@ CREATE TABLE tracked_changes_edfi.assessmentscorerangelearningstandard ); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'assesssmentadministrationparticipation') THEN +CREATE TABLE tracked_changes_edfi.assesssmentadministrationparticipation +( + oldadministrationidentifier VARCHAR(255) NOT NULL, + oldassessmentidentifier VARCHAR(60) NOT NULL, + oldassigningeducationorganizationid BIGINT NOT NULL, + oldnamespace VARCHAR(255) NOT NULL, + oldparticipatingeducationorganizationid BIGINT NOT NULL, + newadministrationidentifier VARCHAR(255) NULL, + newassessmentidentifier VARCHAR(60) NULL, + newassigningeducationorganizationid BIGINT NULL, + newnamespace VARCHAR(255) NULL, + newparticipatingeducationorganizationid BIGINT NULL, + id uuid NOT NULL, + changeversion bigint NOT NULL, + discriminator varchar(128) NULL, + createdate timestamp NOT NULL DEFAULT (now()), + CONSTRAINT assesssmentadministrationparticipation_pk PRIMARY KEY (ChangeVersion) +); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'balancesheetdimension') THEN CREATE TABLE tracked_changes_edfi.balancesheetdimension ( @@ -1671,6 +1728,58 @@ CREATE TABLE tracked_changes_edfi.studentassessmenteducationorganizationassociat ); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'studentassessmentregistration') THEN +CREATE TABLE tracked_changes_edfi.studentassessmentregistration +( + oldadministrationidentifier VARCHAR(255) NOT NULL, + oldassessmentidentifier VARCHAR(60) NOT NULL, + oldassigningeducationorganizationid BIGINT NOT NULL, + oldeducationorganizationid BIGINT NOT NULL, + oldnamespace VARCHAR(255) NOT NULL, + oldstudentusi INT NOT NULL, + oldstudentuniqueid VARCHAR(32) NOT NULL, + newadministrationidentifier VARCHAR(255) NULL, + newassessmentidentifier VARCHAR(60) NULL, + newassigningeducationorganizationid BIGINT NULL, + neweducationorganizationid BIGINT NULL, + newnamespace VARCHAR(255) NULL, + newstudentusi INT NULL, + newstudentuniqueid VARCHAR(32) NULL, + id uuid NOT NULL, + changeversion bigint NOT NULL, + discriminator varchar(128) NULL, + createdate timestamp NOT NULL DEFAULT (now()), + CONSTRAINT studentassessmentregistration_pk PRIMARY KEY (ChangeVersion) +); +END IF; + +IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'studentassessmentregistrationbatterypartassociation') THEN +CREATE TABLE tracked_changes_edfi.studentassessmentregistrationbatterypartassociation +( + oldadministrationidentifier VARCHAR(255) NOT NULL, + oldassessmentbatterypartname VARCHAR(65) NOT NULL, + oldassessmentidentifier VARCHAR(60) NOT NULL, + oldassigningeducationorganizationid BIGINT NOT NULL, + oldeducationorganizationid BIGINT NOT NULL, + oldnamespace VARCHAR(255) NOT NULL, + oldstudentusi INT NOT NULL, + oldstudentuniqueid VARCHAR(32) NOT NULL, + newadministrationidentifier VARCHAR(255) NULL, + newassessmentbatterypartname VARCHAR(65) NULL, + newassessmentidentifier VARCHAR(60) NULL, + newassigningeducationorganizationid BIGINT NULL, + neweducationorganizationid BIGINT NULL, + newnamespace VARCHAR(255) NULL, + newstudentusi INT NULL, + newstudentuniqueid VARCHAR(32) NULL, + id uuid NOT NULL, + changeversion bigint NOT NULL, + discriminator varchar(128) NULL, + createdate timestamp NOT NULL DEFAULT (now()), + CONSTRAINT studentassessmentregistrationbatterypartassociation_pk PRIMARY KEY (ChangeVersion) +); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'studentcohortassociation') THEN CREATE TABLE tracked_changes_edfi.studentcohortassociation ( @@ -1792,6 +1901,23 @@ CREATE TABLE tracked_changes_edfi.studentdisciplineincidentnonoffenderassociatio ); END IF; +IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'studenteducationorganizationassessmentaccommodation') THEN +CREATE TABLE tracked_changes_edfi.studenteducationorganizationassessmentaccommodation +( + oldeducationorganizationid BIGINT NOT NULL, + oldstudentusi INT NOT NULL, + oldstudentuniqueid VARCHAR(32) NOT NULL, + neweducationorganizationid BIGINT NULL, + newstudentusi INT NULL, + newstudentuniqueid VARCHAR(32) NULL, + id uuid NOT NULL, + changeversion bigint NOT NULL, + discriminator varchar(128) NULL, + createdate timestamp NOT NULL DEFAULT (now()), + CONSTRAINT studenteducationorganizationassessmentaccommodation_pk PRIMARY KEY (ChangeVersion) +); +END IF; + IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'tracked_changes_edfi' AND table_name = 'studenteducationorganizationassociation') THEN CREATE TABLE tracked_changes_edfi.studenteducationorganizationassociation ( @@ -2105,6 +2231,7 @@ CREATE TABLE tracked_changes_edfi.studentspecialeducationprogrameligibilityassoc ( oldconsenttoevaluationreceiveddate DATE NOT NULL, oldeducationorganizationid BIGINT NOT NULL, + oldprogrameducationorganizationid BIGINT NOT NULL, oldprogramname VARCHAR(60) NOT NULL, oldprogramtypedescriptorid INT NOT NULL, oldprogramtypedescriptornamespace VARCHAR(255) NOT NULL, @@ -2113,6 +2240,7 @@ CREATE TABLE tracked_changes_edfi.studentspecialeducationprogrameligibilityassoc oldstudentuniqueid VARCHAR(32) NOT NULL, newconsenttoevaluationreceiveddate DATE NULL, neweducationorganizationid BIGINT NULL, + newprogrameducationorganizationid BIGINT NULL, newprogramname VARCHAR(60) NULL, newprogramtypedescriptorid INT NULL, newprogramtypedescriptornamespace VARCHAR(255) NULL, diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql index 32944e2529..9715ac085c 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0210-CreateTriggersForChangeVersionAndKeyChanges.sql @@ -20,6 +20,16 @@ CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.assessment FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); END IF; +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'assessmentadministration') THEN +CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.assessmentadministration + FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); +END IF; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'assessmentbatterypart') THEN +CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.assessmentbatterypart + FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); +END IF; + IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'assessmentitem') THEN CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.assessmentitem FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); @@ -30,6 +40,11 @@ CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.assessmentscorerangelea FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); END IF; +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'assesssmentadministrationparticipation') THEN +CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.assesssmentadministrationparticipation + FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); +END IF; + IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'balancesheetdimension') THEN CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.balancesheetdimension FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); @@ -741,6 +756,16 @@ CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.studentassessmenteducat FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); END IF; +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'studentassessmentregistration') THEN +CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.studentassessmentregistration + FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); +END IF; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'studentassessmentregistrationbatterypartassociation') THEN +CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.studentassessmentregistrationbatterypartassociation + FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); +END IF; + IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'studentcohortassociation') THEN CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.studentcohortassociation FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); @@ -766,6 +791,11 @@ CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.studentdisciplineincide FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); END IF; +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'studenteducationorganizationassessmentaccommodation') THEN +CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.studenteducationorganizationassessmentaccommodation + FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); +END IF; + IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'updatechangeversion' AND event_object_schema = 'edfi' AND event_object_table = 'studenteducationorganizationassociation') THEN CREATE TRIGGER UpdateChangeVersion BEFORE UPDATE ON edfi.studenteducationorganizationassociation FOR EACH ROW EXECUTE PROCEDURE changes.UpdateChangeVersion(); diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql index 111bc3f40d..4697dc877b 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/Changes/0220-CreateTriggersForDeleteTracking.sql @@ -252,6 +252,46 @@ CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.assessment FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.assessment_deleted(); END IF; +CREATE OR REPLACE FUNCTION tracked_changes_edfi.assessmentadministration_deleted() + RETURNS trigger AS +$BODY$ +BEGIN + INSERT INTO tracked_changes_edfi.assessmentadministration( + oldadministrationidentifier, oldassessmentidentifier, oldassigningeducationorganizationid, oldnamespace, + id, discriminator, changeversion) + VALUES ( + OLD.administrationidentifier, OLD.assessmentidentifier, OLD.assigningeducationorganizationid, OLD.namespace, + OLD.id, OLD.discriminator, nextval('changes.changeversionsequence')); + + RETURN NULL; +END; +$BODY$ LANGUAGE plpgsql; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'trackdeletes' AND event_object_schema = 'edfi' AND event_object_table = 'assessmentadministration') THEN +CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.assessmentadministration + FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.assessmentadministration_deleted(); +END IF; + +CREATE OR REPLACE FUNCTION tracked_changes_edfi.assessmentbatterypart_deleted() + RETURNS trigger AS +$BODY$ +BEGIN + INSERT INTO tracked_changes_edfi.assessmentbatterypart( + oldassessmentbatterypartname, oldassessmentidentifier, oldnamespace, + id, discriminator, changeversion) + VALUES ( + OLD.assessmentbatterypartname, OLD.assessmentidentifier, OLD.namespace, + OLD.id, OLD.discriminator, nextval('changes.changeversionsequence')); + + RETURN NULL; +END; +$BODY$ LANGUAGE plpgsql; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'trackdeletes' AND event_object_schema = 'edfi' AND event_object_table = 'assessmentbatterypart') THEN +CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.assessmentbatterypart + FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.assessmentbatterypart_deleted(); +END IF; + CREATE OR REPLACE FUNCTION tracked_changes_edfi.assessmentcategorydescriptor_deleted() RETURNS trigger AS $BODY$ @@ -394,6 +434,26 @@ CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.assessmentscorerangelearningsta FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.assessmentscorerangelearningstandard_deleted(); END IF; +CREATE OR REPLACE FUNCTION tracked_changes_edfi.assesssmentadministrationparticipation_deleted() + RETURNS trigger AS +$BODY$ +BEGIN + INSERT INTO tracked_changes_edfi.assesssmentadministrationparticipation( + oldadministrationidentifier, oldassessmentidentifier, oldassigningeducationorganizationid, oldnamespace, oldparticipatingeducationorganizationid, + id, discriminator, changeversion) + VALUES ( + OLD.administrationidentifier, OLD.assessmentidentifier, OLD.assigningeducationorganizationid, OLD.namespace, OLD.participatingeducationorganizationid, + OLD.id, OLD.discriminator, nextval('changes.changeversionsequence')); + + RETURN NULL; +END; +$BODY$ LANGUAGE plpgsql; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'trackdeletes' AND event_object_schema = 'edfi' AND event_object_table = 'assesssmentadministrationparticipation') THEN +CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.assesssmentadministrationparticipation + FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.assesssmentadministrationparticipation_deleted(); +END IF; + CREATE OR REPLACE FUNCTION tracked_changes_edfi.assignmentlatestatusdescriptor_deleted() RETURNS trigger AS $BODY$ @@ -4347,6 +4407,23 @@ CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.schoolyeartype FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.schoolyeartype_deleted(); END IF; +CREATE OR REPLACE FUNCTION tracked_changes_edfi.section504disabilitytypedescriptor_deleted() + RETURNS trigger AS +$BODY$ +BEGIN + INSERT INTO tracked_changes_edfi.descriptor(olddescriptorid, oldcodevalue, oldnamespace, id, discriminator, changeversion) + SELECT OLD.Section504DisabilityTypeDescriptorId, b.codevalue, b.namespace, b.id, 'edfi.Section504DisabilityTypeDescriptor', nextval('changes.ChangeVersionSequence') + FROM edfi.descriptor b WHERE old.Section504DisabilityTypeDescriptorId = b.descriptorid ; + + RETURN NULL; +END; +$BODY$ LANGUAGE plpgsql; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'trackdeletes' AND event_object_schema = 'edfi' AND event_object_table = 'section504disabilitytypedescriptor') THEN +CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.section504disabilitytypedescriptor + FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.section504disabilitytypedescriptor_deleted(); +END IF; + CREATE OR REPLACE FUNCTION tracked_changes_edfi.section_deleted() RETURNS trigger AS $BODY$ @@ -5041,6 +5118,54 @@ CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.studentassessmenteducationorgan FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.studentassessmenteducationorganizationassociation_deleted(); END IF; +CREATE OR REPLACE FUNCTION tracked_changes_edfi.studentassessmentregistration_deleted() + RETURNS trigger AS +$BODY$ +DECLARE + dj0 edfi.student%ROWTYPE; +BEGIN + SELECT INTO dj0 * FROM edfi.student j0 WHERE studentusi = old.studentusi; + + INSERT INTO tracked_changes_edfi.studentassessmentregistration( + oldadministrationidentifier, oldassessmentidentifier, oldassigningeducationorganizationid, oldeducationorganizationid, oldnamespace, oldstudentusi, oldstudentuniqueid, + id, discriminator, changeversion) + VALUES ( + OLD.administrationidentifier, OLD.assessmentidentifier, OLD.assigningeducationorganizationid, OLD.educationorganizationid, OLD.namespace, OLD.studentusi, dj0.studentuniqueid, + OLD.id, OLD.discriminator, nextval('changes.changeversionsequence')); + + RETURN NULL; +END; +$BODY$ LANGUAGE plpgsql; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'trackdeletes' AND event_object_schema = 'edfi' AND event_object_table = 'studentassessmentregistration') THEN +CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.studentassessmentregistration + FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.studentassessmentregistration_deleted(); +END IF; + +CREATE OR REPLACE FUNCTION tracked_changes_edfi.studentassessmentregistrationbatterypartassociation_deleted() + RETURNS trigger AS +$BODY$ +DECLARE + dj0 edfi.student%ROWTYPE; +BEGIN + SELECT INTO dj0 * FROM edfi.student j0 WHERE studentusi = old.studentusi; + + INSERT INTO tracked_changes_edfi.studentassessmentregistrationbatterypartassociation( + oldadministrationidentifier, oldassessmentbatterypartname, oldassessmentidentifier, oldassigningeducationorganizationid, oldeducationorganizationid, oldnamespace, oldstudentusi, oldstudentuniqueid, + id, discriminator, changeversion) + VALUES ( + OLD.administrationidentifier, OLD.assessmentbatterypartname, OLD.assessmentidentifier, OLD.assigningeducationorganizationid, OLD.educationorganizationid, OLD.namespace, OLD.studentusi, dj0.studentuniqueid, + OLD.id, OLD.discriminator, nextval('changes.changeversionsequence')); + + RETURN NULL; +END; +$BODY$ LANGUAGE plpgsql; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'trackdeletes' AND event_object_schema = 'edfi' AND event_object_table = 'studentassessmentregistrationbatterypartassociation') THEN +CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.studentassessmentregistrationbatterypartassociation + FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.studentassessmentregistrationbatterypartassociation_deleted(); +END IF; + CREATE OR REPLACE FUNCTION tracked_changes_edfi.studentcharacteristicdescriptor_deleted() RETURNS trigger AS $BODY$ @@ -5190,6 +5315,30 @@ CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.studentdisciplineincidentnonoff FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.studentdisciplineincidentnonoffenderassociation_deleted(); END IF; +CREATE OR REPLACE FUNCTION tracked_changes_edfi.studenteducationorganizationassessmentaccommodation_deleted() + RETURNS trigger AS +$BODY$ +DECLARE + dj0 edfi.student%ROWTYPE; +BEGIN + SELECT INTO dj0 * FROM edfi.student j0 WHERE studentusi = old.studentusi; + + INSERT INTO tracked_changes_edfi.studenteducationorganizationassessmentaccommodation( + oldeducationorganizationid, oldstudentusi, oldstudentuniqueid, + id, discriminator, changeversion) + VALUES ( + OLD.educationorganizationid, OLD.studentusi, dj0.studentuniqueid, + OLD.id, OLD.discriminator, nextval('changes.changeversionsequence')); + + RETURN NULL; +END; +$BODY$ LANGUAGE plpgsql; + +IF NOT EXISTS(SELECT 1 FROM information_schema.triggers WHERE trigger_name = 'trackdeletes' AND event_object_schema = 'edfi' AND event_object_table = 'studenteducationorganizationassessmentaccommodation') THEN +CREATE TRIGGER TrackDeletes AFTER DELETE ON edfi.studenteducationorganizationassessmentaccommodation + FOR EACH ROW EXECUTE PROCEDURE tracked_changes_edfi.studenteducationorganizationassessmentaccommodation_deleted(); +END IF; + CREATE OR REPLACE FUNCTION tracked_changes_edfi.studenteducationorganizationassociation_deleted() RETURNS trigger AS $BODY$ @@ -5534,10 +5683,10 @@ BEGIN SELECT INTO dj1 * FROM edfi.student j1 WHERE studentusi = old.studentusi; INSERT INTO tracked_changes_edfi.studentspecialeducationprogrameligibilityassociation( - oldconsenttoevaluationreceiveddate, oldeducationorganizationid, oldprogramname, oldprogramtypedescriptorid, oldprogramtypedescriptornamespace, oldprogramtypedescriptorcodevalue, oldstudentusi, oldstudentuniqueid, + oldconsenttoevaluationreceiveddate, oldeducationorganizationid, oldprogrameducationorganizationid, oldprogramname, oldprogramtypedescriptorid, oldprogramtypedescriptornamespace, oldprogramtypedescriptorcodevalue, oldstudentusi, oldstudentuniqueid, id, discriminator, changeversion) VALUES ( - OLD.consenttoevaluationreceiveddate, OLD.educationorganizationid, OLD.programname, OLD.programtypedescriptorid, dj0.namespace, dj0.codevalue, OLD.studentusi, dj1.studentuniqueid, + OLD.consenttoevaluationreceiveddate, OLD.educationorganizationid, OLD.programeducationorganizationid, OLD.programname, OLD.programtypedescriptorid, dj0.namespace, dj0.codevalue, OLD.studentusi, dj1.studentuniqueid, OLD.id, OLD.discriminator, nextval('changes.changeversionsequence')); RETURN NULL; diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql index 0729fd1193..ff6d05ac4c 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/PgSql/Structure/Ods/RecordOwnership/0010-AddColumnOwnershipTokenForTable.sql @@ -9,10 +9,16 @@ ALTER TABLE edfi.AccountabilityRating ADD CreatedByOwnershipTokenId SMALLINT NUL ALTER TABLE edfi.Assessment ADD CreatedByOwnershipTokenId SMALLINT NULL; +ALTER TABLE edfi.AssessmentAdministration ADD CreatedByOwnershipTokenId SMALLINT NULL; + +ALTER TABLE edfi.AssessmentBatteryPart ADD CreatedByOwnershipTokenId SMALLINT NULL; + ALTER TABLE edfi.AssessmentItem ADD CreatedByOwnershipTokenId SMALLINT NULL; ALTER TABLE edfi.AssessmentScoreRangeLearningStandard ADD CreatedByOwnershipTokenId SMALLINT NULL; +ALTER TABLE edfi.AssesssmentAdministrationParticipation ADD CreatedByOwnershipTokenId SMALLINT NULL; + ALTER TABLE edfi.BalanceSheetDimension ADD CreatedByOwnershipTokenId SMALLINT NULL; ALTER TABLE edfi.BellSchedule ADD CreatedByOwnershipTokenId SMALLINT NULL; @@ -171,6 +177,10 @@ ALTER TABLE edfi.StudentAssessment ADD CreatedByOwnershipTokenId SMALLINT NULL; ALTER TABLE edfi.StudentAssessmentEducationOrganizationAssociation ADD CreatedByOwnershipTokenId SMALLINT NULL; +ALTER TABLE edfi.StudentAssessmentRegistration ADD CreatedByOwnershipTokenId SMALLINT NULL; + +ALTER TABLE edfi.StudentAssessmentRegistrationBatteryPartAssociation ADD CreatedByOwnershipTokenId SMALLINT NULL; + ALTER TABLE edfi.StudentCohortAssociation ADD CreatedByOwnershipTokenId SMALLINT NULL; ALTER TABLE edfi.StudentCompetencyObjective ADD CreatedByOwnershipTokenId SMALLINT NULL; @@ -181,6 +191,8 @@ ALTER TABLE edfi.StudentDisciplineIncidentBehaviorAssociation ADD CreatedByOwner ALTER TABLE edfi.StudentDisciplineIncidentNonOffenderAssociation ADD CreatedByOwnershipTokenId SMALLINT NULL; +ALTER TABLE edfi.StudentEducationOrganizationAssessmentAccommodation ADD CreatedByOwnershipTokenId SMALLINT NULL; + ALTER TABLE edfi.StudentEducationOrganizationAssociation ADD CreatedByOwnershipTokenId SMALLINT NULL; ALTER TABLE edfi.StudentEducationOrganizationResponsibilityAssociation ADD CreatedByOwnershipTokenId SMALLINT NULL; diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Ed-Fi-Core.xsd b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Ed-Fi-Core.xsd index 3643b45cae..74ed2a5922 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Ed-Fi-Core.xsd +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Ed-Fi-Core.xsd @@ -241,6 +241,74 @@ + + + The anticipated administration of an assessment under the purview of an education organization. + + Domain Entity + + + + + + + + A reference to the education organization which contracts for or administers an assessment. + + + + + A reference to the assessment. + + + + + The title or name of the assessment in the context of its administration. + + + + + The anticipated dates for the assessment or administration window. + + + + + A reference to the parts of the assessment battery that are offered in this administration of the assessment. + + + + + + + + + The parts organized for administering an assessessment which together provide a comprehensive assessment of the students. + + Domain Entity + + + + + + + + A reference to the assessment. + + + + + The name of the part of an assessment battery. + + + + + A reference to the objective assessment(s) that are administered by the assessment battery part. + + + + + + This entity represents one of many single measures that make up an assessment. @@ -360,6 +428,35 @@ + + + Identifies the point of contact for the administration of an assessment under the purview of an education organization. + + Domain Entity + + + + + + + + A reference to the assessment administration for which participation is being indicated. + + + + + A reference to the education organization for which participation is being indicated. + + + + + Pre-identified contacts for education organizations administering the assessment. + + + + + + The NCES balance sheet accounting dimension, used to track financial transactions for each fund. These financial statements only report assets, deferred outflows of resources, liabilities, deferred inflows of resources, and equity accounts. The statements are considered snapshots of how these accounts stand as of a certain point in time. @@ -4676,6 +4773,79 @@ + + + Identifies an assessment registration that a student is expected to participate in including the testing organization, reporting organization and assessment delivery details. + + Domain Entity + + + + + + + + A reference to the expected administration of an assessment. + + + + + A reference to the attending student education organization association. + + + + + A reference to the attending student school association that is active during the period of administration. + + + + + A reference to the education organization expected to administer the assessment. + + + + + A reference to the education organization which should receive the results of the assessment. + + + + + A reference to the accommodations expected for administering the assessment. + + + + + The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria. + + AccommodationDescriptor + + + + + + The environment or format in which the assessment is expected to be administered. + + PlatformTypeDescriptor + + + + + + The grade level or primary instructional level at which the student is to be assessed. + + GradeLevelDescriptor + + + + + + Key/value pairs which may be used to facilitate customization of an assessment or to support vendor reporting/analysis. + + + + + + This entity represents the competency assessed or evaluated for the student against a specific competency objective. @@ -4730,6 +4900,38 @@ + + + The accommodation(s) required or expected for administering assessments as determined by the education organization. + + Domain Entity + + + + + + + + A reference to the education organization determining the student's accommodations required for assessments. + + + + + Reference to the student associated with the assessment. + + + + + The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria. + + AccommodationDescriptor + + + + + + + This entity holds a student's grade or competency level for a gradebook entry. @@ -7348,6 +7550,17 @@ + + + This descriptor defines the reason(s) why student qualifies for Section 504 consideration. + + Descriptor + + + + + + This descriptor defines characteristics of a Section, such as whether attendance is taken and the Section is graded. @@ -8419,6 +8632,38 @@ + + + The association to the part(s) of the assessment battery that the student is to be tested for this administration of the assessment. + + Association + + + + + + + + A reference to the registration that indicates the student is expected to participate in particular assessment. + + + + + A reference to the part of the assessment battery that the student is to be tested for this administration of the assessment. + + + + + The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond. + + AccommodationDescriptor + + + + + + + This association represents the cohort(s) for which a student is designated. @@ -9315,6 +9560,48 @@ + + + This association identifies student that qualifies for the Section 504 of the Rehabilitation Act of 1973. + + Association + + + + + + + + Indicates whether student has a disability, either temporary or permenant, that qualifies student for Section 504 consideration. Selection of FALSE for this boolean is equivalent to marking student as 'Did Not Qualify'. + + + + + Indicates whether student has a Section 504 accommodation plan. + + + + + Defines one or more disabilities student has that qualifies them for a Section 504 plan. + + Section504DisabilityTypeDescriptor + + + + + + The month, day, and year on which the meeting with student's parent/guardian held to discuss the 504 eligibility of the student. + + + + + The month, day, and year on which the Section 504 eligibility decision is made. + + + + + + This association indicates the course sections to which a student is assigned. @@ -9936,19 +10223,102 @@ - The title of the rating. + The title of the rating. + + + + + The school year for which the accountability rating is assessed. + + + + + + + Provides alternative references for an AccountabilityRating. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + + Extended Reference + + + + + + + + Identity of an AccountabilityRating. + + + + + + + + + Identity of an AssessmentAdministration. + + Identity + + + + + + A reference to the education organization which contracts for or administers an assessment. + + + + + A reference to the assessment. + + + + + The title or name of the assessment in the context of its administration. + + + + + + + Provides alternative references for an AssessmentAdministration. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + + Extended Reference + + + + + + + + Identity of an AssessmentAdministration. + + + + + + + + + Identity of an AssessmentBatteryPart. + + Identity + + + + + + A reference to the assessment. - + - The school year for which the accountability rating is assessed. + The name of the part of an assessment battery. - + - Provides alternative references for an AccountabilityRating. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + Provides alternative references for an AssessmentBatteryPart. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. Extended Reference @@ -9956,9 +10326,9 @@ - + - Identity of an AccountabilityRating. + Identity of an AssessmentBatteryPart. @@ -10095,6 +10465,45 @@ + + + Identity of an AssesssmentAdministrationParticipation. + + Identity + + + + + + A reference to the assessment administration for which participation is being indicated. + + + + + A reference to the education organization for which participation is being indicated. + + + + + + + Provides alternative references for an AssesssmentAdministrationParticipation. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + + Extended Reference + + + + + + + + Identity of an AssesssmentAdministrationParticipation. + + + + + + Identity of a BalanceSheetDimension. @@ -14113,6 +14522,84 @@ + + + Identity of a StudentAssessmentRegistrationBatteryPartAssociation. + + Identity + + + + + + A reference to the registration that indicates the student is expected to participate in particular assessment. + + + + + A reference to the part of the assessment battery that the student is to be tested for this administration of the assessment. + + + + + + + Provides alternative references for a StudentAssessmentRegistrationBatteryPartAssociation. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + + Extended Reference + + + + + + + + Identity of a StudentAssessmentRegistrationBatteryPartAssociation. + + + + + + + + + Identity of a StudentAssessmentRegistration. + + Identity + + + + + + A reference to the expected administration of an assessment. + + + + + A reference to the attending student education organization association. + + + + + + + Provides alternative references for a StudentAssessmentRegistration. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + + Extended Reference + + + + + + + + Identity of a StudentAssessmentRegistration. + + + + + + Identity of a StudentCohortAssociation. @@ -14375,6 +14862,45 @@ + + + Identity of a StudentEducationOrganizationAssessmentAccommodation. + + Identity + + + + + + A reference to the education organization determining the student's accommodations required for assessments. + + + + + Reference to the student associated with the assessment. + + + + + + + Provides alternative references for a StudentEducationOrganizationAssessmentAccommodation. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + + Extended Reference + + + + + + + + Identity of a StudentEducationOrganizationAssessmentAccommodation. + + + + + + Encapsulates primary attributes that can be used to look up the identity of a StudentEducationOrganizationAssociation. @@ -15217,6 +15743,55 @@ + + + Identity of a StudentSection504ProgramAssociation. + + Identity + + + + + + The student associated with the program. + + + + + The program associated with the student. + + + + + The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + + + + + The education organization where the student is participating in or receiving the program services. + + + + + + + Provides alternative references for a StudentSection504ProgramAssociation. Use XML IDREF to reference a record that is included in the interchange. Use the identity type to look up a record that was loaded previously. + + Extended Reference + + + + + + + + Identity of a StudentSection504ProgramAssociation. + + + + + + Identity of a StudentSectionAssociation. @@ -17574,6 +18149,15 @@ + + + This descriptor defines the reason(s) why student qualifies for Section 504 consideration. + + Extended Descriptor Reference + + + + This descriptor defines characteristics of a Section, such as whether attendance is taken and the Section is graded. @@ -18125,6 +18709,61 @@ + + + Short list of information which identifies the point of contact for the administration of an assessment within an education organization. + + Common + + + + + + A reference to the education organization. + + + + + The email address for the contact. + + + + + The contact's first name. + + + + + The contact's last name. + + + + + The login ID for the user; used for security access control interface. + + + + + + + An untyped key and value pair that is used to provide additional information needed for vendor regisration, administration, or reporting. + + Common + + + + + + An agreed upon identifier for the custom information. + + + + + Custom value for the indicated CustomizationKey. + + + + A unique number or alphanumeric code assigned to an assessment by a school, school system, a state, or other agency or entity. @@ -21288,6 +21927,17 @@ + + + The title or name of the assessment in the context of its administration. + + Simple + + + + + + used for the bell schedule, another name for day (e.g., Blue day, Red day). @@ -21310,6 +21960,17 @@ + + + The name of the part of a assessment battery. + + Simple + + + + + + The AssessmentFamily an Assessment is a member of. @@ -21721,6 +22382,28 @@ + + + An agreed upon identifier for the custom information. + + Simple + + + + + + + + + Custom value for the indicated CustomizationKey. + + Simple + + + + + + The department or suborganization the employee/contractor is associated with in the Education Organization. diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Interchange-Descriptors.xsd b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Interchange-Descriptors.xsd index b83cf2d6f7..4f6fce286a 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Interchange-Descriptors.xsd +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/Interchange-Descriptors.xsd @@ -184,6 +184,7 @@ The Descriptor interchange is used to describe metadata about the descriptors an + diff --git a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/SchemaAnnotation.xsd b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/SchemaAnnotation.xsd index c4fd53732f..8bb4a33d45 100644 --- a/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/SchemaAnnotation.xsd +++ b/Application/EdFi.Ods.Standard/Standard/5.2.0/Artifacts/Schemas/SchemaAnnotation.xsd @@ -188,6 +188,7 @@ + diff --git a/Postman Test Suite/Ed-Fi ODS-API Custom View-Based Authorization Test Suite.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API Custom View-Based Authorization Test Suite.postman_collection.json index 267cec7da2..4afe364ead 100644 --- a/Postman Test Suite/Ed-Fi ODS-API Custom View-Based Authorization Test Suite.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API Custom View-Based Authorization Test Suite.postman_collection.json @@ -2065,14 +2065,21 @@ "\r", "const item = items[0];\r", "\r", - "pm.test(\"Should return an entry with the key values of the item previously added and deleted.\", () => {\r", - " pm.expect(item.keyValues).to.deep.equal({\r", + "const expectedKeyValues = {\r", " \"consentToEvaluationReceivedDate\": \"2024-08-02\",\r", " \"studentUniqueId\": \"ABC123\",\r", " \"educationOrganizationId\": 255901,\r", " \"programName\": \"Bilingual\",\r", - " \"programTypeDescriptor\": \"uri://ed-fi.org/ProgramTypeDescriptor#Bilingual\",\r", - " });\r", + " \"programTypeDescriptor\": \"uri://ed-fi.org/ProgramTypeDescriptor#Bilingual\"\r", + "};\r", + "\r", + "// Check if `programEducationOrganizationId` exists in the response\r", + "if (item.keyValues.hasOwnProperty(\"programEducationOrganizationId\")) {\r", + " expectedKeyValues.programEducationOrganizationId = 255901;\r", + "}\r", + "\r", + "pm.test(\"Should return an entry with the key values of the item previously added and deleted.\", () => {\r", + " pm.expect(item.keyValues).to.deep.equal(expectedKeyValues);\r", "});" ], "type": "text/javascript", diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.1.0.approved.txt b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.1.0.approved.txt deleted file mode 100644 index 5f282702bb..0000000000 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.1.0.approved.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.2.0.approved.txt b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.2.0.approved.txt deleted file mode 100644 index 5f282702bb..0000000000 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_510_ApprovalTests.Generated_File_List.Standard.5.2.0.approved.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Controllers_Controllers.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Controllers_Controllers.generated.approved.cs index 21dbd09261..41cba909a6 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Controllers_Controllers.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Controllers_Controllers.generated.approved.cs @@ -542,6 +542,73 @@ protected override void MapAll(Api.Common.Models.Requests.Assessments.EdFi.Asses } } +namespace EdFi.Ods.Api.Services.Controllers.AssessmentAdministrations.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/assessmentAdministrations")] + public partial class AssessmentAdministrationsController : DataManagementControllerBase< + Api.Common.Models.Resources.AssessmentAdministration.EdFi.AssessmentAdministration, + Entities.Common.EdFi.IAssessmentAdministration, + Entities.NHibernate.AssessmentAdministrationAggregate.EdFi.AssessmentAdministration, + Api.Common.Models.Requests.AssessmentAdministrations.EdFi.AssessmentAdministrationPut, + Api.Common.Models.Requests.AssessmentAdministrations.EdFi.AssessmentAdministrationPost, + Api.Common.Models.Requests.AssessmentAdministrations.EdFi.AssessmentAdministrationDelete, + Api.Common.Models.Requests.AssessmentAdministrations.EdFi.AssessmentAdministrationGetByExample> + { + public AssessmentAdministrationsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.AssessmentAdministrations.EdFi.AssessmentAdministrationGetByExample request, Entities.Common.EdFi.IAssessmentAdministration specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.AdministrationIdentifier = request.AdministrationIdentifier; + specification.AssessmentIdentifier = request.AssessmentIdentifier; + specification.AssigningEducationOrganizationId = request.AssigningEducationOrganizationId; + specification.Id = request.Id; + specification.Namespace = request.Namespace; + } + } +} + +namespace EdFi.Ods.Api.Services.Controllers.AssessmentBatteryParts.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/assessmentBatteryParts")] + public partial class AssessmentBatteryPartsController : DataManagementControllerBase< + Api.Common.Models.Resources.AssessmentBatteryPart.EdFi.AssessmentBatteryPart, + Entities.Common.EdFi.IAssessmentBatteryPart, + Entities.NHibernate.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPart, + Api.Common.Models.Requests.AssessmentBatteryParts.EdFi.AssessmentBatteryPartPut, + Api.Common.Models.Requests.AssessmentBatteryParts.EdFi.AssessmentBatteryPartPost, + Api.Common.Models.Requests.AssessmentBatteryParts.EdFi.AssessmentBatteryPartDelete, + Api.Common.Models.Requests.AssessmentBatteryParts.EdFi.AssessmentBatteryPartGetByExample> + { + public AssessmentBatteryPartsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.AssessmentBatteryParts.EdFi.AssessmentBatteryPartGetByExample request, Entities.Common.EdFi.IAssessmentBatteryPart specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.AssessmentBatteryPartName = request.AssessmentBatteryPartName; + specification.AssessmentIdentifier = request.AssessmentIdentifier; + specification.Id = request.Id; + specification.Namespace = request.Namespace; + } + } +} + namespace EdFi.Ods.Api.Services.Controllers.AssessmentCategoryDescriptors.EdFi { [ApiExplorerSettings(IgnoreApi = true)] @@ -840,6 +907,41 @@ protected override void MapAll(Api.Common.Models.Requests.AssessmentScoreRangeLe } } +namespace EdFi.Ods.Api.Services.Controllers.AssesssmentAdministrationParticipations.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/assesssmentAdministrationParticipations")] + public partial class AssesssmentAdministrationParticipationsController : DataManagementControllerBase< + Api.Common.Models.Resources.AssesssmentAdministrationParticipation.EdFi.AssesssmentAdministrationParticipation, + Entities.Common.EdFi.IAssesssmentAdministrationParticipation, + Entities.NHibernate.AssesssmentAdministrationParticipationAggregate.EdFi.AssesssmentAdministrationParticipation, + Api.Common.Models.Requests.AssesssmentAdministrationParticipations.EdFi.AssesssmentAdministrationParticipationPut, + Api.Common.Models.Requests.AssesssmentAdministrationParticipations.EdFi.AssesssmentAdministrationParticipationPost, + Api.Common.Models.Requests.AssesssmentAdministrationParticipations.EdFi.AssesssmentAdministrationParticipationDelete, + Api.Common.Models.Requests.AssesssmentAdministrationParticipations.EdFi.AssesssmentAdministrationParticipationGetByExample> + { + public AssesssmentAdministrationParticipationsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.AssesssmentAdministrationParticipations.EdFi.AssesssmentAdministrationParticipationGetByExample request, Entities.Common.EdFi.IAssesssmentAdministrationParticipation specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.AdministrationIdentifier = request.AdministrationIdentifier; + specification.AssessmentIdentifier = request.AssessmentIdentifier; + specification.AssigningEducationOrganizationId = request.AssigningEducationOrganizationId; + specification.Id = request.Id; + specification.Namespace = request.Namespace; + specification.ParticipatingEducationOrganizationId = request.ParticipatingEducationOrganizationId; + } + } +} + namespace EdFi.Ods.Api.Services.Controllers.AssignmentLateStatusDescriptors.EdFi { [ApiExplorerSettings(IgnoreApi = true)] @@ -9109,6 +9211,43 @@ protected override void MapAll(Api.Common.Models.Requests.Sections.EdFi.SectionG } } +namespace EdFi.Ods.Api.Services.Controllers.Section504DisabilityTypeDescriptors.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/section504DisabilityTypeDescriptors")] + public partial class Section504DisabilityTypeDescriptorsController : DataManagementControllerBase< + Api.Common.Models.Resources.Section504DisabilityTypeDescriptor.EdFi.Section504DisabilityTypeDescriptor, + Entities.Common.EdFi.ISection504DisabilityTypeDescriptor, + Entities.NHibernate.Section504DisabilityTypeDescriptorAggregate.EdFi.Section504DisabilityTypeDescriptor, + Api.Common.Models.Requests.Section504DisabilityTypeDescriptors.EdFi.Section504DisabilityTypeDescriptorPut, + Api.Common.Models.Requests.Section504DisabilityTypeDescriptors.EdFi.Section504DisabilityTypeDescriptorPost, + Api.Common.Models.Requests.Section504DisabilityTypeDescriptors.EdFi.Section504DisabilityTypeDescriptorDelete, + Api.Common.Models.Requests.Section504DisabilityTypeDescriptors.EdFi.Section504DisabilityTypeDescriptorGetByExample> + { + public Section504DisabilityTypeDescriptorsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.Section504DisabilityTypeDescriptors.EdFi.Section504DisabilityTypeDescriptorGetByExample request, Entities.Common.EdFi.ISection504DisabilityTypeDescriptor specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.CodeValue = request.CodeValue; + specification.Description = request.Description; + specification.EffectiveBeginDate = request.EffectiveBeginDate; + specification.EffectiveEndDate = request.EffectiveEndDate; + specification.Id = request.Id; + specification.Namespace = request.Namespace; + specification.Section504DisabilityTypeDescriptorId = request.Section504DisabilityTypeDescriptorId; + specification.ShortDescription = request.ShortDescription; + } + } +} + namespace EdFi.Ods.Api.Services.Controllers.SectionAttendanceTakenEvents.EdFi { [ApiExplorerSettings(IgnoreApi = true)] @@ -10381,6 +10520,85 @@ protected override void MapAll(Api.Common.Models.Requests.StudentAssessmentEduca } } +namespace EdFi.Ods.Api.Services.Controllers.StudentAssessmentRegistrations.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/studentAssessmentRegistrations")] + public partial class StudentAssessmentRegistrationsController : DataManagementControllerBase< + Api.Common.Models.Resources.StudentAssessmentRegistration.EdFi.StudentAssessmentRegistration, + Entities.Common.EdFi.IStudentAssessmentRegistration, + Entities.NHibernate.StudentAssessmentRegistrationAggregate.EdFi.StudentAssessmentRegistration, + Api.Common.Models.Requests.StudentAssessmentRegistrations.EdFi.StudentAssessmentRegistrationPut, + Api.Common.Models.Requests.StudentAssessmentRegistrations.EdFi.StudentAssessmentRegistrationPost, + Api.Common.Models.Requests.StudentAssessmentRegistrations.EdFi.StudentAssessmentRegistrationDelete, + Api.Common.Models.Requests.StudentAssessmentRegistrations.EdFi.StudentAssessmentRegistrationGetByExample> + { + public StudentAssessmentRegistrationsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.StudentAssessmentRegistrations.EdFi.StudentAssessmentRegistrationGetByExample request, Entities.Common.EdFi.IStudentAssessmentRegistration specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.AdministrationIdentifier = request.AdministrationIdentifier; + specification.AssessmentGradeLevelDescriptor = request.AssessmentGradeLevelDescriptor; + specification.AssessmentIdentifier = request.AssessmentIdentifier; + specification.AssigningEducationOrganizationId = request.AssigningEducationOrganizationId; + specification.EducationOrganizationId = request.EducationOrganizationId; + specification.EntryDate = request.EntryDate; + specification.Id = request.Id; + specification.Namespace = request.Namespace; + specification.PlatformTypeDescriptor = request.PlatformTypeDescriptor; + specification.ReportingEducationOrganizationId = request.ReportingEducationOrganizationId; + specification.SchoolId = request.SchoolId; + specification.StudentUniqueId = request.StudentUniqueId; + specification.TestingEducationOrganizationId = request.TestingEducationOrganizationId; + } + } +} + +namespace EdFi.Ods.Api.Services.Controllers.StudentAssessmentRegistrationBatteryPartAssociations.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/studentAssessmentRegistrationBatteryPartAssociations")] + public partial class StudentAssessmentRegistrationBatteryPartAssociationsController : DataManagementControllerBase< + Api.Common.Models.Resources.StudentAssessmentRegistrationBatteryPartAssociation.EdFi.StudentAssessmentRegistrationBatteryPartAssociation, + Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation, + Entities.NHibernate.StudentAssessmentRegistrationBatteryPartAssociationAggregate.EdFi.StudentAssessmentRegistrationBatteryPartAssociation, + Api.Common.Models.Requests.StudentAssessmentRegistrationBatteryPartAssociations.EdFi.StudentAssessmentRegistrationBatteryPartAssociationPut, + Api.Common.Models.Requests.StudentAssessmentRegistrationBatteryPartAssociations.EdFi.StudentAssessmentRegistrationBatteryPartAssociationPost, + Api.Common.Models.Requests.StudentAssessmentRegistrationBatteryPartAssociations.EdFi.StudentAssessmentRegistrationBatteryPartAssociationDelete, + Api.Common.Models.Requests.StudentAssessmentRegistrationBatteryPartAssociations.EdFi.StudentAssessmentRegistrationBatteryPartAssociationGetByExample> + { + public StudentAssessmentRegistrationBatteryPartAssociationsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.StudentAssessmentRegistrationBatteryPartAssociations.EdFi.StudentAssessmentRegistrationBatteryPartAssociationGetByExample request, Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.AdministrationIdentifier = request.AdministrationIdentifier; + specification.AssessmentBatteryPartName = request.AssessmentBatteryPartName; + specification.AssessmentIdentifier = request.AssessmentIdentifier; + specification.AssigningEducationOrganizationId = request.AssigningEducationOrganizationId; + specification.EducationOrganizationId = request.EducationOrganizationId; + specification.Id = request.Id; + specification.Namespace = request.Namespace; + specification.StudentUniqueId = request.StudentUniqueId; + } + } +} + namespace EdFi.Ods.Api.Services.Controllers.StudentCharacteristicDescriptors.EdFi { [ApiExplorerSettings(IgnoreApi = true)] @@ -10642,6 +10860,38 @@ protected override void MapAll(Api.Common.Models.Requests.StudentDisciplineIncid } } +namespace EdFi.Ods.Api.Services.Controllers.StudentEducationOrganizationAssessmentAccommodations.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/studentEducationOrganizationAssessmentAccommodations")] + public partial class StudentEducationOrganizationAssessmentAccommodationsController : DataManagementControllerBase< + Api.Common.Models.Resources.StudentEducationOrganizationAssessmentAccommodation.EdFi.StudentEducationOrganizationAssessmentAccommodation, + Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation, + Entities.NHibernate.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi.StudentEducationOrganizationAssessmentAccommodation, + Api.Common.Models.Requests.StudentEducationOrganizationAssessmentAccommodations.EdFi.StudentEducationOrganizationAssessmentAccommodationPut, + Api.Common.Models.Requests.StudentEducationOrganizationAssessmentAccommodations.EdFi.StudentEducationOrganizationAssessmentAccommodationPost, + Api.Common.Models.Requests.StudentEducationOrganizationAssessmentAccommodations.EdFi.StudentEducationOrganizationAssessmentAccommodationDelete, + Api.Common.Models.Requests.StudentEducationOrganizationAssessmentAccommodations.EdFi.StudentEducationOrganizationAssessmentAccommodationGetByExample> + { + public StudentEducationOrganizationAssessmentAccommodationsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.StudentEducationOrganizationAssessmentAccommodations.EdFi.StudentEducationOrganizationAssessmentAccommodationGetByExample request, Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.EducationOrganizationId = request.EducationOrganizationId; + specification.Id = request.Id; + specification.StudentUniqueId = request.StudentUniqueId; + } + } +} + namespace EdFi.Ods.Api.Services.Controllers.StudentEducationOrganizationAssociations.EdFi { [ApiExplorerSettings(IgnoreApi = true)] @@ -11348,6 +11598,50 @@ protected override void MapAll(Api.Common.Models.Requests.StudentSchoolFoodServi } } +namespace EdFi.Ods.Api.Services.Controllers.StudentSection504ProgramAssociations.EdFi +{ + [ApiExplorerSettings(IgnoreApi = true)] + [ExcludeFromCodeCoverage] + [ApiController] + [Authorize] + [ApplyOdsRouteRootTemplate, Route($"{RouteConstants.DataManagementRoutePrefix}/ed-fi/studentSection504ProgramAssociations")] + public partial class StudentSection504ProgramAssociationsController : DataManagementControllerBase< + Api.Common.Models.Resources.StudentSection504ProgramAssociation.EdFi.StudentSection504ProgramAssociation, + Entities.Common.EdFi.IStudentSection504ProgramAssociation, + Entities.NHibernate.StudentSection504ProgramAssociationAggregate.EdFi.StudentSection504ProgramAssociation, + Api.Common.Models.Requests.StudentSection504ProgramAssociations.EdFi.StudentSection504ProgramAssociationPut, + Api.Common.Models.Requests.StudentSection504ProgramAssociations.EdFi.StudentSection504ProgramAssociationPost, + Api.Common.Models.Requests.StudentSection504ProgramAssociations.EdFi.StudentSection504ProgramAssociationDelete, + Api.Common.Models.Requests.StudentSection504ProgramAssociations.EdFi.StudentSection504ProgramAssociationGetByExample> + { + public StudentSection504ProgramAssociationsController(IPipelineFactory pipelineFactory, IEdFiProblemDetailsProvider problemDetailsProvider, IDefaultPageSizeLimitProvider defaultPageSizeLimitProvider, ApiSettings apiSettings, IContextProvider profileContentTypeContextProvider, IContextProvider dataManagementResourceContextProvider, ILogContextAccessor logContextAccessor) + : base(pipelineFactory, problemDetailsProvider, defaultPageSizeLimitProvider, apiSettings, profileContentTypeContextProvider, dataManagementResourceContextProvider, logContextAccessor) + { + } + + protected override void MapAll(Api.Common.Models.Requests.StudentSection504ProgramAssociations.EdFi.StudentSection504ProgramAssociationGetByExample request, Entities.Common.EdFi.IStudentSection504ProgramAssociation specification) + { + // Copy all existing values + specification.SuspendReferenceAssignmentCheck(); + specification.AccommodationPlan = request.AccommodationPlan; + specification.BeginDate = request.BeginDate; + specification.EducationOrganizationId = request.EducationOrganizationId; + specification.EndDate = request.EndDate; + specification.Id = request.Id; + specification.ProgramEducationOrganizationId = request.ProgramEducationOrganizationId; + specification.ProgramName = request.ProgramName; + specification.ProgramTypeDescriptor = request.ProgramTypeDescriptor; + specification.ReasonExitedDescriptor = request.ReasonExitedDescriptor; + specification.Section504DisabilityTypeDescriptor = request.Section504DisabilityTypeDescriptor; + specification.Section504Eligibility = request.Section504Eligibility; + specification.Section504EligibilityDecisionDate = request.Section504EligibilityDecisionDate; + specification.Section504MeetingDate = request.Section504MeetingDate; + specification.ServedOutsideOfRegularSession = request.ServedOutsideOfRegularSession; + specification.StudentUniqueId = request.StudentUniqueId; + } + } +} + namespace EdFi.Ods.Api.Services.Controllers.StudentSectionAssociations.EdFi { [ApiExplorerSettings(IgnoreApi = true)] @@ -11527,6 +11821,7 @@ protected override void MapAll(Api.Common.Models.Requests.StudentSpecialEducatio specification.IDEAIndicator = request.IDEAIndicator; specification.IDEAPartDescriptor = request.IDEAPartDescriptor; specification.OriginalECIServicesDate = request.OriginalECIServicesDate; + specification.ProgramEducationOrganizationId = request.ProgramEducationOrganizationId; specification.ProgramName = request.ProgramName; specification.ProgramTypeDescriptor = request.ProgramTypeDescriptor; specification.StudentUniqueId = request.StudentUniqueId; diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappings.generated.hbm.approved.xml b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappings.generated.hbm.approved.xml index 58a52bd610..00b721ba95 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappings.generated.hbm.approved.xml +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappings.generated.hbm.approved.xml @@ -604,6 +604,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -834,6 +1061,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5911,6 +6244,22 @@ + + + + + + + + + + + + + + + + @@ -8583,6 +8932,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15847,26 +16227,209 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + @@ -15874,58 +16437,109 @@ + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + - + + - + + + + + + + + + + + + + + + + + + + + - + - + + + - - + - + - + + + - - + @@ -15933,16 +16547,16 @@ - + - - - - + + + + + - @@ -15951,7 +16565,6 @@ - @@ -15963,15 +16576,16 @@ - + - - - + + + + + - @@ -15980,8 +16594,7 @@ - - + @@ -15992,14 +16605,15 @@ - + + + - + - @@ -16010,14 +16624,15 @@ - + + + - + - @@ -16035,24 +16650,67 @@ - - - - - - + + + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16615,6 +17273,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -19074,6 +19816,7 @@ + @@ -19091,6 +19834,7 @@ + @@ -19131,7 +19875,7 @@ - + diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml index 7642c1ca5a..9423fcdaad 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_MsSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml @@ -151,6 +151,14 @@ + + + + + + + + @@ -159,6 +167,14 @@ + + + + + + + + @@ -652,6 +668,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -882,6 +1138,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3556,6 +3904,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -6020,6 +6389,13 @@ + + + + + + + @@ -7459,6 +7835,13 @@ + + + + + + + @@ -8628,6 +9011,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -10394,6 +10800,13 @@ + + + + + + + @@ -10408,6 +10821,20 @@ + + + + + + + + + + + + + + @@ -10590,6 +11017,13 @@ + + + + + + + @@ -10625,6 +11059,13 @@ + + + + + + + @@ -10695,6 +11136,13 @@ + + + + + + + @@ -12265,6 +12713,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15199,6 +15683,15 @@ + + + + + + + + + @@ -15889,7 +16382,7 @@ - + @@ -19650,6 +20143,13 @@ + + + + + + + @@ -20614,11 +21114,194 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + @@ -20627,56 +21310,110 @@ - + - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + - - + - + - + + + - - + + + + + + + + + + + + + @@ -20684,16 +21421,16 @@ - + - - - - + + + + + - @@ -20702,16 +21439,12 @@ - - - - - - + + @@ -20720,15 +21453,16 @@ - + - - - + + + + + - @@ -20737,18 +21471,11 @@ - - + - - - - - - @@ -20756,14 +21483,15 @@ - + + + - + - @@ -20783,25 +21511,68 @@ - - - - - - + + + + - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + @@ -21353,6 +22124,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -21430,6 +22285,14 @@ + + + + + + + + @@ -23255,6 +24118,15 @@ + + + + + + + + + @@ -23887,6 +24759,7 @@ + @@ -23943,7 +24816,7 @@ - + diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappings.generated.hbm.approved.xml b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappings.generated.hbm.approved.xml index 24f1cb49fe..d622b29cd7 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappings.generated.hbm.approved.xml +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappings.generated.hbm.approved.xml @@ -604,6 +604,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -834,6 +1061,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5911,6 +6244,22 @@ + + + + + + + + + + + + + + + + @@ -8583,6 +8932,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15847,26 +16227,209 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + @@ -15874,58 +16437,109 @@ + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + - + + - + + + + + + + + + + + + + + + + + + + + - + - + + + - - + - + - + + + - - + @@ -15933,16 +16547,16 @@ - + - - - - + + + + + - @@ -15951,7 +16565,6 @@ - @@ -15963,15 +16576,16 @@ - + - - - + + + + + - @@ -15980,8 +16594,7 @@ - - + @@ -15992,14 +16605,15 @@ - + + + - + - @@ -16010,14 +16624,15 @@ - + + + - + - @@ -16035,24 +16650,67 @@ - - - - - - + + + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16615,6 +17273,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -19074,6 +19816,7 @@ + @@ -19091,6 +19834,7 @@ + @@ -19131,7 +19875,7 @@ - + diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml index b6a23ad511..e3f9640f3d 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_EntityOrmMappings_PgSql_EntityOrmMappingsForQueries.generated.hbm.approved.xml @@ -151,6 +151,14 @@ + + + + + + + + @@ -159,6 +167,14 @@ + + + + + + + + @@ -652,6 +668,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -882,6 +1138,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3556,6 +3904,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -6020,6 +6389,13 @@ + + + + + + + @@ -7459,6 +7835,13 @@ + + + + + + + @@ -8628,6 +9011,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -10394,6 +10800,13 @@ + + + + + + + @@ -10408,6 +10821,20 @@ + + + + + + + + + + + + + + @@ -10590,6 +11017,13 @@ + + + + + + + @@ -10625,6 +11059,13 @@ + + + + + + + @@ -10695,6 +11136,13 @@ + + + + + + + @@ -12265,6 +12713,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15199,6 +15683,15 @@ + + + + + + + + + @@ -15889,7 +16382,7 @@ - + @@ -19650,6 +20143,13 @@ + + + + + + + @@ -20614,11 +21114,194 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + @@ -20627,56 +21310,110 @@ - + - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + - - + - + - + + + - - + + + + + + + + + + + + + @@ -20684,16 +21421,16 @@ - + - - - - + + + + + - @@ -20702,16 +21439,12 @@ - - - - - - + + @@ -20720,15 +21453,16 @@ - + - - - + + + + + - @@ -20737,18 +21471,11 @@ - - + - - - - - - @@ -20756,14 +21483,15 @@ - + + + - + - @@ -20783,25 +21511,68 @@ - - - - - - + + + + - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + @@ -21353,6 +22124,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -21430,6 +22285,14 @@ + + + + + + + + @@ -23255,6 +24118,15 @@ + + + + + + + + + @@ -23887,6 +24759,7 @@ + @@ -23943,7 +24816,7 @@ - + diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_ExceptionHandling_DatabaseMetadata.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_ExceptionHandling_DatabaseMetadata.generated.approved.cs index 053d251e1b..ed5526474b 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_ExceptionHandling_DatabaseMetadata.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_ExceptionHandling_DatabaseMetadata.generated.approved.cs @@ -44,9 +44,24 @@ public IndexDetails GetIndexDetails(string indexName) { "AssessmentAcademicSubject_PK", new IndexDetails { IndexName = "AssessmentAcademicSubject_PK", TableName = "AssessmentAcademicSubject", ColumnNames = new List { "AssessmentIdentifier", "Namespace", "AcademicSubjectDescriptorId" } } }, { "FK_AssessmentAcademicSubject_AcademicSubjectDescriptor", new IndexDetails { IndexName = "FK_AssessmentAcademicSubject_AcademicSubjectDescriptor", TableName = "AssessmentAcademicSubject", ColumnNames = new List { "AcademicSubjectDescriptorId" } } }, { "FK_AssessmentAcademicSubject_Assessment", new IndexDetails { IndexName = "FK_AssessmentAcademicSubject_Assessment", TableName = "AssessmentAcademicSubject", ColumnNames = new List { "AssessmentIdentifier", "Namespace" } } }, + { "AssessmentAdministration_PK", new IndexDetails { IndexName = "AssessmentAdministration_PK", TableName = "AssessmentAdministration", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace" } } }, + { "FK_AssessmentAdministration_Assessment", new IndexDetails { IndexName = "FK_AssessmentAdministration_Assessment", TableName = "AssessmentAdministration", ColumnNames = new List { "AssessmentIdentifier", "Namespace" } } }, + { "FK_AssessmentAdministration_EducationOrganization", new IndexDetails { IndexName = "FK_AssessmentAdministration_EducationOrganization", TableName = "AssessmentAdministration", ColumnNames = new List { "AssigningEducationOrganizationId" } } }, + { "UX_AssessmentAdministration_Id", new IndexDetails { IndexName = "UX_AssessmentAdministration_Id", TableName = "AssessmentAdministration", ColumnNames = new List { "Id" } } }, + { "AssessmentAdministrationAssessmentAdminstrationPeriod_PK", new IndexDetails { IndexName = "AssessmentAdministrationAssessmentAdminstrationPeriod_PK", TableName = "AssessmentAdministrationAssessmentAdminstrationPeriod", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace", "BeginDate" } } }, + { "FK_AssessmentAdministrationAssessmentAdminstrationPeriod_AssessmentAdministration", new IndexDetails { IndexName = "FK_AssessmentAdministrationAssessmentAdminstrationPeriod_AssessmentAdministration", TableName = "AssessmentAdministrationAssessmentAdminstrationPeriod", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace" } } }, + { "AssessmentAdministrationAssessmentBatteryPart_PK", new IndexDetails { IndexName = "AssessmentAdministrationAssessmentBatteryPart_PK", TableName = "AssessmentAdministrationAssessmentBatteryPart", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace", "AssessmentBatteryPartName" } } }, + { "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentAdministration", new IndexDetails { IndexName = "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentAdministration", TableName = "AssessmentAdministrationAssessmentBatteryPart", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace" } } }, + { "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentBatteryPart", new IndexDetails { IndexName = "FK_AssessmentAdministrationAssessmentBatteryPart_AssessmentBatteryPart", TableName = "AssessmentAdministrationAssessmentBatteryPart", ColumnNames = new List { "AssessmentBatteryPartName", "AssessmentIdentifier", "Namespace" } } }, { "AssessmentAssessedGradeLevel_PK", new IndexDetails { IndexName = "AssessmentAssessedGradeLevel_PK", TableName = "AssessmentAssessedGradeLevel", ColumnNames = new List { "AssessmentIdentifier", "Namespace", "GradeLevelDescriptorId" } } }, { "FK_AssessmentAssessedGradeLevel_Assessment", new IndexDetails { IndexName = "FK_AssessmentAssessedGradeLevel_Assessment", TableName = "AssessmentAssessedGradeLevel", ColumnNames = new List { "AssessmentIdentifier", "Namespace" } } }, { "FK_AssessmentAssessedGradeLevel_GradeLevelDescriptor", new IndexDetails { IndexName = "FK_AssessmentAssessedGradeLevel_GradeLevelDescriptor", TableName = "AssessmentAssessedGradeLevel", ColumnNames = new List { "GradeLevelDescriptorId" } } }, + { "AssessmentBatteryPart_PK", new IndexDetails { IndexName = "AssessmentBatteryPart_PK", TableName = "AssessmentBatteryPart", ColumnNames = new List { "AssessmentBatteryPartName", "AssessmentIdentifier", "Namespace" } } }, + { "FK_AssessmentBatteryPart_Assessment", new IndexDetails { IndexName = "FK_AssessmentBatteryPart_Assessment", TableName = "AssessmentBatteryPart", ColumnNames = new List { "AssessmentIdentifier", "Namespace" } } }, + { "UX_AssessmentBatteryPart_Id", new IndexDetails { IndexName = "UX_AssessmentBatteryPart_Id", TableName = "AssessmentBatteryPart", ColumnNames = new List { "Id" } } }, + { "AssessmentBatteryPartObjectiveAssessment_PK", new IndexDetails { IndexName = "AssessmentBatteryPartObjectiveAssessment_PK", TableName = "AssessmentBatteryPartObjectiveAssessment", ColumnNames = new List { "AssessmentBatteryPartName", "AssessmentIdentifier", "Namespace", "IdentificationCode" } } }, + { "FK_AssessmentBatteryPartObjectiveAssessment_AssessmentBatteryPart", new IndexDetails { IndexName = "FK_AssessmentBatteryPartObjectiveAssessment_AssessmentBatteryPart", TableName = "AssessmentBatteryPartObjectiveAssessment", ColumnNames = new List { "AssessmentBatteryPartName", "AssessmentIdentifier", "Namespace" } } }, + { "FK_AssessmentBatteryPartObjectiveAssessment_ObjectiveAssessment", new IndexDetails { IndexName = "FK_AssessmentBatteryPartObjectiveAssessment_ObjectiveAssessment", TableName = "AssessmentBatteryPartObjectiveAssessment", ColumnNames = new List { "AssessmentIdentifier", "IdentificationCode", "Namespace" } } }, { "AssessmentCategoryDescriptor_PK", new IndexDetails { IndexName = "AssessmentCategoryDescriptor_PK", TableName = "AssessmentCategoryDescriptor", ColumnNames = new List { "AssessmentCategoryDescriptorId" } } }, { "AssessmentContentStandard_PK", new IndexDetails { IndexName = "AssessmentContentStandard_PK", TableName = "AssessmentContentStandard", ColumnNames = new List { "AssessmentIdentifier", "Namespace" } } }, { "FK_AssessmentContentStandard_EducationOrganization", new IndexDetails { IndexName = "FK_AssessmentContentStandard_EducationOrganization", TableName = "AssessmentContentStandard", ColumnNames = new List { "MandatingEducationOrganizationId" } } }, @@ -102,6 +117,13 @@ public IndexDetails GetIndexDetails(string indexName) { "AssessmentSection_PK", new IndexDetails { IndexName = "AssessmentSection_PK", TableName = "AssessmentSection", ColumnNames = new List { "AssessmentIdentifier", "Namespace", "LocalCourseCode", "SchoolId", "SchoolYear", "SectionIdentifier", "SessionName" } } }, { "FK_AssessmentSection_Assessment", new IndexDetails { IndexName = "FK_AssessmentSection_Assessment", TableName = "AssessmentSection", ColumnNames = new List { "AssessmentIdentifier", "Namespace" } } }, { "FK_AssessmentSection_Section", new IndexDetails { IndexName = "FK_AssessmentSection_Section", TableName = "AssessmentSection", ColumnNames = new List { "LocalCourseCode", "SchoolId", "SchoolYear", "SectionIdentifier", "SessionName" } } }, + { "AssesssmentAdministrationParticipation_PK", new IndexDetails { IndexName = "AssesssmentAdministrationParticipation_PK", TableName = "AssesssmentAdministrationParticipation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace", "ParticipatingEducationOrganizationId" } } }, + { "FK_AssesssmentAdministrationParticipation_AssessmentAdministration", new IndexDetails { IndexName = "FK_AssesssmentAdministrationParticipation_AssessmentAdministration", TableName = "AssesssmentAdministrationParticipation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace" } } }, + { "FK_AssesssmentAdministrationParticipation_EducationOrganization", new IndexDetails { IndexName = "FK_AssesssmentAdministrationParticipation_EducationOrganization", TableName = "AssesssmentAdministrationParticipation", ColumnNames = new List { "ParticipatingEducationOrganizationId" } } }, + { "UX_AssesssmentAdministrationParticipation_Id", new IndexDetails { IndexName = "UX_AssesssmentAdministrationParticipation_Id", TableName = "AssesssmentAdministrationParticipation", ColumnNames = new List { "Id" } } }, + { "AssesssmentAdministrationParticipationAdministrationPointOfContact_PK", new IndexDetails { IndexName = "AssesssmentAdministrationParticipationAdministrationPointOfContact_PK", TableName = "AssesssmentAdministrationParticipationAdministrationPointOfContact", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace", "ParticipatingEducationOrganizationId", "EducationOrganizationId", "ElectronicMailAddress" } } }, + { "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_AssesssmentAdministrationParticipation", new IndexDetails { IndexName = "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_AssesssmentAdministrationParticipation", TableName = "AssesssmentAdministrationParticipationAdministrationPointOfContact", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace", "ParticipatingEducationOrganizationId" } } }, + { "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_EducationOrganization", new IndexDetails { IndexName = "FK_AssesssmentAdministrationParticipationAdministrationPointOfContact_EducationOrganization", TableName = "AssesssmentAdministrationParticipationAdministrationPointOfContact", ColumnNames = new List { "EducationOrganizationId" } } }, { "AssignmentLateStatusDescriptor_PK", new IndexDetails { IndexName = "AssignmentLateStatusDescriptor_PK", TableName = "AssignmentLateStatusDescriptor", ColumnNames = new List { "AssignmentLateStatusDescriptorId" } } }, { "AttemptStatusDescriptor_PK", new IndexDetails { IndexName = "AttemptStatusDescriptor_PK", TableName = "AttemptStatusDescriptor", ColumnNames = new List { "AttemptStatusDescriptorId" } } }, { "AttendanceEventCategoryDescriptor_PK", new IndexDetails { IndexName = "AttendanceEventCategoryDescriptor_PK", TableName = "AttendanceEventCategoryDescriptor", ColumnNames = new List { "AttendanceEventCategoryDescriptorId" } } }, @@ -963,6 +985,7 @@ public IndexDetails GetIndexDetails(string indexName) { "FK_Section_SectionTypeDescriptor", new IndexDetails { IndexName = "FK_Section_SectionTypeDescriptor", TableName = "Section", ColumnNames = new List { "SectionTypeDescriptorId" } } }, { "Section_PK", new IndexDetails { IndexName = "Section_PK", TableName = "Section", ColumnNames = new List { "LocalCourseCode", "SchoolId", "SchoolYear", "SectionIdentifier", "SessionName" } } }, { "UX_Section_Id", new IndexDetails { IndexName = "UX_Section_Id", TableName = "Section", ColumnNames = new List { "Id" } } }, + { "Section504DisabilityTypeDescriptor_PK", new IndexDetails { IndexName = "Section504DisabilityTypeDescriptor_PK", TableName = "Section504DisabilityTypeDescriptor", ColumnNames = new List { "Section504DisabilityTypeDescriptorId" } } }, { "FK_SectionAttendanceTakenEvent_CalendarDate", new IndexDetails { IndexName = "FK_SectionAttendanceTakenEvent_CalendarDate", TableName = "SectionAttendanceTakenEvent", ColumnNames = new List { "CalendarCode", "Date", "SchoolId", "SchoolYear" } } }, { "FK_SectionAttendanceTakenEvent_Section", new IndexDetails { IndexName = "FK_SectionAttendanceTakenEvent_Section", TableName = "SectionAttendanceTakenEvent", ColumnNames = new List { "LocalCourseCode", "SchoolId", "SchoolYear", "SectionIdentifier", "SessionName" } } }, { "FK_SectionAttendanceTakenEvent_Staff", new IndexDetails { IndexName = "FK_SectionAttendanceTakenEvent_Staff", TableName = "SectionAttendanceTakenEvent", ColumnNames = new List { "StaffUSI" } } }, @@ -1225,6 +1248,28 @@ public IndexDetails GetIndexDetails(string indexName) { "StudentAssessmentPerformanceLevel_PK", new IndexDetails { IndexName = "StudentAssessmentPerformanceLevel_PK", TableName = "StudentAssessmentPerformanceLevel", ColumnNames = new List { "AssessmentIdentifier", "Namespace", "StudentAssessmentIdentifier", "StudentUSI", "AssessmentReportingMethodDescriptorId", "PerformanceLevelDescriptorId" } } }, { "FK_StudentAssessmentPeriod_AssessmentPeriodDescriptor", new IndexDetails { IndexName = "FK_StudentAssessmentPeriod_AssessmentPeriodDescriptor", TableName = "StudentAssessmentPeriod", ColumnNames = new List { "AssessmentPeriodDescriptorId" } } }, { "StudentAssessmentPeriod_PK", new IndexDetails { IndexName = "StudentAssessmentPeriod_PK", TableName = "StudentAssessmentPeriod", ColumnNames = new List { "AssessmentIdentifier", "Namespace", "StudentAssessmentIdentifier", "StudentUSI" } } }, + { "FK_StudentAssessmentRegistration_AssessmentAdministration", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_AssessmentAdministration", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "Namespace" } } }, + { "FK_StudentAssessmentRegistration_EducationOrganization", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_EducationOrganization", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "ReportingEducationOrganizationId" } } }, + { "FK_StudentAssessmentRegistration_EducationOrganization1", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_EducationOrganization1", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "TestingEducationOrganizationId" } } }, + { "FK_StudentAssessmentRegistration_GradeLevelDescriptor", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_GradeLevelDescriptor", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "AssessmentGradeLevelDescriptorId" } } }, + { "FK_StudentAssessmentRegistration_PlatformTypeDescriptor", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_PlatformTypeDescriptor", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "PlatformTypeDescriptorId" } } }, + { "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssessmentAccommodation", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssessmentAccommodation", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "EducationOrganizationId", "StudentUSI" } } }, + { "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssociation", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_StudentEducationOrganizationAssociation", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "EducationOrganizationId", "StudentUSI" } } }, + { "FK_StudentAssessmentRegistration_StudentSchoolAssociation", new IndexDetails { IndexName = "FK_StudentAssessmentRegistration_StudentSchoolAssociation", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "EntryDate", "SchoolId", "StudentUSI" } } }, + { "StudentAssessmentRegistration_PK", new IndexDetails { IndexName = "StudentAssessmentRegistration_PK", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI" } } }, + { "UX_StudentAssessmentRegistration_Id", new IndexDetails { IndexName = "UX_StudentAssessmentRegistration_Id", TableName = "StudentAssessmentRegistration", ColumnNames = new List { "Id" } } }, + { "FK_StudentAssessmentRegistrationAssessmentAccommodation_AccommodationDescriptor", new IndexDetails { IndexName = "FK_StudentAssessmentRegistrationAssessmentAccommodation_AccommodationDescriptor", TableName = "StudentAssessmentRegistrationAssessmentAccommodation", ColumnNames = new List { "AccommodationDescriptorId" } } }, + { "FK_StudentAssessmentRegistrationAssessmentAccommodation_StudentAssessmentRegistration", new IndexDetails { IndexName = "FK_StudentAssessmentRegistrationAssessmentAccommodation_StudentAssessmentRegistration", TableName = "StudentAssessmentRegistrationAssessmentAccommodation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI" } } }, + { "StudentAssessmentRegistrationAssessmentAccommodation_PK", new IndexDetails { IndexName = "StudentAssessmentRegistrationAssessmentAccommodation_PK", TableName = "StudentAssessmentRegistrationAssessmentAccommodation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI", "AccommodationDescriptorId" } } }, + { "FK_StudentAssessmentRegistrationAssessmentCustomization_StudentAssessmentRegistration", new IndexDetails { IndexName = "FK_StudentAssessmentRegistrationAssessmentCustomization_StudentAssessmentRegistration", TableName = "StudentAssessmentRegistrationAssessmentCustomization", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI" } } }, + { "StudentAssessmentRegistrationAssessmentCustomization_PK", new IndexDetails { IndexName = "StudentAssessmentRegistrationAssessmentCustomization_PK", TableName = "StudentAssessmentRegistrationAssessmentCustomization", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI", "CustomizationKey" } } }, + { "FK_StudentAssessmentRegistrationBatteryPartAssociation_AssessmentBatteryPart", new IndexDetails { IndexName = "FK_StudentAssessmentRegistrationBatteryPartAssociation_AssessmentBatteryPart", TableName = "StudentAssessmentRegistrationBatteryPartAssociation", ColumnNames = new List { "AssessmentBatteryPartName", "AssessmentIdentifier", "Namespace" } } }, + { "FK_StudentAssessmentRegistrationBatteryPartAssociation_StudentAssessmentRegistration", new IndexDetails { IndexName = "FK_StudentAssessmentRegistrationBatteryPartAssociation_StudentAssessmentRegistration", TableName = "StudentAssessmentRegistrationBatteryPartAssociation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI" } } }, + { "StudentAssessmentRegistrationBatteryPartAssociation_PK", new IndexDetails { IndexName = "StudentAssessmentRegistrationBatteryPartAssociation_PK", TableName = "StudentAssessmentRegistrationBatteryPartAssociation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentBatteryPartName", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI" } } }, + { "UX_StudentAssessmentRegistrationBatteryPartAssociation_Id", new IndexDetails { IndexName = "UX_StudentAssessmentRegistrationBatteryPartAssociation_Id", TableName = "StudentAssessmentRegistrationBatteryPartAssociation", ColumnNames = new List { "Id" } } }, + { "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_AccommodationDescriptor", new IndexDetails { IndexName = "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_AccommodationDescriptor", TableName = "StudentAssessmentRegistrationBatteryPartAssociationAccommodation", ColumnNames = new List { "AccommodationDescriptorId" } } }, + { "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_StudentAssessmentRegistrationBatteryPartAssociation", new IndexDetails { IndexName = "FK_StudentAssessmentRegistrationBatteryPartAssociationAccommodation_StudentAssessmentRegistrationBatteryPartAssociation", TableName = "StudentAssessmentRegistrationBatteryPartAssociationAccommodation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentBatteryPartName", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI" } } }, + { "StudentAssessmentRegistrationBatteryPartAssociationAccommodation_PK", new IndexDetails { IndexName = "StudentAssessmentRegistrationBatteryPartAssociationAccommodation_PK", TableName = "StudentAssessmentRegistrationBatteryPartAssociationAccommodation", ColumnNames = new List { "AdministrationIdentifier", "AssessmentBatteryPartName", "AssessmentIdentifier", "AssigningEducationOrganizationId", "EducationOrganizationId", "Namespace", "StudentUSI", "AccommodationDescriptorId" } } }, { "FK_StudentAssessmentScoreResult_AssessmentReportingMethodDescriptor", new IndexDetails { IndexName = "FK_StudentAssessmentScoreResult_AssessmentReportingMethodDescriptor", TableName = "StudentAssessmentScoreResult", ColumnNames = new List { "AssessmentReportingMethodDescriptorId" } } }, { "FK_StudentAssessmentScoreResult_ResultDatatypeTypeDescriptor", new IndexDetails { IndexName = "FK_StudentAssessmentScoreResult_ResultDatatypeTypeDescriptor", TableName = "StudentAssessmentScoreResult", ColumnNames = new List { "ResultDatatypeTypeDescriptorId" } } }, { "FK_StudentAssessmentScoreResult_StudentAssessment", new IndexDetails { IndexName = "FK_StudentAssessmentScoreResult_StudentAssessment", TableName = "StudentAssessmentScoreResult", ColumnNames = new List { "AssessmentIdentifier", "Namespace", "StudentAssessmentIdentifier", "StudentUSI" } } }, @@ -1285,6 +1330,13 @@ public IndexDetails GetIndexDetails(string indexName) { "FK_StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode_DisciplineIncidentParticipationCodeDescrip", new IndexDetails { IndexName = "FK_StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode_DisciplineIncidentParticipationCodeDescrip", TableName = "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode", ColumnNames = new List { "DisciplineIncidentParticipationCodeDescriptorId" } } }, { "FK_StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode_StudentDisciplineIncidentNonOffenderAssoci", new IndexDetails { IndexName = "FK_StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode_StudentDisciplineIncidentNonOffenderAssoci", TableName = "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode", ColumnNames = new List { "IncidentIdentifier", "SchoolId", "StudentUSI" } } }, { "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode_PK", new IndexDetails { IndexName = "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode_PK", TableName = "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode", ColumnNames = new List { "IncidentIdentifier", "SchoolId", "StudentUSI", "DisciplineIncidentParticipationCodeDescriptorId" } } }, + { "FK_StudentEducationOrganizationAssessmentAccommodation_EducationOrganization", new IndexDetails { IndexName = "FK_StudentEducationOrganizationAssessmentAccommodation_EducationOrganization", TableName = "StudentEducationOrganizationAssessmentAccommodation", ColumnNames = new List { "EducationOrganizationId" } } }, + { "FK_StudentEducationOrganizationAssessmentAccommodation_Student", new IndexDetails { IndexName = "FK_StudentEducationOrganizationAssessmentAccommodation_Student", TableName = "StudentEducationOrganizationAssessmentAccommodation", ColumnNames = new List { "StudentUSI" } } }, + { "StudentEducationOrganizationAssessmentAccommodation_PK", new IndexDetails { IndexName = "StudentEducationOrganizationAssessmentAccommodation_PK", TableName = "StudentEducationOrganizationAssessmentAccommodation", ColumnNames = new List { "EducationOrganizationId", "StudentUSI" } } }, + { "UX_StudentEducationOrganizationAssessmentAccommodation_Id", new IndexDetails { IndexName = "UX_StudentEducationOrganizationAssessmentAccommodation_Id", TableName = "StudentEducationOrganizationAssessmentAccommodation", ColumnNames = new List { "Id" } } }, + { "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_AccommodationDescriptor", new IndexDetails { IndexName = "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_AccommodationDescriptor", TableName = "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation", ColumnNames = new List { "AccommodationDescriptorId" } } }, + { "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_StudentEducationOrganizationAssessmentAccommodation", new IndexDetails { IndexName = "FK_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_StudentEducationOrganizationAssessmentAccommodation", TableName = "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation", ColumnNames = new List { "EducationOrganizationId", "StudentUSI" } } }, + { "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_PK", new IndexDetails { IndexName = "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation_PK", TableName = "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation", ColumnNames = new List { "EducationOrganizationId", "StudentUSI", "AccommodationDescriptorId" } } }, { "FK_StudentEducationOrganizationAssociation_BarrierToInternetAccessInResidenceDescriptor", new IndexDetails { IndexName = "FK_StudentEducationOrganizationAssociation_BarrierToInternetAccessInResidenceDescriptor", TableName = "StudentEducationOrganizationAssociation", ColumnNames = new List { "BarrierToInternetAccessInResidenceDescriptorId" } } }, { "FK_StudentEducationOrganizationAssociation_EducationOrganization", new IndexDetails { IndexName = "FK_StudentEducationOrganizationAssociation_EducationOrganization", TableName = "StudentEducationOrganizationAssociation", ColumnNames = new List { "EducationOrganizationId" } } }, { "FK_StudentEducationOrganizationAssociation_InternetAccessTypeInResidenceDescriptor", new IndexDetails { IndexName = "FK_StudentEducationOrganizationAssociation_InternetAccessTypeInResidenceDescriptor", TableName = "StudentEducationOrganizationAssociation", ColumnNames = new List { "InternetAccessTypeInResidenceDescriptorId" } } }, @@ -1505,6 +1557,8 @@ public IndexDetails GetIndexDetails(string indexName) { "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_SchoolFoodServiceProgramServiceDescriptor", new IndexDetails { IndexName = "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_SchoolFoodServiceProgramServiceDescriptor", TableName = "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService", ColumnNames = new List { "SchoolFoodServiceProgramServiceDescriptorId" } } }, { "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_StudentSchoolFoodServiceProgramAssociation", new IndexDetails { IndexName = "FK_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_StudentSchoolFoodServiceProgramAssociation", TableName = "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService", ColumnNames = new List { "BeginDate", "EducationOrganizationId", "ProgramEducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId", "StudentUSI" } } }, { "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_PK", new IndexDetails { IndexName = "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService_PK", TableName = "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService", ColumnNames = new List { "BeginDate", "EducationOrganizationId", "ProgramEducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId", "StudentUSI", "SchoolFoodServiceProgramServiceDescriptorId" } } }, + { "FK_StudentSection504ProgramAssociation_Section504DisabilityTypeDescriptor", new IndexDetails { IndexName = "FK_StudentSection504ProgramAssociation_Section504DisabilityTypeDescriptor", TableName = "StudentSection504ProgramAssociation", ColumnNames = new List { "Section504DisabilityTypeDescriptorId" } } }, + { "StudentSection504ProgramAssociation_PK", new IndexDetails { IndexName = "StudentSection504ProgramAssociation_PK", TableName = "StudentSection504ProgramAssociation", ColumnNames = new List { "BeginDate", "EducationOrganizationId", "ProgramEducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId", "StudentUSI" } } }, { "FK_StudentSectionAssociation_AttemptStatusDescriptor", new IndexDetails { IndexName = "FK_StudentSectionAssociation_AttemptStatusDescriptor", TableName = "StudentSectionAssociation", ColumnNames = new List { "AttemptStatusDescriptorId" } } }, { "FK_StudentSectionAssociation_RepeatIdentifierDescriptor", new IndexDetails { IndexName = "FK_StudentSectionAssociation_RepeatIdentifierDescriptor", TableName = "StudentSectionAssociation", ColumnNames = new List { "RepeatIdentifierDescriptorId" } } }, { "FK_StudentSectionAssociation_Section", new IndexDetails { IndexName = "FK_StudentSectionAssociation_Section", TableName = "StudentSectionAssociation", ColumnNames = new List { "LocalCourseCode", "SchoolId", "SchoolYear", "SectionIdentifier", "SessionName" } } }, @@ -1547,9 +1601,9 @@ public IndexDetails GetIndexDetails(string indexName) { "FK_StudentSpecialEducationProgramEligibilityAssociation_EligibilityEvaluationTypeDescriptor", new IndexDetails { IndexName = "FK_StudentSpecialEducationProgramEligibilityAssociation_EligibilityEvaluationTypeDescriptor", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "EligibilityEvaluationTypeDescriptorId" } } }, { "FK_StudentSpecialEducationProgramEligibilityAssociation_EvaluationDelayReasonDescriptor", new IndexDetails { IndexName = "FK_StudentSpecialEducationProgramEligibilityAssociation_EvaluationDelayReasonDescriptor", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "EvaluationDelayReasonDescriptorId" } } }, { "FK_StudentSpecialEducationProgramEligibilityAssociation_IDEAPartDescriptor", new IndexDetails { IndexName = "FK_StudentSpecialEducationProgramEligibilityAssociation_IDEAPartDescriptor", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "IDEAPartDescriptorId" } } }, - { "FK_StudentSpecialEducationProgramEligibilityAssociation_Program", new IndexDetails { IndexName = "FK_StudentSpecialEducationProgramEligibilityAssociation_Program", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "EducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId" } } }, + { "FK_StudentSpecialEducationProgramEligibilityAssociation_Program", new IndexDetails { IndexName = "FK_StudentSpecialEducationProgramEligibilityAssociation_Program", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "ProgramEducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId" } } }, { "FK_StudentSpecialEducationProgramEligibilityAssociation_Student", new IndexDetails { IndexName = "FK_StudentSpecialEducationProgramEligibilityAssociation_Student", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "StudentUSI" } } }, - { "StudentSpecialEducationProgramEligibilityAssociation_PK", new IndexDetails { IndexName = "StudentSpecialEducationProgramEligibilityAssociation_PK", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "ConsentToEvaluationReceivedDate", "EducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId", "StudentUSI" } } }, + { "StudentSpecialEducationProgramEligibilityAssociation_PK", new IndexDetails { IndexName = "StudentSpecialEducationProgramEligibilityAssociation_PK", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "ConsentToEvaluationReceivedDate", "EducationOrganizationId", "ProgramEducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId", "StudentUSI" } } }, { "UX_StudentSpecialEducationProgramEligibilityAssociation_Id", new IndexDetails { IndexName = "UX_StudentSpecialEducationProgramEligibilityAssociation_Id", TableName = "StudentSpecialEducationProgramEligibilityAssociation", ColumnNames = new List { "Id" } } }, { "FK_StudentTitleIPartAProgramAssociation_TitleIPartAParticipantDescriptor", new IndexDetails { IndexName = "FK_StudentTitleIPartAProgramAssociation_TitleIPartAParticipantDescriptor", TableName = "StudentTitleIPartAProgramAssociation", ColumnNames = new List { "TitleIPartAParticipantDescriptorId" } } }, { "StudentTitleIPartAProgramAssociation_PK", new IndexDetails { IndexName = "StudentTitleIPartAProgramAssociation_PK", TableName = "StudentTitleIPartAProgramAssociation", ColumnNames = new List { "BeginDate", "EducationOrganizationId", "ProgramEducationOrganizationId", "ProgramName", "ProgramTypeDescriptorId", "StudentUSI" } } }, diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs index 88d03192e9..09c601b23b 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs @@ -6444,378 +6444,21 @@ void IChildEntity.SetParent(object value) } } } -// Aggregate: AssessmentCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AssessmentCategoryDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.AssessmentCategoryDescriptor table of the AssessmentCategoryDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int AssessmentCategoryDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AssessmentCategoryDescriptorId", AssessmentCategoryDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor) target, null); - } - - } -} -// Aggregate: AssessmentIdentificationSystemDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AssessmentIdentificationSystemDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.AssessmentIdentificationSystemDescriptor table of the AssessmentIdentificationSystemDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int AssessmentIdentificationSystemDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- +// Aggregate: AssessmentAdministration - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AssessmentIdentificationSystemDescriptorId", AssessmentIdentificationSystemDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor) target, null); - } - - } -} -// Aggregate: AssessmentItem - -namespace EdFi.Ods.Entities.NHibernate.AssessmentItemAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentAdministrationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class AssessmentItemReferenceData : IHasPrimaryKeyValues + public class AssessmentAdministrationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + public virtual string AdministrationIdentifier { get; set; } public virtual string AssessmentIdentifier { get; set; } - public virtual string IdentificationCode { get; set; } + public virtual long AssigningEducationOrganizationId { get; set; } public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -6837,8 +6480,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("Namespace", Namespace); return keyValues; @@ -6890,21 +6534,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItem table of the AssessmentItem aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministration table of the AssessmentAdministration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItem : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssessmentAdministration : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentAdministration, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentItem() + public AssessmentAdministration() { - AssessmentItemLearningStandards = new HashSet(); - AssessmentItemPossibleResponses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentAdministrationAssessmentAdminstrationPeriods = new HashSet(); + AssessmentAdministrationAssessmentBatteryParts = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -6913,9 +6557,11 @@ public AssessmentItem() // Primary Key // ------------------------------------------------------------- [DomainSignature] + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] - public virtual string IdentificationCode { get; set; } + public virtual long AssigningEducationOrganizationId { get; set; } [DomainSignature] public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -6928,45 +6574,6 @@ public AssessmentItem() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AssessmentItemCategoryDescriptorId - { - get - { - if (_assessmentItemCategoryDescriptorId == default(int?)) - _assessmentItemCategoryDescriptorId = string.IsNullOrWhiteSpace(_assessmentItemCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptor); - - return _assessmentItemCategoryDescriptorId; - } - set - { - _assessmentItemCategoryDescriptorId = value; - _assessmentItemCategoryDescriptor = null; - } - } - - private int? _assessmentItemCategoryDescriptorId; - private string _assessmentItemCategoryDescriptor; - - public virtual string AssessmentItemCategoryDescriptor - { - get - { - if (_assessmentItemCategoryDescriptor == null) - _assessmentItemCategoryDescriptor = _assessmentItemCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptorId.Value); - - return _assessmentItemCategoryDescriptor; - } - set - { - _assessmentItemCategoryDescriptor = value; - _assessmentItemCategoryDescriptorId = default(int?); - } - } - public virtual string AssessmentItemURI { get; set; } - public virtual string ExpectedTimeAssessed { get; set; } - public virtual string ItemText { get; set; } - public virtual decimal? MaxRawScore { get; set; } - public virtual string Nomenclature { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -7016,7 +6623,7 @@ public IDictionary Extensions /// /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentAdministration.AssessmentDiscriminator { get { return AssessmentReferenceData?.Discriminator; } set { } @@ -7025,21 +6632,41 @@ string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator /// /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentItem.AssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentAdministration.AssessmentResourceId { get { return AssessmentReferenceData?.Id; } set { } } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData AssigningEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the AssigningEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationDiscriminator + { + get { return AssigningEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the AssigningEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationResourceId + { + get { return AssigningEducationOrganizationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _assessmentItemLearningStandards; - private ICollection _assessmentItemLearningStandardsCovariant; - public virtual ICollection AssessmentItemLearningStandards + private ICollection _assessmentAdministrationAssessmentAdminstrationPeriods; + private ICollection _assessmentAdministrationAssessmentAdminstrationPeriodsCovariant; + public virtual ICollection AssessmentAdministrationAssessmentAdminstrationPeriods { get { @@ -7048,45 +6675,45 @@ public virtual ICollection(value); + _assessmentAdministrationAssessmentAdminstrationPeriods = value; + _assessmentAdministrationAssessmentAdminstrationPeriodsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemLearningStandards + ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationAssessmentAdminstrationPeriods { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _assessmentItemLearningStandards) - if (item.AssessmentItem == null) - item.AssessmentItem = this; + foreach (var item in _assessmentAdministrationAssessmentAdminstrationPeriods) + if (item.AssessmentAdministration == null) + item.AssessmentAdministration = this; // ------------------------------------------------------------- - return _assessmentItemLearningStandardsCovariant; + return _assessmentAdministrationAssessmentAdminstrationPeriodsCovariant; } set { - AssessmentItemLearningStandards = new HashSet(value.Cast()); + AssessmentAdministrationAssessmentAdminstrationPeriods = new HashSet(value.Cast()); } } - private ICollection _assessmentItemPossibleResponses; - private ICollection _assessmentItemPossibleResponsesCovariant; - public virtual ICollection AssessmentItemPossibleResponses + private ICollection _assessmentAdministrationAssessmentBatteryParts; + private ICollection _assessmentAdministrationAssessmentBatteryPartsCovariant; + public virtual ICollection AssessmentAdministrationAssessmentBatteryParts { get { @@ -7095,38 +6722,38 @@ public virtual ICollection(value); + _assessmentAdministrationAssessmentBatteryParts = value; + _assessmentAdministrationAssessmentBatteryPartsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemPossibleResponses + ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationAssessmentBatteryParts { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _assessmentItemPossibleResponses) - if (item.AssessmentItem == null) - item.AssessmentItem = this; + foreach (var item in _assessmentAdministrationAssessmentBatteryParts) + if (item.AssessmentAdministration == null) + item.AssessmentAdministration = this; // ------------------------------------------------------------- - return _assessmentItemPossibleResponsesCovariant; + return _assessmentAdministrationAssessmentBatteryPartsCovariant; } set { - AssessmentItemPossibleResponses = new HashSet(value.Cast()); + AssessmentAdministrationAssessmentBatteryParts = new HashSet(value.Cast()); } } @@ -7135,7 +6762,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentItemCategoryDescriptor", new LookupColumnDetails { PropertyName = "AssessmentItemCategoryDescriptorId", LookupTypeName = "AssessmentItemCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -7150,8 +6776,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("Namespace", Namespace); return keyValues; @@ -7216,12 +6843,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItem)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministration)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItem) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministration) target, null); } } @@ -7229,19 +6856,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItemLearningStandard table of the AssessmentItem aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministrationAssessmentAdminstrationPeriod table of the AssessmentAdministration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItemLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentItemLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssessmentAdministrationAssessmentAdminstrationPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentItemLearningStandard() + public AssessmentAdministrationAssessmentAdminstrationPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -7250,16 +6877,24 @@ public AssessmentItemLearningStandard() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual AssessmentItem AssessmentItem { get; set; } + public virtual AssessmentAdministration AssessmentAdministration { get; set; } - Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentItem + Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationAssessmentAdminstrationPeriod.AssessmentAdministration { - get { return AssessmentItem; } - set { AssessmentItem = (AssessmentItem) value; } + get { return AssessmentAdministration; } + set { AssessmentAdministration = (AssessmentAdministration) value; } } [DomainSignature] - public virtual string LearningStandardId { get; set; } + public virtual DateTime BeginDate + { + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _beginDate; + // ------------------------------------------------------------- // ============================================================= @@ -7270,6 +6905,25 @@ Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentI // ============================================================= // Properties // ------------------------------------------------------------- + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -7314,26 +6968,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardResourceId - { - get { return LearningStandardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -7355,10 +6989,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentItem as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentAdministration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -7422,36 +7056,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItemLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod) target, null); } void IChildEntity.SetParent(object value) { - AssessmentItem = (AssessmentItem) value; + AssessmentAdministration = (AssessmentAdministration) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItemPossibleResponse table of the AssessmentItem aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministrationAssessmentBatteryPart table of the AssessmentAdministration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItemPossibleResponse : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentItemPossibleResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssessmentAdministrationAssessmentBatteryPart : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentItemPossibleResponse() + public AssessmentAdministrationAssessmentBatteryPart() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -7460,16 +7094,16 @@ public AssessmentItemPossibleResponse() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual AssessmentItem AssessmentItem { get; set; } + public virtual AssessmentAdministration AssessmentAdministration { get; set; } - Entities.Common.EdFi.IAssessmentItem IAssessmentItemPossibleResponse.AssessmentItem + Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationAssessmentBatteryPart.AssessmentAdministration { - get { return AssessmentItem; } - set { AssessmentItem = (AssessmentItem) value; } + get { return AssessmentAdministration; } + set { AssessmentAdministration = (AssessmentAdministration) value; } } [DomainSignature] - public virtual string ResponseValue { get; set; } + public virtual string AssessmentBatteryPartName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -7480,8 +7114,6 @@ Entities.Common.EdFi.IAssessmentItem IAssessmentItemPossibleResponse.AssessmentI // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool? CorrectResponse { get; set; } - public virtual string ResponseDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -7526,6 +7158,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartReferenceData AssessmentBatteryPartReferenceData { get; set; } + + /// + /// Read-only property that allows the AssessmentBatteryPart discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartDiscriminator + { + get { return AssessmentBatteryPartReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the AssessmentBatteryPart resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartResourceId + { + get { return AssessmentBatteryPartReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -7547,10 +7199,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentItem as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentAdministration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ResponseValue", ResponseValue); + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); return keyValues; } @@ -7614,81 +7266,140 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart) target, null); } void IChildEntity.SetParent(object value) { - AssessmentItem = (AssessmentItem) value; + AssessmentAdministration = (AssessmentAdministration) value; } } } -// Aggregate: AssessmentItemCategoryDescriptor +// Aggregate: AssessmentBatteryPart -namespace EdFi.Ods.Entities.NHibernate.AssessmentItemCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentBatteryPartAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class AssessmentBatteryPartReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string AssessmentBatteryPartName { get; set; } + public virtual string AssessmentIdentifier { get; set; } + public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItemCategoryDescriptor table of the AssessmentItemCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentBatteryPart table of the AssessmentBatteryPart aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItemCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentItemCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentBatteryPart : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentBatteryPart, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentBatteryPart() + { + AssessmentBatteryPartObjectiveAssessments = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AssessmentItemCategoryDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual string AssessmentBatteryPartName { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -7704,16 +7415,112 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentDiscriminator + { + get { return AssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentResourceId + { + get { return AssessmentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _assessmentBatteryPartObjectiveAssessments; + private ICollection _assessmentBatteryPartObjectiveAssessmentsCovariant; + public virtual ICollection AssessmentBatteryPartObjectiveAssessments + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentBatteryPartObjectiveAssessments) + if (item.AssessmentBatteryPart == null) + item.AssessmentBatteryPart = this; + // ------------------------------------------------------------- + + return _assessmentBatteryPartObjectiveAssessments; + } + set + { + _assessmentBatteryPartObjectiveAssessments = value; + _assessmentBatteryPartObjectiveAssessmentsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentBatteryPartObjectiveAssessments + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentBatteryPartObjectiveAssessments) + if (item.AssessmentBatteryPart == null) + item.AssessmentBatteryPart = this; + // ------------------------------------------------------------- + + return _assessmentBatteryPartObjectiveAssessmentsCovariant; + } + set + { + AssessmentBatteryPartObjectiveAssessments = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map @@ -7733,7 +7540,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentItemCategoryDescriptorId", AssessmentItemCategoryDescriptorId); + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); return keyValues; } @@ -7797,77 +7606,55 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentBatteryPart)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentBatteryPart) target, null); } } -} -// Aggregate: AssessmentItemResultDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AssessmentItemResultDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItemResultDescriptor table of the AssessmentItemResultDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentBatteryPartObjectiveAssessment table of the AssessmentBatteryPart aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItemResultDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentItemResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentBatteryPartObjectiveAssessment : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentBatteryPartObjectiveAssessment() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int AssessmentItemResultDescriptorId + [DomainSignature, JsonIgnore] + public virtual AssessmentBatteryPart AssessmentBatteryPart { get; set; } + + Entities.Common.EdFi.IAssessmentBatteryPart IAssessmentBatteryPartObjectiveAssessment.AssessmentBatteryPart { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return AssessmentBatteryPart; } + set { AssessmentBatteryPart = (AssessmentBatteryPart) value; } } - + + [DomainSignature] + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -7883,11 +7670,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentDiscriminator + { + get { return ObjectiveAssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentResourceId + { + get { return ObjectiveAssessmentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -7908,11 +7744,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (AssessmentBatteryPart as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AssessmentItemResultDescriptorId", AssessmentItemResultDescriptorId); + keyValues.Add("IdentificationCode", IdentificationCode); return keyValues; } @@ -7976,37 +7812,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment) target, null); } + void IChildEntity.SetParent(object value) + { + AssessmentBatteryPart = (AssessmentBatteryPart) value; + } } } -// Aggregate: AssessmentPeriodDescriptor +// Aggregate: AssessmentCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.AssessmentPeriodDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentPeriodDescriptor table of the AssessmentPeriodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentCategoryDescriptor table of the AssessmentCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AssessmentPeriodDescriptorId + public virtual int AssessmentCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -8091,7 +7931,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentPeriodDescriptorId", AssessmentPeriodDescriptorId); + keyValues.Add("AssessmentCategoryDescriptorId", AssessmentCategoryDescriptorId); return keyValues; } @@ -8155,37 +7995,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor) target, null); } } } -// Aggregate: AssessmentReportingMethodDescriptor +// Aggregate: AssessmentIdentificationSystemDescriptor -namespace EdFi.Ods.Entities.NHibernate.AssessmentReportingMethodDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentIdentificationSystemDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentReportingMethodDescriptor table of the AssessmentReportingMethodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentIdentificationSystemDescriptor table of the AssessmentIdentificationSystemDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentReportingMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentReportingMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId + public virtual int AssessmentIdentificationSystemDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -8270,7 +8110,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("AssessmentIdentificationSystemDescriptorId", AssessmentIdentificationSystemDescriptorId); return keyValues; } @@ -8334,31 +8174,31 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor) target, null); } } } -// Aggregate: AssessmentScoreRangeLearningStandard +// Aggregate: AssessmentItem -namespace EdFi.Ods.Entities.NHibernate.AssessmentScoreRangeLearningStandardAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentItemAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class AssessmentScoreRangeLearningStandardReferenceData : IHasPrimaryKeyValues + public class AssessmentItemReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- public virtual string AssessmentIdentifier { get; set; } + public virtual string IdentificationCode { get; set; } public virtual string Namespace { get; set; } - public virtual string ScoreRangeId { get; set; } // ------------------------------------------------------------- /// @@ -8380,8 +8220,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("IdentificationCode", IdentificationCode); keyValues.Add("Namespace", Namespace); - keyValues.Add("ScoreRangeId", ScoreRangeId); return keyValues; } @@ -8432,20 +8272,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentScoreRangeLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItem table of the AssessmentItem aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandard : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssessmentItem : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentScoreRangeLearningStandard() + public AssessmentItem() { - AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentItemLearningStandards = new HashSet(); + AssessmentItemPossibleResponses = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -8456,9 +8297,9 @@ public AssessmentScoreRangeLearningStandard() [DomainSignature] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] - public virtual string Namespace { get; set; } + public virtual string IdentificationCode { get; set; } [DomainSignature] - public virtual string ScoreRangeId { get; set; } + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -8469,43 +8310,45 @@ public AssessmentScoreRangeLearningStandard() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AssessmentReportingMethodDescriptorId + public virtual int? AssessmentItemCategoryDescriptorId { get { - if (_assessmentReportingMethodDescriptorId == default(int?)) - _assessmentReportingMethodDescriptorId = string.IsNullOrWhiteSpace(_assessmentReportingMethodDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + if (_assessmentItemCategoryDescriptorId == default(int?)) + _assessmentItemCategoryDescriptorId = string.IsNullOrWhiteSpace(_assessmentItemCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptor); - return _assessmentReportingMethodDescriptorId; + return _assessmentItemCategoryDescriptorId; } set { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; + _assessmentItemCategoryDescriptorId = value; + _assessmentItemCategoryDescriptor = null; } } - private int? _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; + private int? _assessmentItemCategoryDescriptorId; + private string _assessmentItemCategoryDescriptor; - public virtual string AssessmentReportingMethodDescriptor + public virtual string AssessmentItemCategoryDescriptor { get { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = _assessmentReportingMethodDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId.Value); + if (_assessmentItemCategoryDescriptor == null) + _assessmentItemCategoryDescriptor = _assessmentItemCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptorId.Value); - return _assessmentReportingMethodDescriptor; + return _assessmentItemCategoryDescriptor; } set { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int?); + _assessmentItemCategoryDescriptor = value; + _assessmentItemCategoryDescriptorId = default(int?); } } - public virtual string IdentificationCode { get; set; } - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } + public virtual string AssessmentItemURI { get; set; } + public virtual string ExpectedTimeAssessed { get; set; } + public virtual string ItemText { get; set; } + public virtual decimal? MaxRawScore { get; set; } + public virtual string Nomenclature { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -8555,7 +8398,7 @@ public IDictionary Extensions /// /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator { get { return AssessmentReferenceData?.Discriminator; } set { } @@ -8564,41 +8407,21 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDisc /// /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentItem.AssessmentResourceId { get { return AssessmentReferenceData?.Id; } set { } } - public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } - - /// - /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentDiscriminator - { - get { return ObjectiveAssessmentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentResourceId - { - get { return ObjectiveAssessmentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _assessmentScoreRangeLearningStandardLearningStandards; - private ICollection _assessmentScoreRangeLearningStandardLearningStandardsCovariant; - public virtual ICollection AssessmentScoreRangeLearningStandardLearningStandards + private ICollection _assessmentItemLearningStandards; + private ICollection _assessmentItemLearningStandardsCovariant; + public virtual ICollection AssessmentItemLearningStandards { get { @@ -8607,38 +8430,85 @@ public virtual ICollection(value); - } + _assessmentItemLearningStandards = value; + _assessmentItemLearningStandardsCovariant = new CovariantCollectionAdapter(value); + } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentScoreRangeLearningStandardLearningStandards + ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemLearningStandards { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) - if (item.AssessmentScoreRangeLearningStandard == null) - item.AssessmentScoreRangeLearningStandard = this; + foreach (var item in _assessmentItemLearningStandards) + if (item.AssessmentItem == null) + item.AssessmentItem = this; // ------------------------------------------------------------- - return _assessmentScoreRangeLearningStandardLearningStandardsCovariant; + return _assessmentItemLearningStandardsCovariant; } set { - AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(value.Cast()); + AssessmentItemLearningStandards = new HashSet(value.Cast()); + } + } + + + private ICollection _assessmentItemPossibleResponses; + private ICollection _assessmentItemPossibleResponsesCovariant; + public virtual ICollection AssessmentItemPossibleResponses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentItemPossibleResponses) + if (item.AssessmentItem == null) + item.AssessmentItem = this; + // ------------------------------------------------------------- + + return _assessmentItemPossibleResponses; + } + set + { + _assessmentItemPossibleResponses = value; + _assessmentItemPossibleResponsesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemPossibleResponses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentItemPossibleResponses) + if (item.AssessmentItem == null) + item.AssessmentItem = this; + // ------------------------------------------------------------- + + return _assessmentItemPossibleResponsesCovariant; + } + set + { + AssessmentItemPossibleResponses = new HashSet(value.Cast()); } } @@ -8647,7 +8517,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "AssessmentItemCategoryDescriptor", new LookupColumnDetails { PropertyName = "AssessmentItemCategoryDescriptorId", LookupTypeName = "AssessmentItemCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -8663,8 +8533,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("IdentificationCode", IdentificationCode); keyValues.Add("Namespace", Namespace); - keyValues.Add("ScoreRangeId", ScoreRangeId); return keyValues; } @@ -8728,12 +8598,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItem)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItem) target, null); } } @@ -8741,19 +8611,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentScoreRangeLearningStandardLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItemLearningStandard table of the AssessmentItem aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandardLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssessmentItemLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentItemLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentScoreRangeLearningStandardLearningStandard() + public AssessmentItemLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -8762,12 +8632,12 @@ public AssessmentScoreRangeLearningStandardLearningStandard() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual AssessmentScoreRangeLearningStandard AssessmentScoreRangeLearningStandard { get; set; } + public virtual AssessmentItem AssessmentItem { get; set; } - Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard IAssessmentScoreRangeLearningStandardLearningStandard.AssessmentScoreRangeLearningStandard + Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentItem { - get { return AssessmentScoreRangeLearningStandard; } - set { AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; } + get { return AssessmentItem; } + set { AssessmentItem = (AssessmentItem) value; } } [DomainSignature] @@ -8831,7 +8701,7 @@ public IDictionary Extensions /// /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardDiscriminator + string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardDiscriminator { get { return LearningStandardReferenceData?.Discriminator; } set { } @@ -8840,7 +8710,7 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandar /// /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardResourceId + Guid? Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardResourceId { get { return LearningStandardReferenceData?.Id; } set { } @@ -8867,7 +8737,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentScoreRangeLearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentItem as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("LearningStandardId", LearningStandardId); @@ -8934,41 +8804,233 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItemLearningStandard) target, null); } void IChildEntity.SetParent(object value) { - AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; + AssessmentItem = (AssessmentItem) value; + } + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AssessmentItemPossibleResponse table of the AssessmentItem aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class AssessmentItemPossibleResponse : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentItemPossibleResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentItemPossibleResponse() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual AssessmentItem AssessmentItem { get; set; } + + Entities.Common.EdFi.IAssessmentItem IAssessmentItemPossibleResponse.AssessmentItem + { + get { return AssessmentItem; } + set { AssessmentItem = (AssessmentItem) value; } + } + + [DomainSignature] + public virtual string ResponseValue { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual bool? CorrectResponse { get; set; } + public virtual string ResponseDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (AssessmentItem as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("ResponseValue", ResponseValue); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse) target, null); + } + + void IChildEntity.SetParent(object value) + { + AssessmentItem = (AssessmentItem) value; } } } -// Aggregate: AssignmentLateStatusDescriptor +// Aggregate: AssessmentItemCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.AssignmentLateStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentItemCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssignmentLateStatusDescriptor table of the AssignmentLateStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItemCategoryDescriptor table of the AssessmentItemCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssignmentLateStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssignmentLateStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentItemCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentItemCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AssignmentLateStatusDescriptorId + public virtual int AssessmentItemCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -9053,7 +9115,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssignmentLateStatusDescriptorId", AssignmentLateStatusDescriptorId); + keyValues.Add("AssessmentItemCategoryDescriptorId", AssessmentItemCategoryDescriptorId); return keyValues; } @@ -9117,37 +9179,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor) target, null); } } } -// Aggregate: AttemptStatusDescriptor +// Aggregate: AssessmentItemResultDescriptor -namespace EdFi.Ods.Entities.NHibernate.AttemptStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentItemResultDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AttemptStatusDescriptor table of the AttemptStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItemResultDescriptor table of the AssessmentItemResultDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AttemptStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAttemptStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentItemResultDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentItemResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AttemptStatusDescriptorId + public virtual int AssessmentItemResultDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -9232,7 +9294,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AttemptStatusDescriptorId", AttemptStatusDescriptorId); + keyValues.Add("AssessmentItemResultDescriptorId", AssessmentItemResultDescriptorId); return keyValues; } @@ -9296,37 +9358,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAttemptStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAttemptStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor) target, null); } } } -// Aggregate: AttendanceEventCategoryDescriptor +// Aggregate: AssessmentPeriodDescriptor -namespace EdFi.Ods.Entities.NHibernate.AttendanceEventCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentPeriodDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AttendanceEventCategoryDescriptor table of the AttendanceEventCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentPeriodDescriptor table of the AssessmentPeriodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AttendanceEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAttendanceEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AttendanceEventCategoryDescriptorId + public virtual int AssessmentPeriodDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -9411,7 +9473,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AttendanceEventCategoryDescriptorId", AttendanceEventCategoryDescriptorId); + keyValues.Add("AssessmentPeriodDescriptorId", AssessmentPeriodDescriptorId); return keyValues; } @@ -9475,138 +9537,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor) target, null); } } } -// Aggregate: BalanceSheetDimension +// Aggregate: AssessmentReportingMethodDescriptor -namespace EdFi.Ods.Entities.NHibernate.BalanceSheetDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentReportingMethodDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class BalanceSheetDimensionReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BalanceSheetDimension table of the BalanceSheetDimension aggregate in the ODS database. + /// A class which represents the edfi.AssessmentReportingMethodDescriptor table of the AssessmentReportingMethodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BalanceSheetDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IBalanceSheetDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssessmentReportingMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentReportingMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public BalanceSheetDimension() - { - BalanceSheetDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string Code { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual int AssessmentReportingMethodDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -9617,35 +9623,6 @@ public BalanceSheetDimension() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -9656,53 +9633,6 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _balanceSheetDimensionReportingTags; - private ICollection _balanceSheetDimensionReportingTagsCovariant; - public virtual ICollection BalanceSheetDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _balanceSheetDimensionReportingTags) - if (item.BalanceSheetDimension == null) - item.BalanceSheetDimension = this; - // ------------------------------------------------------------- - - return _balanceSheetDimensionReportingTags; - } - set - { - _balanceSheetDimensionReportingTags = value; - _balanceSheetDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBalanceSheetDimension.BalanceSheetDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _balanceSheetDimensionReportingTags) - if (item.BalanceSheetDimension == null) - item.BalanceSheetDimension = this; - // ------------------------------------------------------------- - - return _balanceSheetDimensionReportingTagsCovariant; - } - set - { - BalanceSheetDimensionReportingTags = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -9722,8 +9652,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); return keyValues; } @@ -9787,32 +9716,118 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBalanceSheetDimension) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor) target, null); + } + + } +} +// Aggregate: AssessmentScoreRangeLearningStandard + +namespace EdFi.Ods.Entities.NHibernate.AssessmentScoreRangeLearningStandardAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class AssessmentScoreRangeLearningStandardReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string AssessmentIdentifier { get; set; } + public virtual string Namespace { get; set; } + public virtual string ScoreRangeId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + keyValues.Add("ScoreRangeId", ScoreRangeId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; } + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BalanceSheetDimensionReportingTag table of the BalanceSheetDimension aggregate in the ODS database. + /// A class which represents the edfi.AssessmentScoreRangeLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BalanceSheetDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBalanceSheetDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssessmentScoreRangeLearningStandard : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public BalanceSheetDimensionReportingTag() + public AssessmentScoreRangeLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -9820,60 +9835,59 @@ public BalanceSheetDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual BalanceSheetDimension BalanceSheetDimension { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual string ScoreRangeId { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.IBalanceSheetDimension IBalanceSheetDimensionReportingTag.BalanceSheetDimension - { - get { return BalanceSheetDimension; } - set { BalanceSheetDimension = (BalanceSheetDimension) value; } - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - [DomainSignature] - public virtual int ReportingTagDescriptorId + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int? AssessmentReportingMethodDescriptorId { get { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + if (_assessmentReportingMethodDescriptorId == default(int?)) + _assessmentReportingMethodDescriptorId = string.IsNullOrWhiteSpace(_assessmentReportingMethodDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - return _reportingTagDescriptorId; + return _assessmentReportingMethodDescriptorId; } set { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; } } - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; + private int? _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; - public virtual string ReportingTagDescriptor + public virtual string AssessmentReportingMethodDescriptor { get { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = _assessmentReportingMethodDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId.Value); - return _reportingTagDescriptor; + return _assessmentReportingMethodDescriptor; } set { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int?); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + public virtual string IdentificationCode { get; set; } + public virtual string MaximumScore { get; set; } + public virtual string MinimumScore { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -9918,200 +9932,104 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, - }; + public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + /// + /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDiscriminator { - get { return _idPropertyByLookupProperty; } + get { return AssessmentReferenceData?.Discriminator; } + set { } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + /// + /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentResourceId { - // Get parent key values - var keyValues = (BalanceSheetDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + get { return AssessmentReferenceData?.Id; } + set { } + } - // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } - return keyValues; + /// + /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentDiscriminator + { + get { return ObjectiveAssessmentReferenceData?.Discriminator; } + set { } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + /// + /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentResourceId { - var compareTo = obj as IHasPrimaryKeyValues; + get { return ObjectiveAssessmentReferenceData?.Id; } + set { } + } - if (ReferenceEquals(this, compareTo)) - return true; + // ------------------------------------------------------------- - if (compareTo == null) - return false; + //============================================================= + // Collections + // ------------------------------------------------------------- - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + private ICollection _assessmentScoreRangeLearningStandardLearningStandards; + private ICollection _assessmentScoreRangeLearningStandardLearningStandardsCovariant; + public virtual ICollection AssessmentScoreRangeLearningStandardLearningStandards + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) + if (item.AssessmentScoreRangeLearningStandard == null) + item.AssessmentScoreRangeLearningStandard = this; + // ------------------------------------------------------------- - foreach (DictionaryEntry entry in theseKeys) + return _assessmentScoreRangeLearningStandardLearningStandards; + } + set { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + _assessmentScoreRangeLearningStandardLearningStandards = value; + _assessmentScoreRangeLearningStandardLearningStandardsCovariant = new CovariantCollectionAdapter(value); } - - return true; } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentScoreRangeLearningStandardLearningStandards { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) + if (item.AssessmentScoreRangeLearningStandard == null) + item.AssessmentScoreRangeLearningStandard = this; + // ------------------------------------------------------------- - foreach (DictionaryEntry entry in keyValues) + return _assessmentScoreRangeLearningStandardLearningStandardsCovariant; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(value.Cast()); } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag) target, null); - } - - void IChildEntity.SetParent(object value) - { - BalanceSheetDimension = (BalanceSheetDimension) value; - } - } -} -// Aggregate: BarrierToInternetAccessInResidenceDescriptor - -namespace EdFi.Ods.Entities.NHibernate.BarrierToInternetAccessInResidenceDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.BarrierToInternetAccessInResidenceDescriptor table of the BarrierToInternetAccessInResidenceDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class BarrierToInternetAccessInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int BarrierToInternetAccessInResidenceDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -10126,7 +10044,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BarrierToInternetAccessInResidenceDescriptorId", BarrierToInternetAccessInResidenceDescriptorId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + keyValues.Add("ScoreRangeId", ScoreRangeId); return keyValues; } @@ -10190,77 +10110,55 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard) target, null); } } -} -// Aggregate: BehaviorDescriptor - -namespace EdFi.Ods.Entities.NHibernate.BehaviorDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BehaviorDescriptor table of the BehaviorDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentScoreRangeLearningStandardLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BehaviorDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IBehaviorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AssessmentScoreRangeLearningStandardLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentScoreRangeLearningStandardLearningStandard() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int BehaviorDescriptorId + [DomainSignature, JsonIgnore] + public virtual AssessmentScoreRangeLearningStandard AssessmentScoreRangeLearningStandard { get; set; } + + Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard IAssessmentScoreRangeLearningStandardLearningStandard.AssessmentScoreRangeLearningStandard { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return AssessmentScoreRangeLearningStandard; } + set { AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; } } - + + [DomainSignature] + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -10276,11 +10174,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardDiscriminator + { + get { return LearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardResourceId + { + get { return LearningStandardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -10301,11 +10248,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (AssessmentScoreRangeLearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -10369,30 +10316,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBehaviorDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBehaviorDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard) target, null); } + void IChildEntity.SetParent(object value) + { + AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; + } } } -// Aggregate: BellSchedule +// Aggregate: AssesssmentAdministrationParticipation -namespace EdFi.Ods.Entities.NHibernate.BellScheduleAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssesssmentAdministrationParticipationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class BellScheduleReferenceData : IHasPrimaryKeyValues + public class AssesssmentAdministrationParticipationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string BellScheduleName { get; set; } - public virtual long SchoolId { get; set; } + public virtual string AdministrationIdentifier { get; set; } + public virtual string AssessmentIdentifier { get; set; } + public virtual long AssigningEducationOrganizationId { get; set; } + public virtual string Namespace { get; set; } + public virtual long ParticipatingEducationOrganizationId { get; set; } // ------------------------------------------------------------- /// @@ -10413,8 +10367,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BellScheduleName", BellScheduleName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); + keyValues.Add("Namespace", Namespace); + keyValues.Add("ParticipatingEducationOrganizationId", ParticipatingEducationOrganizationId); return keyValues; } @@ -10465,22 +10422,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellSchedule table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AssesssmentAdministrationParticipation table of the AssesssmentAdministrationParticipation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellSchedule : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IBellSchedule, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssesssmentAdministrationParticipation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssesssmentAdministrationParticipation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public BellSchedule() + public AssesssmentAdministrationParticipation() { - BellScheduleClassPeriods = new HashSet(); - BellScheduleDates = new HashSet(); - BellScheduleGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssesssmentAdministrationParticipationAdministrationPointOfContacts = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -10489,9 +10444,15 @@ public BellSchedule() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string BellScheduleName { get; set; } + public virtual string AdministrationIdentifier { get; set; } [DomainSignature] - public virtual long SchoolId { get; set; } + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual long AssigningEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual long ParticipatingEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10502,10 +10463,6 @@ public BellSchedule() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AlternateDayName { get; set; } - public virtual TimeSpan? EndTime { get; set; } - public virtual TimeSpan? StartTime { get; set; } - public virtual int? TotalInstructionalTime { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10550,120 +10507,55 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + public virtual NHibernate.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationReferenceData AssessmentAdministrationReferenceData { get; set; } /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentAdministration discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IBellSchedule.SchoolResourceId + string Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssessmentAdministrationDiscriminator { - get { return SchoolReferenceData?.Id; } + get { return AssessmentAdministrationReferenceData?.Discriminator; } set { } } - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _bellScheduleClassPeriods; - private ICollection _bellScheduleClassPeriodsCovariant; - public virtual ICollection BellScheduleClassPeriods - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleClassPeriods) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- - - return _bellScheduleClassPeriods; - } - set - { - _bellScheduleClassPeriods = value; - _bellScheduleClassPeriodsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleClassPeriods + /// + /// Read-only property that allows the AssessmentAdministration resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssessmentAdministrationResourceId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleClassPeriods) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- - - return _bellScheduleClassPeriodsCovariant; - } - set - { - BellScheduleClassPeriods = new HashSet(value.Cast()); - } + get { return AssessmentAdministrationReferenceData?.Id; } + set { } } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParticipatingEducationOrganizationReferenceData { get; set; } - private ICollection _bellScheduleDates; - private ICollection _bellScheduleDatesCovariant; - public virtual ICollection BellScheduleDates + /// + /// Read-only property that allows the ParticipatingEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssesssmentAdministrationParticipation.ParticipatingEducationOrganizationDiscriminator { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleDates) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- - - return _bellScheduleDates; - } - set - { - _bellScheduleDates = value; - _bellScheduleDatesCovariant = new CovariantCollectionAdapter(value); - } + get { return ParticipatingEducationOrganizationReferenceData?.Discriminator; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleDates + /// + /// Read-only property that allows the ParticipatingEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssesssmentAdministrationParticipation.ParticipatingEducationOrganizationResourceId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleDates) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- - - return _bellScheduleDatesCovariant; - } - set - { - BellScheduleDates = new HashSet(value.Cast()); - } + get { return ParticipatingEducationOrganizationReferenceData?.Id; } + set { } } + // ------------------------------------------------------------- - private ICollection _bellScheduleGradeLevels; - private ICollection _bellScheduleGradeLevelsCovariant; - public virtual ICollection BellScheduleGradeLevels + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _assesssmentAdministrationParticipationAdministrationPointOfContacts; + private ICollection _assesssmentAdministrationParticipationAdministrationPointOfContactsCovariant; + public virtual ICollection AssesssmentAdministrationParticipationAdministrationPointOfContacts { get { @@ -10672,38 +10564,38 @@ public virtual ICollection(value); + _assesssmentAdministrationParticipationAdministrationPointOfContacts = value; + _assesssmentAdministrationParticipationAdministrationPointOfContactsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleGradeLevels + ICollection Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssesssmentAdministrationParticipationAdministrationPointOfContacts { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _bellScheduleGradeLevels) - if (item.BellSchedule == null) - item.BellSchedule = this; + foreach (var item in _assesssmentAdministrationParticipationAdministrationPointOfContacts) + if (item.AssesssmentAdministrationParticipation == null) + item.AssesssmentAdministrationParticipation = this; // ------------------------------------------------------------- - return _bellScheduleGradeLevelsCovariant; + return _assesssmentAdministrationParticipationAdministrationPointOfContactsCovariant; } set { - BellScheduleGradeLevels = new HashSet(value.Cast()); + AssesssmentAdministrationParticipationAdministrationPointOfContacts = new HashSet(value.Cast()); } } @@ -10726,8 +10618,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BellScheduleName", BellScheduleName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); + keyValues.Add("Namespace", Namespace); + keyValues.Add("ParticipatingEducationOrganizationId", ParticipatingEducationOrganizationId); return keyValues; } @@ -10791,12 +10686,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellSchedule)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssesssmentAdministrationParticipation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellSchedule) target, null); + this.MapTo((Entities.Common.EdFi.IAssesssmentAdministrationParticipation) target, null); } } @@ -10804,19 +10699,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellScheduleClassPeriod table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AssesssmentAdministrationParticipationAdministrationPointOfContact table of the AssesssmentAdministrationParticipation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellScheduleClassPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBellScheduleClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssesssmentAdministrationParticipationAdministrationPointOfContact : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public BellScheduleClassPeriod() + public AssesssmentAdministrationParticipationAdministrationPointOfContact() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -10825,16 +10720,18 @@ public BellScheduleClassPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual BellSchedule BellSchedule { get; set; } + public virtual AssesssmentAdministrationParticipation AssesssmentAdministrationParticipation { get; set; } - Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule + Entities.Common.EdFi.IAssesssmentAdministrationParticipation IAssesssmentAdministrationParticipationAdministrationPointOfContact.AssesssmentAdministrationParticipation { - get { return BellSchedule; } - set { BellSchedule = (BellSchedule) value; } + get { return AssesssmentAdministrationParticipation; } + set { AssesssmentAdministrationParticipation = (AssesssmentAdministrationParticipation) value; } } [DomainSignature] - public virtual string ClassPeriodName { get; set; } + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ElectronicMailAddress { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10845,6 +10742,9 @@ Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string FirstName { get; set; } + public virtual string LastSurname { get; set; } + public virtual string LoginId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10889,23 +10789,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the ClassPeriod discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator + string Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationDiscriminator { - get { return ClassPeriodReferenceData?.Discriminator; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ClassPeriod resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodResourceId + Guid? Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationResourceId { - get { return ClassPeriodReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Id; } set { } } @@ -10930,10 +10830,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssesssmentAdministrationParticipation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ClassPeriodName", ClassPeriodName); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); return keyValues; } @@ -10997,111 +10898,96 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleClassPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellScheduleClassPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact) target, null); } void IChildEntity.SetParent(object value) { - BellSchedule = (BellSchedule) value; + AssesssmentAdministrationParticipation = (AssesssmentAdministrationParticipation) value; } } +} +// Aggregate: AssignmentLateStatusDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AssignmentLateStatusDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellScheduleDate table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AssignmentLateStatusDescriptor table of the AssignmentLateStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellScheduleDate : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBellScheduleDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AssignmentLateStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssignmentLateStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public BellScheduleDate() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual BellSchedule BellSchedule { get; set; } - - Entities.Common.EdFi.IBellSchedule IBellScheduleDate.BellSchedule - { - get { return BellSchedule; } - set { BellSchedule = (BellSchedule) value; } - } - [DomainSignature] - public virtual DateTime Date + public virtual int AssignmentLateStatusDescriptorId { - get { return _date; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _date = new DateTime(value.Year, value.Month, value.Day); } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - private DateTime _date; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions + string IDescriptor.CodeValue { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- - public IDictionary AggregateExtensions { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -11127,11 +11013,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Date", Date); + keyValues.Add("AssignmentLateStatusDescriptorId", AssignmentLateStatusDescriptorId); return keyValues; } @@ -11195,92 +11081,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleDate)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellScheduleDate) target, null); + this.MapTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - BellSchedule = (BellSchedule) value; - } } +} +// Aggregate: AttemptStatusDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AttemptStatusDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellScheduleGradeLevel table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AttemptStatusDescriptor table of the AttemptStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellScheduleGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBellScheduleGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class AttemptStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAttemptStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public BellScheduleGradeLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual BellSchedule BellSchedule { get; set; } - - Entities.Common.EdFi.IBellSchedule IBellScheduleGradeLevel.BellSchedule - { - get { return BellSchedule; } - set { BellSchedule = (BellSchedule) value; } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + public virtual int AttemptStatusDescriptorId { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -11296,35 +11167,6 @@ public virtual string GradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -11340,7 +11182,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -11351,11 +11192,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("AttemptStatusDescriptorId", AttemptStatusDescriptorId); return keyValues; } @@ -11419,41 +11260,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAttemptStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellScheduleGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IAttemptStatusDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - BellSchedule = (BellSchedule) value; - } } } -// Aggregate: BusRouteDescriptor +// Aggregate: AttendanceEventCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.BusRouteDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AttendanceEventCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BusRouteDescriptor table of the BusRouteDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AttendanceEventCategoryDescriptor table of the AttendanceEventCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BusRouteDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IBusRouteDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class AttendanceEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAttendanceEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int BusRouteDescriptorId + public virtual int AttendanceEventCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -11538,7 +11375,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BusRouteDescriptorId", BusRouteDescriptorId); + keyValues.Add("AttendanceEventCategoryDescriptorId", AttendanceEventCategoryDescriptorId); return keyValues; } @@ -11602,31 +11439,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBusRouteDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBusRouteDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor) target, null); } } } -// Aggregate: Calendar +// Aggregate: BalanceSheetDimension -namespace EdFi.Ods.Entities.NHibernate.CalendarAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.BalanceSheetDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CalendarReferenceData : IHasPrimaryKeyValues + public class BalanceSheetDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CalendarCode { get; set; } - public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } + public virtual string Code { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// @@ -11647,9 +11483,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -11700,20 +11535,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Calendar table of the Calendar aggregate in the ODS database. + /// A class which represents the edfi.BalanceSheetDimension table of the BalanceSheetDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Calendar : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICalendar, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class BalanceSheetDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IBalanceSheetDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Calendar() + public BalanceSheetDimension() { - CalendarGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + BalanceSheetDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -11722,11 +11557,9 @@ public Calendar() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CalendarCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } + public virtual string Code { get; set; } [DomainSignature] - public virtual short SchoolYear { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -11737,40 +11570,7 @@ public Calendar() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int CalendarTypeDescriptorId - { - get - { - if (_calendarTypeDescriptorId == default(int)) - _calendarTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarTypeDescriptor", _calendarTypeDescriptor); - - return _calendarTypeDescriptorId; - } - set - { - _calendarTypeDescriptorId = value; - _calendarTypeDescriptor = null; - } - } - - private int _calendarTypeDescriptorId; - private string _calendarTypeDescriptor; - - public virtual string CalendarTypeDescriptor - { - get - { - if (_calendarTypeDescriptor == null) - _calendarTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarTypeDescriptor", _calendarTypeDescriptorId); - - return _calendarTypeDescriptor; - } - set - { - _calendarTypeDescriptor = value; - _calendarTypeDescriptorId = default(int); - } - } + public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -11815,37 +11615,15 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICalendar.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } - - /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICalendar.SchoolYearTypeResourceId - { - get { return SchoolYearTypeReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _calendarGradeLevels; - private ICollection _calendarGradeLevelsCovariant; - public virtual ICollection CalendarGradeLevels + private ICollection _balanceSheetDimensionReportingTags; + private ICollection _balanceSheetDimensionReportingTagsCovariant; + public virtual ICollection BalanceSheetDimensionReportingTags { get { @@ -11854,38 +11632,38 @@ public virtual ICollection(value); + _balanceSheetDimensionReportingTags = value; + _balanceSheetDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICalendar.CalendarGradeLevels + ICollection Entities.Common.EdFi.IBalanceSheetDimension.BalanceSheetDimensionReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _calendarGradeLevels) - if (item.Calendar == null) - item.Calendar = this; + foreach (var item in _balanceSheetDimensionReportingTags) + if (item.BalanceSheetDimension == null) + item.BalanceSheetDimension = this; // ------------------------------------------------------------- - return _calendarGradeLevelsCovariant; + return _balanceSheetDimensionReportingTagsCovariant; } set { - CalendarGradeLevels = new HashSet(value.Cast()); + BalanceSheetDimensionReportingTags = new HashSet(value.Cast()); } } @@ -11894,7 +11672,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CalendarTypeDescriptor", new LookupColumnDetails { PropertyName = "CalendarTypeDescriptorId", LookupTypeName = "CalendarTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -11909,9 +11686,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -11975,12 +11751,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendar)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendar) target, null); + this.MapTo((Entities.Common.EdFi.IBalanceSheetDimension) target, null); } } @@ -11988,19 +11764,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarGradeLevel table of the Calendar aggregate in the ODS database. + /// A class which represents the edfi.BalanceSheetDimensionReportingTag table of the BalanceSheetDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICalendarGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class BalanceSheetDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBalanceSheetDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CalendarGradeLevel() + public BalanceSheetDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -12009,47 +11785,47 @@ public CalendarGradeLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Calendar Calendar { get; set; } + public virtual BalanceSheetDimension BalanceSheetDimension { get; set; } - Entities.Common.EdFi.ICalendar ICalendarGradeLevel.Calendar + Entities.Common.EdFi.IBalanceSheetDimension IBalanceSheetDimensionReportingTag.BalanceSheetDimension { - get { return Calendar; } - set { Calendar = (Calendar) value; } + get { return BalanceSheetDimension; } + set { BalanceSheetDimension = (BalanceSheetDimension) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId + public virtual int ReportingTagDescriptorId { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - return _gradeLevelDescriptorId; + return _reportingTagDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; - public virtual string GradeLevelDescriptor + public virtual string ReportingTagDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - return _gradeLevelDescriptor; + return _reportingTagDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -12116,7 +11892,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -12128,10 +11904,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Calendar as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (BalanceSheetDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -12195,36 +11971,392 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag) target, null); } void IChildEntity.SetParent(object value) { - Calendar = (Calendar) value; + BalanceSheetDimension = (BalanceSheetDimension) value; } } } -// Aggregate: CalendarDate +// Aggregate: BarrierToInternetAccessInResidenceDescriptor -namespace EdFi.Ods.Entities.NHibernate.CalendarDateAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.BarrierToInternetAccessInResidenceDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.BarrierToInternetAccessInResidenceDescriptor table of the BarrierToInternetAccessInResidenceDescriptor aggregate in the ODS database. /// - public class CalendarDateReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class BarrierToInternetAccessInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CalendarCode { get; set; } - public virtual DateTime Date { get; set; } + [DomainSignature] + public virtual int BarrierToInternetAccessInResidenceDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BarrierToInternetAccessInResidenceDescriptorId", BarrierToInternetAccessInResidenceDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor) target, null); + } + + } +} +// Aggregate: BehaviorDescriptor + +namespace EdFi.Ods.Entities.NHibernate.BehaviorDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.BehaviorDescriptor table of the BehaviorDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class BehaviorDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IBehaviorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int BehaviorDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IBehaviorDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IBehaviorDescriptor) target, null); + } + + } +} +// Aggregate: BellSchedule + +namespace EdFi.Ods.Entities.NHibernate.BellScheduleAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class BellScheduleReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string BellScheduleName { get; set; } public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- /// @@ -12245,10 +12377,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("Date", Date); + keyValues.Add("BellScheduleName", BellScheduleName); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -12299,20 +12429,22 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarDate table of the CalendarDate aggregate in the ODS database. + /// A class which represents the edfi.BellSchedule table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarDate : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICalendarDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class BellSchedule : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IBellSchedule, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CalendarDate() + public BellSchedule() { - CalendarDateCalendarEvents = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + BellScheduleClassPeriods = new HashSet(); + BellScheduleDates = new HashSet(); + BellScheduleGradeLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -12321,21 +12453,9 @@ public CalendarDate() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CalendarCode { get; set; } - [DomainSignature] - public virtual DateTime Date - { - get { return _date; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _date = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _date; - + public virtual string BellScheduleName { get; set; } [DomainSignature] public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12346,6 +12466,10 @@ public virtual DateTime Date // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string AlternateDayName { get; set; } + public virtual TimeSpan? EndTime { get; set; } + public virtual TimeSpan? StartTime { get; set; } + public virtual int? TotalInstructionalTime { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12390,23 +12514,14 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.CalendarAggregate.EdFi.CalendarReferenceData CalendarReferenceData { get; set; } - - /// - /// Read-only property that allows the Calendar discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator - { - get { return CalendarReferenceData?.Discriminator; } - set { } - } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the Calendar resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICalendarDate.CalendarResourceId + Guid? Entities.Common.EdFi.IBellSchedule.SchoolResourceId { - get { return CalendarReferenceData?.Id; } + get { return SchoolReferenceData?.Id; } set { } } @@ -12416,9 +12531,9 @@ string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _calendarDateCalendarEvents; - private ICollection _calendarDateCalendarEventsCovariant; - public virtual ICollection CalendarDateCalendarEvents + private ICollection _bellScheduleClassPeriods; + private ICollection _bellScheduleClassPeriodsCovariant; + public virtual ICollection BellScheduleClassPeriods { get { @@ -12427,38 +12542,132 @@ public virtual ICollection(value); + _bellScheduleClassPeriods = value; + _bellScheduleClassPeriodsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICalendarDate.CalendarDateCalendarEvents + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleClassPeriods { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _calendarDateCalendarEvents) - if (item.CalendarDate == null) - item.CalendarDate = this; + foreach (var item in _bellScheduleClassPeriods) + if (item.BellSchedule == null) + item.BellSchedule = this; // ------------------------------------------------------------- - return _calendarDateCalendarEventsCovariant; + return _bellScheduleClassPeriodsCovariant; } set { - CalendarDateCalendarEvents = new HashSet(value.Cast()); + BellScheduleClassPeriods = new HashSet(value.Cast()); + } + } + + + private ICollection _bellScheduleDates; + private ICollection _bellScheduleDatesCovariant; + public virtual ICollection BellScheduleDates + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _bellScheduleDates) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleDates; + } + set + { + _bellScheduleDates = value; + _bellScheduleDatesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleDates + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _bellScheduleDates) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleDatesCovariant; + } + set + { + BellScheduleDates = new HashSet(value.Cast()); + } + } + + + private ICollection _bellScheduleGradeLevels; + private ICollection _bellScheduleGradeLevelsCovariant; + public virtual ICollection BellScheduleGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _bellScheduleGradeLevels) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleGradeLevels; + } + set + { + _bellScheduleGradeLevels = value; + _bellScheduleGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _bellScheduleGradeLevels) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleGradeLevelsCovariant; + } + set + { + BellScheduleGradeLevels = new HashSet(value.Cast()); } } @@ -12481,10 +12690,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("Date", Date); + keyValues.Add("BellScheduleName", BellScheduleName); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -12548,12 +12755,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDate)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellSchedule)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarDate) target, null); + this.MapTo((Entities.Common.EdFi.IBellSchedule) target, null); } } @@ -12561,19 +12768,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarDateCalendarEvent table of the CalendarDate aggregate in the ODS database. + /// A class which represents the edfi.BellScheduleClassPeriod table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarDateCalendarEvent : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICalendarDateCalendarEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class BellScheduleClassPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBellScheduleClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CalendarDateCalendarEvent() + public BellScheduleClassPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -12582,49 +12789,16 @@ public CalendarDateCalendarEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual CalendarDate CalendarDate { get; set; } + public virtual BellSchedule BellSchedule { get; set; } - Entities.Common.EdFi.ICalendarDate ICalendarDateCalendarEvent.CalendarDate + Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule { - get { return CalendarDate; } - set { CalendarDate = (CalendarDate) value; } + get { return BellSchedule; } + set { BellSchedule = (BellSchedule) value; } } [DomainSignature] - public virtual int CalendarEventDescriptorId - { - get - { - if (_calendarEventDescriptorId == default(int)) - _calendarEventDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarEventDescriptor", _calendarEventDescriptor); - - return _calendarEventDescriptorId; - } - set - { - _calendarEventDescriptorId = value; - _calendarEventDescriptor = null; - } - } - - private int _calendarEventDescriptorId; - private string _calendarEventDescriptor; - - public virtual string CalendarEventDescriptor - { - get - { - if (_calendarEventDescriptor == null) - _calendarEventDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarEventDescriptor", _calendarEventDescriptorId); - - return _calendarEventDescriptor; - } - set - { - _calendarEventDescriptor = value; - _calendarEventDescriptorId = default(int); - } - } + public virtual string ClassPeriodName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12679,6 +12853,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } + + /// + /// Read-only property that allows the ClassPeriod discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator + { + get { return ClassPeriodReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ClassPeriod resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodResourceId + { + get { return ClassPeriodReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -12689,7 +12883,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CalendarEventDescriptor", new LookupColumnDetails { PropertyName = "CalendarEventDescriptorId", LookupTypeName = "CalendarEventDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -12701,10 +12894,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CalendarDate as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); + keyValues.Add("ClassPeriodName", ClassPeriodName); return keyValues; } @@ -12768,81 +12961,67 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDateCalendarEvent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleClassPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarDateCalendarEvent) target, null); + this.MapTo((Entities.Common.EdFi.IBellScheduleClassPeriod) target, null); } void IChildEntity.SetParent(object value) { - CalendarDate = (CalendarDate) value; + BellSchedule = (BellSchedule) value; } } -} -// Aggregate: CalendarEventDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CalendarEventDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarEventDescriptor table of the CalendarEventDescriptor aggregate in the ODS database. + /// A class which represents the edfi.BellScheduleDate table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarEventDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICalendarEventDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class BellScheduleDate : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBellScheduleDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public BellScheduleDate() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual BellSchedule BellSchedule { get; set; } + + Entities.Common.EdFi.IBellSchedule IBellScheduleDate.BellSchedule + { + get { return BellSchedule; } + set { BellSchedule = (BellSchedule) value; } + } + [DomainSignature] - public virtual int CalendarEventDescriptorId + public virtual DateTime Date { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _date; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _date = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _date; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -12858,6 +13037,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12883,11 +13091,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); + keyValues.Add("Date", Date); return keyValues; } @@ -12951,79 +13159,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarEventDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleDate)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarEventDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IBellScheduleDate) target, null); } + void IChildEntity.SetParent(object value) + { + BellSchedule = (BellSchedule) value; + } } -} -// Aggregate: CalendarTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CalendarTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarTypeDescriptor table of the CalendarTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.BellScheduleGradeLevel table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICalendarTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class BellScheduleGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBellScheduleGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CalendarTypeDescriptorId + public BellScheduleGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual BellSchedule BellSchedule { get; set; } + + Entities.Common.EdFi.IBellSchedule IBellScheduleGradeLevel.BellSchedule { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return BellSchedule; } + set { BellSchedule = (BellSchedule) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -13037,6 +13260,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13052,6 +13304,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -13062,11 +13315,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CalendarTypeDescriptorId", CalendarTypeDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -13130,37 +13383,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IBellScheduleGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + BellSchedule = (BellSchedule) value; + } } } -// Aggregate: CareerPathwayDescriptor +// Aggregate: BusRouteDescriptor -namespace EdFi.Ods.Entities.NHibernate.CareerPathwayDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.BusRouteDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CareerPathwayDescriptor table of the CareerPathwayDescriptor aggregate in the ODS database. + /// A class which represents the edfi.BusRouteDescriptor table of the BusRouteDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CareerPathwayDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICareerPathwayDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { + public class BusRouteDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IBusRouteDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CareerPathwayDescriptorId + public virtual int BusRouteDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -13245,7 +13502,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CareerPathwayDescriptorId", CareerPathwayDescriptorId); + keyValues.Add("BusRouteDescriptorId", BusRouteDescriptorId); return keyValues; } @@ -13309,82 +13566,175 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICareerPathwayDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBusRouteDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICareerPathwayDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IBusRouteDescriptor) target, null); } } } -// Aggregate: CharterApprovalAgencyTypeDescriptor +// Aggregate: Calendar -namespace EdFi.Ods.Entities.NHibernate.CharterApprovalAgencyTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class CalendarReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string CalendarCode { get; set; } + public virtual long SchoolId { get; set; } + public virtual short SchoolYear { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CharterApprovalAgencyTypeDescriptor table of the CharterApprovalAgencyTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.Calendar table of the Calendar aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CharterApprovalAgencyTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class Calendar : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICalendar, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public Calendar() + { + CalendarGradeLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CharterApprovalAgencyTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual string CalendarCode { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual int CalendarTypeDescriptorId + { + get + { + if (_calendarTypeDescriptorId == default(int)) + _calendarTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarTypeDescriptor", _calendarTypeDescriptor); + + return _calendarTypeDescriptorId; + } + set + { + _calendarTypeDescriptorId = value; + _calendarTypeDescriptor = null; + } + } + + private int _calendarTypeDescriptorId; + private string _calendarTypeDescriptor; + + public virtual string CalendarTypeDescriptor + { + get + { + if (_calendarTypeDescriptor == null) + _calendarTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarTypeDescriptor", _calendarTypeDescriptorId); + + return _calendarTypeDescriptor; + } + set + { + _calendarTypeDescriptor = value; + _calendarTypeDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -13395,21 +13745,120 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICalendar.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICalendar.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _calendarGradeLevels; + private ICollection _calendarGradeLevelsCovariant; + public virtual ICollection CalendarGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _calendarGradeLevels) + if (item.Calendar == null) + item.Calendar = this; + // ------------------------------------------------------------- + + return _calendarGradeLevels; + } + set + { + _calendarGradeLevels = value; + _calendarGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICalendar.CalendarGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _calendarGradeLevels) + if (item.Calendar == null) + item.Calendar = this; + // ------------------------------------------------------------- + + return _calendarGradeLevelsCovariant; + } + set + { + CalendarGradeLevels = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CalendarTypeDescriptor", new LookupColumnDetails { PropertyName = "CalendarTypeDescriptorId", LookupTypeName = "CalendarTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -13424,7 +13873,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CharterApprovalAgencyTypeDescriptorId", CharterApprovalAgencyTypeDescriptorId); + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -13488,79 +13939,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendar)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICalendar) target, null); } } -} -// Aggregate: CharterStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CharterStatusDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CharterStatusDescriptor table of the CharterStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CalendarGradeLevel table of the Calendar aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CharterStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICharterStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CalendarGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICalendarGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CharterStatusDescriptorId + public CalendarGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Calendar Calendar { get; set; } + + Entities.Common.EdFi.ICalendar ICalendarGradeLevel.Calendar { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Calendar; } + set { Calendar = (Calendar) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -13574,6 +14036,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13589,6 +14080,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -13599,11 +14091,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Calendar as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CharterStatusDescriptorId", CharterStatusDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -13667,31 +14159,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICharterStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICharterStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + Calendar = (Calendar) value; + } } } -// Aggregate: ChartOfAccount +// Aggregate: CalendarDate -namespace EdFi.Ods.Entities.NHibernate.ChartOfAccountAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarDateAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ChartOfAccountReferenceData : IHasPrimaryKeyValues + public class CalendarDateReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AccountIdentifier { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int FiscalYear { get; set; } + public virtual string CalendarCode { get; set; } + public virtual DateTime Date { get; set; } + public virtual long SchoolId { get; set; } + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- /// @@ -13712,9 +14209,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("Date", Date); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -13765,20 +14263,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ChartOfAccount table of the ChartOfAccount aggregate in the ODS database. + /// A class which represents the edfi.CalendarDate table of the CalendarDate aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ChartOfAccount : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IChartOfAccount, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CalendarDate : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICalendarDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ChartOfAccount() + public CalendarDate() { - ChartOfAccountReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CalendarDateCalendarEvents = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -13787,11 +14285,21 @@ public ChartOfAccount() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string AccountIdentifier { get; set; } + public virtual string CalendarCode { get; set; } [DomainSignature] - public virtual long EducationOrganizationId { get; set; } + public virtual DateTime Date + { + get { return _date; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _date = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _date; + [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13802,49 +14310,6 @@ public ChartOfAccount() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AccountName { get; set; } - public virtual int AccountTypeDescriptorId - { - get - { - if (_accountTypeDescriptorId == default(int)) - _accountTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccountTypeDescriptor", _accountTypeDescriptor); - - return _accountTypeDescriptorId; - } - set - { - _accountTypeDescriptorId = value; - _accountTypeDescriptor = null; - } - } - - private int _accountTypeDescriptorId; - private string _accountTypeDescriptor; - - public virtual string AccountTypeDescriptor - { - get - { - if (_accountTypeDescriptor == null) - _accountTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccountTypeDescriptor", _accountTypeDescriptorId); - - return _accountTypeDescriptor; - } - set - { - _accountTypeDescriptor = value; - _accountTypeDescriptorId = default(int); - } - } - public virtual string BalanceSheetCode { get; set; } - public virtual string FunctionCode { get; set; } - public virtual string FundCode { get; set; } - public virtual string ObjectCode { get; set; } - public virtual string OperationalUnitCode { get; set; } - public virtual string ProgramCode { get; set; } - public virtual string ProjectCode { get; set; } - public virtual string SourceCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13889,183 +14354,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.BalanceSheetDimensionAggregate.EdFi.BalanceSheetDimensionReferenceData BalanceSheetDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the BalanceSheetDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionDiscriminator - { - get { return BalanceSheetDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the BalanceSheetDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionResourceId - { - get { return BalanceSheetDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.FunctionDimensionAggregate.EdFi.FunctionDimensionReferenceData FunctionDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the FunctionDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.FunctionDimensionDiscriminator - { - get { return FunctionDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the FunctionDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.FunctionDimensionResourceId - { - get { return FunctionDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.FundDimensionAggregate.EdFi.FundDimensionReferenceData FundDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the FundDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.FundDimensionDiscriminator - { - get { return FundDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the FundDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.FundDimensionResourceId - { - get { return FundDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ObjectDimensionAggregate.EdFi.ObjectDimensionReferenceData ObjectDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the ObjectDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.ObjectDimensionDiscriminator - { - get { return ObjectDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ObjectDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.ObjectDimensionResourceId - { - get { return ObjectDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.OperationalUnitDimensionAggregate.EdFi.OperationalUnitDimensionReferenceData OperationalUnitDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the OperationalUnitDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionDiscriminator - { - get { return OperationalUnitDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the OperationalUnitDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionResourceId - { - get { return OperationalUnitDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ProgramDimensionAggregate.EdFi.ProgramDimensionReferenceData ProgramDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the ProgramDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.ProgramDimensionDiscriminator - { - get { return ProgramDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ProgramDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.ProgramDimensionResourceId - { - get { return ProgramDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ProjectDimensionAggregate.EdFi.ProjectDimensionReferenceData ProjectDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the ProjectDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.ProjectDimensionDiscriminator - { - get { return ProjectDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ProjectDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.ProjectDimensionResourceId - { - get { return ProjectDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.SourceDimensionAggregate.EdFi.SourceDimensionReferenceData SourceDimensionReferenceData { get; set; } + public virtual NHibernate.CalendarAggregate.EdFi.CalendarReferenceData CalendarReferenceData { get; set; } /// - /// Read-only property that allows the SourceDimension discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Calendar discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator + string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator { - get { return SourceDimensionReferenceData?.Discriminator; } + get { return CalendarReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the SourceDimension resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Calendar resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IChartOfAccount.SourceDimensionResourceId + Guid? Entities.Common.EdFi.ICalendarDate.CalendarResourceId { - get { return SourceDimensionReferenceData?.Id; } + get { return CalendarReferenceData?.Id; } set { } } @@ -14075,9 +14380,9 @@ string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _chartOfAccountReportingTags; - private ICollection _chartOfAccountReportingTagsCovariant; - public virtual ICollection ChartOfAccountReportingTags + private ICollection _calendarDateCalendarEvents; + private ICollection _calendarDateCalendarEventsCovariant; + public virtual ICollection CalendarDateCalendarEvents { get { @@ -14086,38 +14391,38 @@ public virtual ICollection(value); + _calendarDateCalendarEvents = value; + _calendarDateCalendarEventsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IChartOfAccount.ChartOfAccountReportingTags + ICollection Entities.Common.EdFi.ICalendarDate.CalendarDateCalendarEvents { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _chartOfAccountReportingTags) - if (item.ChartOfAccount == null) - item.ChartOfAccount = this; + foreach (var item in _calendarDateCalendarEvents) + if (item.CalendarDate == null) + item.CalendarDate = this; // ------------------------------------------------------------- - return _chartOfAccountReportingTagsCovariant; + return _calendarDateCalendarEventsCovariant; } set { - ChartOfAccountReportingTags = new HashSet(value.Cast()); + CalendarDateCalendarEvents = new HashSet(value.Cast()); } } @@ -14126,7 +14431,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AccountTypeDescriptor", new LookupColumnDetails { PropertyName = "AccountTypeDescriptorId", LookupTypeName = "AccountTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -14141,9 +14445,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("Date", Date); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -14207,12 +14512,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccount)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDate)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IChartOfAccount) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarDate) target, null); } } @@ -14220,19 +14525,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ChartOfAccountReportingTag table of the ChartOfAccount aggregate in the ODS database. + /// A class which represents the edfi.CalendarDateCalendarEvent table of the CalendarDate aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ChartOfAccountReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IChartOfAccountReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CalendarDateCalendarEvent : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICalendarDateCalendarEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ChartOfAccountReportingTag() + public CalendarDateCalendarEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -14241,47 +14546,47 @@ public ChartOfAccountReportingTag() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual ChartOfAccount ChartOfAccount { get; set; } + public virtual CalendarDate CalendarDate { get; set; } - Entities.Common.EdFi.IChartOfAccount IChartOfAccountReportingTag.ChartOfAccount + Entities.Common.EdFi.ICalendarDate ICalendarDateCalendarEvent.CalendarDate { - get { return ChartOfAccount; } - set { ChartOfAccount = (ChartOfAccount) value; } + get { return CalendarDate; } + set { CalendarDate = (CalendarDate) value; } } [DomainSignature] - public virtual int ReportingTagDescriptorId + public virtual int CalendarEventDescriptorId { get { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + if (_calendarEventDescriptorId == default(int)) + _calendarEventDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarEventDescriptor", _calendarEventDescriptor); - return _reportingTagDescriptorId; + return _calendarEventDescriptorId; } set { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; + _calendarEventDescriptorId = value; + _calendarEventDescriptor = null; } } - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; + private int _calendarEventDescriptorId; + private string _calendarEventDescriptor; - public virtual string ReportingTagDescriptor + public virtual string CalendarEventDescriptor { get { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + if (_calendarEventDescriptor == null) + _calendarEventDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarEventDescriptor", _calendarEventDescriptorId); - return _reportingTagDescriptor; + return _calendarEventDescriptor; } set { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); + _calendarEventDescriptor = value; + _calendarEventDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -14294,7 +14599,6 @@ public virtual string ReportingTagDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -14349,7 +14653,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + { "CalendarEventDescriptor", new LookupColumnDetails { PropertyName = "CalendarEventDescriptorId", LookupTypeName = "CalendarEventDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -14361,10 +14665,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ChartOfAccount as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CalendarDate as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); return keyValues; } @@ -14428,41 +14732,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccountReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDateCalendarEvent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IChartOfAccountReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarDateCalendarEvent) target, null); } void IChildEntity.SetParent(object value) { - ChartOfAccount = (ChartOfAccount) value; + CalendarDate = (CalendarDate) value; } } } -// Aggregate: CitizenshipStatusDescriptor +// Aggregate: CalendarEventDescriptor -namespace EdFi.Ods.Entities.NHibernate.CitizenshipStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarEventDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CitizenshipStatusDescriptor table of the CitizenshipStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CalendarEventDescriptor table of the CalendarEventDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CitizenshipStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICitizenshipStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CalendarEventDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICalendarEventDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CitizenshipStatusDescriptorId + public virtual int CalendarEventDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -14547,7 +14851,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CitizenshipStatusDescriptorId", CitizenshipStatusDescriptorId); + keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); return keyValues; } @@ -14611,42 +14915,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarEventDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarEventDescriptor) target, null); } } } -// Aggregate: ClassPeriod +// Aggregate: CalendarTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.ClassPeriodAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarTypeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.CalendarTypeDescriptor table of the CalendarTypeDescriptor aggregate in the ODS database. /// - public class ClassPeriodReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class CalendarTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICalendarTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string ClassPeriodName { get; set; } - public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual int CalendarTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -14655,8 +15030,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassPeriodName", ClassPeriodName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("CalendarTypeDescriptorId", CalendarTypeDescriptorId); return keyValues; } @@ -14677,8 +15051,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -14695,54 +15079,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICalendarTypeDescriptor) target, null); + } + } +} +// Aggregate: CareerPathwayDescriptor +namespace EdFi.Ods.Entities.NHibernate.CareerPathwayDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ClassPeriod table of the ClassPeriod aggregate in the ODS database. + /// A class which represents the edfi.CareerPathwayDescriptor table of the CareerPathwayDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ClassPeriod : AggregateRootWithCompositeKey, IHasCascadableKeyValues, - Entities.Common.EdFi.IClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CareerPathwayDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICareerPathwayDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ClassPeriod() - { - ClassPeriodMeetingTimes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string ClassPeriodName { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } + public virtual int CareerPathwayDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool? OfficialAttendancePeriod { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -14753,103 +15180,16 @@ public ClassPeriod() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IClassPeriod.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _classPeriodMeetingTimes; - private ICollection _classPeriodMeetingTimesCovariant; - public virtual ICollection ClassPeriodMeetingTimes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _classPeriodMeetingTimes) - if (item.ClassPeriod == null) - item.ClassPeriod = this; - // ------------------------------------------------------------- - - return _classPeriodMeetingTimes; - } - set - { - _classPeriodMeetingTimes = value; - _classPeriodMeetingTimesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IClassPeriod.ClassPeriodMeetingTimes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _classPeriodMeetingTimes) - if (item.ClassPeriod == null) - item.ClassPeriod = this; - // ------------------------------------------------------------- - - return _classPeriodMeetingTimesCovariant; - } - set - { - ClassPeriodMeetingTimes = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -14869,18 +15209,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassPeriodName", ClassPeriodName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("CareerPathwayDescriptorId", CareerPathwayDescriptorId); return keyValues; } - /// - /// Gets or sets the capturing the new key values that have - /// not been modified directly on the entity. - /// - OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } - #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -14940,57 +15273,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICareerPathwayDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IClassPeriod) target, null); + this.MapTo((Entities.Common.EdFi.ICareerPathwayDescriptor) target, null); } } +} +// Aggregate: CharterApprovalAgencyTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CharterApprovalAgencyTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ClassPeriodMeetingTime table of the ClassPeriod aggregate in the ODS database. + /// A class which represents the edfi.CharterApprovalAgencyTypeDescriptor table of the CharterApprovalAgencyTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ClassPeriodMeetingTime : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IClassPeriodMeetingTime, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CharterApprovalAgencyTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ClassPeriodMeetingTime() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ClassPeriod ClassPeriod { get; set; } - - Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod + [DomainSignature] + public virtual int CharterApprovalAgencyTypeDescriptorId { - get { return ClassPeriod; } - set { ClassPeriod = (ClassPeriod) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual TimeSpan EndTime { get; set; } - [DomainSignature] - public virtual TimeSpan StartTime { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -15006,35 +15359,6 @@ Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15060,12 +15384,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ClassPeriod as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EndTime", EndTime); - keyValues.Add("StartTime", StartTime); + keyValues.Add("CharterApprovalAgencyTypeDescriptorId", CharterApprovalAgencyTypeDescriptorId); return keyValues; } @@ -15129,41 +15452,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriodMeetingTime)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IClassPeriodMeetingTime) target, null); + this.MapTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ClassPeriod = (ClassPeriod) value; - } } } -// Aggregate: ClassroomPositionDescriptor +// Aggregate: CharterStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.ClassroomPositionDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CharterStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ClassroomPositionDescriptor table of the ClassroomPositionDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CharterStatusDescriptor table of the CharterStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ClassroomPositionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IClassroomPositionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CharterStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICharterStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ClassroomPositionDescriptorId + public virtual int CharterStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -15248,7 +15567,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassroomPositionDescriptorId", ClassroomPositionDescriptorId); + keyValues.Add("CharterStatusDescriptorId", CharterStatusDescriptorId); return keyValues; } @@ -15312,30 +15631,31 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IClassroomPositionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICharterStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IClassroomPositionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICharterStatusDescriptor) target, null); } } } -// Aggregate: Cohort +// Aggregate: ChartOfAccount -namespace EdFi.Ods.Entities.NHibernate.CohortAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ChartOfAccountAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CohortReferenceData : IHasPrimaryKeyValues + public class ChartOfAccountReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CohortIdentifier { get; set; } + public virtual string AccountIdentifier { get; set; } public virtual long EducationOrganizationId { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// @@ -15356,8 +15676,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("AccountIdentifier", AccountIdentifier); keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -15408,20 +15729,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Cohort table of the Cohort aggregate in the ODS database. + /// A class which represents the edfi.ChartOfAccount table of the ChartOfAccount aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Cohort : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICohort, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ChartOfAccount : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IChartOfAccount, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Cohort() + public ChartOfAccount() { - CohortPrograms = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ChartOfAccountReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -15430,9 +15751,11 @@ public Cohort() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CohortIdentifier { get; set; } + public virtual string AccountIdentifier { get; set; } [DomainSignature] public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15443,109 +15766,49 @@ public Cohort() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AcademicSubjectDescriptorId - { - get - { - if (_academicSubjectDescriptorId == default(int?)) - _academicSubjectDescriptorId = string.IsNullOrWhiteSpace(_academicSubjectDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } - } - - private int? _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor - { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = _academicSubjectDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId.Value); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int?); - } - } - public virtual string CohortDescription { get; set; } - public virtual int? CohortScopeDescriptorId - { - get - { - if (_cohortScopeDescriptorId == default(int?)) - _cohortScopeDescriptorId = string.IsNullOrWhiteSpace(_cohortScopeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortScopeDescriptor", _cohortScopeDescriptor); - - return _cohortScopeDescriptorId; - } - set - { - _cohortScopeDescriptorId = value; - _cohortScopeDescriptor = null; - } - } - - private int? _cohortScopeDescriptorId; - private string _cohortScopeDescriptor; - - public virtual string CohortScopeDescriptor - { - get - { - if (_cohortScopeDescriptor == null) - _cohortScopeDescriptor = _cohortScopeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortScopeDescriptor", _cohortScopeDescriptorId.Value); - - return _cohortScopeDescriptor; - } - set - { - _cohortScopeDescriptor = value; - _cohortScopeDescriptorId = default(int?); - } - } - public virtual int CohortTypeDescriptorId + public virtual string AccountName { get; set; } + public virtual int AccountTypeDescriptorId { get { - if (_cohortTypeDescriptorId == default(int)) - _cohortTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortTypeDescriptor", _cohortTypeDescriptor); + if (_accountTypeDescriptorId == default(int)) + _accountTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccountTypeDescriptor", _accountTypeDescriptor); - return _cohortTypeDescriptorId; + return _accountTypeDescriptorId; } set { - _cohortTypeDescriptorId = value; - _cohortTypeDescriptor = null; + _accountTypeDescriptorId = value; + _accountTypeDescriptor = null; } } - private int _cohortTypeDescriptorId; - private string _cohortTypeDescriptor; + private int _accountTypeDescriptorId; + private string _accountTypeDescriptor; - public virtual string CohortTypeDescriptor + public virtual string AccountTypeDescriptor { get { - if (_cohortTypeDescriptor == null) - _cohortTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortTypeDescriptor", _cohortTypeDescriptorId); + if (_accountTypeDescriptor == null) + _accountTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccountTypeDescriptor", _accountTypeDescriptorId); - return _cohortTypeDescriptor; + return _accountTypeDescriptor; } set { - _cohortTypeDescriptor = value; - _cohortTypeDescriptorId = default(int); + _accountTypeDescriptor = value; + _accountTypeDescriptorId = default(int); } } + public virtual string BalanceSheetCode { get; set; } + public virtual string FunctionCode { get; set; } + public virtual string FundCode { get; set; } + public virtual string ObjectCode { get; set; } + public virtual string OperationalUnitCode { get; set; } + public virtual string ProgramCode { get; set; } + public virtual string ProjectCode { get; set; } + public virtual string SourceCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15590,12 +15853,32 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.BalanceSheetDimensionAggregate.EdFi.BalanceSheetDimensionReferenceData BalanceSheetDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the BalanceSheetDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionDiscriminator + { + get { return BalanceSheetDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the BalanceSheetDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionResourceId + { + get { return BalanceSheetDimensionReferenceData?.Id; } + set { } + } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IChartOfAccount.EducationOrganizationDiscriminator { get { return EducationOrganizationReferenceData?.Discriminator; } set { } @@ -15604,21 +15887,161 @@ string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator /// /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICohort.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IChartOfAccount.EducationOrganizationResourceId { get { return EducationOrganizationReferenceData?.Id; } set { } } + public virtual NHibernate.FunctionDimensionAggregate.EdFi.FunctionDimensionReferenceData FunctionDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the FunctionDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.FunctionDimensionDiscriminator + { + get { return FunctionDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the FunctionDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.FunctionDimensionResourceId + { + get { return FunctionDimensionReferenceData?.Id; } + set { } + } + + public virtual NHibernate.FundDimensionAggregate.EdFi.FundDimensionReferenceData FundDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the FundDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.FundDimensionDiscriminator + { + get { return FundDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the FundDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.FundDimensionResourceId + { + get { return FundDimensionReferenceData?.Id; } + set { } + } + + public virtual NHibernate.ObjectDimensionAggregate.EdFi.ObjectDimensionReferenceData ObjectDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the ObjectDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.ObjectDimensionDiscriminator + { + get { return ObjectDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ObjectDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.ObjectDimensionResourceId + { + get { return ObjectDimensionReferenceData?.Id; } + set { } + } + + public virtual NHibernate.OperationalUnitDimensionAggregate.EdFi.OperationalUnitDimensionReferenceData OperationalUnitDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the OperationalUnitDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionDiscriminator + { + get { return OperationalUnitDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the OperationalUnitDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionResourceId + { + get { return OperationalUnitDimensionReferenceData?.Id; } + set { } + } + + public virtual NHibernate.ProgramDimensionAggregate.EdFi.ProgramDimensionReferenceData ProgramDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the ProgramDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.ProgramDimensionDiscriminator + { + get { return ProgramDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProgramDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.ProgramDimensionResourceId + { + get { return ProgramDimensionReferenceData?.Id; } + set { } + } + + public virtual NHibernate.ProjectDimensionAggregate.EdFi.ProjectDimensionReferenceData ProjectDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the ProjectDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.ProjectDimensionDiscriminator + { + get { return ProjectDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProjectDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.ProjectDimensionResourceId + { + get { return ProjectDimensionReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SourceDimensionAggregate.EdFi.SourceDimensionReferenceData SourceDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the SourceDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator + { + get { return SourceDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the SourceDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.SourceDimensionResourceId + { + get { return SourceDimensionReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _cohortPrograms; - private ICollection _cohortProgramsCovariant; - public virtual ICollection CohortPrograms + private ICollection _chartOfAccountReportingTags; + private ICollection _chartOfAccountReportingTagsCovariant; + public virtual ICollection ChartOfAccountReportingTags { get { @@ -15627,38 +16050,38 @@ public virtual ICollection(value); + _chartOfAccountReportingTags = value; + _chartOfAccountReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICohort.CohortPrograms + ICollection Entities.Common.EdFi.IChartOfAccount.ChartOfAccountReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _cohortPrograms) - if (item.Cohort == null) - item.Cohort = this; + foreach (var item in _chartOfAccountReportingTags) + if (item.ChartOfAccount == null) + item.ChartOfAccount = this; // ------------------------------------------------------------- - return _cohortProgramsCovariant; + return _chartOfAccountReportingTagsCovariant; } set { - CohortPrograms = new HashSet(value.Cast()); + ChartOfAccountReportingTags = new HashSet(value.Cast()); } } @@ -15667,9 +16090,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "CohortScopeDescriptor", new LookupColumnDetails { PropertyName = "CohortScopeDescriptorId", LookupTypeName = "CohortScopeDescriptor"} }, - { "CohortTypeDescriptor", new LookupColumnDetails { PropertyName = "CohortTypeDescriptorId", LookupTypeName = "CohortTypeDescriptor"} }, + { "AccountTypeDescriptor", new LookupColumnDetails { PropertyName = "AccountTypeDescriptorId", LookupTypeName = "AccountTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -15684,8 +16105,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("AccountIdentifier", AccountIdentifier); keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -15749,12 +16171,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohort)target); + return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccount)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohort) target, null); + this.MapTo((Entities.Common.EdFi.IChartOfAccount) target, null); } } @@ -15762,19 +16184,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CohortProgram table of the Cohort aggregate in the ODS database. + /// A class which represents the edfi.ChartOfAccountReportingTag table of the ChartOfAccount aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CohortProgram : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICohortProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ChartOfAccountReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IChartOfAccountReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CohortProgram() + public ChartOfAccountReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -15783,51 +16205,47 @@ public CohortProgram() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Cohort Cohort { get; set; } + public virtual ChartOfAccount ChartOfAccount { get; set; } - Entities.Common.EdFi.ICohort ICohortProgram.Cohort + Entities.Common.EdFi.IChartOfAccount IChartOfAccountReportingTag.ChartOfAccount { - get { return Cohort; } - set { Cohort = (Cohort) value; } + get { return ChartOfAccount; } + set { ChartOfAccount = (ChartOfAccount) value; } } [DomainSignature] - public virtual long ProgramEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramName { get; set; } - [DomainSignature] - public virtual int ProgramTypeDescriptorId + public virtual int ReportingTagDescriptorId { get { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - return _programTypeDescriptorId; + return _reportingTagDescriptorId; } set { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; } } - private int _programTypeDescriptorId; - private string _programTypeDescriptor; + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; - public virtual string ProgramTypeDescriptor + public virtual string ReportingTagDescriptor { get { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - return _programTypeDescriptor; + return _reportingTagDescriptor; } set { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -15840,6 +16258,7 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15884,26 +16303,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } - - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICohortProgram.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -15914,7 +16313,7 @@ string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -15926,12 +16325,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Cohort as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ChartOfAccount as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -15995,41 +16392,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccountReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohortProgram) target, null); + this.MapTo((Entities.Common.EdFi.IChartOfAccountReportingTag) target, null); } void IChildEntity.SetParent(object value) { - Cohort = (Cohort) value; + ChartOfAccount = (ChartOfAccount) value; } } } -// Aggregate: CohortScopeDescriptor +// Aggregate: CitizenshipStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.CohortScopeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CitizenshipStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CohortScopeDescriptor table of the CohortScopeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CitizenshipStatusDescriptor table of the CitizenshipStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CohortScopeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICohortScopeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CitizenshipStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICitizenshipStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CohortScopeDescriptorId + public virtual int CitizenshipStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -16114,7 +16511,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortScopeDescriptorId", CohortScopeDescriptorId); + keyValues.Add("CitizenshipStatusDescriptorId", CitizenshipStatusDescriptorId); return keyValues; } @@ -16178,113 +16575,42 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortScopeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohortScopeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor) target, null); } } } -// Aggregate: CohortTypeDescriptor +// Aggregate: ClassPeriod -namespace EdFi.Ods.Entities.NHibernate.CohortTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ClassPeriodAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.CohortTypeDescriptor table of the CohortTypeDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CohortTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICohortTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ClassPeriodReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int CohortTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual string ClassPeriodName { get; set; } + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -16293,7 +16619,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortTypeDescriptorId", CohortTypeDescriptorId); + keyValues.Add("ClassPeriodName", ClassPeriodName); + keyValues.Add("SchoolId", SchoolId); return keyValues; } @@ -16314,18 +16641,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -16342,97 +16659,54 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortTypeDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICohortTypeDescriptor) target, null); - } - } -} -// Aggregate: CohortYearTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.CohortYearTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CohortYearTypeDescriptor table of the CohortYearTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ClassPeriod table of the ClassPeriod aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CohortYearTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICohortYearTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ClassPeriod : AggregateRootWithCompositeKey, IHasCascadableKeyValues, + Entities.Common.EdFi.IClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ClassPeriod() + { + ClassPeriodMeetingTimes = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CohortYearTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual string ClassPeriodName { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual bool? OfficialAttendancePeriod { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -16443,16 +16717,103 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IClassPeriod.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _classPeriodMeetingTimes; + private ICollection _classPeriodMeetingTimesCovariant; + public virtual ICollection ClassPeriodMeetingTimes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _classPeriodMeetingTimes) + if (item.ClassPeriod == null) + item.ClassPeriod = this; + // ------------------------------------------------------------- + + return _classPeriodMeetingTimes; + } + set + { + _classPeriodMeetingTimes = value; + _classPeriodMeetingTimesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IClassPeriod.ClassPeriodMeetingTimes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _classPeriodMeetingTimes) + if (item.ClassPeriod == null) + item.ClassPeriod = this; + // ------------------------------------------------------------- + + return _classPeriodMeetingTimesCovariant; + } + set + { + ClassPeriodMeetingTimes = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map @@ -16472,11 +16833,18 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortYearTypeDescriptorId", CohortYearTypeDescriptorId); + keyValues.Add("ClassPeriodName", ClassPeriodName); + keyValues.Add("SchoolId", SchoolId); return keyValues; } + /// + /// Gets or sets the capturing the new key values that have + /// not been modified directly on the entity. + /// + OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } + #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -16536,35 +16904,32 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortYearTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohortYearTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IClassPeriod) target, null); } } -} -// Aggregate: CommunityOrganization - -namespace EdFi.Ods.Entities.NHibernate.CommunityOrganizationAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CommunityOrganization table of the CommunityOrganization aggregate in the ODS database. + /// A class which represents the edfi.ClassPeriodMeetingTime table of the ClassPeriod aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CommunityOrganization : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.ICommunityOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ClassPeriodMeetingTime : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IClassPeriodMeetingTime, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public CommunityOrganization() + public virtual void SuspendReferenceAssignmentCheck() { } + + public ClassPeriodMeetingTime() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -16572,38 +16937,24 @@ public CommunityOrganization() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual long CommunityOrganizationId + [DomainSignature, JsonIgnore] + public virtual ClassPeriod ClassPeriod { get; set; } + + Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } + get { return ClassPeriod; } + set { ClassPeriod = (ClassPeriod) value; } } - + + [DomainSignature] + public virtual TimeSpan EndTime { get; set; } + [DomainSignature] + public virtual TimeSpan StartTime { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor - { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } - } - string IEducationOrganization.ShortNameOfInstitution - { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } - } - string IEducationOrganization.WebSite - { - get { return WebSite; } - set { WebSite = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -16663,7 +17014,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -16674,11 +17024,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ClassPeriod as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CommunityOrganizationId", CommunityOrganizationId); + keyValues.Add("EndTime", EndTime); + keyValues.Add("StartTime", StartTime); return keyValues; } @@ -16742,47 +17093,44 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICommunityOrganization)target); + return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriodMeetingTime)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICommunityOrganization) target, null); + this.MapTo((Entities.Common.EdFi.IClassPeriodMeetingTime) target, null); } + void IChildEntity.SetParent(object value) + { + ClassPeriod = (ClassPeriod) value; + } } } -// Aggregate: CommunityProvider +// Aggregate: ClassroomPositionDescriptor -namespace EdFi.Ods.Entities.NHibernate.CommunityProviderAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ClassroomPositionDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CommunityProvider table of the CommunityProvider aggregate in the ODS database. + /// A class which represents the edfi.ClassroomPositionDescriptor table of the ClassroomPositionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CommunityProvider : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.ICommunityProvider, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ClassroomPositionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IClassroomPositionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public CommunityProvider() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long CommunityProviderId + public virtual int ClassroomPositionDescriptorId { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } // ------------------------------------------------------------- @@ -16790,136 +17138,41 @@ public virtual long CommunityProviderId // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor - { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } - } - string IEducationOrganization.ShortNameOfInstitution - { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } - } - string IEducationOrganization.WebSite + string IDescriptor.CodeValue { - get { return WebSite; } - set { WebSite = value; } + get { return CodeValue; } + set { CodeValue = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual long? CommunityOrganizationId { get; set; } - public virtual bool? LicenseExemptIndicator { get; set; } - public virtual int ProviderCategoryDescriptorId + string IDescriptor.Description { - get - { - if (_providerCategoryDescriptorId == default(int)) - _providerCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderCategoryDescriptor", _providerCategoryDescriptor); - - return _providerCategoryDescriptorId; - } - set - { - _providerCategoryDescriptorId = value; - _providerCategoryDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _providerCategoryDescriptorId; - private string _providerCategoryDescriptor; - - public virtual string ProviderCategoryDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_providerCategoryDescriptor == null) - _providerCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderCategoryDescriptor", _providerCategoryDescriptorId); - - return _providerCategoryDescriptor; - } - set - { - _providerCategoryDescriptor = value; - _providerCategoryDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - public virtual int? ProviderProfitabilityDescriptorId + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_providerProfitabilityDescriptorId == default(int?)) - _providerProfitabilityDescriptorId = string.IsNullOrWhiteSpace(_providerProfitabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptor); - - return _providerProfitabilityDescriptorId; - } - set - { - _providerProfitabilityDescriptorId = value; - _providerProfitabilityDescriptor = null; - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private int? _providerProfitabilityDescriptorId; - private string _providerProfitabilityDescriptor; - - public virtual string ProviderProfitabilityDescriptor + string IDescriptor.Namespace { - get - { - if (_providerProfitabilityDescriptor == null) - _providerProfitabilityDescriptor = _providerProfitabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptorId.Value); - - return _providerProfitabilityDescriptor; - } - set - { - _providerProfitabilityDescriptor = value; - _providerProfitabilityDescriptorId = default(int?); - } + get { return Namespace; } + set { Namespace = value; } } - public virtual int ProviderStatusDescriptorId + string IDescriptor.ShortDescription { - get - { - if (_providerStatusDescriptorId == default(int)) - _providerStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderStatusDescriptor", _providerStatusDescriptor); - - return _providerStatusDescriptorId; - } - set - { - _providerStatusDescriptorId = value; - _providerStatusDescriptor = null; - } + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- - private int _providerStatusDescriptorId; - private string _providerStatusDescriptor; - - public virtual string ProviderStatusDescriptor - { - get - { - if (_providerStatusDescriptor == null) - _providerStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderStatusDescriptor", _providerStatusDescriptorId); - - return _providerStatusDescriptor; - } - set - { - _providerStatusDescriptor = value; - _providerStatusDescriptorId = default(int); - } - } - public virtual bool? SchoolIndicator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -16930,51 +17183,11 @@ public virtual string ProviderStatusDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the CommunityOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICommunityProvider.CommunityOrganizationResourceId - { - get { return CommunityOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -16985,10 +17198,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, - { "ProviderCategoryDescriptor", new LookupColumnDetails { PropertyName = "ProviderCategoryDescriptorId", LookupTypeName = "ProviderCategoryDescriptor"} }, - { "ProviderProfitabilityDescriptor", new LookupColumnDetails { PropertyName = "ProviderProfitabilityDescriptorId", LookupTypeName = "ProviderProfitabilityDescriptor"} }, - { "ProviderStatusDescriptor", new LookupColumnDetails { PropertyName = "ProviderStatusDescriptorId", LookupTypeName = "ProviderStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -17003,7 +17212,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CommunityProviderId", CommunityProviderId); + keyValues.Add("ClassroomPositionDescriptorId", ClassroomPositionDescriptorId); return keyValues; } @@ -17067,31 +17276,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProvider)target); + return this.SynchronizeTo((Entities.Common.EdFi.IClassroomPositionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICommunityProvider) target, null); + this.MapTo((Entities.Common.EdFi.IClassroomPositionDescriptor) target, null); } } } -// Aggregate: CommunityProviderLicense +// Aggregate: Cohort -namespace EdFi.Ods.Entities.NHibernate.CommunityProviderLicenseAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CohortAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CommunityProviderLicenseReferenceData : IHasPrimaryKeyValues + public class CohortReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long CommunityProviderId { get; set; } - public virtual string LicenseIdentifier { get; set; } - public virtual string LicensingOrganization { get; set; } + public virtual string CohortIdentifier { get; set; } + public virtual long EducationOrganizationId { get; set; } // ------------------------------------------------------------- /// @@ -17112,9 +17320,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CommunityProviderId", CommunityProviderId); - keyValues.Add("LicenseIdentifier", LicenseIdentifier); - keyValues.Add("LicensingOrganization", LicensingOrganization); + keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -17165,19 +17372,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CommunityProviderLicense table of the CommunityProviderLicense aggregate in the ODS database. + /// A class which represents the edfi.Cohort table of the Cohort aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CommunityProviderLicense : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICommunityProviderLicense, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Cohort : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICohort, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CommunityProviderLicense() + public Cohort() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CohortPrograms = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -17186,11 +17394,9 @@ public CommunityProviderLicense() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long CommunityProviderId { get; set; } - [DomainSignature] - public virtual string LicenseIdentifier { get; set; } + public virtual string CohortIdentifier { get; set; } [DomainSignature] - public virtual string LicensingOrganization { get; set; } + public virtual long EducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -17201,124 +17407,109 @@ public CommunityProviderLicense() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AuthorizedFacilityCapacity { get; set; } - public virtual DateTime LicenseEffectiveDate + public virtual int? AcademicSubjectDescriptorId { - get { return _licenseEffectiveDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _licenseEffectiveDate = new DateTime(value.Year, value.Month, value.Day); } - } + get + { + if (_academicSubjectDescriptorId == default(int?)) + _academicSubjectDescriptorId = string.IsNullOrWhiteSpace(_academicSubjectDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - private DateTime _licenseEffectiveDate; - - public virtual DateTime? LicenseExpirationDate - { - get { return _licenseExpirationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _licenseExpirationDate = null; - } else - { - var given = (DateTime) value; - _licenseExpirationDate = new DateTime(given.Year, given.Month, given.Day); - } + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; } } - private DateTime? _licenseExpirationDate; - - public virtual DateTime? LicenseIssueDate + private int? _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + public virtual string AcademicSubjectDescriptor { - get { return _licenseIssueDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _licenseIssueDate = null; - } else - { - var given = (DateTime) value; - _licenseIssueDate = new DateTime(given.Year, given.Month, given.Day); - } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = _academicSubjectDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId.Value); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int?); } } - - private DateTime? _licenseIssueDate; - - public virtual int? LicenseStatusDescriptorId + public virtual string CohortDescription { get; set; } + public virtual int? CohortScopeDescriptorId { get { - if (_licenseStatusDescriptorId == default(int?)) - _licenseStatusDescriptorId = string.IsNullOrWhiteSpace(_licenseStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseStatusDescriptor", _licenseStatusDescriptor); + if (_cohortScopeDescriptorId == default(int?)) + _cohortScopeDescriptorId = string.IsNullOrWhiteSpace(_cohortScopeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortScopeDescriptor", _cohortScopeDescriptor); - return _licenseStatusDescriptorId; + return _cohortScopeDescriptorId; } set { - _licenseStatusDescriptorId = value; - _licenseStatusDescriptor = null; + _cohortScopeDescriptorId = value; + _cohortScopeDescriptor = null; } } - private int? _licenseStatusDescriptorId; - private string _licenseStatusDescriptor; + private int? _cohortScopeDescriptorId; + private string _cohortScopeDescriptor; - public virtual string LicenseStatusDescriptor + public virtual string CohortScopeDescriptor { get { - if (_licenseStatusDescriptor == null) - _licenseStatusDescriptor = _licenseStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseStatusDescriptor", _licenseStatusDescriptorId.Value); + if (_cohortScopeDescriptor == null) + _cohortScopeDescriptor = _cohortScopeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortScopeDescriptor", _cohortScopeDescriptorId.Value); - return _licenseStatusDescriptor; + return _cohortScopeDescriptor; } set { - _licenseStatusDescriptor = value; - _licenseStatusDescriptorId = default(int?); + _cohortScopeDescriptor = value; + _cohortScopeDescriptorId = default(int?); } } - public virtual int LicenseTypeDescriptorId + public virtual int CohortTypeDescriptorId { get { - if (_licenseTypeDescriptorId == default(int)) - _licenseTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseTypeDescriptor", _licenseTypeDescriptor); + if (_cohortTypeDescriptorId == default(int)) + _cohortTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortTypeDescriptor", _cohortTypeDescriptor); - return _licenseTypeDescriptorId; + return _cohortTypeDescriptorId; } set { - _licenseTypeDescriptorId = value; - _licenseTypeDescriptor = null; + _cohortTypeDescriptorId = value; + _cohortTypeDescriptor = null; } } - private int _licenseTypeDescriptorId; - private string _licenseTypeDescriptor; + private int _cohortTypeDescriptorId; + private string _cohortTypeDescriptor; - public virtual string LicenseTypeDescriptor + public virtual string CohortTypeDescriptor { get { - if (_licenseTypeDescriptor == null) - _licenseTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseTypeDescriptor", _licenseTypeDescriptorId); + if (_cohortTypeDescriptor == null) + _cohortTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortTypeDescriptor", _cohortTypeDescriptorId); - return _licenseTypeDescriptor; + return _cohortTypeDescriptor; } set { - _licenseTypeDescriptor = value; - _licenseTypeDescriptorId = default(int); + _cohortTypeDescriptor = value; + _cohortTypeDescriptorId = default(int); } } - public virtual int? OldestAgeAuthorizedToServe { get; set; } - public virtual int? YoungestAgeAuthorizedToServe { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -17363,14 +17554,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityProviderReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the CommunityProvider resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderResourceId + string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator { - get { return CommunityProviderReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICohort.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } set { } } @@ -17379,13 +17579,61 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _cohortPrograms; + private ICollection _cohortProgramsCovariant; + public virtual ICollection CohortPrograms + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _cohortPrograms) + if (item.Cohort == null) + item.Cohort = this; + // ------------------------------------------------------------- + + return _cohortPrograms; + } + set + { + _cohortPrograms = value; + _cohortProgramsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICohort.CohortPrograms + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _cohortPrograms) + if (item.Cohort == null) + item.Cohort = this; + // ------------------------------------------------------------- + + return _cohortProgramsCovariant; + } + set + { + CohortPrograms = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LicenseStatusDescriptor", new LookupColumnDetails { PropertyName = "LicenseStatusDescriptorId", LookupTypeName = "LicenseStatusDescriptor"} }, - { "LicenseTypeDescriptor", new LookupColumnDetails { PropertyName = "LicenseTypeDescriptorId", LookupTypeName = "LicenseTypeDescriptor"} }, + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, + { "CohortScopeDescriptor", new LookupColumnDetails { PropertyName = "CohortScopeDescriptorId", LookupTypeName = "CohortScopeDescriptor"} }, + { "CohortTypeDescriptor", new LookupColumnDetails { PropertyName = "CohortTypeDescriptorId", LookupTypeName = "CohortTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -17400,9 +17648,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CommunityProviderId", CommunityProviderId); - keyValues.Add("LicenseIdentifier", LicenseIdentifier); - keyValues.Add("LicensingOrganization", LicensingOrganization); + keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -17466,79 +17713,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProviderLicense)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICohort)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICommunityProviderLicense) target, null); + this.MapTo((Entities.Common.EdFi.ICohort) target, null); } } -} -// Aggregate: CompetencyLevelDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CompetencyLevelDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CompetencyLevelDescriptor table of the CompetencyLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CohortProgram table of the Cohort aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CompetencyLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICompetencyLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CohortProgram : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICohortProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CompetencyLevelDescriptorId + public CohortProgram() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Cohort Cohort { get; set; } + + Entities.Common.EdFi.ICohort ICohortProgram.Cohort { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Cohort; } + set { Cohort = (Cohort) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual long ProgramEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ProgramName { get; set; } + [DomainSignature] + public virtual int ProgramTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + public virtual string ProgramTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -17552,11 +17814,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator + { + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICohortProgram.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -17567,6 +17878,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -17577,11 +17889,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Cohort as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -17645,43 +17959,117 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICohortProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICompetencyLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICohortProgram) target, null); } + void IChildEntity.SetParent(object value) + { + Cohort = (Cohort) value; + } } } -// Aggregate: CompetencyObjective +// Aggregate: CohortScopeDescriptor -namespace EdFi.Ods.Entities.NHibernate.CompetencyObjectiveAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CohortScopeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.CohortScopeDescriptor table of the CohortScopeDescriptor aggregate in the ODS database. /// - public class CompetencyObjectiveReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class CohortScopeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICohortScopeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual string Objective { get; set; } - public virtual int ObjectiveGradeLevelDescriptorId { get; set; } + [DomainSignature] + public virtual int CohortScopeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -17690,9 +18078,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("Objective", Objective); - keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); + keyValues.Add("CohortScopeDescriptorId", CohortScopeDescriptorId); return keyValues; } @@ -17713,8 +18099,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -17731,90 +18127,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICohortScopeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICohortScopeDescriptor) target, null); + } + } +} +// Aggregate: CohortTypeDescriptor +namespace EdFi.Ods.Entities.NHibernate.CohortTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CompetencyObjective table of the CompetencyObjective aggregate in the ODS database. + /// A class which represents the edfi.CohortTypeDescriptor table of the CohortTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CompetencyObjective : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CohortTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICohortTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CompetencyObjective() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string Objective { get; set; } - [DomainSignature] - public virtual int ObjectiveGradeLevelDescriptorId - { - get - { - if (_objectiveGradeLevelDescriptorId == default(int)) - _objectiveGradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _objectiveGradeLevelDescriptor); - - return _objectiveGradeLevelDescriptorId; - } - set - { - _objectiveGradeLevelDescriptorId = value; - _objectiveGradeLevelDescriptor = null; - } - } - - private int _objectiveGradeLevelDescriptorId; - private string _objectiveGradeLevelDescriptor; - - public virtual string ObjectiveGradeLevelDescriptor + public virtual int CohortTypeDescriptorId { - get - { - if (_objectiveGradeLevelDescriptor == null) - _objectiveGradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _objectiveGradeLevelDescriptorId); - - return _objectiveGradeLevelDescriptor; - } - set - { - _objectiveGradeLevelDescriptor = value; - _objectiveGradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CompetencyObjectiveId { get; set; } - public virtual string Description { get; set; } - public virtual string SuccessCriteria { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -17825,60 +18228,11 @@ public virtual string ObjectiveGradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -17889,7 +18243,6 @@ string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscrimina // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ObjectiveGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "ObjectiveGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -17904,9 +18257,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("Objective", Objective); - keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); + keyValues.Add("CohortTypeDescriptorId", CohortTypeDescriptorId); return keyValues; } @@ -17970,41 +18321,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyObjective)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICohortTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICompetencyObjective) target, null); + this.MapTo((Entities.Common.EdFi.ICohortTypeDescriptor) target, null); } } } -// Aggregate: Contact +// Aggregate: CohortYearTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.ContactAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CohortYearTypeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.CohortYearTypeDescriptor table of the CohortYearTypeDescriptor aggregate in the ODS database. /// - public class ContactReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class CohortYearTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICohortYearTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int ContactUSI { get; set; } + [DomainSignature] + public virtual int CohortYearTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -18013,7 +18436,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ContactUSI", ContactUSI); + keyValues.Add("CohortYearTypeDescriptorId", CohortYearTypeDescriptorId); return keyValues; } @@ -18034,8 +18457,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -18052,38 +18485,50 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICohortYearTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICohortYearTypeDescriptor) target, null); + } + } +} +// Aggregate: CommunityOrganization +namespace EdFi.Ods.Entities.NHibernate.CommunityOrganizationAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Contact table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CommunityOrganization table of the CommunityOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Contact : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IContact, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CommunityOrganization : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.ICommunityOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public virtual void SuspendReferenceAssignmentCheck() { } - - public Contact() + public CommunityOrganization() { - ContactAddresses = new HashSet(); - ContactElectronicMails = new HashSet(); - ContactInternationalAddresses = new HashSet(); - ContactLanguages = new HashSet(); - ContactOtherNames = new HashSet(); - ContactPersonalIdentificationDocuments = new HashSet(); - ContactTelephones = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -18091,176 +18536,43 @@ public Contact() // ============================================================= // Primary Key // ------------------------------------------------------------- - [Display(Name="ContactUniqueId")][DomainSignature] - public virtual int ContactUSI + [DomainSignature] + public virtual long CommunityOrganizationId { - get - { - if (_contactUSI == default(int) && _contactUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Contact", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_contactUniqueId, out var usi)) - { - _contactUSI = usi; - } - } - - return _contactUSI; - } - set - { - _contactUSI = value; - } + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } } - - private int _contactUSI; - string IIdentifiablePerson.UniqueId { get { return ContactUniqueId; } } - + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string ContactUniqueId - { - get - { - if (_contactUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Contact", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_contactUSI, out var uniqueId)) - { - _contactUniqueId = uniqueId; - } - } - - return _contactUniqueId; - } - set - { - _contactUniqueId = value; - } - } - private string _contactUniqueId; - - public virtual string FirstName { get; set; } - public virtual string GenderIdentity { get; set; } - public virtual string GenerationCodeSuffix { get; set; } - public virtual int? HighestCompletedLevelOfEducationDescriptorId - { - get - { - if (_highestCompletedLevelOfEducationDescriptorId == default(int?)) - _highestCompletedLevelOfEducationDescriptorId = string.IsNullOrWhiteSpace(_highestCompletedLevelOfEducationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptor); - - return _highestCompletedLevelOfEducationDescriptorId; - } - set - { - _highestCompletedLevelOfEducationDescriptorId = value; - _highestCompletedLevelOfEducationDescriptor = null; - } - } - - private int? _highestCompletedLevelOfEducationDescriptorId; - private string _highestCompletedLevelOfEducationDescriptor; - - public virtual string HighestCompletedLevelOfEducationDescriptor + string IEducationOrganization.NameOfInstitution { - get - { - if (_highestCompletedLevelOfEducationDescriptor == null) - _highestCompletedLevelOfEducationDescriptor = _highestCompletedLevelOfEducationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptorId.Value); - - return _highestCompletedLevelOfEducationDescriptor; - } - set - { - _highestCompletedLevelOfEducationDescriptor = value; - _highestCompletedLevelOfEducationDescriptorId = default(int?); - } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } } - public virtual string LastSurname { get; set; } - public virtual string LoginId { get; set; } - public virtual string MaidenName { get; set; } - public virtual string MiddleName { get; set; } - public virtual string PersonalTitlePrefix { get; set; } - public virtual string PersonId { get; set; } - public virtual string PreferredFirstName { get; set; } - public virtual string PreferredLastSurname { get; set; } - public virtual int? SexDescriptorId + string IEducationOrganization.OperationalStatusDescriptor { - get - { - if (_sexDescriptorId == default(int?)) - _sexDescriptorId = string.IsNullOrWhiteSpace(_sexDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); - - return _sexDescriptorId; - } - set - { - _sexDescriptorId = value; - _sexDescriptor = null; - } + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } } - - private int? _sexDescriptorId; - private string _sexDescriptor; - - public virtual string SexDescriptor + string IEducationOrganization.ShortNameOfInstitution { - get - { - if (_sexDescriptor == null) - _sexDescriptor = _sexDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId.Value); - - return _sexDescriptor; - } - set - { - _sexDescriptor = value; - _sexDescriptorId = default(int?); - } + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } } - public virtual int? SourceSystemDescriptorId + string IEducationOrganization.WebSite { - get - { - if (_sourceSystemDescriptorId == default(int?)) - _sourceSystemDescriptorId = string.IsNullOrWhiteSpace(_sourceSystemDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SourceSystemDescriptor", _sourceSystemDescriptor); - - return _sourceSystemDescriptorId; - } - set - { - _sourceSystemDescriptorId = value; - _sourceSystemDescriptor = null; - } + get { return WebSite; } + set { WebSite = value; } } + // ------------------------------------------------------------- - private int? _sourceSystemDescriptorId; - private string _sourceSystemDescriptor; - - public virtual string SourceSystemDescriptor - { - get - { - if (_sourceSystemDescriptor == null) - _sourceSystemDescriptor = _sourceSystemDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SourceSystemDescriptor", _sourceSystemDescriptorId.Value); - - return _sourceSystemDescriptor; - } - set - { - _sourceSystemDescriptor = value; - _sourceSystemDescriptorId = default(int?); - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -18305,368 +18617,17 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.PersonAggregate.EdFi.PersonReferenceData PersonReferenceData { get; set; } - - /// - /// Read-only property that allows the Person discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IContact.PersonDiscriminator - { - get { return PersonReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Person resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IContact.PersonResourceId - { - get { return PersonReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _contactAddresses; - private ICollection _contactAddressesCovariant; - public virtual ICollection ContactAddresses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactAddresses; - } - set - { - _contactAddresses = value; - _contactAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactAddresses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactAddressesCovariant; - } - set - { - ContactAddresses = new HashSet(value.Cast()); - } - } - - - private ICollection _contactElectronicMails; - private ICollection _contactElectronicMailsCovariant; - public virtual ICollection ContactElectronicMails - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactElectronicMails) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactElectronicMails; - } - set - { - _contactElectronicMails = value; - _contactElectronicMailsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactElectronicMails - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactElectronicMails) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactElectronicMailsCovariant; - } - set - { - ContactElectronicMails = new HashSet(value.Cast()); - } - } - - - private ICollection _contactInternationalAddresses; - private ICollection _contactInternationalAddressesCovariant; - public virtual ICollection ContactInternationalAddresses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactInternationalAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactInternationalAddresses; - } - set - { - _contactInternationalAddresses = value; - _contactInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactInternationalAddresses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactInternationalAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactInternationalAddressesCovariant; - } - set - { - ContactInternationalAddresses = new HashSet(value.Cast()); - } - } - - - private ICollection _contactLanguages; - private ICollection _contactLanguagesCovariant; - public virtual ICollection ContactLanguages - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguages) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactLanguages; - } - set - { - _contactLanguages = value; - _contactLanguagesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactLanguages - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguages) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactLanguagesCovariant; - } - set - { - ContactLanguages = new HashSet(value.Cast()); - } - } - - - private ICollection _contactOtherNames; - private ICollection _contactOtherNamesCovariant; - public virtual ICollection ContactOtherNames - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactOtherNames) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactOtherNames; - } - set - { - _contactOtherNames = value; - _contactOtherNamesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactOtherNames - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactOtherNames) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactOtherNamesCovariant; - } - set - { - ContactOtherNames = new HashSet(value.Cast()); - } - } - - - private ICollection _contactPersonalIdentificationDocuments; - private ICollection _contactPersonalIdentificationDocumentsCovariant; - public virtual ICollection ContactPersonalIdentificationDocuments - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactPersonalIdentificationDocuments) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactPersonalIdentificationDocuments; - } - set - { - _contactPersonalIdentificationDocuments = value; - _contactPersonalIdentificationDocumentsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactPersonalIdentificationDocuments - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactPersonalIdentificationDocuments) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactPersonalIdentificationDocumentsCovariant; - } - set - { - ContactPersonalIdentificationDocuments = new HashSet(value.Cast()); - } - } - - - private ICollection _contactTelephones; - private ICollection _contactTelephonesCovariant; - public virtual ICollection ContactTelephones - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactTelephones) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactTelephones; - } - set - { - _contactTelephones = value; - _contactTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactTelephones - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactTelephones) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactTelephonesCovariant; - } - set - { - ContactTelephones = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "HighestCompletedLevelOfEducationDescriptor", new LookupColumnDetails { PropertyName = "HighestCompletedLevelOfEducationDescriptorId", LookupTypeName = "LevelOfEducationDescriptor"} }, - { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, - { "SourceSystemDescriptor", new LookupColumnDetails { PropertyName = "SourceSystemDescriptorId", LookupTypeName = "SourceSystemDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -18681,7 +18642,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ContactUSI", ContactUSI); + keyValues.Add("CommunityOrganizationId", CommunityOrganizationId); return keyValues; } @@ -18745,33 +18706,35 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContact)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICommunityOrganization)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContact) target, null); + this.MapTo((Entities.Common.EdFi.ICommunityOrganization) target, null); } } +} +// Aggregate: CommunityProvider + +namespace EdFi.Ods.Entities.NHibernate.CommunityProviderAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactAddress table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CommunityProvider table of the CommunityProvider aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CommunityProvider : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.ICommunityProvider, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ContactAddress() + public CommunityProvider() { - ContactAddressPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -18779,143 +18742,148 @@ public ContactAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } + [DomainSignature] + public virtual long CommunityProviderId + { + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } + } + + // ------------------------------------------------------------- - Entities.Common.EdFi.IContact IContactAddress.Contact + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IEducationOrganization.NameOfInstitution { - get { return Contact; } - set { Contact = (Contact) value; } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } + } + string IEducationOrganization.OperationalStatusDescriptor + { + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } + } + string IEducationOrganization.ShortNameOfInstitution + { + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } + } + string IEducationOrganization.WebSite + { + get { return WebSite; } + set { WebSite = value; } } + // ------------------------------------------------------------- - [DomainSignature] - public virtual int AddressTypeDescriptorId + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual long? CommunityOrganizationId { get; set; } + public virtual bool? LicenseExemptIndicator { get; set; } + public virtual int ProviderCategoryDescriptorId { get { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + if (_providerCategoryDescriptorId == default(int)) + _providerCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderCategoryDescriptor", _providerCategoryDescriptor); - return _addressTypeDescriptorId; + return _providerCategoryDescriptorId; } set { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; + _providerCategoryDescriptorId = value; + _providerCategoryDescriptor = null; } } - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; + private int _providerCategoryDescriptorId; + private string _providerCategoryDescriptor; - public virtual string AddressTypeDescriptor + public virtual string ProviderCategoryDescriptor { get { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + if (_providerCategoryDescriptor == null) + _providerCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderCategoryDescriptor", _providerCategoryDescriptorId); - return _addressTypeDescriptor; + return _providerCategoryDescriptor; } set { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); + _providerCategoryDescriptor = value; + _providerCategoryDescriptorId = default(int); } } - [DomainSignature] - public virtual string City { get; set; } - [DomainSignature] - public virtual string PostalCode { get; set; } - [DomainSignature] - public virtual int StateAbbreviationDescriptorId + public virtual int? ProviderProfitabilityDescriptorId { get { - if (_stateAbbreviationDescriptorId == default(int)) - _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); + if (_providerProfitabilityDescriptorId == default(int?)) + _providerProfitabilityDescriptorId = string.IsNullOrWhiteSpace(_providerProfitabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptor); - return _stateAbbreviationDescriptorId; + return _providerProfitabilityDescriptorId; } set { - _stateAbbreviationDescriptorId = value; - _stateAbbreviationDescriptor = null; + _providerProfitabilityDescriptorId = value; + _providerProfitabilityDescriptor = null; } } - private int _stateAbbreviationDescriptorId; - private string _stateAbbreviationDescriptor; + private int? _providerProfitabilityDescriptorId; + private string _providerProfitabilityDescriptor; - public virtual string StateAbbreviationDescriptor + public virtual string ProviderProfitabilityDescriptor { get { - if (_stateAbbreviationDescriptor == null) - _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); + if (_providerProfitabilityDescriptor == null) + _providerProfitabilityDescriptor = _providerProfitabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptorId.Value); - return _stateAbbreviationDescriptor; + return _providerProfitabilityDescriptor; } set { - _stateAbbreviationDescriptor = value; - _stateAbbreviationDescriptorId = default(int); + _providerProfitabilityDescriptor = value; + _providerProfitabilityDescriptorId = default(int?); } } - [DomainSignature] - public virtual string StreetNumberName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string ApartmentRoomSuiteNumber { get; set; } - public virtual string BuildingSiteNumber { get; set; } - public virtual string CongressionalDistrict { get; set; } - public virtual string CountyFIPSCode { get; set; } - public virtual bool? DoNotPublishIndicator { get; set; } - public virtual string Latitude { get; set; } - public virtual int? LocaleDescriptorId + public virtual int ProviderStatusDescriptorId { get { - if (_localeDescriptorId == default(int?)) - _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); + if (_providerStatusDescriptorId == default(int)) + _providerStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderStatusDescriptor", _providerStatusDescriptor); - return _localeDescriptorId; + return _providerStatusDescriptorId; } set { - _localeDescriptorId = value; - _localeDescriptor = null; + _providerStatusDescriptorId = value; + _providerStatusDescriptor = null; } } - private int? _localeDescriptorId; - private string _localeDescriptor; + private int _providerStatusDescriptorId; + private string _providerStatusDescriptor; - public virtual string LocaleDescriptor + public virtual string ProviderStatusDescriptor { get { - if (_localeDescriptor == null) - _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); + if (_providerStatusDescriptor == null) + _providerStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderStatusDescriptor", _providerStatusDescriptorId); - return _localeDescriptor; + return _providerStatusDescriptor; } set { - _localeDescriptor = value; - _localeDescriptorId = default(int?); + _providerStatusDescriptor = value; + _providerStatusDescriptorId = default(int); } } - public virtual string Longitude { get; set; } - public virtual string NameOfCounty { get; set; } + public virtual bool? SchoolIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -18960,66 +18928,31 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityOrganizationReferenceData { get; set; } - private ICollection _contactAddressPeriods; - private ICollection _contactAddressPeriodsCovariant; - public virtual ICollection ContactAddressPeriods + /// + /// Read-only property that allows the CommunityOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICommunityProvider.CommunityOrganizationResourceId { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddressPeriods) - if (item.ContactAddress == null) - item.ContactAddress = this; - // ------------------------------------------------------------- - - return _contactAddressPeriods; - } - set - { - _contactAddressPeriods = value; - _contactAddressPeriodsCovariant = new CovariantCollectionAdapter(value); - } + get { return CommunityOrganizationReferenceData?.Id; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContactAddress.ContactAddressPeriods - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddressPeriods) - if (item.ContactAddress == null) - item.ContactAddress = this; - // ------------------------------------------------------------- - - return _contactAddressPeriodsCovariant; - } - set - { - ContactAddressPeriods = new HashSet(value.Cast()); - } - } + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + { "ProviderCategoryDescriptor", new LookupColumnDetails { PropertyName = "ProviderCategoryDescriptorId", LookupTypeName = "ProviderCategoryDescriptor"} }, + { "ProviderProfitabilityDescriptor", new LookupColumnDetails { PropertyName = "ProviderProfitabilityDescriptorId", LookupTypeName = "ProviderProfitabilityDescriptor"} }, + { "ProviderStatusDescriptor", new LookupColumnDetails { PropertyName = "ProviderStatusDescriptorId", LookupTypeName = "ProviderStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -19030,15 +18963,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); - keyValues.Add("City", City); - keyValues.Add("PostalCode", PostalCode); - keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); - keyValues.Add("StreetNumberName", StreetNumberName); + keyValues.Add("CommunityProviderId", CommunityProviderId); return keyValues; } @@ -19102,162 +19031,54 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactAddress)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProvider)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactAddress) target, null); + this.MapTo((Entities.Common.EdFi.ICommunityProvider) target, null); } - void IChildEntity.SetParent(object value) - { - Contact = (Contact) value; - } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 +} +// Aggregate: CommunityProviderLicense +namespace EdFi.Ods.Entities.NHibernate.CommunityProviderLicenseAggregate.EdFi +{ /// - /// A class which represents the edfi.ContactAddressPeriod table of the Contact aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ContactAddressPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CommunityProviderLicenseReferenceData : IHasPrimaryKeyValues { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ContactAddressPeriod() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ContactAddress ContactAddress { get; set; } - - Entities.Common.EdFi.IContactAddress IContactAddressPeriod.ContactAddress - { - get { return ContactAddress; } - set { ContactAddress = (ContactAddress) value; } - } - - [DomainSignature] - public virtual DateTime BeginDate - { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _beginDate; - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual long CommunityProviderId { get; set; } + public virtual string LicenseIdentifier { get; set; } + public virtual string LicensingOrganization { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ContactAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); + keyValues.Add("CommunityProviderId", CommunityProviderId); + keyValues.Add("LicenseIdentifier", LicenseIdentifier); + keyValues.Add("LicensingOrganization", LicensingOrganization); return keyValues; } @@ -19278,18 +19099,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -19306,51 +19117,31 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IContactAddressPeriod)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IContactAddressPeriod) target, null); - } - - void IChildEntity.SetParent(object value) - { - ContactAddress = (ContactAddress) value; - } } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactElectronicMail table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CommunityProviderLicense table of the CommunityProviderLicense aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactElectronicMail : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactElectronicMail, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CommunityProviderLicense : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICommunityProviderLicense, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactElectronicMail() + public CommunityProviderLicense() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -19358,64 +19149,140 @@ public ContactElectronicMail() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } + [DomainSignature] + public virtual long CommunityProviderId { get; set; } + [DomainSignature] + public virtual string LicenseIdentifier { get; set; } + [DomainSignature] + public virtual string LicensingOrganization { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.IContact IContactElectronicMail.Contact + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int? AuthorizedFacilityCapacity { get; set; } + public virtual DateTime LicenseEffectiveDate { - get { return Contact; } - set { Contact = (Contact) value; } + get { return _licenseEffectiveDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _licenseEffectiveDate = new DateTime(value.Year, value.Month, value.Day); } } - [DomainSignature] - public virtual string ElectronicMailAddress { get; set; } - [DomainSignature] - public virtual int ElectronicMailTypeDescriptorId + private DateTime _licenseEffectiveDate; + + public virtual DateTime? LicenseExpirationDate + { + get { return _licenseExpirationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _licenseExpirationDate = null; + } else + { + var given = (DateTime) value; + _licenseExpirationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _licenseExpirationDate; + + public virtual DateTime? LicenseIssueDate + { + get { return _licenseIssueDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _licenseIssueDate = null; + } else + { + var given = (DateTime) value; + _licenseIssueDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _licenseIssueDate; + + public virtual int? LicenseStatusDescriptorId { get { - if (_electronicMailTypeDescriptorId == default(int)) - _electronicMailTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptor); + if (_licenseStatusDescriptorId == default(int?)) + _licenseStatusDescriptorId = string.IsNullOrWhiteSpace(_licenseStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseStatusDescriptor", _licenseStatusDescriptor); - return _electronicMailTypeDescriptorId; + return _licenseStatusDescriptorId; } set { - _electronicMailTypeDescriptorId = value; - _electronicMailTypeDescriptor = null; + _licenseStatusDescriptorId = value; + _licenseStatusDescriptor = null; } } - private int _electronicMailTypeDescriptorId; - private string _electronicMailTypeDescriptor; + private int? _licenseStatusDescriptorId; + private string _licenseStatusDescriptor; - public virtual string ElectronicMailTypeDescriptor + public virtual string LicenseStatusDescriptor { get { - if (_electronicMailTypeDescriptor == null) - _electronicMailTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptorId); + if (_licenseStatusDescriptor == null) + _licenseStatusDescriptor = _licenseStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseStatusDescriptor", _licenseStatusDescriptorId.Value); - return _electronicMailTypeDescriptor; + return _licenseStatusDescriptor; } set { - _electronicMailTypeDescriptor = value; - _electronicMailTypeDescriptorId = default(int); + _licenseStatusDescriptor = value; + _licenseStatusDescriptorId = default(int?); } } - // ------------------------------------------------------------- + public virtual int LicenseTypeDescriptorId + { + get + { + if (_licenseTypeDescriptorId == default(int)) + _licenseTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseTypeDescriptor", _licenseTypeDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _licenseTypeDescriptorId; + } + set + { + _licenseTypeDescriptorId = value; + _licenseTypeDescriptor = null; + } + } - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual bool? DoNotPublishIndicator { get; set; } - public virtual bool? PrimaryEmailAddressIndicator { get; set; } + private int _licenseTypeDescriptorId; + private string _licenseTypeDescriptor; + + public virtual string LicenseTypeDescriptor + { + get + { + if (_licenseTypeDescriptor == null) + _licenseTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseTypeDescriptor", _licenseTypeDescriptorId); + + return _licenseTypeDescriptor; + } + set + { + _licenseTypeDescriptor = value; + _licenseTypeDescriptorId = default(int); + } + } + public virtual int? OldestAgeAuthorizedToServe { get; set; } + public virtual int? YoungestAgeAuthorizedToServe { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -19460,6 +19327,17 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityProviderReferenceData { get; set; } + + /// + /// Read-only property that allows the CommunityProvider resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderResourceId + { + get { return CommunityProviderReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -19470,7 +19348,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ElectronicMailTypeDescriptor", new LookupColumnDetails { PropertyName = "ElectronicMailTypeDescriptorId", LookupTypeName = "ElectronicMailTypeDescriptor"} }, + { "LicenseStatusDescriptor", new LookupColumnDetails { PropertyName = "LicenseStatusDescriptorId", LookupTypeName = "LicenseStatusDescriptor"} }, + { "LicenseTypeDescriptor", new LookupColumnDetails { PropertyName = "LicenseTypeDescriptorId", LookupTypeName = "LicenseTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -19481,12 +19360,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); - keyValues.Add("ElectronicMailTypeDescriptorId", ElectronicMailTypeDescriptorId); + keyValues.Add("CommunityProviderId", CommunityProviderId); + keyValues.Add("LicenseIdentifier", LicenseIdentifier); + keyValues.Add("LicensingOrganization", LicensingOrganization); return keyValues; } @@ -19550,175 +19430,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactElectronicMail)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProviderLicense)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactElectronicMail) target, null); + this.MapTo((Entities.Common.EdFi.ICommunityProviderLicense) target, null); } - void IChildEntity.SetParent(object value) - { - Contact = (Contact) value; - } } +} +// Aggregate: CompetencyLevelDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CompetencyLevelDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactInternationalAddress table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CompetencyLevelDescriptor table of the CompetencyLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactInternationalAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CompetencyLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICompetencyLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ContactInternationalAddress() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } - - Entities.Common.EdFi.IContact IContactInternationalAddress.Contact - { - get { return Contact; } - set { Contact = (Contact) value; } - } - [DomainSignature] - public virtual int AddressTypeDescriptorId - { - get - { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); - - return _addressTypeDescriptorId; - } - set - { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; - } - } - - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; - - public virtual string AddressTypeDescriptor + public virtual int CompetencyLevelDescriptorId { - get - { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); - - return _addressTypeDescriptor; - } - set - { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string AddressLine1 { get; set; } - public virtual string AddressLine2 { get; set; } - public virtual string AddressLine3 { get; set; } - public virtual string AddressLine4 { get; set; } - public virtual DateTime? BeginDate + string IDescriptor.CodeValue { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return CodeValue; } + set { CodeValue = value; } } - - private DateTime? _beginDate; - - public virtual int CountryDescriptorId + string IDescriptor.Description { - get - { - if (_countryDescriptorId == default(int)) - _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); - - return _countryDescriptorId; - } - set - { - _countryDescriptorId = value; - _countryDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _countryDescriptorId; - private string _countryDescriptor; - - public virtual string CountryDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_countryDescriptor == null) - _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); - - return _countryDescriptor; - } - set - { - _countryDescriptor = value; - _countryDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - public virtual DateTime? EndDate + DateTime? IDescriptor.EffectiveEndDate { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- - private DateTime? _endDate; - - public virtual string Latitude { get; set; } - public virtual string Longitude { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -19729,35 +19516,6 @@ public virtual DateTime? EndDate // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -19773,8 +19531,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -19785,11 +19541,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); return keyValues; } @@ -19853,37 +19609,117 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactInternationalAddress)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactInternationalAddress) target, null); + this.MapTo((Entities.Common.EdFi.ICompetencyLevelDescriptor) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: CompetencyObjective + +namespace EdFi.Ods.Entities.NHibernate.CompetencyObjectiveAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class CompetencyObjectiveReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual string Objective { get; set; } + public virtual int ObjectiveGradeLevelDescriptorId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - Contact = (Contact) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Objective", Objective); + keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactLanguage table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CompetencyObjective table of the CompetencyObjective aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactLanguage : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CompetencyObjective : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactLanguage() + public CompetencyObjective() { - ContactLanguageUses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -19891,48 +19727,43 @@ public ContactLanguage() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } - - Entities.Common.EdFi.IContact IContactLanguage.Contact - { - get { return Contact; } - set { Contact = (Contact) value; } - } - [DomainSignature] - public virtual int LanguageDescriptorId + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Objective { get; set; } + [DomainSignature] + public virtual int ObjectiveGradeLevelDescriptorId { get { - if (_languageDescriptorId == default(int)) - _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); + if (_objectiveGradeLevelDescriptorId == default(int)) + _objectiveGradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _objectiveGradeLevelDescriptor); - return _languageDescriptorId; + return _objectiveGradeLevelDescriptorId; } set { - _languageDescriptorId = value; - _languageDescriptor = null; + _objectiveGradeLevelDescriptorId = value; + _objectiveGradeLevelDescriptor = null; } } - private int _languageDescriptorId; - private string _languageDescriptor; + private int _objectiveGradeLevelDescriptorId; + private string _objectiveGradeLevelDescriptor; - public virtual string LanguageDescriptor + public virtual string ObjectiveGradeLevelDescriptor { get { - if (_languageDescriptor == null) - _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); + if (_objectiveGradeLevelDescriptor == null) + _objectiveGradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _objectiveGradeLevelDescriptorId); - return _languageDescriptor; + return _objectiveGradeLevelDescriptor; } set { - _languageDescriptor = value; - _languageDescriptorId = default(int); + _objectiveGradeLevelDescriptor = value; + _objectiveGradeLevelDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -19945,6 +19776,9 @@ public virtual string LanguageDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string CompetencyObjectiveId { get; set; } + public virtual string Description { get; set; } + public virtual string SuccessCriteria { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -19989,64 +19823,37 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - private ICollection _contactLanguageUses; - private ICollection _contactLanguageUsesCovariant; - public virtual ICollection ContactLanguageUses + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscriminator { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguageUses) - if (item.ContactLanguage == null) - item.ContactLanguage = this; - // ------------------------------------------------------------- - - return _contactLanguageUses; - } - set - { - _contactLanguageUses = value; - _contactLanguageUsesCovariant = new CovariantCollectionAdapter(value); - } + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContactLanguage.ContactLanguageUses + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationResourceId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguageUses) - if (item.ContactLanguage == null) - item.ContactLanguage = this; - // ------------------------------------------------------------- - - return _contactLanguageUsesCovariant; - } - set - { - ContactLanguageUses = new HashSet(value.Cast()); - } + get { return EducationOrganizationReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, + { "ObjectiveGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "ObjectiveGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -20057,11 +19864,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Objective", Objective); + keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); return keyValues; } @@ -20125,87 +19934,152 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguage)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyObjective)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactLanguage) target, null); + this.MapTo((Entities.Common.EdFi.ICompetencyObjective) target, null); } - void IChildEntity.SetParent(object value) - { - Contact = (Contact) value; - } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 +} +// Aggregate: Contact +namespace EdFi.Ods.Entities.NHibernate.ContactAggregate.EdFi +{ /// - /// A class which represents the edfi.ContactLanguageUse table of the Contact aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ContactLanguageUse : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactLanguageUse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContactReferenceData : IHasPrimaryKeyValues { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ContactLanguageUse() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ContactLanguage ContactLanguage { get; set; } - - Entities.Common.EdFi.IContactLanguage IContactLanguageUse.ContactLanguage - { - get { return ContactLanguage; } - set { ContactLanguage = (ContactLanguage) value; } - } + public virtual int ContactUSI { get; set; } + // ------------------------------------------------------------- - [DomainSignature] - public virtual int LanguageUseDescriptorId - { - get - { - if (_languageUseDescriptorId == default(int)) - _languageUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageUseDescriptor", _languageUseDescriptor); + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - return _languageUseDescriptorId; - } - set + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("ContactUSI", ContactUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _languageUseDescriptorId = value; - _languageUseDescriptor = null; + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } + + return true; } - private int _languageUseDescriptorId; - private string _languageUseDescriptor; + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - public virtual string LanguageUseDescriptor + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.Contact table of the Contact aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class Contact : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IContact, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public Contact() + { + ContactAddresses = new HashSet(); + ContactElectronicMails = new HashSet(); + ContactInternationalAddresses = new HashSet(); + ContactLanguages = new HashSet(); + ContactOtherNames = new HashSet(); + ContactPersonalIdentificationDocuments = new HashSet(); + ContactTelephones = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Display(Name="ContactUniqueId")][DomainSignature] + public virtual int ContactUSI { get { - if (_languageUseDescriptor == null) - _languageUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageUseDescriptor", _languageUseDescriptorId); - - return _languageUseDescriptor; - } + if (_contactUSI == default(int) && _contactUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Contact", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_contactUniqueId, out var usi)) + { + _contactUSI = usi; + } + } + + return _contactUSI; + } set { - _languageUseDescriptor = value; - _languageUseDescriptorId = default(int); + _contactUSI = value; } } + + private int _contactUSI; + string IIdentifiablePerson.UniqueId { get { return ContactUniqueId; } } + // ------------------------------------------------------------- // ============================================================= @@ -20216,6 +20090,141 @@ public virtual string LanguageUseDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string ContactUniqueId + { + get + { + if (_contactUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Contact", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_contactUSI, out var uniqueId)) + { + _contactUniqueId = uniqueId; + } + } + + return _contactUniqueId; + } + set + { + _contactUniqueId = value; + } + } + private string _contactUniqueId; + + public virtual string FirstName { get; set; } + public virtual string GenderIdentity { get; set; } + public virtual string GenerationCodeSuffix { get; set; } + public virtual int? HighestCompletedLevelOfEducationDescriptorId + { + get + { + if (_highestCompletedLevelOfEducationDescriptorId == default(int?)) + _highestCompletedLevelOfEducationDescriptorId = string.IsNullOrWhiteSpace(_highestCompletedLevelOfEducationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptor); + + return _highestCompletedLevelOfEducationDescriptorId; + } + set + { + _highestCompletedLevelOfEducationDescriptorId = value; + _highestCompletedLevelOfEducationDescriptor = null; + } + } + + private int? _highestCompletedLevelOfEducationDescriptorId; + private string _highestCompletedLevelOfEducationDescriptor; + + public virtual string HighestCompletedLevelOfEducationDescriptor + { + get + { + if (_highestCompletedLevelOfEducationDescriptor == null) + _highestCompletedLevelOfEducationDescriptor = _highestCompletedLevelOfEducationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptorId.Value); + + return _highestCompletedLevelOfEducationDescriptor; + } + set + { + _highestCompletedLevelOfEducationDescriptor = value; + _highestCompletedLevelOfEducationDescriptorId = default(int?); + } + } + public virtual string LastSurname { get; set; } + public virtual string LoginId { get; set; } + public virtual string MaidenName { get; set; } + public virtual string MiddleName { get; set; } + public virtual string PersonalTitlePrefix { get; set; } + public virtual string PersonId { get; set; } + public virtual string PreferredFirstName { get; set; } + public virtual string PreferredLastSurname { get; set; } + public virtual int? SexDescriptorId + { + get + { + if (_sexDescriptorId == default(int?)) + _sexDescriptorId = string.IsNullOrWhiteSpace(_sexDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); + + return _sexDescriptorId; + } + set + { + _sexDescriptorId = value; + _sexDescriptor = null; + } + } + + private int? _sexDescriptorId; + private string _sexDescriptor; + + public virtual string SexDescriptor + { + get + { + if (_sexDescriptor == null) + _sexDescriptor = _sexDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId.Value); + + return _sexDescriptor; + } + set + { + _sexDescriptor = value; + _sexDescriptorId = default(int?); + } + } + public virtual int? SourceSystemDescriptorId + { + get + { + if (_sourceSystemDescriptorId == default(int?)) + _sourceSystemDescriptorId = string.IsNullOrWhiteSpace(_sourceSystemDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SourceSystemDescriptor", _sourceSystemDescriptor); + + return _sourceSystemDescriptorId; + } + set + { + _sourceSystemDescriptorId = value; + _sourceSystemDescriptor = null; + } + } + + private int? _sourceSystemDescriptorId; + private string _sourceSystemDescriptor; + + public virtual string SourceSystemDescriptor + { + get + { + if (_sourceSystemDescriptor == null) + _sourceSystemDescriptor = _sourceSystemDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SourceSystemDescriptor", _sourceSystemDescriptorId.Value); + + return _sourceSystemDescriptor; + } + set + { + _sourceSystemDescriptor = value; + _sourceSystemDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -20260,18 +20269,368 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.PersonAggregate.EdFi.PersonReferenceData PersonReferenceData { get; set; } + + /// + /// Read-only property that allows the Person discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IContact.PersonDiscriminator + { + get { return PersonReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Person resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IContact.PersonResourceId + { + get { return PersonReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _contactAddresses; + private ICollection _contactAddressesCovariant; + public virtual ICollection ContactAddresses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactAddresses; + } + set + { + _contactAddresses = value; + _contactAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactAddresses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactAddressesCovariant; + } + set + { + ContactAddresses = new HashSet(value.Cast()); + } + } + + + private ICollection _contactElectronicMails; + private ICollection _contactElectronicMailsCovariant; + public virtual ICollection ContactElectronicMails + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactElectronicMails) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactElectronicMails; + } + set + { + _contactElectronicMails = value; + _contactElectronicMailsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactElectronicMails + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactElectronicMails) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactElectronicMailsCovariant; + } + set + { + ContactElectronicMails = new HashSet(value.Cast()); + } + } + + + private ICollection _contactInternationalAddresses; + private ICollection _contactInternationalAddressesCovariant; + public virtual ICollection ContactInternationalAddresses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactInternationalAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactInternationalAddresses; + } + set + { + _contactInternationalAddresses = value; + _contactInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactInternationalAddresses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactInternationalAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactInternationalAddressesCovariant; + } + set + { + ContactInternationalAddresses = new HashSet(value.Cast()); + } + } + + + private ICollection _contactLanguages; + private ICollection _contactLanguagesCovariant; + public virtual ICollection ContactLanguages + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactLanguages) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactLanguages; + } + set + { + _contactLanguages = value; + _contactLanguagesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactLanguages + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactLanguages) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactLanguagesCovariant; + } + set + { + ContactLanguages = new HashSet(value.Cast()); + } + } + + + private ICollection _contactOtherNames; + private ICollection _contactOtherNamesCovariant; + public virtual ICollection ContactOtherNames + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactOtherNames) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactOtherNames; + } + set + { + _contactOtherNames = value; + _contactOtherNamesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactOtherNames + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactOtherNames) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactOtherNamesCovariant; + } + set + { + ContactOtherNames = new HashSet(value.Cast()); + } + } + + + private ICollection _contactPersonalIdentificationDocuments; + private ICollection _contactPersonalIdentificationDocumentsCovariant; + public virtual ICollection ContactPersonalIdentificationDocuments + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactPersonalIdentificationDocuments) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactPersonalIdentificationDocuments; + } + set + { + _contactPersonalIdentificationDocuments = value; + _contactPersonalIdentificationDocumentsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactPersonalIdentificationDocuments + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactPersonalIdentificationDocuments) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactPersonalIdentificationDocumentsCovariant; + } + set + { + ContactPersonalIdentificationDocuments = new HashSet(value.Cast()); + } + } + + + private ICollection _contactTelephones; + private ICollection _contactTelephonesCovariant; + public virtual ICollection ContactTelephones + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactTelephones) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactTelephones; + } + set + { + _contactTelephones = value; + _contactTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactTelephones + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactTelephones) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactTelephonesCovariant; + } + set + { + ContactTelephones = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, - { "LanguageUseDescriptor", new LookupColumnDetails { PropertyName = "LanguageUseDescriptorId", LookupTypeName = "LanguageUseDescriptor"} }, + { "HighestCompletedLevelOfEducationDescriptor", new LookupColumnDetails { PropertyName = "HighestCompletedLevelOfEducationDescriptorId", LookupTypeName = "LevelOfEducationDescriptor"} }, + { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, + { "SourceSystemDescriptor", new LookupColumnDetails { PropertyName = "SourceSystemDescriptorId", LookupTypeName = "SourceSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -20282,11 +20641,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ContactLanguage as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); + keyValues.Add("ContactUSI", ContactUSI); return keyValues; } @@ -20350,36 +20709,33 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguageUse)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContact)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactLanguageUse) target, null); + this.MapTo((Entities.Common.EdFi.IContact) target, null); } - void IChildEntity.SetParent(object value) - { - ContactLanguage = (ContactLanguage) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactOtherName table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.ContactAddress table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactOtherName : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContactAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactOtherName() + public ContactAddress() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ContactAddressPeriods = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -20390,47 +20746,88 @@ public ContactOtherName() [DomainSignature, JsonIgnore] public virtual Contact Contact { get; set; } - Entities.Common.EdFi.IContact IContactOtherName.Contact + Entities.Common.EdFi.IContact IContactAddress.Contact { get { return Contact; } set { Contact = (Contact) value; } } [DomainSignature] - public virtual int OtherNameTypeDescriptorId + public virtual int AddressTypeDescriptorId { get { - if (_otherNameTypeDescriptorId == default(int)) - _otherNameTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OtherNameTypeDescriptor", _otherNameTypeDescriptor); + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); - return _otherNameTypeDescriptorId; + return _addressTypeDescriptorId; } set { - _otherNameTypeDescriptorId = value; - _otherNameTypeDescriptor = null; + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; } } - private int _otherNameTypeDescriptorId; - private string _otherNameTypeDescriptor; + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; - public virtual string OtherNameTypeDescriptor + public virtual string AddressTypeDescriptor { get { - if (_otherNameTypeDescriptor == null) - _otherNameTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OtherNameTypeDescriptor", _otherNameTypeDescriptorId); + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); - return _otherNameTypeDescriptor; + return _addressTypeDescriptor; } set { - _otherNameTypeDescriptor = value; - _otherNameTypeDescriptorId = default(int); + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); + } + } + [DomainSignature] + public virtual string City { get; set; } + [DomainSignature] + public virtual string PostalCode { get; set; } + [DomainSignature] + public virtual int StateAbbreviationDescriptorId + { + get + { + if (_stateAbbreviationDescriptorId == default(int)) + _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); + + return _stateAbbreviationDescriptorId; + } + set + { + _stateAbbreviationDescriptorId = value; + _stateAbbreviationDescriptor = null; + } + } + + private int _stateAbbreviationDescriptorId; + private string _stateAbbreviationDescriptor; + + public virtual string StateAbbreviationDescriptor + { + get + { + if (_stateAbbreviationDescriptor == null) + _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); + + return _stateAbbreviationDescriptor; + } + set + { + _stateAbbreviationDescriptor = value; + _stateAbbreviationDescriptorId = default(int); } } + [DomainSignature] + public virtual string StreetNumberName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20441,11 +20838,48 @@ public virtual string OtherNameTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string FirstName { get; set; } - public virtual string GenerationCodeSuffix { get; set; } - public virtual string LastSurname { get; set; } - public virtual string MiddleName { get; set; } - public virtual string PersonalTitlePrefix { get; set; } + public virtual string ApartmentRoomSuiteNumber { get; set; } + public virtual string BuildingSiteNumber { get; set; } + public virtual string CongressionalDistrict { get; set; } + public virtual string CountyFIPSCode { get; set; } + public virtual bool? DoNotPublishIndicator { get; set; } + public virtual string Latitude { get; set; } + public virtual int? LocaleDescriptorId + { + get + { + if (_localeDescriptorId == default(int?)) + _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); + + return _localeDescriptorId; + } + set + { + _localeDescriptorId = value; + _localeDescriptor = null; + } + } + + private int? _localeDescriptorId; + private string _localeDescriptor; + + public virtual string LocaleDescriptor + { + get + { + if (_localeDescriptor == null) + _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); + + return _localeDescriptor; + } + set + { + _localeDescriptor = value; + _localeDescriptorId = default(int?); + } + } + public virtual string Longitude { get; set; } + public virtual string NameOfCounty { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20495,12 +20929,61 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _contactAddressPeriods; + private ICollection _contactAddressPeriodsCovariant; + public virtual ICollection ContactAddressPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactAddressPeriods) + if (item.ContactAddress == null) + item.ContactAddress = this; + // ------------------------------------------------------------- + + return _contactAddressPeriods; + } + set + { + _contactAddressPeriods = value; + _contactAddressPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContactAddress.ContactAddressPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactAddressPeriods) + if (item.ContactAddress == null) + item.ContactAddress = this; + // ------------------------------------------------------------- + + return _contactAddressPeriodsCovariant; + } + set + { + ContactAddressPeriods = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OtherNameTypeDescriptor", new LookupColumnDetails { PropertyName = "OtherNameTypeDescriptorId", LookupTypeName = "OtherNameTypeDescriptor"} }, + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -20515,7 +20998,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("City", City); + keyValues.Add("PostalCode", PostalCode); + keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); + keyValues.Add("StreetNumberName", StreetNumberName); return keyValues; } @@ -20579,12 +21066,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactOtherName)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactOtherName) target, null); + this.MapTo((Entities.Common.EdFi.IContactAddress) target, null); } void IChildEntity.SetParent(object value) @@ -20596,19 +21083,19 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactPersonalIdentificationDocument table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.ContactAddressPeriod table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContactAddressPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactPersonalIdentificationDocument() + public ContactAddressPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -20617,84 +21104,24 @@ public ContactPersonalIdentificationDocument() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } - - Entities.Common.EdFi.IContact IContactPersonalIdentificationDocument.Contact - { - get { return Contact; } - set { Contact = (Contact) value; } - } + public virtual ContactAddress ContactAddress { get; set; } - [DomainSignature] - public virtual int IdentificationDocumentUseDescriptorId + Entities.Common.EdFi.IContactAddress IContactAddressPeriod.ContactAddress { - get - { - if (_identificationDocumentUseDescriptorId == default(int)) - _identificationDocumentUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptor); - - return _identificationDocumentUseDescriptorId; - } - set - { - _identificationDocumentUseDescriptorId = value; - _identificationDocumentUseDescriptor = null; - } + get { return ContactAddress; } + set { ContactAddress = (ContactAddress) value; } } - private int _identificationDocumentUseDescriptorId; - private string _identificationDocumentUseDescriptor; - - public virtual string IdentificationDocumentUseDescriptor - { - get - { - if (_identificationDocumentUseDescriptor == null) - _identificationDocumentUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptorId); - - return _identificationDocumentUseDescriptor; - } - set - { - _identificationDocumentUseDescriptor = value; - _identificationDocumentUseDescriptorId = default(int); - } - } [DomainSignature] - public virtual int PersonalInformationVerificationDescriptorId + public virtual DateTime BeginDate { - get - { - if (_personalInformationVerificationDescriptorId == default(int)) - _personalInformationVerificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptor); - - return _personalInformationVerificationDescriptorId; - } - set - { - _personalInformationVerificationDescriptorId = value; - _personalInformationVerificationDescriptor = null; - } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } - private int _personalInformationVerificationDescriptorId; - private string _personalInformationVerificationDescriptor; - - public virtual string PersonalInformationVerificationDescriptor - { - get - { - if (_personalInformationVerificationDescriptor == null) - _personalInformationVerificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptorId); - - return _personalInformationVerificationDescriptor; - } - set - { - _personalInformationVerificationDescriptor = value; - _personalInformationVerificationDescriptorId = default(int); - } - } + private DateTime _beginDate; + // ------------------------------------------------------------- // ============================================================= @@ -20705,62 +21132,25 @@ public virtual string PersonalInformationVerificationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? DocumentExpirationDate + public virtual DateTime? EndDate { - get { return _documentExpirationDate; } + get { return _endDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _documentExpirationDate = null; + _endDate = null; } else { var given = (DateTime) value; - _documentExpirationDate = new DateTime(given.Year, given.Month, given.Day); + _endDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _documentExpirationDate; + private DateTime? _endDate; - public virtual string DocumentTitle { get; set; } - public virtual int? IssuerCountryDescriptorId - { - get - { - if (_issuerCountryDescriptorId == default(int?)) - _issuerCountryDescriptorId = string.IsNullOrWhiteSpace(_issuerCountryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _issuerCountryDescriptor); - - return _issuerCountryDescriptorId; - } - set - { - _issuerCountryDescriptorId = value; - _issuerCountryDescriptor = null; - } - } - - private int? _issuerCountryDescriptorId; - private string _issuerCountryDescriptor; - - public virtual string IssuerCountryDescriptor - { - get - { - if (_issuerCountryDescriptor == null) - _issuerCountryDescriptor = _issuerCountryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _issuerCountryDescriptorId.Value); - - return _issuerCountryDescriptor; - } - set - { - _issuerCountryDescriptor = value; - _issuerCountryDescriptorId = default(int?); - } - } - public virtual string IssuerDocumentIdentificationCode { get; set; } - public virtual string IssuerName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20815,9 +21205,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IdentificationDocumentUseDescriptor", new LookupColumnDetails { PropertyName = "IdentificationDocumentUseDescriptorId", LookupTypeName = "IdentificationDocumentUseDescriptor"} }, - { "IssuerCountryDescriptor", new LookupColumnDetails { PropertyName = "IssuerCountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, - { "PersonalInformationVerificationDescriptor", new LookupColumnDetails { PropertyName = "PersonalInformationVerificationDescriptorId", LookupTypeName = "PersonalInformationVerificationDescriptor"} }, + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -20829,11 +21218,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ContactAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); - keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -20897,36 +21285,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactAddressPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument) target, null); + this.MapTo((Entities.Common.EdFi.IContactAddressPeriod) target, null); } void IChildEntity.SetParent(object value) { - Contact = (Contact) value; + ContactAddress = (ContactAddress) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactTelephone table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.ContactElectronicMail table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactTelephone : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContactElectronicMail : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactElectronicMail, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactTelephone() + public ContactElectronicMail() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -20937,47 +21325,47 @@ public ContactTelephone() [DomainSignature, JsonIgnore] public virtual Contact Contact { get; set; } - Entities.Common.EdFi.IContact IContactTelephone.Contact + Entities.Common.EdFi.IContact IContactElectronicMail.Contact { get { return Contact; } set { Contact = (Contact) value; } } [DomainSignature] - public virtual string TelephoneNumber { get; set; } + public virtual string ElectronicMailAddress { get; set; } [DomainSignature] - public virtual int TelephoneNumberTypeDescriptorId + public virtual int ElectronicMailTypeDescriptorId { get { - if (_telephoneNumberTypeDescriptorId == default(int)) - _telephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptor); + if (_electronicMailTypeDescriptorId == default(int)) + _electronicMailTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptor); - return _telephoneNumberTypeDescriptorId; + return _electronicMailTypeDescriptorId; } set { - _telephoneNumberTypeDescriptorId = value; - _telephoneNumberTypeDescriptor = null; + _electronicMailTypeDescriptorId = value; + _electronicMailTypeDescriptor = null; } } - private int _telephoneNumberTypeDescriptorId; - private string _telephoneNumberTypeDescriptor; + private int _electronicMailTypeDescriptorId; + private string _electronicMailTypeDescriptor; - public virtual string TelephoneNumberTypeDescriptor + public virtual string ElectronicMailTypeDescriptor { get { - if (_telephoneNumberTypeDescriptor == null) - _telephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptorId); + if (_electronicMailTypeDescriptor == null) + _electronicMailTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptorId); - return _telephoneNumberTypeDescriptor; + return _electronicMailTypeDescriptor; } set { - _telephoneNumberTypeDescriptor = value; - _telephoneNumberTypeDescriptorId = default(int); + _electronicMailTypeDescriptor = value; + _electronicMailTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -20991,8 +21379,7 @@ public virtual string TelephoneNumberTypeDescriptor // Properties // ------------------------------------------------------------- public virtual bool? DoNotPublishIndicator { get; set; } - public virtual int? OrderOfPriority { get; set; } - public virtual bool? TextMessageCapabilityIndicator { get; set; } + public virtual bool? PrimaryEmailAddressIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21047,7 +21434,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "TelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "TelephoneNumberTypeDescriptorId", LookupTypeName = "TelephoneNumberTypeDescriptor"} }, + { "ElectronicMailTypeDescriptor", new LookupColumnDetails { PropertyName = "ElectronicMailTypeDescriptorId", LookupTypeName = "ElectronicMailTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21062,8 +21449,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("TelephoneNumber", TelephoneNumber); - keyValues.Add("TelephoneNumberTypeDescriptorId", TelephoneNumberTypeDescriptorId); + keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); + keyValues.Add("ElectronicMailTypeDescriptorId", ElectronicMailTypeDescriptorId); return keyValues; } @@ -21127,12 +21514,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactTelephone)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactElectronicMail)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactTelephone) target, null); + this.MapTo((Entities.Common.EdFi.IContactElectronicMail) target, null); } void IChildEntity.SetParent(object value) @@ -21140,73 +21527,162 @@ void IChildEntity.SetParent(object value) Contact = (Contact) value; } } -} -// Aggregate: ContactTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ContactTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactTypeDescriptor table of the ContactTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactInternationalAddress table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IContactTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ContactInternationalAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ContactInternationalAddress() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactInternationalAddress.Contact + { + get { return Contact; } + set { Contact = (Contact) value; } + } + [DomainSignature] - public virtual int ContactTypeDescriptorId + public virtual int AddressTypeDescriptorId { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get + { + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + + return _addressTypeDescriptorId; + } + set + { + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; + } + } + + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; + + public virtual string AddressTypeDescriptor + { + get + { + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + + return _addressTypeDescriptor; + } + set + { + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); + } } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string AddressLine1 { get; set; } + public virtual string AddressLine2 { get; set; } + public virtual string AddressLine3 { get; set; } + public virtual string AddressLine4 { get; set; } + public virtual DateTime? BeginDate { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - DateTime? IDescriptor.EffectiveEndDate + + private DateTime? _beginDate; + + public virtual int CountryDescriptorId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_countryDescriptorId == default(int)) + _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); + + return _countryDescriptorId; + } + set + { + _countryDescriptorId = value; + _countryDescriptor = null; + } } - string IDescriptor.Namespace + + private int _countryDescriptorId; + private string _countryDescriptor; + + public virtual string CountryDescriptor { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_countryDescriptor == null) + _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); + + return _countryDescriptor; + } + set + { + _countryDescriptor = value; + _countryDescriptorId = default(int); + } } - string IDescriptor.ShortDescription + public virtual DateTime? EndDate { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + private DateTime? _endDate; + + public virtual string Latitude { get; set; } + public virtual string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21217,6 +21693,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21232,6 +21737,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21242,11 +21749,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ContactTypeDescriptorId", ContactTypeDescriptorId); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); return keyValues; } @@ -21310,79 +21817,95 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactInternationalAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IContactInternationalAddress) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } -} -// Aggregate: ContentClassDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ContentClassDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContentClassDescriptor table of the ContentClassDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactLanguage table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContentClassDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IContentClassDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ContactLanguage : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ContentClassDescriptorId + public ContactLanguage() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + ContactLanguageUses = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactLanguage.Contact { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Contact; } + set { Contact = (Contact) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int LanguageDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_languageDescriptorId == default(int)) + _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); + + return _languageDescriptorId; + } + set + { + _languageDescriptorId = value; + _languageDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _languageDescriptorId; + private string _languageDescriptor; + + public virtual string LanguageDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_languageDescriptor == null) + _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); + + return _languageDescriptor; + } + set + { + _languageDescriptor = value; + _languageDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -21396,6 +21919,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21406,11 +21958,59 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _contactLanguageUses; + private ICollection _contactLanguageUsesCovariant; + public virtual ICollection ContactLanguageUses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactLanguageUses) + if (item.ContactLanguage == null) + item.ContactLanguage = this; + // ------------------------------------------------------------- + + return _contactLanguageUses; + } + set + { + _contactLanguageUses = value; + _contactLanguageUsesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContactLanguage.ContactLanguageUses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactLanguageUses) + if (item.ContactLanguage == null) + item.ContactLanguage = this; + // ------------------------------------------------------------- + + return _contactLanguageUsesCovariant; + } + set + { + ContactLanguageUses = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21421,11 +22021,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ContentClassDescriptorId", ContentClassDescriptorId); + keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); return keyValues; } @@ -21489,79 +22089,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContentClassDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguage)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContentClassDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IContactLanguage) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } -} -// Aggregate: ContinuationOfServicesReasonDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ContinuationOfServicesReasonDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContinuationOfServicesReasonDescriptor table of the ContinuationOfServicesReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactLanguageUse table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContinuationOfServicesReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ContactLanguageUse : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactLanguageUse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ContinuationOfServicesReasonDescriptorId + public ContactLanguageUse() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual ContactLanguage ContactLanguage { get; set; } + + Entities.Common.EdFi.IContactLanguage IContactLanguageUse.ContactLanguage { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return ContactLanguage; } + set { ContactLanguage = (ContactLanguage) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int LanguageUseDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_languageUseDescriptorId == default(int)) + _languageUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageUseDescriptor", _languageUseDescriptor); + + return _languageUseDescriptorId; + } + set + { + _languageUseDescriptorId = value; + _languageUseDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _languageUseDescriptorId; + private string _languageUseDescriptor; + + public virtual string LanguageUseDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_languageUseDescriptor == null) + _languageUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageUseDescriptor", _languageUseDescriptorId); + + return _languageUseDescriptor; + } + set + { + _languageUseDescriptor = value; + _languageUseDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -21575,6 +22190,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21590,6 +22234,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, + { "LanguageUseDescriptor", new LookupColumnDetails { PropertyName = "LanguageUseDescriptorId", LookupTypeName = "LanguageUseDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21600,11 +22246,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ContactLanguage as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ContinuationOfServicesReasonDescriptorId", ContinuationOfServicesReasonDescriptorId); + keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); return keyValues; } @@ -21668,82 +22314,102 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguageUse)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IContactLanguageUse) target, null); } + void IChildEntity.SetParent(object value) + { + ContactLanguage = (ContactLanguage) value; + } } -} -// Aggregate: CostRateDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CostRateDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CostRateDescriptor table of the CostRateDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactOtherName table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CostRateDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICostRateDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ContactOtherName : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CostRateDescriptorId + public ContactOtherName() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactOtherName.Contact { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Contact; } + set { Contact = (Contact) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int OtherNameTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_otherNameTypeDescriptorId == default(int)) + _otherNameTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OtherNameTypeDescriptor", _otherNameTypeDescriptor); + + return _otherNameTypeDescriptorId; + } + set + { + _otherNameTypeDescriptorId = value; + _otherNameTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _otherNameTypeDescriptorId; + private string _otherNameTypeDescriptor; + + public virtual string OtherNameTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_otherNameTypeDescriptor == null) + _otherNameTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OtherNameTypeDescriptor", _otherNameTypeDescriptorId); + + return _otherNameTypeDescriptor; + } + set + { + _otherNameTypeDescriptor = value; + _otherNameTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string FirstName { get; set; } + public virtual string GenerationCodeSuffix { get; set; } + public virtual string LastSurname { get; set; } + public virtual string MiddleName { get; set; } + public virtual string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21754,6 +22420,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21769,6 +22464,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "OtherNameTypeDescriptor", new LookupColumnDetails { PropertyName = "OtherNameTypeDescriptorId", LookupTypeName = "OtherNameTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21779,11 +22475,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CostRateDescriptorId", CostRateDescriptorId); + keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); return keyValues; } @@ -21847,82 +22543,188 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICostRateDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactOtherName)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICostRateDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IContactOtherName) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } -} -// Aggregate: CountryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CountryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CountryDescriptor table of the CountryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactPersonalIdentificationDocument table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CountryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICountryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ContactPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CountryDescriptorId + public ContactPersonalIdentificationDocument() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description + [DomainSignature, JsonIgnore] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactPersonalIdentificationDocument.Contact { - get { return Description; } - set { Description = value; } + get { return Contact; } + set { Contact = (Contact) value; } } - DateTime? IDescriptor.EffectiveBeginDate + + [DomainSignature] + public virtual int IdentificationDocumentUseDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_identificationDocumentUseDescriptorId == default(int)) + _identificationDocumentUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptor); + + return _identificationDocumentUseDescriptorId; + } + set + { + _identificationDocumentUseDescriptorId = value; + _identificationDocumentUseDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _identificationDocumentUseDescriptorId; + private string _identificationDocumentUseDescriptor; + + public virtual string IdentificationDocumentUseDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_identificationDocumentUseDescriptor == null) + _identificationDocumentUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptorId); + + return _identificationDocumentUseDescriptor; + } + set + { + _identificationDocumentUseDescriptor = value; + _identificationDocumentUseDescriptorId = default(int); + } } - string IDescriptor.Namespace + [DomainSignature] + public virtual int PersonalInformationVerificationDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_personalInformationVerificationDescriptorId == default(int)) + _personalInformationVerificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptor); + + return _personalInformationVerificationDescriptorId; + } + set + { + _personalInformationVerificationDescriptorId = value; + _personalInformationVerificationDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _personalInformationVerificationDescriptorId; + private string _personalInformationVerificationDescriptor; + + public virtual string PersonalInformationVerificationDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_personalInformationVerificationDescriptor == null) + _personalInformationVerificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptorId); + + return _personalInformationVerificationDescriptor; + } + set + { + _personalInformationVerificationDescriptor = value; + _personalInformationVerificationDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual DateTime? DocumentExpirationDate + { + get { return _documentExpirationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _documentExpirationDate = null; + } else + { + var given = (DateTime) value; + _documentExpirationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _documentExpirationDate; + + public virtual string DocumentTitle { get; set; } + public virtual int? IssuerCountryDescriptorId + { + get + { + if (_issuerCountryDescriptorId == default(int?)) + _issuerCountryDescriptorId = string.IsNullOrWhiteSpace(_issuerCountryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _issuerCountryDescriptor); + + return _issuerCountryDescriptorId; + } + set + { + _issuerCountryDescriptorId = value; + _issuerCountryDescriptor = null; + } + } + + private int? _issuerCountryDescriptorId; + private string _issuerCountryDescriptor; + + public virtual string IssuerCountryDescriptor + { + get + { + if (_issuerCountryDescriptor == null) + _issuerCountryDescriptor = _issuerCountryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _issuerCountryDescriptorId.Value); + + return _issuerCountryDescriptor; + } + set + { + _issuerCountryDescriptor = value; + _issuerCountryDescriptorId = default(int?); + } + } + public virtual string IssuerDocumentIdentificationCode { get; set; } + public virtual string IssuerName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21933,6 +22735,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21948,6 +22779,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "IdentificationDocumentUseDescriptor", new LookupColumnDetails { PropertyName = "IdentificationDocumentUseDescriptorId", LookupTypeName = "IdentificationDocumentUseDescriptor"} }, + { "IssuerCountryDescriptor", new LookupColumnDetails { PropertyName = "IssuerCountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, + { "PersonalInformationVerificationDescriptor", new LookupColumnDetails { PropertyName = "PersonalInformationVerificationDescriptorId", LookupTypeName = "PersonalInformationVerificationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21958,11 +22792,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CountryDescriptorId", CountryDescriptorId); + keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); + keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); return keyValues; } @@ -22026,121 +22861,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICountryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICountryDescriptor) target, null); - } - - } -} -// Aggregate: Course - -namespace EdFi.Ods.Entities.NHibernate.CourseAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class CourseReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string CourseCode { get; set; } - public virtual long EducationOrganizationId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + Contact = (Contact) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Course table of the Course aggregate in the ODS database. + /// A class which represents the edfi.ContactTelephone table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Course : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContactTelephone : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Course() + public ContactTelephone() { - CourseAcademicSubjects = new HashSet(); - CourseCompetencyLevels = new HashSet(); - CourseIdentificationCodes = new HashSet(); - CourseLearningStandards = new HashSet(); - CourseLevelCharacteristics = new HashSet(); - CourseOfferedGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -22148,219 +22898,65 @@ public Course() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactTelephone.Contact + { + get { return Contact; } + set { Contact = (Contact) value; } + } + [DomainSignature] - public virtual string CourseCode { get; set; } + public virtual string TelephoneNumber { get; set; } [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - // ------------------------------------------------------------- + public virtual int TelephoneNumberTypeDescriptorId + { + get + { + if (_telephoneNumberTypeDescriptorId == default(int)) + _telephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? CareerPathwayDescriptorId - { - get - { - if (_careerPathwayDescriptorId == default(int?)) - _careerPathwayDescriptorId = string.IsNullOrWhiteSpace(_careerPathwayDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CareerPathwayDescriptor", _careerPathwayDescriptor); - - return _careerPathwayDescriptorId; - } - set - { - _careerPathwayDescriptorId = value; - _careerPathwayDescriptor = null; - } - } - - private int? _careerPathwayDescriptorId; - private string _careerPathwayDescriptor; - - public virtual string CareerPathwayDescriptor - { - get - { - if (_careerPathwayDescriptor == null) - _careerPathwayDescriptor = _careerPathwayDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CareerPathwayDescriptor", _careerPathwayDescriptorId.Value); - - return _careerPathwayDescriptor; - } - set - { - _careerPathwayDescriptor = value; - _careerPathwayDescriptorId = default(int?); - } - } - public virtual int? CourseDefinedByDescriptorId - { - get - { - if (_courseDefinedByDescriptorId == default(int?)) - _courseDefinedByDescriptorId = string.IsNullOrWhiteSpace(_courseDefinedByDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseDefinedByDescriptor", _courseDefinedByDescriptor); - - return _courseDefinedByDescriptorId; - } - set - { - _courseDefinedByDescriptorId = value; - _courseDefinedByDescriptor = null; - } - } - - private int? _courseDefinedByDescriptorId; - private string _courseDefinedByDescriptor; - - public virtual string CourseDefinedByDescriptor - { - get - { - if (_courseDefinedByDescriptor == null) - _courseDefinedByDescriptor = _courseDefinedByDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseDefinedByDescriptor", _courseDefinedByDescriptorId.Value); - - return _courseDefinedByDescriptor; - } - set - { - _courseDefinedByDescriptor = value; - _courseDefinedByDescriptorId = default(int?); - } - } - public virtual string CourseDescription { get; set; } - public virtual int? CourseGPAApplicabilityDescriptorId - { - get - { - if (_courseGPAApplicabilityDescriptorId == default(int?)) - _courseGPAApplicabilityDescriptorId = string.IsNullOrWhiteSpace(_courseGPAApplicabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptor); - - return _courseGPAApplicabilityDescriptorId; - } - set - { - _courseGPAApplicabilityDescriptorId = value; - _courseGPAApplicabilityDescriptor = null; - } - } - - private int? _courseGPAApplicabilityDescriptorId; - private string _courseGPAApplicabilityDescriptor; - - public virtual string CourseGPAApplicabilityDescriptor - { - get - { - if (_courseGPAApplicabilityDescriptor == null) - _courseGPAApplicabilityDescriptor = _courseGPAApplicabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptorId.Value); - - return _courseGPAApplicabilityDescriptor; - } - set - { - _courseGPAApplicabilityDescriptor = value; - _courseGPAApplicabilityDescriptorId = default(int?); - } - } - public virtual string CourseTitle { get; set; } - public virtual DateTime? DateCourseAdopted - { - get { return _dateCourseAdopted; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _dateCourseAdopted = null; - } else - { - var given = (DateTime) value; - _dateCourseAdopted = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _dateCourseAdopted; - - public virtual bool? HighSchoolCourseRequirement { get; set; } - public virtual int? MaxCompletionsForCredit { get; set; } - public virtual decimal? MaximumAvailableCreditConversion { get; set; } - public virtual decimal? MaximumAvailableCredits { get; set; } - public virtual int? MaximumAvailableCreditTypeDescriptorId - { - get - { - if (_maximumAvailableCreditTypeDescriptorId == default(int?)) - _maximumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_maximumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptor); - - return _maximumAvailableCreditTypeDescriptorId; + return _telephoneNumberTypeDescriptorId; } set { - _maximumAvailableCreditTypeDescriptorId = value; - _maximumAvailableCreditTypeDescriptor = null; + _telephoneNumberTypeDescriptorId = value; + _telephoneNumberTypeDescriptor = null; } } - private int? _maximumAvailableCreditTypeDescriptorId; - private string _maximumAvailableCreditTypeDescriptor; + private int _telephoneNumberTypeDescriptorId; + private string _telephoneNumberTypeDescriptor; - public virtual string MaximumAvailableCreditTypeDescriptor + public virtual string TelephoneNumberTypeDescriptor { get { - if (_maximumAvailableCreditTypeDescriptor == null) - _maximumAvailableCreditTypeDescriptor = _maximumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptorId.Value); + if (_telephoneNumberTypeDescriptor == null) + _telephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptorId); - return _maximumAvailableCreditTypeDescriptor; - } - set - { - _maximumAvailableCreditTypeDescriptor = value; - _maximumAvailableCreditTypeDescriptorId = default(int?); + return _telephoneNumberTypeDescriptor; } - } - public virtual decimal? MinimumAvailableCreditConversion { get; set; } - public virtual decimal? MinimumAvailableCredits { get; set; } - public virtual int? MinimumAvailableCreditTypeDescriptorId - { - get - { - if (_minimumAvailableCreditTypeDescriptorId == default(int?)) - _minimumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_minimumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptor); - - return _minimumAvailableCreditTypeDescriptorId; - } set { - _minimumAvailableCreditTypeDescriptorId = value; - _minimumAvailableCreditTypeDescriptor = null; + _telephoneNumberTypeDescriptor = value; + _telephoneNumberTypeDescriptorId = default(int); } } + // ------------------------------------------------------------- - private int? _minimumAvailableCreditTypeDescriptorId; - private string _minimumAvailableCreditTypeDescriptor; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public virtual string MinimumAvailableCreditTypeDescriptor - { - get - { - if (_minimumAvailableCreditTypeDescriptor == null) - _minimumAvailableCreditTypeDescriptor = _minimumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptorId.Value); - - return _minimumAvailableCreditTypeDescriptor; - } - set - { - _minimumAvailableCreditTypeDescriptor = value; - _minimumAvailableCreditTypeDescriptorId = default(int?); - } - } - public virtual int NumberOfParts { get; set; } - public virtual int? TimeRequiredForCompletion { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual bool? DoNotPublishIndicator { get; set; } + public virtual int? OrderOfPriority { get; set; } + public virtual bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -22405,323 +23001,17 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourse.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _courseAcademicSubjects; - private ICollection _courseAcademicSubjectsCovariant; - public virtual ICollection CourseAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseAcademicSubjects) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseAcademicSubjects; - } - set - { - _courseAcademicSubjects = value; - _courseAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseAcademicSubjects) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseAcademicSubjectsCovariant; - } - set - { - CourseAcademicSubjects = new HashSet(value.Cast()); - } - } - - - private ICollection _courseCompetencyLevels; - private ICollection _courseCompetencyLevelsCovariant; - public virtual ICollection CourseCompetencyLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseCompetencyLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseCompetencyLevels; - } - set - { - _courseCompetencyLevels = value; - _courseCompetencyLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseCompetencyLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseCompetencyLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseCompetencyLevelsCovariant; - } - set - { - CourseCompetencyLevels = new HashSet(value.Cast()); - } - } - - - private ICollection _courseIdentificationCodes; - private ICollection _courseIdentificationCodesCovariant; - public virtual ICollection CourseIdentificationCodes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseIdentificationCodes) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseIdentificationCodes; - } - set - { - _courseIdentificationCodes = value; - _courseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseIdentificationCodes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseIdentificationCodes) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseIdentificationCodesCovariant; - } - set - { - CourseIdentificationCodes = new HashSet(value.Cast()); - } - } - - - private ICollection _courseLearningStandards; - private ICollection _courseLearningStandardsCovariant; - public virtual ICollection CourseLearningStandards - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLearningStandards) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseLearningStandards; - } - set - { - _courseLearningStandards = value; - _courseLearningStandardsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseLearningStandards - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLearningStandards) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseLearningStandardsCovariant; - } - set - { - CourseLearningStandards = new HashSet(value.Cast()); - } - } - - - private ICollection _courseLevelCharacteristics; - private ICollection _courseLevelCharacteristicsCovariant; - public virtual ICollection CourseLevelCharacteristics - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLevelCharacteristics) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseLevelCharacteristics; - } - set - { - _courseLevelCharacteristics = value; - _courseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseLevelCharacteristics - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLevelCharacteristics) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseLevelCharacteristicsCovariant; - } - set - { - CourseLevelCharacteristics = new HashSet(value.Cast()); - } - } - - - private ICollection _courseOfferedGradeLevels; - private ICollection _courseOfferedGradeLevelsCovariant; - public virtual ICollection CourseOfferedGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferedGradeLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseOfferedGradeLevels; - } - set - { - _courseOfferedGradeLevels = value; - _courseOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseOfferedGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferedGradeLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseOfferedGradeLevelsCovariant; - } - set - { - CourseOfferedGradeLevels = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CareerPathwayDescriptor", new LookupColumnDetails { PropertyName = "CareerPathwayDescriptorId", LookupTypeName = "CareerPathwayDescriptor"} }, - { "CourseDefinedByDescriptor", new LookupColumnDetails { PropertyName = "CourseDefinedByDescriptorId", LookupTypeName = "CourseDefinedByDescriptor"} }, - { "CourseGPAApplicabilityDescriptor", new LookupColumnDetails { PropertyName = "CourseGPAApplicabilityDescriptorId", LookupTypeName = "CourseGPAApplicabilityDescriptor"} }, - { "MaximumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MaximumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "MinimumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MinimumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "TelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "TelephoneNumberTypeDescriptorId", LookupTypeName = "TelephoneNumberTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -22732,12 +23022,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("TelephoneNumber", TelephoneNumber); + keyValues.Add("TelephoneNumberTypeDescriptorId", TelephoneNumberTypeDescriptorId); return keyValues; } @@ -22801,88 +23091,81 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourse)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactTelephone)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourse) target, null); + this.MapTo((Entities.Common.EdFi.IContactTelephone) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } +} +// Aggregate: ContactTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ContactTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseAcademicSubject table of the Course aggregate in the ODS database. + /// A class which represents the edfi.ContactTypeDescriptor table of the ContactTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContactTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IContactTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseAcademicSubject() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseAcademicSubject.Course - { - get { return Course; } - set { Course = (Course) value; } - } - [DomainSignature] - public virtual int AcademicSubjectDescriptorId - { - get - { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } - } - - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor + public virtual int ContactTypeDescriptorId { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -22898,35 +23181,6 @@ public virtual string AcademicSubjectDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -22942,7 +23196,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -22953,11 +23206,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("ContactTypeDescriptorId", ContactTypeDescriptorId); return keyValues; } @@ -23021,92 +23274,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.IContactTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } +} +// Aggregate: ContentClassDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ContentClassDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseCompetencyLevel table of the Course aggregate in the ODS database. + /// A class which represents the edfi.ContentClassDescriptor table of the ContentClassDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseCompetencyLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseCompetencyLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContentClassDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IContentClassDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseCompetencyLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseCompetencyLevel.Course - { - get { return Course; } - set { Course = (Course) value; } - } - [DomainSignature] - public virtual int CompetencyLevelDescriptorId - { - get - { - if (_competencyLevelDescriptorId == default(int)) - _competencyLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CompetencyLevelDescriptor", _competencyLevelDescriptor); - - return _competencyLevelDescriptorId; - } - set - { - _competencyLevelDescriptorId = value; - _competencyLevelDescriptor = null; - } - } - - private int _competencyLevelDescriptorId; - private string _competencyLevelDescriptor; - - public virtual string CompetencyLevelDescriptor + public virtual int ContentClassDescriptorId { - get - { - if (_competencyLevelDescriptor == null) - _competencyLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CompetencyLevelDescriptor", _competencyLevelDescriptorId); - - return _competencyLevelDescriptor; - } - set - { - _competencyLevelDescriptor = value; - _competencyLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -23122,35 +23360,6 @@ public virtual string CompetencyLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23166,7 +23375,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CompetencyLevelDescriptor", new LookupColumnDetails { PropertyName = "CompetencyLevelDescriptorId", LookupTypeName = "CompetencyLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23177,11 +23385,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); + keyValues.Add("ContentClassDescriptorId", ContentClassDescriptorId); return keyValues; } @@ -23245,100 +23453,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseCompetencyLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContentClassDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseCompetencyLevel) target, null); + this.MapTo((Entities.Common.EdFi.IContentClassDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } +} +// Aggregate: ContinuationOfServicesReasonDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ContinuationOfServicesReasonDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseIdentificationCode table of the Course aggregate in the ODS database. + /// A class which represents the edfi.ContinuationOfServicesReasonDescriptor table of the ContinuationOfServicesReasonDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ContinuationOfServicesReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseIdentificationCode() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseIdentificationCode.Course - { - get { return Course; } - set { Course = (Course) value; } - } - [DomainSignature] - public virtual int CourseIdentificationSystemDescriptorId - { - get - { - if (_courseIdentificationSystemDescriptorId == default(int)) - _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); - - return _courseIdentificationSystemDescriptorId; - } - set - { - _courseIdentificationSystemDescriptorId = value; - _courseIdentificationSystemDescriptor = null; - } - } - - private int _courseIdentificationSystemDescriptorId; - private string _courseIdentificationSystemDescriptor; - - public virtual string CourseIdentificationSystemDescriptor + public virtual int ContinuationOfServicesReasonDescriptorId { - get - { - if (_courseIdentificationSystemDescriptor == null) - _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); - - return _courseIdentificationSystemDescriptor; - } - set - { - _courseIdentificationSystemDescriptor = value; - _courseIdentificationSystemDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AssigningOrganizationIdentificationCode { get; set; } - public virtual string CourseCatalogURL { get; set; } - public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23349,35 +23539,6 @@ public virtual string CourseIdentificationSystemDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23393,7 +23554,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23404,11 +23564,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); + keyValues.Add("ContinuationOfServicesReasonDescriptorId", ContinuationOfServicesReasonDescriptorId); return keyValues; } @@ -23472,59 +23632,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } +} +// Aggregate: CostRateDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CostRateDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseLearningStandard table of the Course aggregate in the ODS database. + /// A class which represents the edfi.CostRateDescriptor table of the CostRateDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CostRateDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICostRateDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseLearningStandard() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseLearningStandard.Course + [DomainSignature] + public virtual int CostRateDescriptorId { - get { return Course; } - set { Course = (Course) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string LearningStandardId { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -23540,60 +23718,11 @@ Entities.Common.EdFi.ICourse ICourseLearningStandard.Course // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseLearningStandard.LearningStandardResourceId - { - get { return LearningStandardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -23614,11 +23743,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("CostRateDescriptorId", CostRateDescriptorId); return keyValues; } @@ -23682,92 +23811,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICostRateDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.ICostRateDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } +} +// Aggregate: CountryDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CountryDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseLevelCharacteristic table of the Course aggregate in the ODS database. + /// A class which represents the edfi.CountryDescriptor table of the CountryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CountryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICountryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseLevelCharacteristic() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseLevelCharacteristic.Course - { - get { return Course; } - set { Course = (Course) value; } - } - [DomainSignature] - public virtual int CourseLevelCharacteristicDescriptorId - { - get - { - if (_courseLevelCharacteristicDescriptorId == default(int)) - _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); - - return _courseLevelCharacteristicDescriptorId; - } - set - { - _courseLevelCharacteristicDescriptorId = value; - _courseLevelCharacteristicDescriptor = null; - } - } - - private int _courseLevelCharacteristicDescriptorId; - private string _courseLevelCharacteristicDescriptor; - - public virtual string CourseLevelCharacteristicDescriptor + public virtual int CountryDescriptorId { - get - { - if (_courseLevelCharacteristicDescriptor == null) - _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); - - return _courseLevelCharacteristicDescriptor; - } - set - { - _courseLevelCharacteristicDescriptor = value; - _courseLevelCharacteristicDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -23783,35 +23897,6 @@ public virtual string CourseLevelCharacteristicDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23827,7 +23912,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23838,11 +23922,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); + keyValues.Add("CountryDescriptorId", CountryDescriptorId); return keyValues; } @@ -23906,36 +23990,121 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristic)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICountryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristic) target, null); + this.MapTo((Entities.Common.EdFi.ICountryDescriptor) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: Course + +namespace EdFi.Ods.Entities.NHibernate.CourseAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class CourseReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string CourseCode { get; set; } + public virtual long EducationOrganizationId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - Course = (Course) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferedGradeLevel table of the Course aggregate in the ODS database. + /// A class which represents the edfi.Course table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Course : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOfferedGradeLevel() + public Course() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CourseAcademicSubjects = new HashSet(); + CourseCompetencyLevels = new HashSet(); + CourseIdentificationCodes = new HashSet(); + CourseLearningStandards = new HashSet(); + CourseLevelCharacteristics = new HashSet(); + CourseOfferedGradeLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -23943,60 +24112,219 @@ public CourseOfferedGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } + [DomainSignature] + public virtual string CourseCode { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.ICourse ICourseOfferedGradeLevel.Course + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int? CareerPathwayDescriptorId { - get { return Course; } - set { Course = (Course) value; } + get + { + if (_careerPathwayDescriptorId == default(int?)) + _careerPathwayDescriptorId = string.IsNullOrWhiteSpace(_careerPathwayDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CareerPathwayDescriptor", _careerPathwayDescriptor); + + return _careerPathwayDescriptorId; + } + set + { + _careerPathwayDescriptorId = value; + _careerPathwayDescriptor = null; + } } - [DomainSignature] - public virtual int GradeLevelDescriptorId + private int? _careerPathwayDescriptorId; + private string _careerPathwayDescriptor; + + public virtual string CareerPathwayDescriptor { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_careerPathwayDescriptor == null) + _careerPathwayDescriptor = _careerPathwayDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CareerPathwayDescriptor", _careerPathwayDescriptorId.Value); + + return _careerPathwayDescriptor; + } + set + { + _careerPathwayDescriptor = value; + _careerPathwayDescriptorId = default(int?); + } + } + public virtual int? CourseDefinedByDescriptorId + { + get + { + if (_courseDefinedByDescriptorId == default(int?)) + _courseDefinedByDescriptorId = string.IsNullOrWhiteSpace(_courseDefinedByDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseDefinedByDescriptor", _courseDefinedByDescriptor); - return _gradeLevelDescriptorId; + return _courseDefinedByDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _courseDefinedByDescriptorId = value; + _courseDefinedByDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int? _courseDefinedByDescriptorId; + private string _courseDefinedByDescriptor; - public virtual string GradeLevelDescriptor + public virtual string CourseDefinedByDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_courseDefinedByDescriptor == null) + _courseDefinedByDescriptor = _courseDefinedByDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseDefinedByDescriptor", _courseDefinedByDescriptorId.Value); - return _gradeLevelDescriptor; + return _courseDefinedByDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _courseDefinedByDescriptor = value; + _courseDefinedByDescriptorId = default(int?); } } - // ------------------------------------------------------------- + public virtual string CourseDescription { get; set; } + public virtual int? CourseGPAApplicabilityDescriptorId + { + get + { + if (_courseGPAApplicabilityDescriptorId == default(int?)) + _courseGPAApplicabilityDescriptorId = string.IsNullOrWhiteSpace(_courseGPAApplicabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _courseGPAApplicabilityDescriptorId; + } + set + { + _courseGPAApplicabilityDescriptorId = value; + _courseGPAApplicabilityDescriptor = null; + } + } - // ============================================================= - // Properties - // ------------------------------------------------------------- + private int? _courseGPAApplicabilityDescriptorId; + private string _courseGPAApplicabilityDescriptor; + + public virtual string CourseGPAApplicabilityDescriptor + { + get + { + if (_courseGPAApplicabilityDescriptor == null) + _courseGPAApplicabilityDescriptor = _courseGPAApplicabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptorId.Value); + + return _courseGPAApplicabilityDescriptor; + } + set + { + _courseGPAApplicabilityDescriptor = value; + _courseGPAApplicabilityDescriptorId = default(int?); + } + } + public virtual string CourseTitle { get; set; } + public virtual DateTime? DateCourseAdopted + { + get { return _dateCourseAdopted; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _dateCourseAdopted = null; + } else + { + var given = (DateTime) value; + _dateCourseAdopted = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _dateCourseAdopted; + + public virtual bool? HighSchoolCourseRequirement { get; set; } + public virtual int? MaxCompletionsForCredit { get; set; } + public virtual decimal? MaximumAvailableCreditConversion { get; set; } + public virtual decimal? MaximumAvailableCredits { get; set; } + public virtual int? MaximumAvailableCreditTypeDescriptorId + { + get + { + if (_maximumAvailableCreditTypeDescriptorId == default(int?)) + _maximumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_maximumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptor); + + return _maximumAvailableCreditTypeDescriptorId; + } + set + { + _maximumAvailableCreditTypeDescriptorId = value; + _maximumAvailableCreditTypeDescriptor = null; + } + } + + private int? _maximumAvailableCreditTypeDescriptorId; + private string _maximumAvailableCreditTypeDescriptor; + + public virtual string MaximumAvailableCreditTypeDescriptor + { + get + { + if (_maximumAvailableCreditTypeDescriptor == null) + _maximumAvailableCreditTypeDescriptor = _maximumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptorId.Value); + + return _maximumAvailableCreditTypeDescriptor; + } + set + { + _maximumAvailableCreditTypeDescriptor = value; + _maximumAvailableCreditTypeDescriptorId = default(int?); + } + } + public virtual decimal? MinimumAvailableCreditConversion { get; set; } + public virtual decimal? MinimumAvailableCredits { get; set; } + public virtual int? MinimumAvailableCreditTypeDescriptorId + { + get + { + if (_minimumAvailableCreditTypeDescriptorId == default(int?)) + _minimumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_minimumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptor); + + return _minimumAvailableCreditTypeDescriptorId; + } + set + { + _minimumAvailableCreditTypeDescriptorId = value; + _minimumAvailableCreditTypeDescriptor = null; + } + } + + private int? _minimumAvailableCreditTypeDescriptorId; + private string _minimumAvailableCreditTypeDescriptor; + + public virtual string MinimumAvailableCreditTypeDescriptor + { + get + { + if (_minimumAvailableCreditTypeDescriptor == null) + _minimumAvailableCreditTypeDescriptor = _minimumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptorId.Value); + + return _minimumAvailableCreditTypeDescriptor; + } + set + { + _minimumAvailableCreditTypeDescriptor = value; + _minimumAvailableCreditTypeDescriptorId = default(int?); + } + } + public virtual int NumberOfParts { get; set; } + public virtual int? TimeRequiredForCompletion { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24041,17 +24369,323 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourse.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _courseAcademicSubjects; + private ICollection _courseAcademicSubjectsCovariant; + public virtual ICollection CourseAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseAcademicSubjects) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseAcademicSubjects; + } + set + { + _courseAcademicSubjects = value; + _courseAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseAcademicSubjects) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseAcademicSubjectsCovariant; + } + set + { + CourseAcademicSubjects = new HashSet(value.Cast()); + } + } + + + private ICollection _courseCompetencyLevels; + private ICollection _courseCompetencyLevelsCovariant; + public virtual ICollection CourseCompetencyLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseCompetencyLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseCompetencyLevels; + } + set + { + _courseCompetencyLevels = value; + _courseCompetencyLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseCompetencyLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseCompetencyLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseCompetencyLevelsCovariant; + } + set + { + CourseCompetencyLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _courseIdentificationCodes; + private ICollection _courseIdentificationCodesCovariant; + public virtual ICollection CourseIdentificationCodes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseIdentificationCodes) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseIdentificationCodes; + } + set + { + _courseIdentificationCodes = value; + _courseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseIdentificationCodes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseIdentificationCodes) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseIdentificationCodesCovariant; + } + set + { + CourseIdentificationCodes = new HashSet(value.Cast()); + } + } + + + private ICollection _courseLearningStandards; + private ICollection _courseLearningStandardsCovariant; + public virtual ICollection CourseLearningStandards + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseLearningStandards) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseLearningStandards; + } + set + { + _courseLearningStandards = value; + _courseLearningStandardsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseLearningStandards + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseLearningStandards) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseLearningStandardsCovariant; + } + set + { + CourseLearningStandards = new HashSet(value.Cast()); + } + } + + + private ICollection _courseLevelCharacteristics; + private ICollection _courseLevelCharacteristicsCovariant; + public virtual ICollection CourseLevelCharacteristics + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseLevelCharacteristics) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseLevelCharacteristics; + } + set + { + _courseLevelCharacteristics = value; + _courseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseLevelCharacteristics + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseLevelCharacteristics) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseLevelCharacteristicsCovariant; + } + set + { + CourseLevelCharacteristics = new HashSet(value.Cast()); + } + } + + + private ICollection _courseOfferedGradeLevels; + private ICollection _courseOfferedGradeLevelsCovariant; + public virtual ICollection CourseOfferedGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseOfferedGradeLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseOfferedGradeLevels; + } + set + { + _courseOfferedGradeLevels = value; + _courseOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseOfferedGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseOfferedGradeLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseOfferedGradeLevelsCovariant; + } + set + { + CourseOfferedGradeLevels = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "CareerPathwayDescriptor", new LookupColumnDetails { PropertyName = "CareerPathwayDescriptorId", LookupTypeName = "CareerPathwayDescriptor"} }, + { "CourseDefinedByDescriptor", new LookupColumnDetails { PropertyName = "CourseDefinedByDescriptorId", LookupTypeName = "CourseDefinedByDescriptor"} }, + { "CourseGPAApplicabilityDescriptor", new LookupColumnDetails { PropertyName = "CourseGPAApplicabilityDescriptorId", LookupTypeName = "CourseGPAApplicabilityDescriptor"} }, + { "MaximumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MaximumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "MinimumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MinimumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -24062,11 +24696,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -24130,83 +24765,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferedGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourse)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOfferedGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.ICourse) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } -} -// Aggregate: CourseAttemptResultDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseAttemptResultDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseAttemptResultDescriptor table of the CourseAttemptResultDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseAcademicSubject table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseAttemptResultDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseAttemptResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseAttemptResultDescriptorId + public CourseAcademicSubject() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Course Course { get; set; } + + Entities.Common.EdFi.ICourse ICourseAcademicSubject.Course { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Course; } + set { Course = (Course) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AcademicSubjectDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + public virtual string AcademicSubjectDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -24220,6 +24862,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24235,6 +24906,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -24245,11 +24917,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -24313,256 +24985,92 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseAcademicSubject) target, null); } + void IChildEntity.SetParent(object value) + { + Course = (Course) value; + } } -} -// Aggregate: CourseDefinedByDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseDefinedByDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseDefinedByDescriptor table of the CourseDefinedByDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseCompetencyLevel table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseDefinedByDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseDefinedByDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseCompetencyLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseCompetencyLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseDefinedByDescriptorId + public CourseCompetencyLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + [DomainSignature, JsonIgnore] + public virtual Course Course { get; set; } + + Entities.Common.EdFi.ICourse ICourseCompetencyLevel.Course { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return Course; } + set { Course = (Course) value; } } - DateTime? IDescriptor.EffectiveEndDate + + [DomainSignature] + public virtual int CompetencyLevelDescriptorId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + get { - }; + if (_competencyLevelDescriptorId == default(int)) + _competencyLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CompetencyLevelDescriptor", _competencyLevelDescriptor); - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _competencyLevelDescriptorId; + } + set + { + _competencyLevelDescriptorId = value; + _competencyLevelDescriptor = null; + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CourseDefinedByDescriptorId", CourseDefinedByDescriptorId); - - return keyValues; - } + private int _competencyLevelDescriptorId; + private string _competencyLevelDescriptor; - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + public virtual string CompetencyLevelDescriptor { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (_competencyLevelDescriptor == null) + _competencyLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CompetencyLevelDescriptor", _competencyLevelDescriptorId); + + return _competencyLevelDescriptor; } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + _competencyLevelDescriptor = value; + _competencyLevelDescriptorId = default(int); } - - return hashCode.ToHashCode(); } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseDefinedByDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICourseDefinedByDescriptor) target, null); - } - - } -} -// Aggregate: CourseGPAApplicabilityDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseGPAApplicabilityDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.CourseGPAApplicabilityDescriptor table of the CourseGPAApplicabilityDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseGPAApplicabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseGPAApplicabilityDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -24578,6 +25086,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24593,6 +25130,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CompetencyLevelDescriptor", new LookupColumnDetails { PropertyName = "CompetencyLevelDescriptorId", LookupTypeName = "CompetencyLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -24603,11 +25141,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CourseGPAApplicabilityDescriptorId", CourseGPAApplicabilityDescriptorId); + keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); return keyValues; } @@ -24671,261 +25209,100 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseCompetencyLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseCompetencyLevel) target, null); } + void IChildEntity.SetParent(object value) + { + Course = (Course) value; + } } -} -// Aggregate: CourseIdentificationSystemDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseIdentificationSystemDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseIdentificationSystemDescriptor table of the CourseIdentificationSystemDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseIdentificationCode table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseIdentificationSystemDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + public CourseIdentificationCode() { - get { return ShortDescription; } - set { ShortDescription = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Course Course { get; set; } - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + Entities.Common.EdFi.ICourse ICourseIdentificationCode.Course { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); - - return keyValues; + get { return Course; } + set { Course = (Course) value; } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [DomainSignature] + public virtual int CourseIdentificationSystemDescriptorId { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + if (_courseIdentificationSystemDescriptorId == default(int)) + _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); - foreach (DictionaryEntry entry in keyValues) + return _courseIdentificationSystemDescriptorId; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + _courseIdentificationSystemDescriptorId = value; + _courseIdentificationSystemDescriptor = null; } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor) target, null); } - } -} -// Aggregate: CourseLevelCharacteristicDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseLevelCharacteristicDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.CourseLevelCharacteristicDescriptor table of the CourseLevelCharacteristicDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { + private int _courseIdentificationSystemDescriptorId; + private string _courseIdentificationSystemDescriptor; - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseLevelCharacteristicDescriptorId + public virtual string CourseIdentificationSystemDescriptor { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get + { + if (_courseIdentificationSystemDescriptor == null) + _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); + + return _courseIdentificationSystemDescriptor; + } + set + { + _courseIdentificationSystemDescriptor = value; + _courseIdentificationSystemDescriptorId = default(int); + } } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string AssigningOrganizationIdentificationCode { get; set; } + public virtual string CourseCatalogURL { get; set; } + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24936,6 +25313,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24951,6 +25357,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -24961,11 +25368,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); + keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); return keyValues; } @@ -25029,122 +25436,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor) target, null); - } - - } -} -// Aggregate: CourseOffering - -namespace EdFi.Ods.Entities.NHibernate.CourseOfferingAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class CourseOfferingReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string LocalCourseCode { get; set; } - public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual string SessionName { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SessionName", SessionName); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.ICourseIdentificationCode) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + Course = (Course) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOffering table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseLearningStandard table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOffering : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICourseOffering, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOffering() + public CourseLearningStandard() { - CourseOfferingCourseLevelCharacteristics = new HashSet(); - CourseOfferingCurriculumUseds = new HashSet(); - CourseOfferingOfferedGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -25152,14 +25473,17 @@ public CourseOffering() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Course Course { get; set; } + + Entities.Common.EdFi.ICourse ICourseLearningStandard.Course + { + get { return Course; } + set { Course = (Course) value; } + } + [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -25170,10 +25494,6 @@ public CourseOffering() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CourseCode { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int? InstructionalTimePlanned { get; set; } - public virtual string LocalCourseTitle { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -25218,54 +25538,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } - - /// - /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseOffering.CourseDiscriminator - { - get { return CourseReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseOffering.CourseResourceId - { - get { return CourseReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseOffering.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.SessionAggregate.EdFi.SessionReferenceData SessionReferenceData { get; set; } + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } /// - /// Read-only property that allows the Session discriminator value to be mapped to the resource reference. + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator + string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardDiscriminator { - get { return SessionReferenceData?.Discriminator; } + get { return LearningStandardReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the Session resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICourseOffering.SessionResourceId + Guid? Entities.Common.EdFi.ICourseLearningStandard.LearningStandardResourceId { - get { return SessionReferenceData?.Id; } + get { return LearningStandardReferenceData?.Id; } set { } } @@ -25274,147 +25563,6 @@ string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _courseOfferingCourseLevelCharacteristics; - private ICollection _courseOfferingCourseLevelCharacteristicsCovariant; - public virtual ICollection CourseOfferingCourseLevelCharacteristics - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCourseLevelCharacteristics) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- - - return _courseOfferingCourseLevelCharacteristics; - } - set - { - _courseOfferingCourseLevelCharacteristics = value; - _courseOfferingCourseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCourseLevelCharacteristics - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCourseLevelCharacteristics) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- - - return _courseOfferingCourseLevelCharacteristicsCovariant; - } - set - { - CourseOfferingCourseLevelCharacteristics = new HashSet(value.Cast()); - } - } - - - private ICollection _courseOfferingCurriculumUseds; - private ICollection _courseOfferingCurriculumUsedsCovariant; - public virtual ICollection CourseOfferingCurriculumUseds - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCurriculumUseds) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- - - return _courseOfferingCurriculumUseds; - } - set - { - _courseOfferingCurriculumUseds = value; - _courseOfferingCurriculumUsedsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCurriculumUseds - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCurriculumUseds) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- - - return _courseOfferingCurriculumUsedsCovariant; - } - set - { - CourseOfferingCurriculumUseds = new HashSet(value.Cast()); - } - } - - - private ICollection _courseOfferingOfferedGradeLevels; - private ICollection _courseOfferingOfferedGradeLevelsCovariant; - public virtual ICollection CourseOfferingOfferedGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingOfferedGradeLevels) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- - - return _courseOfferingOfferedGradeLevels; - } - set - { - _courseOfferingOfferedGradeLevels = value; - _courseOfferingOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingOfferedGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingOfferedGradeLevels) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- - - return _courseOfferingOfferedGradeLevelsCovariant; - } - set - { - CourseOfferingOfferedGradeLevels = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -25430,14 +25578,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SessionName", SessionName); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -25501,32 +25646,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOffering)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOffering) target, null); + this.MapTo((Entities.Common.EdFi.ICourseLearningStandard) target, null); } + void IChildEntity.SetParent(object value) + { + Course = (Course) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferingCourseLevelCharacteristic table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseLevelCharacteristic table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferingCourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOfferingCourseLevelCharacteristic() + public CourseLevelCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -25535,12 +25684,12 @@ public CourseOfferingCourseLevelCharacteristic() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual CourseOffering CourseOffering { get; set; } + public virtual Course Course { get; set; } - Entities.Common.EdFi.ICourseOffering ICourseOfferingCourseLevelCharacteristic.CourseOffering + Entities.Common.EdFi.ICourse ICourseLevelCharacteristic.Course { - get { return CourseOffering; } - set { CourseOffering = (CourseOffering) value; } + get { return Course; } + set { Course = (Course) value; } } [DomainSignature] @@ -25654,7 +25803,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); @@ -25721,36 +25870,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristic)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic) target, null); + this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristic) target, null); } void IChildEntity.SetParent(object value) { - CourseOffering = (CourseOffering) value; + Course = (Course) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferingCurriculumUsed table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferedGradeLevel table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferingCurriculumUsed : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferingCurriculumUsed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOfferingCurriculumUsed() + public CourseOfferedGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -25759,47 +25908,47 @@ public CourseOfferingCurriculumUsed() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual CourseOffering CourseOffering { get; set; } + public virtual Course Course { get; set; } - Entities.Common.EdFi.ICourseOffering ICourseOfferingCurriculumUsed.CourseOffering + Entities.Common.EdFi.ICourse ICourseOfferedGradeLevel.Course { - get { return CourseOffering; } - set { CourseOffering = (CourseOffering) value; } + get { return Course; } + set { Course = (Course) value; } } [DomainSignature] - public virtual int CurriculumUsedDescriptorId + public virtual int GradeLevelDescriptorId { get { - if (_curriculumUsedDescriptorId == default(int)) - _curriculumUsedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CurriculumUsedDescriptor", _curriculumUsedDescriptor); + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - return _curriculumUsedDescriptorId; + return _gradeLevelDescriptorId; } set { - _curriculumUsedDescriptorId = value; - _curriculumUsedDescriptor = null; + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; } } - private int _curriculumUsedDescriptorId; - private string _curriculumUsedDescriptor; + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; - public virtual string CurriculumUsedDescriptor + public virtual string GradeLevelDescriptor { get { - if (_curriculumUsedDescriptor == null) - _curriculumUsedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CurriculumUsedDescriptor", _curriculumUsedDescriptorId); + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - return _curriculumUsedDescriptor; + return _gradeLevelDescriptor; } set { - _curriculumUsedDescriptor = value; - _curriculumUsedDescriptorId = default(int); + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -25866,7 +26015,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CurriculumUsedDescriptor", new LookupColumnDetails { PropertyName = "CurriculumUsedDescriptorId", LookupTypeName = "CurriculumUsedDescriptor"} }, + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -25878,10 +26027,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -25945,136 +26094,96 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferedGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferedGradeLevel) target, null); } void IChildEntity.SetParent(object value) { - CourseOffering = (CourseOffering) value; + Course = (Course) value; } } +} +// Aggregate: CourseAttemptResultDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CourseAttemptResultDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferingOfferedGradeLevel table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseAttemptResultDescriptor table of the CourseAttemptResultDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferingOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseAttemptResultDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseAttemptResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseOfferingOfferedGradeLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseOffering CourseOffering { get; set; } - - Entities.Common.EdFi.ICourseOffering ICourseOfferingOfferedGradeLevel.CourseOffering - { - get { return CourseOffering; } - set { CourseOffering = (CourseOffering) value; } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + public virtual int CourseAttemptResultDescriptorId { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - _extensions = value; - } - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public IDictionary AggregateExtensions { get; set; } + // ============================================================= + // Extensions + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -26090,7 +26199,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -26101,11 +26209,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); return keyValues; } @@ -26169,41 +26277,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - CourseOffering = (CourseOffering) value; - } } } -// Aggregate: CourseRepeatCodeDescriptor +// Aggregate: CourseDefinedByDescriptor -namespace EdFi.Ods.Entities.NHibernate.CourseRepeatCodeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CourseDefinedByDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseRepeatCodeDescriptor table of the CourseRepeatCodeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseDefinedByDescriptor table of the CourseDefinedByDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseRepeatCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseRepeatCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseDefinedByDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseDefinedByDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CourseRepeatCodeDescriptorId + public virtual int CourseDefinedByDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -26288,7 +26392,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseRepeatCodeDescriptorId", CourseRepeatCodeDescriptorId); + keyValues.Add("CourseDefinedByDescriptorId", CourseDefinedByDescriptorId); return keyValues; } @@ -26352,47 +26456,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseDefinedByDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseDefinedByDescriptor) target, null); } } } -// Aggregate: CourseTranscript +// Aggregate: CourseGPAApplicabilityDescriptor -namespace EdFi.Ods.Entities.NHibernate.CourseTranscriptAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CourseGPAApplicabilityDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.CourseGPAApplicabilityDescriptor table of the CourseGPAApplicabilityDescriptor aggregate in the ODS database. /// - public class CourseTranscriptReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class CourseGPAApplicabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int CourseAttemptResultDescriptorId { get; set; } - public virtual string CourseCode { get; set; } - public virtual long CourseEducationOrganizationId { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual int StudentUSI { get; set; } - public virtual int TermDescriptorId { get; set; } + [DomainSignature] + public virtual int CourseGPAApplicabilityDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -26401,13 +26571,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("StudentUSI", StudentUSI); - keyValues.Add("TermDescriptorId", TermDescriptorId); + keyValues.Add("CourseGPAApplicabilityDescriptorId", CourseGPAApplicabilityDescriptorId); return keyValues; } @@ -26428,8 +26592,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -26446,416 +26620,524 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor) target, null); + } + } +} +// Aggregate: CourseIdentificationSystemDescriptor +namespace EdFi.Ods.Entities.NHibernate.CourseIdentificationSystemDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscript table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseIdentificationSystemDescriptor table of the CourseIdentificationSystemDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscript : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICourseTranscript, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscript() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int CourseIdentificationSystemDescriptorId { - CourseTranscriptAcademicSubjects = new HashSet(); - CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(); - CourseTranscriptCoursePrograms = new HashSet(); - CourseTranscriptCreditCategories = new HashSet(); - CourseTranscriptEarnedAdditionalCredits = new HashSet(); - CourseTranscriptPartialCourseTranscriptAwards = new HashSet(); - CourseTranscriptSections = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseAttemptResultDescriptorId + string IDescriptor.CodeValue { - get - { - if (_courseAttemptResultDescriptorId == default(int)) - _courseAttemptResultDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseAttemptResultDescriptor", _courseAttemptResultDescriptor); + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - return _courseAttemptResultDescriptorId; - } - set + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - _courseAttemptResultDescriptorId = value; - _courseAttemptResultDescriptor = null; - } - } + }; - private int _courseAttemptResultDescriptorId; - private string _courseAttemptResultDescriptor; + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } - public virtual string CourseAttemptResultDescriptor + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - if (_courseAttemptResultDescriptor == null) - _courseAttemptResultDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseAttemptResultDescriptor", _courseAttemptResultDescriptorId); - - return _courseAttemptResultDescriptor; - } - set - { - _courseAttemptResultDescriptor = value; - _courseAttemptResultDescriptorId = default(int); - } + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); + + return keyValues; } - [DomainSignature] - public virtual string CourseCode { get; set; } - [DomainSignature] - public virtual long CourseEducationOrganizationId { get; set; } - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - if (_studentUSI == default(int) && _studentUniqueId != null) + if (entry.Value is string) { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) { - _studentUSI = usi; + return false; } } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } - } - private int _studentUSI; - private string _studentUniqueId; + return true; + } - public virtual string StudentUniqueId + public override int GetHashCode() { - get + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - if (_studentUniqueId == null) + if (entry.Value is string) { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); } - - return _studentUniqueId; } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - _studentUniqueId = value; - } + return hashCode.ToHashCode(); } - [DomainSignature] - public virtual int TermDescriptorId + #endregion + bool ISynchronizable.Synchronize(object target) { - get - { - if (_termDescriptorId == default(int)) - _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target); + } - return _termDescriptorId; - } - set - { - _termDescriptorId = value; - _termDescriptor = null; - } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor) target, null); } - private int _termDescriptorId; - private string _termDescriptor; + } +} +// Aggregate: CourseLevelCharacteristicDescriptor - public virtual string TermDescriptor +namespace EdFi.Ods.Entities.NHibernate.CourseLevelCharacteristicDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.CourseLevelCharacteristicDescriptor table of the CourseLevelCharacteristicDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class CourseLevelCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int CourseLevelCharacteristicDescriptorId { - get - { - if (_termDescriptor == null) - _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); - - return _termDescriptor; - } - set - { - _termDescriptor = value; - _termDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AlternativeCourseTitle { get; set; } - public virtual string AssigningOrganizationIdentificationCode { get; set; } - public virtual decimal? AttemptedCreditConversion { get; set; } - public virtual decimal? AttemptedCredits { get; set; } - public virtual int? AttemptedCreditTypeDescriptorId - { - get - { - if (_attemptedCreditTypeDescriptorId == default(int?)) - _attemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_attemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _attemptedCreditTypeDescriptor); + // ------------------------------------------------------------- - return _attemptedCreditTypeDescriptorId; - } - set - { - _attemptedCreditTypeDescriptorId = value; - _attemptedCreditTypeDescriptor = null; - } - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - private int? _attemptedCreditTypeDescriptorId; - private string _attemptedCreditTypeDescriptor; + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public virtual string AttemptedCreditTypeDescriptor - { - get - { - if (_attemptedCreditTypeDescriptor == null) - _attemptedCreditTypeDescriptor = _attemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _attemptedCreditTypeDescriptorId.Value); - - return _attemptedCreditTypeDescriptor; - } - set + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - _attemptedCreditTypeDescriptor = value; - _attemptedCreditTypeDescriptorId = default(int?); - } + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } } - public virtual string CourseCatalogURL { get; set; } - public virtual int? CourseRepeatCodeDescriptorId + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - if (_courseRepeatCodeDescriptorId == default(int?)) - _courseRepeatCodeDescriptorId = string.IsNullOrWhiteSpace(_courseRepeatCodeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptor); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - return _courseRepeatCodeDescriptorId; - } - set - { - _courseRepeatCodeDescriptorId = value; - _courseRepeatCodeDescriptor = null; - } - } + // Add current key values + keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); - private int? _courseRepeatCodeDescriptorId; - private string _courseRepeatCodeDescriptor; + return keyValues; + } - public virtual string CourseRepeatCodeDescriptor + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - if (_courseRepeatCodeDescriptor == null) - _courseRepeatCodeDescriptor = _courseRepeatCodeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptorId.Value); - - return _courseRepeatCodeDescriptor; - } - set + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _courseRepeatCodeDescriptor = value; - _courseRepeatCodeDescriptorId = default(int?); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - public virtual string CourseTitle { get; set; } - public virtual decimal? EarnedCreditConversion { get; set; } - public virtual decimal? EarnedCredits { get; set; } - public virtual int? EarnedCreditTypeDescriptorId + + public override int GetHashCode() { - get - { - if (_earnedCreditTypeDescriptorId == default(int?)) - _earnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_earnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _earnedCreditTypeDescriptor); + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _earnedCreditTypeDescriptorId; - } - set - { - _earnedCreditTypeDescriptorId = value; - _earnedCreditTypeDescriptor = null; - } - } + if (keyValues.Count == 0) + return base.GetHashCode(); - private int? _earnedCreditTypeDescriptorId; - private string _earnedCreditTypeDescriptor; + var hashCode = new HashCode(); - public virtual string EarnedCreditTypeDescriptor - { - get - { - if (_earnedCreditTypeDescriptor == null) - _earnedCreditTypeDescriptor = _earnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _earnedCreditTypeDescriptorId.Value); - - return _earnedCreditTypeDescriptor; - } - set + foreach (DictionaryEntry entry in keyValues) { - _earnedCreditTypeDescriptor = value; - _earnedCreditTypeDescriptorId = default(int?); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); } - public virtual long? ExternalEducationOrganizationId { get; set; } - public virtual string ExternalEducationOrganizationNameOfInstitution { get; set; } - public virtual string FinalLetterGradeEarned { get; set; } - public virtual decimal? FinalNumericGradeEarned { get; set; } - public virtual int? MethodCreditEarnedDescriptorId + #endregion + bool ISynchronizable.Synchronize(object target) { - get - { - if (_methodCreditEarnedDescriptorId == default(int?)) - _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target); + } - return _methodCreditEarnedDescriptorId; - } - set - { - _methodCreditEarnedDescriptorId = value; - _methodCreditEarnedDescriptor = null; - } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor) target, null); } - private int? _methodCreditEarnedDescriptorId; - private string _methodCreditEarnedDescriptor; + } +} +// Aggregate: CourseOffering - public virtual string MethodCreditEarnedDescriptor +namespace EdFi.Ods.Entities.NHibernate.CourseOfferingAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class CourseOfferingReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string LocalCourseCode { get; set; } + public virtual long SchoolId { get; set; } + public virtual short SchoolYear { get; set; } + public virtual string SessionName { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - if (_methodCreditEarnedDescriptor == null) - _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); - - return _methodCreditEarnedDescriptor; - } - set - { - _methodCreditEarnedDescriptor = value; - _methodCreditEarnedDescriptorId = default(int?); - } + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SessionName", SessionName); + + return keyValues; } - public virtual int? ResponsibleTeacherStaffUSI + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - if (_responsibleTeacherStaffUSI == default(int?) && _responsibleTeacherStaffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_responsibleTeacherStaffUniqueId, out var usi)) - { - _responsibleTeacherStaffUSI = usi; - } - } + var compareTo = obj as IHasPrimaryKeyValues; - return _responsibleTeacherStaffUSI; - } - set - { - _responsibleTeacherStaffUSI = value; + if (ReferenceEquals(this, compareTo)) + return true; - if (value != null) - { - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value.Value); - } - } - } + if (compareTo == null) + return false; - private int? _responsibleTeacherStaffUSI; - private string _responsibleTeacherStaffUniqueId; + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); - public virtual string ResponsibleTeacherStaffUniqueId - { - get + foreach (DictionaryEntry entry in theseKeys) { - if (_responsibleTeacherStaffUniqueId == null && _responsibleTeacherStaffUSI.HasValue) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_responsibleTeacherStaffUSI.Value, out var uniqueId)) - { - _responsibleTeacherStaffUniqueId = uniqueId; - } - } - - return _responsibleTeacherStaffUniqueId; + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } - set - { - if (_responsibleTeacherStaffUniqueId != value) - _responsibleTeacherStaffUSI = default(int?); - _responsibleTeacherStaffUniqueId = value; - } + return true; } - public virtual int? WhenTakenGradeLevelDescriptorId + + public override int GetHashCode() { - get - { - if (_whenTakenGradeLevelDescriptorId == default(int?)) - _whenTakenGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenTakenGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenTakenGradeLevelDescriptor); + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _whenTakenGradeLevelDescriptorId; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - _whenTakenGradeLevelDescriptorId = value; - _whenTakenGradeLevelDescriptor = null; + hashCode.Add(entry.Value); } + + return hashCode.ToHashCode(); } + #endregion + } - private int? _whenTakenGradeLevelDescriptorId; - private string _whenTakenGradeLevelDescriptor; +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 - public virtual string WhenTakenGradeLevelDescriptor + /// + /// A class which represents the edfi.CourseOffering table of the CourseOffering aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class CourseOffering : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICourseOffering, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CourseOffering() { - get - { - if (_whenTakenGradeLevelDescriptor == null) - _whenTakenGradeLevelDescriptor = _whenTakenGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenTakenGradeLevelDescriptorId.Value); - - return _whenTakenGradeLevelDescriptor; - } - set - { - _whenTakenGradeLevelDescriptor = value; - _whenTakenGradeLevelDescriptorId = default(int?); - } + CourseOfferingCourseLevelCharacteristics = new HashSet(); + CourseOfferingCurriculumUseds = new HashSet(); + CourseOfferingOfferedGradeLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string LocalCourseCode { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } + [DomainSignature] + public virtual string SessionName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string CourseCode { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual int? InstructionalTimePlanned { get; set; } + public virtual string LocalCourseTitle { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -26905,7 +27187,7 @@ public IDictionary Extensions /// /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ICourseTranscript.CourseDiscriminator + string Entities.Common.EdFi.ICourseOffering.CourseDiscriminator { get { return CourseReferenceData?.Discriminator; } set { } @@ -26914,69 +27196,40 @@ string Entities.Common.EdFi.ICourseTranscript.CourseDiscriminator /// /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICourseTranscript.CourseResourceId + Guid? Entities.Common.EdFi.ICourseOffering.CourseResourceId { get { return CourseReferenceData?.Id; } set { } } - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ExternalEducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the ExternalEducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationDiscriminator - { - get { return ExternalEducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ExternalEducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationResourceId - { - get { return ExternalEducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData ResponsibleTeacherStaffReferenceData { get; set; } - - /// - /// Read-only property that allows the ResponsibleTeacherStaff discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffDiscriminator - { - get { return ResponsibleTeacherStaffReferenceData?.Discriminator; } - set { } - } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the ResponsibleTeacherStaff resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffResourceId + Guid? Entities.Common.EdFi.ICourseOffering.SchoolResourceId { - get { return ResponsibleTeacherStaffReferenceData?.Id; } + get { return SchoolReferenceData?.Id; } set { } } - public virtual NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordReferenceData StudentAcademicRecordReferenceData { get; set; } + public virtual NHibernate.SessionAggregate.EdFi.SessionReferenceData SessionReferenceData { get; set; } /// - /// Read-only property that allows the StudentAcademicRecord discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Session discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator + string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator { - get { return StudentAcademicRecordReferenceData?.Discriminator; } + get { return SessionReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the StudentAcademicRecord resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Session resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordResourceId + Guid? Entities.Common.EdFi.ICourseOffering.SessionResourceId { - get { return StudentAcademicRecordReferenceData?.Id; } + get { return SessionReferenceData?.Id; } set { } } @@ -26986,9 +27239,9 @@ string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _courseTranscriptAcademicSubjects; - private ICollection _courseTranscriptAcademicSubjectsCovariant; - public virtual ICollection CourseTranscriptAcademicSubjects + private ICollection _courseOfferingCourseLevelCharacteristics; + private ICollection _courseOfferingCourseLevelCharacteristicsCovariant; + public virtual ICollection CourseOfferingCourseLevelCharacteristics { get { @@ -26997,233 +27250,45 @@ public virtual ICollection(value); + _courseOfferingCourseLevelCharacteristics = value; + _courseOfferingCourseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAcademicSubjects + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCourseLevelCharacteristics { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _courseTranscriptAcademicSubjects) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptAcademicSubjectsCovariant; - } - set - { - CourseTranscriptAcademicSubjects = new HashSet(value.Cast()); - } - } - - - private ICollection _courseTranscriptAlternativeCourseIdentificationCodes; - private ICollection _courseTranscriptAlternativeCourseIdentificationCodesCovariant; - public virtual ICollection CourseTranscriptAlternativeCourseIdentificationCodes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptAlternativeCourseIdentificationCodes; - } - set - { - _courseTranscriptAlternativeCourseIdentificationCodes = value; - _courseTranscriptAlternativeCourseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAlternativeCourseIdentificationCodes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptAlternativeCourseIdentificationCodesCovariant; - } - set - { - CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(value.Cast()); - } - } - - - private ICollection _courseTranscriptCoursePrograms; - private ICollection _courseTranscriptCourseProgramsCovariant; - public virtual ICollection CourseTranscriptCoursePrograms - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCoursePrograms) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptCoursePrograms; - } - set - { - _courseTranscriptCoursePrograms = value; - _courseTranscriptCourseProgramsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCoursePrograms - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCoursePrograms) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptCourseProgramsCovariant; - } - set - { - CourseTranscriptCoursePrograms = new HashSet(value.Cast()); - } - } - - - private ICollection _courseTranscriptCreditCategories; - private ICollection _courseTranscriptCreditCategoriesCovariant; - public virtual ICollection CourseTranscriptCreditCategories - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCreditCategories) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptCreditCategories; - } - set - { - _courseTranscriptCreditCategories = value; - _courseTranscriptCreditCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCreditCategories - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCreditCategories) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptCreditCategoriesCovariant; - } - set - { - CourseTranscriptCreditCategories = new HashSet(value.Cast()); - } - } - - - private ICollection _courseTranscriptEarnedAdditionalCredits; - private ICollection _courseTranscriptEarnedAdditionalCreditsCovariant; - public virtual ICollection CourseTranscriptEarnedAdditionalCredits - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptEarnedAdditionalCredits) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptEarnedAdditionalCredits; - } - set - { - _courseTranscriptEarnedAdditionalCredits = value; - _courseTranscriptEarnedAdditionalCreditsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptEarnedAdditionalCredits - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptEarnedAdditionalCredits) - if (item.CourseTranscript == null) - item.CourseTranscript = this; + foreach (var item in _courseOfferingCourseLevelCharacteristics) + if (item.CourseOffering == null) + item.CourseOffering = this; // ------------------------------------------------------------- - return _courseTranscriptEarnedAdditionalCreditsCovariant; + return _courseOfferingCourseLevelCharacteristicsCovariant; } set { - CourseTranscriptEarnedAdditionalCredits = new HashSet(value.Cast()); + CourseOfferingCourseLevelCharacteristics = new HashSet(value.Cast()); } } - private ICollection _courseTranscriptPartialCourseTranscriptAwards; - private ICollection _courseTranscriptPartialCourseTranscriptAwardsCovariant; - public virtual ICollection CourseTranscriptPartialCourseTranscriptAwards + private ICollection _courseOfferingCurriculumUseds; + private ICollection _courseOfferingCurriculumUsedsCovariant; + public virtual ICollection CourseOfferingCurriculumUseds { get { @@ -27232,45 +27297,45 @@ public virtual ICollection(value); + _courseOfferingCurriculumUseds = value; + _courseOfferingCurriculumUsedsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptPartialCourseTranscriptAwards + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCurriculumUseds { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) - if (item.CourseTranscript == null) - item.CourseTranscript = this; + foreach (var item in _courseOfferingCurriculumUseds) + if (item.CourseOffering == null) + item.CourseOffering = this; // ------------------------------------------------------------- - return _courseTranscriptPartialCourseTranscriptAwardsCovariant; + return _courseOfferingCurriculumUsedsCovariant; } set { - CourseTranscriptPartialCourseTranscriptAwards = new HashSet(value.Cast()); + CourseOfferingCurriculumUseds = new HashSet(value.Cast()); } } - private ICollection _courseTranscriptSections; - private ICollection _courseTranscriptSectionsCovariant; - public virtual ICollection CourseTranscriptSections + private ICollection _courseOfferingOfferedGradeLevels; + private ICollection _courseOfferingOfferedGradeLevelsCovariant; + public virtual ICollection CourseOfferingOfferedGradeLevels { get { @@ -27279,38 +27344,38 @@ public virtual ICollection(value); + _courseOfferingOfferedGradeLevels = value; + _courseOfferingOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptSections + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingOfferedGradeLevels { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _courseTranscriptSections) - if (item.CourseTranscript == null) - item.CourseTranscript = this; + foreach (var item in _courseOfferingOfferedGradeLevels) + if (item.CourseOffering == null) + item.CourseOffering = this; // ------------------------------------------------------------- - return _courseTranscriptSectionsCovariant; + return _courseOfferingOfferedGradeLevelsCovariant; } set { - CourseTranscriptSections = new HashSet(value.Cast()); + CourseOfferingOfferedGradeLevels = new HashSet(value.Cast()); } } @@ -27319,13 +27384,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CourseRepeatCodeDescriptor", new LookupColumnDetails { PropertyName = "CourseRepeatCodeDescriptorId", LookupTypeName = "CourseRepeatCodeDescriptor"} }, - { "EarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "EarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, - { "WhenTakenGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenTakenGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -27340,13 +27398,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("StudentUSI", StudentUSI); - keyValues.Add("TermDescriptorId", TermDescriptorId); + keyValues.Add("SessionName", SessionName); return keyValues; } @@ -27410,12 +27465,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscript)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOffering)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscript) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOffering) target, null); } } @@ -27423,19 +27478,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptAcademicSubject table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferingCourseLevelCharacteristic table of the CourseOffering aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseOfferingCourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptAcademicSubject() + public CourseOfferingCourseLevelCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -27444,47 +27499,47 @@ public CourseTranscriptAcademicSubject() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } + public virtual CourseOffering CourseOffering { get; set; } - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAcademicSubject.CourseTranscript + Entities.Common.EdFi.ICourseOffering ICourseOfferingCourseLevelCharacteristic.CourseOffering { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get { return CourseOffering; } + set { CourseOffering = (CourseOffering) value; } } [DomainSignature] - public virtual int AcademicSubjectDescriptorId + public virtual int CourseLevelCharacteristicDescriptorId { get { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + if (_courseLevelCharacteristicDescriptorId == default(int)) + _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); - return _academicSubjectDescriptorId; + return _courseLevelCharacteristicDescriptorId; } set { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; + _courseLevelCharacteristicDescriptorId = value; + _courseLevelCharacteristicDescriptor = null; } } - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; + private int _courseLevelCharacteristicDescriptorId; + private string _courseLevelCharacteristicDescriptor; - public virtual string AcademicSubjectDescriptor + public virtual string CourseLevelCharacteristicDescriptor { get { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + if (_courseLevelCharacteristicDescriptor == null) + _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); - return _academicSubjectDescriptor; + return _courseLevelCharacteristicDescriptor; } set { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); + _courseLevelCharacteristicDescriptor = value; + _courseLevelCharacteristicDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -27551,9 +27606,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -27565,10 +27618,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); return keyValues; } @@ -27632,36 +27685,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic) target, null); } void IChildEntity.SetParent(object value) { - CourseTranscript = (CourseTranscript) value; + CourseOffering = (CourseOffering) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptAlternativeCourseIdentificationCode table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferingCurriculumUsed table of the CourseOffering aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptAlternativeCourseIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseOfferingCurriculumUsed : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferingCurriculumUsed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptAlternativeCourseIdentificationCode() + public CourseOfferingCurriculumUsed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -27670,47 +27723,47 @@ public CourseTranscriptAlternativeCourseIdentificationCode() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } + public virtual CourseOffering CourseOffering { get; set; } - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAlternativeCourseIdentificationCode.CourseTranscript + Entities.Common.EdFi.ICourseOffering ICourseOfferingCurriculumUsed.CourseOffering { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get { return CourseOffering; } + set { CourseOffering = (CourseOffering) value; } } [DomainSignature] - public virtual int CourseIdentificationSystemDescriptorId + public virtual int CurriculumUsedDescriptorId { get { - if (_courseIdentificationSystemDescriptorId == default(int)) - _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); + if (_curriculumUsedDescriptorId == default(int)) + _curriculumUsedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CurriculumUsedDescriptor", _curriculumUsedDescriptor); - return _courseIdentificationSystemDescriptorId; + return _curriculumUsedDescriptorId; } set { - _courseIdentificationSystemDescriptorId = value; - _courseIdentificationSystemDescriptor = null; + _curriculumUsedDescriptorId = value; + _curriculumUsedDescriptor = null; } } - private int _courseIdentificationSystemDescriptorId; - private string _courseIdentificationSystemDescriptor; + private int _curriculumUsedDescriptorId; + private string _curriculumUsedDescriptor; - public virtual string CourseIdentificationSystemDescriptor + public virtual string CurriculumUsedDescriptor { get { - if (_courseIdentificationSystemDescriptor == null) - _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); + if (_curriculumUsedDescriptor == null) + _curriculumUsedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CurriculumUsedDescriptor", _curriculumUsedDescriptorId); - return _courseIdentificationSystemDescriptor; + return _curriculumUsedDescriptor; } set { - _courseIdentificationSystemDescriptor = value; - _courseIdentificationSystemDescriptorId = default(int); + _curriculumUsedDescriptor = value; + _curriculumUsedDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -27723,9 +27776,6 @@ public virtual string CourseIdentificationSystemDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AssigningOrganizationIdentificationCode { get; set; } - public virtual string CourseCatalogURL { get; set; } - public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -27780,9 +27830,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "CurriculumUsedDescriptor", new LookupColumnDetails { PropertyName = "CurriculumUsedDescriptorId", LookupTypeName = "CurriculumUsedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -27794,10 +27842,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); + keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); return keyValues; } @@ -27861,36 +27909,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed) target, null); } void IChildEntity.SetParent(object value) { - CourseTranscript = (CourseTranscript) value; + CourseOffering = (CourseOffering) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptCourseProgram table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferingOfferedGradeLevel table of the CourseOffering aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptCourseProgram : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptCourseProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseOfferingOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptCourseProgram() + public CourseOfferingOfferedGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -27899,49 +27947,47 @@ public CourseTranscriptCourseProgram() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } + public virtual CourseOffering CourseOffering { get; set; } - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCourseProgram.CourseTranscript + Entities.Common.EdFi.ICourseOffering ICourseOfferingOfferedGradeLevel.CourseOffering { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get { return CourseOffering; } + set { CourseOffering = (CourseOffering) value; } } [DomainSignature] - public virtual string CourseProgramName { get; set; } - [DomainSignature] - public virtual int CourseProgramTypeDescriptorId + public virtual int GradeLevelDescriptorId { get { - if (_courseProgramTypeDescriptorId == default(int)) - _courseProgramTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _courseProgramTypeDescriptor); + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - return _courseProgramTypeDescriptorId; + return _gradeLevelDescriptorId; } set { - _courseProgramTypeDescriptorId = value; - _courseProgramTypeDescriptor = null; + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; } } - private int _courseProgramTypeDescriptorId; - private string _courseProgramTypeDescriptor; + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; - public virtual string CourseProgramTypeDescriptor + public virtual string GradeLevelDescriptor { get { - if (_courseProgramTypeDescriptor == null) - _courseProgramTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _courseProgramTypeDescriptorId); + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - return _courseProgramTypeDescriptor; + return _gradeLevelDescriptor; } set { - _courseProgramTypeDescriptor = value; - _courseProgramTypeDescriptorId = default(int); + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -27998,26 +28044,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData CourseProgramReferenceData { get; set; } - - /// - /// Read-only property that allows the CourseProgram discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscriminator - { - get { return CourseProgramReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the CourseProgram resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramResourceId - { - get { return CourseProgramReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -28028,9 +28054,7 @@ string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscrimi // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CourseProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "CourseProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -28042,11 +28066,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CourseProgramName", CourseProgramName); - keyValues.Add("CourseProgramTypeDescriptorId", CourseProgramTypeDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -28110,92 +28133,81 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel) target, null); } void IChildEntity.SetParent(object value) { - CourseTranscript = (CourseTranscript) value; + CourseOffering = (CourseOffering) value; } } +} +// Aggregate: CourseRepeatCodeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CourseRepeatCodeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptCreditCategory table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseRepeatCodeDescriptor table of the CourseRepeatCodeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptCreditCategory : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptCreditCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseRepeatCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseRepeatCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseTranscriptCreditCategory() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } - - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCreditCategory.CourseTranscript - { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } - } - [DomainSignature] - public virtual int CreditCategoryDescriptorId - { - get - { - if (_creditCategoryDescriptorId == default(int)) - _creditCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditCategoryDescriptor", _creditCategoryDescriptor); - - return _creditCategoryDescriptorId; - } - set - { - _creditCategoryDescriptorId = value; - _creditCategoryDescriptor = null; - } - } - - private int _creditCategoryDescriptorId; - private string _creditCategoryDescriptor; - - public virtual string CreditCategoryDescriptor + public virtual int CourseRepeatCodeDescriptorId { - get - { - if (_creditCategoryDescriptor == null) - _creditCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditCategoryDescriptor", _creditCategoryDescriptorId); - - return _creditCategoryDescriptor; - } - set - { - _creditCategoryDescriptor = value; - _creditCategoryDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -28211,35 +28223,6 @@ public virtual string CreditCategoryDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -28255,9 +28238,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CreditCategoryDescriptor", new LookupColumnDetails { PropertyName = "CreditCategoryDescriptorId", LookupTypeName = "CreditCategoryDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -28268,11 +28248,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); + keyValues.Add("CourseRepeatCodeDescriptorId", CourseRepeatCodeDescriptorId); return keyValues; } @@ -28336,170 +28316,62 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory) target, null); + this.MapTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - CourseTranscript = (CourseTranscript) value; - } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 +} +// Aggregate: CourseTranscript +namespace EdFi.Ods.Entities.NHibernate.CourseTranscriptAggregate.EdFi +{ /// - /// A class which represents the edfi.CourseTranscriptEarnedAdditionalCredits table of the CourseTranscript aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseTranscriptEarnedAdditionalCredits : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseTranscriptReferenceData : IHasPrimaryKeyValues { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseTranscriptEarnedAdditionalCredits() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } - - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptEarnedAdditionalCredits.CourseTranscript - { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } - } - - [DomainSignature] - public virtual int AdditionalCreditTypeDescriptorId - { - get - { - if (_additionalCreditTypeDescriptorId == default(int)) - _additionalCreditTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptor); - - return _additionalCreditTypeDescriptorId; - } - set - { - _additionalCreditTypeDescriptorId = value; - _additionalCreditTypeDescriptor = null; - } - } - - private int _additionalCreditTypeDescriptorId; - private string _additionalCreditTypeDescriptor; - - public virtual string AdditionalCreditTypeDescriptor - { - get - { - if (_additionalCreditTypeDescriptor == null) - _additionalCreditTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptorId); - - return _additionalCreditTypeDescriptor; - } - set - { - _additionalCreditTypeDescriptor = value; - _additionalCreditTypeDescriptorId = default(int); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual decimal Credits { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual int CourseAttemptResultDescriptorId { get; set; } + public virtual string CourseCode { get; set; } + public virtual long CourseEducationOrganizationId { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual short SchoolYear { get; set; } + public virtual int StudentUSI { get; set; } + public virtual int TermDescriptorId { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "AdditionalCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AdditionalCreditTypeDescriptorId", LookupTypeName = "AdditionalCreditTypeDescriptor"} }, - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AdditionalCreditTypeDescriptorId", AdditionalCreditTypeDescriptorId); + keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("TermDescriptorId", TermDescriptorId); return keyValues; } @@ -28520,18 +28392,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -28548,51 +28410,38 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits) target, null); - } - - void IChildEntity.SetParent(object value) - { - CourseTranscript = (CourseTranscript) value; - } } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptPartialCourseTranscriptAwards table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscript table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptPartialCourseTranscriptAwards : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseTranscript : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICourseTranscript, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptPartialCourseTranscriptAwards() + public CourseTranscript() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CourseTranscriptAcademicSubjects = new HashSet(); + CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(); + CourseTranscriptCoursePrograms = new HashSet(); + CourseTranscriptCreditCategories = new HashSet(); + CourseTranscriptEarnedAdditionalCredits = new HashSet(); + CourseTranscriptPartialCourseTranscriptAwards = new HashSet(); + CourseTranscriptSections = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -28600,271 +28449,377 @@ public CourseTranscriptPartialCourseTranscriptAwards() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } - - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptPartialCourseTranscriptAwards.CourseTranscript - { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } - } - [DomainSignature] - public virtual DateTime AwardDate - { - get { return _awardDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _awardDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _awardDate; - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual decimal EarnedCredits { get; set; } - public virtual string LetterGradeEarned { get; set; } - public virtual int? MethodCreditEarnedDescriptorId + public virtual int CourseAttemptResultDescriptorId { get { - if (_methodCreditEarnedDescriptorId == default(int?)) - _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); + if (_courseAttemptResultDescriptorId == default(int)) + _courseAttemptResultDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseAttemptResultDescriptor", _courseAttemptResultDescriptor); - return _methodCreditEarnedDescriptorId; + return _courseAttemptResultDescriptorId; } set { - _methodCreditEarnedDescriptorId = value; - _methodCreditEarnedDescriptor = null; + _courseAttemptResultDescriptorId = value; + _courseAttemptResultDescriptor = null; } } - private int? _methodCreditEarnedDescriptorId; - private string _methodCreditEarnedDescriptor; + private int _courseAttemptResultDescriptorId; + private string _courseAttemptResultDescriptor; - public virtual string MethodCreditEarnedDescriptor + public virtual string CourseAttemptResultDescriptor { get { - if (_methodCreditEarnedDescriptor == null) - _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); + if (_courseAttemptResultDescriptor == null) + _courseAttemptResultDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseAttemptResultDescriptor", _courseAttemptResultDescriptorId); - return _methodCreditEarnedDescriptor; + return _courseAttemptResultDescriptor; } set { - _methodCreditEarnedDescriptor = value; - _methodCreditEarnedDescriptorId = default(int?); + _courseAttemptResultDescriptor = value; + _courseAttemptResultDescriptorId = default(int); } } - public virtual string NumericGradeEarned { get; set; } - // ------------------------------------------------------------- + [DomainSignature] + public virtual string CourseCode { get; set; } + [DomainSignature] + public virtual long CourseEducationOrganizationId { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI + { + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; + private int _studentUSI; + private string _studentUniqueId; - public IDictionary Extensions + public virtual string StudentUniqueId { - get => _extensions; - set + get { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + if (_studentUniqueId == null) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } + _studentUniqueId = uniqueId; } } - _extensions = value; + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; } } + [DomainSignature] + public virtual int TermDescriptorId + { + get + { + if (_termDescriptorId == default(int)) + _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); - public IDictionary AggregateExtensions { get; set; } + return _termDescriptorId; + } + set + { + _termDescriptorId = value; + _termDescriptor = null; + } + } + + private int _termDescriptorId; + private string _termDescriptor; + + public virtual string TermDescriptor + { + get + { + if (_termDescriptor == null) + _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); + + return _termDescriptor; + } + set + { + _termDescriptor = value; + _termDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= - // Reference Data + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- - //============================================================= - // Collections - // ------------------------------------------------------------- + // ============================================================= + // Properties // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + public virtual string AlternativeCourseTitle { get; set; } + public virtual string AssigningOrganizationIdentificationCode { get; set; } + public virtual decimal? AttemptedCreditConversion { get; set; } + public virtual decimal? AttemptedCredits { get; set; } + public virtual int? AttemptedCreditTypeDescriptorId + { + get { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, - }; + if (_attemptedCreditTypeDescriptorId == default(int?)) + _attemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_attemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _attemptedCreditTypeDescriptor); - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _attemptedCreditTypeDescriptorId; + } + set + { + _attemptedCreditTypeDescriptorId = value; + _attemptedCreditTypeDescriptor = null; + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("AwardDate", AwardDate); + private int? _attemptedCreditTypeDescriptorId; + private string _attemptedCreditTypeDescriptor; - return keyValues; + public virtual string AttemptedCreditTypeDescriptor + { + get + { + if (_attemptedCreditTypeDescriptor == null) + _attemptedCreditTypeDescriptor = _attemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _attemptedCreditTypeDescriptorId.Value); + + return _attemptedCreditTypeDescriptor; + } + set + { + _attemptedCreditTypeDescriptor = value; + _attemptedCreditTypeDescriptorId = default(int?); + } } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + public virtual string CourseCatalogURL { get; set; } + public virtual int? CourseRepeatCodeDescriptorId { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; + get + { + if (_courseRepeatCodeDescriptorId == default(int?)) + _courseRepeatCodeDescriptorId = string.IsNullOrWhiteSpace(_courseRepeatCodeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptor); - if (compareTo == null) - return false; + return _courseRepeatCodeDescriptorId; + } + set + { + _courseRepeatCodeDescriptorId = value; + _courseRepeatCodeDescriptor = null; + } + } - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + private int? _courseRepeatCodeDescriptorId; + private string _courseRepeatCodeDescriptor; - foreach (DictionaryEntry entry in theseKeys) + public virtual string CourseRepeatCodeDescriptor + { + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (_courseRepeatCodeDescriptor == null) + _courseRepeatCodeDescriptor = _courseRepeatCodeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptorId.Value); + + return _courseRepeatCodeDescriptor; + } + set + { + _courseRepeatCodeDescriptor = value; + _courseRepeatCodeDescriptorId = default(int?); } + } + public virtual string CourseTitle { get; set; } + public virtual decimal? EarnedCreditConversion { get; set; } + public virtual decimal? EarnedCredits { get; set; } + public virtual int? EarnedCreditTypeDescriptorId + { + get + { + if (_earnedCreditTypeDescriptorId == default(int?)) + _earnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_earnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _earnedCreditTypeDescriptor); - return true; + return _earnedCreditTypeDescriptorId; + } + set + { + _earnedCreditTypeDescriptorId = value; + _earnedCreditTypeDescriptor = null; + } } - public override int GetHashCode() + private int? _earnedCreditTypeDescriptorId; + private string _earnedCreditTypeDescriptor; + + public virtual string EarnedCreditTypeDescriptor { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + get + { + if (_earnedCreditTypeDescriptor == null) + _earnedCreditTypeDescriptor = _earnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _earnedCreditTypeDescriptorId.Value); + + return _earnedCreditTypeDescriptor; + } + set + { + _earnedCreditTypeDescriptor = value; + _earnedCreditTypeDescriptorId = default(int?); + } + } + public virtual long? ExternalEducationOrganizationId { get; set; } + public virtual string ExternalEducationOrganizationNameOfInstitution { get; set; } + public virtual string FinalLetterGradeEarned { get; set; } + public virtual decimal? FinalNumericGradeEarned { get; set; } + public virtual int? MethodCreditEarnedDescriptorId + { + get + { + if (_methodCreditEarnedDescriptorId == default(int?)) + _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); - if (keyValues.Count == 0) - return base.GetHashCode(); + return _methodCreditEarnedDescriptorId; + } + set + { + _methodCreditEarnedDescriptorId = value; + _methodCreditEarnedDescriptor = null; + } + } - var hashCode = new HashCode(); + private int? _methodCreditEarnedDescriptorId; + private string _methodCreditEarnedDescriptor; - foreach (DictionaryEntry entry in keyValues) + public virtual string MethodCreditEarnedDescriptor + { + get { - if (entry.Value is string) + if (_methodCreditEarnedDescriptor == null) + _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); + + return _methodCreditEarnedDescriptor; + } + set + { + _methodCreditEarnedDescriptor = value; + _methodCreditEarnedDescriptorId = default(int?); + } + } + public virtual int? ResponsibleTeacherStaffUSI + { + get + { + if (_responsibleTeacherStaffUSI == default(int?) && _responsibleTeacherStaffUniqueId != null) { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_responsibleTeacherStaffUniqueId, out var usi)) + { + _responsibleTeacherStaffUSI = usi; + } } - else + + return _responsibleTeacherStaffUSI; + } + set + { + _responsibleTeacherStaffUSI = value; + + if (value != null) { - hashCode.Add(entry.Value); + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value.Value); } } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target); } - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards) target, null); - } + private int? _responsibleTeacherStaffUSI; + private string _responsibleTeacherStaffUniqueId; - void IChildEntity.SetParent(object value) + public virtual string ResponsibleTeacherStaffUniqueId { - CourseTranscript = (CourseTranscript) value; - } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 + get + { + if (_responsibleTeacherStaffUniqueId == null && _responsibleTeacherStaffUSI.HasValue) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_responsibleTeacherStaffUSI.Value, out var uniqueId)) + { + _responsibleTeacherStaffUniqueId = uniqueId; + } + } - /// - /// A class which represents the edfi.CourseTranscriptSection table of the CourseTranscript aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseTranscriptSection : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptSection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } + return _responsibleTeacherStaffUniqueId; + } + set + { + if (_responsibleTeacherStaffUniqueId != value) + _responsibleTeacherStaffUSI = default(int?); - public CourseTranscriptSection() + _responsibleTeacherStaffUniqueId = value; + } + } + public virtual int? WhenTakenGradeLevelDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get + { + if (_whenTakenGradeLevelDescriptorId == default(int?)) + _whenTakenGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenTakenGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenTakenGradeLevelDescriptor); + + return _whenTakenGradeLevelDescriptorId; + } + set + { + _whenTakenGradeLevelDescriptorId = value; + _whenTakenGradeLevelDescriptor = null; + } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } + private int? _whenTakenGradeLevelDescriptorId; + private string _whenTakenGradeLevelDescriptor; - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptSection.CourseTranscript + public virtual string WhenTakenGradeLevelDescriptor { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get + { + if (_whenTakenGradeLevelDescriptor == null) + _whenTakenGradeLevelDescriptor = _whenTakenGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenTakenGradeLevelDescriptorId.Value); + + return _whenTakenGradeLevelDescriptor; + } + set + { + _whenTakenGradeLevelDescriptor = value; + _whenTakenGradeLevelDescriptorId = default(int?); + } } - - [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual string SectionIdentifier { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -28909,526 +28864,283 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } + public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } /// - /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator + string Entities.Common.EdFi.ICourseTranscript.CourseDiscriminator { - get { return SectionReferenceData?.Discriminator; } + get { return CourseReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICourseTranscriptSection.SectionResourceId + Guid? Entities.Common.EdFi.ICourseTranscript.CourseResourceId { - get { return SectionReferenceData?.Id; } + get { return CourseReferenceData?.Id; } set { } } - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptSection)target); - } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ExternalEducationOrganizationReferenceData { get; set; } - void IMappable.Map(object target) + /// + /// Read-only property that allows the ExternalEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationDiscriminator { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptSection) target, null); + get { return ExternalEducationOrganizationReferenceData?.Discriminator; } + set { } } - void IChildEntity.SetParent(object value) + /// + /// Read-only property that allows the ExternalEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationResourceId { - CourseTranscript = (CourseTranscript) value; + get { return ExternalEducationOrganizationReferenceData?.Id; } + set { } } - } -} -// Aggregate: Credential -namespace EdFi.Ods.Entities.NHibernate.CredentialAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class CredentialReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string CredentialIdentifier { get; set; } - public virtual int StateOfIssueStateAbbreviationDescriptorId { get; set; } - // ------------------------------------------------------------- + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData ResponsibleTeacherStaffReferenceData { get; set; } /// - /// The id of the referenced entity (used as the resource identifier in the API). + /// Read-only property that allows the ResponsibleTeacherStaff discriminator value to be mapped to the resource reference. /// - public virtual Guid? Id { get; set; } + string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffDiscriminator + { + get { return ResponsibleTeacherStaffReferenceData?.Discriminator; } + set { } + } /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. + /// Read-only property that allows the ResponsibleTeacherStaff resource identifier value to be mapped to the resource reference. /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + Guid? Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffResourceId { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CredentialIdentifier", CredentialIdentifier); - keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); - - return keyValues; + get { return ResponsibleTeacherStaffReferenceData?.Id; } + set { } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } + public virtual NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordReferenceData StudentAcademicRecordReferenceData { get; set; } - public override int GetHashCode() + /// + /// Read-only property that allows the StudentAcademicRecord discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + get { return StudentAcademicRecordReferenceData?.Discriminator; } + set { } } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.Credential table of the Credential aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class Credential : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICredential, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - public Credential() + /// + /// Read-only property that allows the StudentAcademicRecord resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordResourceId { - CredentialAcademicSubjects = new HashSet(); - CredentialEndorsements = new HashSet(); - CredentialGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return StudentAcademicRecordReferenceData?.Id; } + set { } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= - // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual string CredentialIdentifier { get; set; } - [DomainSignature] - public virtual int StateOfIssueStateAbbreviationDescriptorId - { - get - { - if (_stateOfIssueStateAbbreviationDescriptorId == default(int)) - _stateOfIssueStateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptor); - - return _stateOfIssueStateAbbreviationDescriptorId; - } - set - { - _stateOfIssueStateAbbreviationDescriptorId = value; - _stateOfIssueStateAbbreviationDescriptor = null; - } - } - private int _stateOfIssueStateAbbreviationDescriptorId; - private string _stateOfIssueStateAbbreviationDescriptor; + //============================================================= + // Collections + // ------------------------------------------------------------- - public virtual string StateOfIssueStateAbbreviationDescriptor + private ICollection _courseTranscriptAcademicSubjects; + private ICollection _courseTranscriptAcademicSubjectsCovariant; + public virtual ICollection CourseTranscriptAcademicSubjects { get { - if (_stateOfIssueStateAbbreviationDescriptor == null) - _stateOfIssueStateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptorId); - - return _stateOfIssueStateAbbreviationDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptAcademicSubjects) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- + + return _courseTranscriptAcademicSubjects; } set { - _stateOfIssueStateAbbreviationDescriptor = value; - _stateOfIssueStateAbbreviationDescriptorId = default(int); + _courseTranscriptAcademicSubjects = value; + _courseTranscriptAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? CredentialFieldDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAcademicSubjects { get { - if (_credentialFieldDescriptorId == default(int?)) - _credentialFieldDescriptorId = string.IsNullOrWhiteSpace(_credentialFieldDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialFieldDescriptor", _credentialFieldDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptAcademicSubjects) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - return _credentialFieldDescriptorId; - } + return _courseTranscriptAcademicSubjectsCovariant; + } set { - _credentialFieldDescriptorId = value; - _credentialFieldDescriptor = null; + CourseTranscriptAcademicSubjects = new HashSet(value.Cast()); } } - private int? _credentialFieldDescriptorId; - private string _credentialFieldDescriptor; - public virtual string CredentialFieldDescriptor + private ICollection _courseTranscriptAlternativeCourseIdentificationCodes; + private ICollection _courseTranscriptAlternativeCourseIdentificationCodesCovariant; + public virtual ICollection CourseTranscriptAlternativeCourseIdentificationCodes { get { - if (_credentialFieldDescriptor == null) - _credentialFieldDescriptor = _credentialFieldDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialFieldDescriptor", _credentialFieldDescriptorId.Value); - - return _credentialFieldDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- + + return _courseTranscriptAlternativeCourseIdentificationCodes; } set { - _credentialFieldDescriptor = value; - _credentialFieldDescriptorId = default(int?); + _courseTranscriptAlternativeCourseIdentificationCodes = value; + _courseTranscriptAlternativeCourseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); } } - public virtual int CredentialTypeDescriptorId + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAlternativeCourseIdentificationCodes { get { - if (_credentialTypeDescriptorId == default(int)) - _credentialTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialTypeDescriptor", _credentialTypeDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - return _credentialTypeDescriptorId; - } + return _courseTranscriptAlternativeCourseIdentificationCodesCovariant; + } set { - _credentialTypeDescriptorId = value; - _credentialTypeDescriptor = null; + CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(value.Cast()); } } - private int _credentialTypeDescriptorId; - private string _credentialTypeDescriptor; - public virtual string CredentialTypeDescriptor + private ICollection _courseTranscriptCoursePrograms; + private ICollection _courseTranscriptCourseProgramsCovariant; + public virtual ICollection CourseTranscriptCoursePrograms { get { - if (_credentialTypeDescriptor == null) - _credentialTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialTypeDescriptor", _credentialTypeDescriptorId); - - return _credentialTypeDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptCoursePrograms) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- + + return _courseTranscriptCoursePrograms; } set { - _credentialTypeDescriptor = value; - _credentialTypeDescriptorId = default(int); - } - } - public virtual DateTime? EffectiveDate - { - get { return _effectiveDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _effectiveDate = null; - } else - { - var given = (DateTime) value; - _effectiveDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _effectiveDate; - - public virtual DateTime? ExpirationDate - { - get { return _expirationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _expirationDate = null; - } else - { - var given = (DateTime) value; - _expirationDate = new DateTime(given.Year, given.Month, given.Day); - } + _courseTranscriptCoursePrograms = value; + _courseTranscriptCourseProgramsCovariant = new CovariantCollectionAdapter(value); } } - private DateTime? _expirationDate; - - public virtual DateTime IssuanceDate - { - get { return _issuanceDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _issuanceDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _issuanceDate; - - public virtual string Namespace { get; set; } - public virtual int? TeachingCredentialBasisDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCoursePrograms { get { - if (_teachingCredentialBasisDescriptorId == default(int?)) - _teachingCredentialBasisDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialBasisDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptCoursePrograms) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - return _teachingCredentialBasisDescriptorId; - } + return _courseTranscriptCourseProgramsCovariant; + } set { - _teachingCredentialBasisDescriptorId = value; - _teachingCredentialBasisDescriptor = null; + CourseTranscriptCoursePrograms = new HashSet(value.Cast()); } } - private int? _teachingCredentialBasisDescriptorId; - private string _teachingCredentialBasisDescriptor; - public virtual string TeachingCredentialBasisDescriptor - { - get - { - if (_teachingCredentialBasisDescriptor == null) - _teachingCredentialBasisDescriptor = _teachingCredentialBasisDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptorId.Value); - - return _teachingCredentialBasisDescriptor; - } - set - { - _teachingCredentialBasisDescriptor = value; - _teachingCredentialBasisDescriptorId = default(int?); - } - } - public virtual int? TeachingCredentialDescriptorId + private ICollection _courseTranscriptCreditCategories; + private ICollection _courseTranscriptCreditCategoriesCovariant; + public virtual ICollection CourseTranscriptCreditCategories { get { - if (_teachingCredentialDescriptorId == default(int?)) - _teachingCredentialDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialDescriptor", _teachingCredentialDescriptor); + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptCreditCategories) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - return _teachingCredentialDescriptorId; - } + return _courseTranscriptCreditCategories; + } set { - _teachingCredentialDescriptorId = value; - _teachingCredentialDescriptor = null; + _courseTranscriptCreditCategories = value; + _courseTranscriptCreditCategoriesCovariant = new CovariantCollectionAdapter(value); } } - private int? _teachingCredentialDescriptorId; - private string _teachingCredentialDescriptor; - - public virtual string TeachingCredentialDescriptor + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCreditCategories { get { - if (_teachingCredentialDescriptor == null) - _teachingCredentialDescriptor = _teachingCredentialDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialDescriptor", _teachingCredentialDescriptorId.Value); - - return _teachingCredentialDescriptor; - } - set - { - _teachingCredentialDescriptor = value; - _teachingCredentialDescriptorId = default(int?); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptCreditCategories) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - public IDictionary Extensions - { - get => _extensions; + return _courseTranscriptCreditCategoriesCovariant; + } set { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; + CourseTranscriptCreditCategories = new HashSet(value.Cast()); } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _credentialAcademicSubjects; - private ICollection _credentialAcademicSubjectsCovariant; - public virtual ICollection CredentialAcademicSubjects + private ICollection _courseTranscriptEarnedAdditionalCredits; + private ICollection _courseTranscriptEarnedAdditionalCreditsCovariant; + public virtual ICollection CourseTranscriptEarnedAdditionalCredits { get { @@ -29437,45 +29149,45 @@ public virtual ICollection(value); + _courseTranscriptEarnedAdditionalCredits = value; + _courseTranscriptEarnedAdditionalCreditsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialAcademicSubjects + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptEarnedAdditionalCredits { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _credentialAcademicSubjects) - if (item.Credential == null) - item.Credential = this; + foreach (var item in _courseTranscriptEarnedAdditionalCredits) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialAcademicSubjectsCovariant; + return _courseTranscriptEarnedAdditionalCreditsCovariant; } set { - CredentialAcademicSubjects = new HashSet(value.Cast()); + CourseTranscriptEarnedAdditionalCredits = new HashSet(value.Cast()); } } - private ICollection _credentialEndorsements; - private ICollection _credentialEndorsementsCovariant; - public virtual ICollection CredentialEndorsements + private ICollection _courseTranscriptPartialCourseTranscriptAwards; + private ICollection _courseTranscriptPartialCourseTranscriptAwardsCovariant; + public virtual ICollection CourseTranscriptPartialCourseTranscriptAwards { get { @@ -29484,45 +29196,45 @@ public virtual ICollection(value); + _courseTranscriptPartialCourseTranscriptAwards = value; + _courseTranscriptPartialCourseTranscriptAwardsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialEndorsements + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptPartialCourseTranscriptAwards { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _credentialEndorsements) - if (item.Credential == null) - item.Credential = this; + foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialEndorsementsCovariant; + return _courseTranscriptPartialCourseTranscriptAwardsCovariant; } set { - CredentialEndorsements = new HashSet(value.Cast()); + CourseTranscriptPartialCourseTranscriptAwards = new HashSet(value.Cast()); } } - private ICollection _credentialGradeLevels; - private ICollection _credentialGradeLevelsCovariant; - public virtual ICollection CredentialGradeLevels + private ICollection _courseTranscriptSections; + private ICollection _courseTranscriptSectionsCovariant; + public virtual ICollection CourseTranscriptSections { get { @@ -29531,38 +29243,38 @@ public virtual ICollection(value); + _courseTranscriptSections = value; + _courseTranscriptSectionsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialGradeLevels + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptSections { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _credentialGradeLevels) - if (item.Credential == null) - item.Credential = this; + foreach (var item in _courseTranscriptSections) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialGradeLevelsCovariant; + return _courseTranscriptSectionsCovariant; } set { - CredentialGradeLevels = new HashSet(value.Cast()); + CourseTranscriptSections = new HashSet(value.Cast()); } } @@ -29571,11 +29283,13 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CredentialFieldDescriptor", new LookupColumnDetails { PropertyName = "CredentialFieldDescriptorId", LookupTypeName = "CredentialFieldDescriptor"} }, - { "CredentialTypeDescriptor", new LookupColumnDetails { PropertyName = "CredentialTypeDescriptorId", LookupTypeName = "CredentialTypeDescriptor"} }, - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, - { "TeachingCredentialBasisDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialBasisDescriptorId", LookupTypeName = "TeachingCredentialBasisDescriptor"} }, - { "TeachingCredentialDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialDescriptorId", LookupTypeName = "TeachingCredentialDescriptor"} }, + { "AttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CourseRepeatCodeDescriptor", new LookupColumnDetails { PropertyName = "CourseRepeatCodeDescriptorId", LookupTypeName = "CourseRepeatCodeDescriptor"} }, + { "EarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "EarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "WhenTakenGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenTakenGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -29590,8 +29304,13 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CredentialIdentifier", CredentialIdentifier); - keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); + keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("TermDescriptorId", TermDescriptorId); return keyValues; } @@ -29655,12 +29374,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredential)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscript)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredential) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscript) target, null); } } @@ -29668,19 +29387,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialAcademicSubject table of the Credential aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptAcademicSubject table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICredentialAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseTranscriptAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CredentialAcademicSubject() + public CourseTranscriptAcademicSubject() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -29689,12 +29408,12 @@ public CredentialAcademicSubject() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Credential Credential { get; set; } + public virtual CourseTranscript CourseTranscript { get; set; } - Entities.Common.EdFi.ICredential ICredentialAcademicSubject.Credential + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAcademicSubject.CourseTranscript { - get { return Credential; } - set { Credential = (Credential) value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } [DomainSignature] @@ -29797,7 +29516,8 @@ public IDictionary Extensions private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -29809,7 +29529,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); @@ -29876,36 +29596,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject) target, null); } void IChildEntity.SetParent(object value) { - Credential = (Credential) value; + CourseTranscript = (CourseTranscript) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialEndorsement table of the Credential aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptAlternativeCourseIdentificationCode table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialEndorsement : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICredentialEndorsement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseTranscriptAlternativeCourseIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CredentialEndorsement() + public CourseTranscriptAlternativeCourseIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -29914,16 +29634,49 @@ public CredentialEndorsement() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Credential Credential { get; set; } + public virtual CourseTranscript CourseTranscript { get; set; } - Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAlternativeCourseIdentificationCode.CourseTranscript { - get { return Credential; } - set { Credential = (Credential) value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } [DomainSignature] - public virtual string CredentialEndorsementX { get; set; } + public virtual int CourseIdentificationSystemDescriptorId + { + get + { + if (_courseIdentificationSystemDescriptorId == default(int)) + _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); + + return _courseIdentificationSystemDescriptorId; + } + set + { + _courseIdentificationSystemDescriptorId = value; + _courseIdentificationSystemDescriptor = null; + } + } + + private int _courseIdentificationSystemDescriptorId; + private string _courseIdentificationSystemDescriptor; + + public virtual string CourseIdentificationSystemDescriptor + { + get + { + if (_courseIdentificationSystemDescriptor == null) + _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); + + return _courseIdentificationSystemDescriptor; + } + set + { + _courseIdentificationSystemDescriptor = value; + _courseIdentificationSystemDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -29934,6 +29687,9 @@ Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string AssigningOrganizationIdentificationCode { get; set; } + public virtual string CourseCatalogURL { get; set; } + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -29988,7 +29744,9 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30000,10 +29758,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CredentialEndorsement", CredentialEndorsementX); + keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); return keyValues; } @@ -30067,36 +29825,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialEndorsement)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialEndorsement) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode) target, null); } void IChildEntity.SetParent(object value) { - Credential = (Credential) value; + CourseTranscript = (CourseTranscript) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialGradeLevel table of the Credential aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptCourseProgram table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICredentialGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CourseTranscriptCourseProgram : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptCourseProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CredentialGradeLevel() + public CourseTranscriptCourseProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -30105,47 +29863,49 @@ public CredentialGradeLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Credential Credential { get; set; } + public virtual CourseTranscript CourseTranscript { get; set; } - Entities.Common.EdFi.ICredential ICredentialGradeLevel.Credential + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCourseProgram.CourseTranscript { - get { return Credential; } - set { Credential = (Credential) value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId + public virtual string CourseProgramName { get; set; } + [DomainSignature] + public virtual int CourseProgramTypeDescriptorId { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_courseProgramTypeDescriptorId == default(int)) + _courseProgramTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _courseProgramTypeDescriptor); - return _gradeLevelDescriptorId; + return _courseProgramTypeDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _courseProgramTypeDescriptorId = value; + _courseProgramTypeDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int _courseProgramTypeDescriptorId; + private string _courseProgramTypeDescriptor; - public virtual string GradeLevelDescriptor + public virtual string CourseProgramTypeDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_courseProgramTypeDescriptor == null) + _courseProgramTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _courseProgramTypeDescriptorId); - return _gradeLevelDescriptor; + return _courseProgramTypeDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _courseProgramTypeDescriptor = value; + _courseProgramTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -30202,6 +29962,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData CourseProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the CourseProgram discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscriminator + { + get { return CourseProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the CourseProgram resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramResourceId + { + get { return CourseProgramReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -30212,8 +29992,9 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CourseProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "CourseProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30225,10 +30006,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("CourseProgramName", CourseProgramName); + keyValues.Add("CourseProgramTypeDescriptorId", CourseProgramTypeDescriptorId); return keyValues; } @@ -30292,83 +30074,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram) target, null); } void IChildEntity.SetParent(object value) { - Credential = (Credential) value; + CourseTranscript = (CourseTranscript) value; } } -} -// Aggregate: CredentialFieldDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CredentialFieldDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialFieldDescriptor table of the CredentialFieldDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptCreditCategory table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialFieldDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICredentialFieldDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseTranscriptCreditCategory : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptCreditCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CredentialFieldDescriptorId + public CourseTranscriptCreditCategory() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCreditCategory.CourseTranscript { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int CreditCategoryDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_creditCategoryDescriptorId == default(int)) + _creditCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditCategoryDescriptor", _creditCategoryDescriptor); + + return _creditCategoryDescriptorId; + } + set + { + _creditCategoryDescriptorId = value; + _creditCategoryDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _creditCategoryDescriptorId; + private string _creditCategoryDescriptor; + + public virtual string CreditCategoryDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_creditCategoryDescriptor == null) + _creditCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditCategoryDescriptor", _creditCategoryDescriptorId); + + return _creditCategoryDescriptor; + } + set + { + _creditCategoryDescriptor = value; + _creditCategoryDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -30382,6 +30175,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -30397,6 +30219,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CreditCategoryDescriptor", new LookupColumnDetails { PropertyName = "CreditCategoryDescriptorId", LookupTypeName = "CreditCategoryDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30407,11 +30232,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CredentialFieldDescriptorId", CredentialFieldDescriptorId); + keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); return keyValues; } @@ -30475,82 +30300,98 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialFieldDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialFieldDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } -} -// Aggregate: CredentialTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CredentialTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialTypeDescriptor table of the CredentialTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptEarnedAdditionalCredits table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICredentialTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseTranscriptEarnedAdditionalCredits : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CredentialTypeDescriptorId + public CourseTranscriptEarnedAdditionalCredits() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptEarnedAdditionalCredits.CourseTranscript { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AdditionalCreditTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_additionalCreditTypeDescriptorId == default(int)) + _additionalCreditTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptor); + + return _additionalCreditTypeDescriptorId; + } + set + { + _additionalCreditTypeDescriptorId = value; + _additionalCreditTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _additionalCreditTypeDescriptorId; + private string _additionalCreditTypeDescriptor; + + public virtual string AdditionalCreditTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_additionalCreditTypeDescriptor == null) + _additionalCreditTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptorId); + + return _additionalCreditTypeDescriptor; + } + set + { + _additionalCreditTypeDescriptor = value; + _additionalCreditTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal Credits { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -30561,6 +30402,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -30576,6 +30446,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AdditionalCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AdditionalCreditTypeDescriptorId", LookupTypeName = "AdditionalCreditTypeDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30586,11 +30459,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CredentialTypeDescriptorId", CredentialTypeDescriptorId); + keyValues.Add("AdditionalCreditTypeDescriptorId", AdditionalCreditTypeDescriptorId); return keyValues; } @@ -30654,82 +30527,109 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } -} -// Aggregate: CreditCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CreditCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CreditCategoryDescriptor table of the CreditCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptPartialCourseTranscriptAwards table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CreditCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICreditCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseTranscriptPartialCourseTranscriptAwards : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CourseTranscriptPartialCourseTranscriptAwards() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptPartialCourseTranscriptAwards.CourseTranscript + { + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } + } + [DomainSignature] - public virtual int CreditCategoryDescriptorId + public virtual DateTime AwardDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _awardDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _awardDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _awardDate; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal EarnedCredits { get; set; } + public virtual string LetterGradeEarned { get; set; } + public virtual int? MethodCreditEarnedDescriptorId + { + get + { + if (_methodCreditEarnedDescriptorId == default(int?)) + _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); + + return _methodCreditEarnedDescriptorId; + } + set + { + _methodCreditEarnedDescriptorId = value; + _methodCreditEarnedDescriptor = null; + } + } + + private int? _methodCreditEarnedDescriptorId; + private string _methodCreditEarnedDescriptor; + + public virtual string MethodCreditEarnedDescriptor + { + get + { + if (_methodCreditEarnedDescriptor == null) + _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); + + return _methodCreditEarnedDescriptor; + } + set + { + _methodCreditEarnedDescriptor = value; + _methodCreditEarnedDescriptorId = default(int?); + } + } + public virtual string NumericGradeEarned { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -30740,6 +30640,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -30755,6 +30684,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30765,11 +30697,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); + keyValues.Add("AwardDate", AwardDate); return keyValues; } @@ -30833,77 +30765,65 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICreditCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICreditCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } -} -// Aggregate: CreditTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CreditTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CreditTypeDescriptor table of the CreditTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptSection table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CourseTranscriptSection : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptSection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CourseTranscriptSection() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int CreditTypeDescriptorId + [DomainSignature, JsonIgnore] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptSection.CourseTranscript { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } - + + [DomainSignature] + public virtual string LocalCourseCode { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual string SectionIdentifier { get; set; } + [DomainSignature] + public virtual string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -30919,11 +30839,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } + + /// + /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator + { + get { return SectionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscriptSection.SectionResourceId + { + get { return SectionReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -30934,6 +30903,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30944,11 +30915,14 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CreditTypeDescriptorId", CreditTypeDescriptorId); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); return keyValues; } @@ -31012,29 +30986,34 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICreditTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptSection)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICreditTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptSection) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } } -// Aggregate: CrisisEvent +// Aggregate: Credential -namespace EdFi.Ods.Entities.NHibernate.CrisisEventAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CredentialAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CrisisEventReferenceData : IHasPrimaryKeyValues + public class CredentialReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CrisisEventName { get; set; } + public virtual string CredentialIdentifier { get; set; } + public virtual int StateOfIssueStateAbbreviationDescriptorId { get; set; } // ------------------------------------------------------------- /// @@ -31055,7 +31034,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CrisisEventName", CrisisEventName); + keyValues.Add("CredentialIdentifier", CredentialIdentifier); + keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); return keyValues; } @@ -31106,19 +31086,22 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CrisisEvent table of the CrisisEvent aggregate in the ODS database. + /// A class which represents the edfi.Credential table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CrisisEvent : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICrisisEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Credential : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICredential, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CrisisEvent() + public Credential() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CredentialAcademicSubjects = new HashSet(); + CredentialEndorsements = new HashSet(); + CredentialGradeLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -31127,7 +31110,42 @@ public CrisisEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CrisisEventName { get; set; } + public virtual string CredentialIdentifier { get; set; } + [DomainSignature] + public virtual int StateOfIssueStateAbbreviationDescriptorId + { + get + { + if (_stateOfIssueStateAbbreviationDescriptorId == default(int)) + _stateOfIssueStateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptor); + + return _stateOfIssueStateAbbreviationDescriptorId; + } + set + { + _stateOfIssueStateAbbreviationDescriptorId = value; + _stateOfIssueStateAbbreviationDescriptor = null; + } + } + + private int _stateOfIssueStateAbbreviationDescriptorId; + private string _stateOfIssueStateAbbreviationDescriptor; + + public virtual string StateOfIssueStateAbbreviationDescriptor + { + get + { + if (_stateOfIssueStateAbbreviationDescriptor == null) + _stateOfIssueStateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptorId); + + return _stateOfIssueStateAbbreviationDescriptor; + } + set + { + _stateOfIssueStateAbbreviationDescriptor = value; + _stateOfIssueStateAbbreviationDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -31138,77 +31156,188 @@ public CrisisEvent() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CrisisDescription { get; set; } - public virtual DateTime? CrisisEndDate + public virtual int? CredentialFieldDescriptorId { - get { return _crisisEndDate; } + get + { + if (_credentialFieldDescriptorId == default(int?)) + _credentialFieldDescriptorId = string.IsNullOrWhiteSpace(_credentialFieldDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialFieldDescriptor", _credentialFieldDescriptor); + + return _credentialFieldDescriptorId; + } + set + { + _credentialFieldDescriptorId = value; + _credentialFieldDescriptor = null; + } + } + + private int? _credentialFieldDescriptorId; + private string _credentialFieldDescriptor; + + public virtual string CredentialFieldDescriptor + { + get + { + if (_credentialFieldDescriptor == null) + _credentialFieldDescriptor = _credentialFieldDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialFieldDescriptor", _credentialFieldDescriptorId.Value); + + return _credentialFieldDescriptor; + } + set + { + _credentialFieldDescriptor = value; + _credentialFieldDescriptorId = default(int?); + } + } + public virtual int CredentialTypeDescriptorId + { + get + { + if (_credentialTypeDescriptorId == default(int)) + _credentialTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialTypeDescriptor", _credentialTypeDescriptor); + + return _credentialTypeDescriptorId; + } + set + { + _credentialTypeDescriptorId = value; + _credentialTypeDescriptor = null; + } + } + + private int _credentialTypeDescriptorId; + private string _credentialTypeDescriptor; + + public virtual string CredentialTypeDescriptor + { + get + { + if (_credentialTypeDescriptor == null) + _credentialTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialTypeDescriptor", _credentialTypeDescriptorId); + + return _credentialTypeDescriptor; + } + set + { + _credentialTypeDescriptor = value; + _credentialTypeDescriptorId = default(int); + } + } + public virtual DateTime? EffectiveDate + { + get { return _effectiveDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _crisisEndDate = null; + _effectiveDate = null; } else { var given = (DateTime) value; - _crisisEndDate = new DateTime(given.Year, given.Month, given.Day); + _effectiveDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _crisisEndDate; + private DateTime? _effectiveDate; - public virtual DateTime? CrisisStartDate + public virtual DateTime? ExpirationDate { - get { return _crisisStartDate; } + get { return _expirationDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _crisisStartDate = null; + _expirationDate = null; } else { var given = (DateTime) value; - _crisisStartDate = new DateTime(given.Year, given.Month, given.Day); + _expirationDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _crisisStartDate; + private DateTime? _expirationDate; - public virtual int CrisisTypeDescriptorId + public virtual DateTime IssuanceDate + { + get { return _issuanceDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _issuanceDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _issuanceDate; + + public virtual string Namespace { get; set; } + public virtual int? TeachingCredentialBasisDescriptorId { get { - if (_crisisTypeDescriptorId == default(int)) - _crisisTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CrisisTypeDescriptor", _crisisTypeDescriptor); + if (_teachingCredentialBasisDescriptorId == default(int?)) + _teachingCredentialBasisDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialBasisDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptor); - return _crisisTypeDescriptorId; + return _teachingCredentialBasisDescriptorId; } set { - _crisisTypeDescriptorId = value; - _crisisTypeDescriptor = null; + _teachingCredentialBasisDescriptorId = value; + _teachingCredentialBasisDescriptor = null; } } - private int _crisisTypeDescriptorId; - private string _crisisTypeDescriptor; + private int? _teachingCredentialBasisDescriptorId; + private string _teachingCredentialBasisDescriptor; - public virtual string CrisisTypeDescriptor + public virtual string TeachingCredentialBasisDescriptor { get { - if (_crisisTypeDescriptor == null) - _crisisTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CrisisTypeDescriptor", _crisisTypeDescriptorId); + if (_teachingCredentialBasisDescriptor == null) + _teachingCredentialBasisDescriptor = _teachingCredentialBasisDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptorId.Value); - return _crisisTypeDescriptor; + return _teachingCredentialBasisDescriptor; } set { - _crisisTypeDescriptor = value; - _crisisTypeDescriptorId = default(int); + _teachingCredentialBasisDescriptor = value; + _teachingCredentialBasisDescriptorId = default(int?); + } + } + public virtual int? TeachingCredentialDescriptorId + { + get + { + if (_teachingCredentialDescriptorId == default(int?)) + _teachingCredentialDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialDescriptor", _teachingCredentialDescriptor); + + return _teachingCredentialDescriptorId; + } + set + { + _teachingCredentialDescriptorId = value; + _teachingCredentialDescriptor = null; + } + } + + private int? _teachingCredentialDescriptorId; + private string _teachingCredentialDescriptor; + + public virtual string TeachingCredentialDescriptor + { + get + { + if (_teachingCredentialDescriptor == null) + _teachingCredentialDescriptor = _teachingCredentialDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialDescriptor", _teachingCredentialDescriptorId.Value); + + return _teachingCredentialDescriptor; + } + set + { + _teachingCredentialDescriptor = value; + _teachingCredentialDescriptorId = default(int?); } } // ------------------------------------------------------------- @@ -31260,12 +31389,157 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _credentialAcademicSubjects; + private ICollection _credentialAcademicSubjectsCovariant; + public virtual ICollection CredentialAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialAcademicSubjects) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- + + return _credentialAcademicSubjects; + } + set + { + _credentialAcademicSubjects = value; + _credentialAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialAcademicSubjects) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- + + return _credentialAcademicSubjectsCovariant; + } + set + { + CredentialAcademicSubjects = new HashSet(value.Cast()); + } + } + + + private ICollection _credentialEndorsements; + private ICollection _credentialEndorsementsCovariant; + public virtual ICollection CredentialEndorsements + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialEndorsements) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- + + return _credentialEndorsements; + } + set + { + _credentialEndorsements = value; + _credentialEndorsementsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialEndorsements + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialEndorsements) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- + + return _credentialEndorsementsCovariant; + } + set + { + CredentialEndorsements = new HashSet(value.Cast()); + } + } + + + private ICollection _credentialGradeLevels; + private ICollection _credentialGradeLevelsCovariant; + public virtual ICollection CredentialGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialGradeLevels) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- + + return _credentialGradeLevels; + } + set + { + _credentialGradeLevels = value; + _credentialGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialGradeLevels) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- + + return _credentialGradeLevelsCovariant; + } + set + { + CredentialGradeLevels = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CrisisTypeDescriptor", new LookupColumnDetails { PropertyName = "CrisisTypeDescriptorId", LookupTypeName = "CrisisTypeDescriptor"} }, + { "CredentialFieldDescriptor", new LookupColumnDetails { PropertyName = "CredentialFieldDescriptorId", LookupTypeName = "CredentialFieldDescriptor"} }, + { "CredentialTypeDescriptor", new LookupColumnDetails { PropertyName = "CredentialTypeDescriptorId", LookupTypeName = "CredentialTypeDescriptor"} }, + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "TeachingCredentialBasisDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialBasisDescriptorId", LookupTypeName = "TeachingCredentialBasisDescriptor"} }, + { "TeachingCredentialDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialDescriptorId", LookupTypeName = "TeachingCredentialDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -31280,7 +31554,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CrisisEventName", CrisisEventName); + keyValues.Add("CredentialIdentifier", CredentialIdentifier); + keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); return keyValues; } @@ -31344,79 +31619,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICrisisEvent)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredential)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICrisisEvent) target, null); + this.MapTo((Entities.Common.EdFi.ICredential) target, null); } } -} -// Aggregate: CrisisTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CrisisTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CrisisTypeDescriptor table of the CrisisTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialAcademicSubject table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CrisisTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICrisisTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CredentialAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICredentialAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CrisisTypeDescriptorId + public CredentialAcademicSubject() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Credential Credential { get; set; } + + Entities.Common.EdFi.ICredential ICredentialAcademicSubject.Credential { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Credential; } + set { Credential = (Credential) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AcademicSubjectDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + public virtual string AcademicSubjectDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -31430,6 +31716,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31445,6 +31760,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -31455,11 +31772,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CrisisTypeDescriptorId", CrisisTypeDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -31523,77 +31840,59 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICrisisTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICrisisTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialAcademicSubject) target, null); } + void IChildEntity.SetParent(object value) + { + Credential = (Credential) value; + } } -} -// Aggregate: CTEProgramServiceDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CTEProgramServiceDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CTEProgramServiceDescriptor table of the CTEProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialEndorsement table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CTEProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICTEProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CredentialEndorsement : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICredentialEndorsement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CredentialEndorsement() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int CTEProgramServiceDescriptorId + [DomainSignature, JsonIgnore] + public virtual Credential Credential { get; set; } + + Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return Credential; } + set { Credential = (Credential) value; } } - + + [DomainSignature] + public virtual string CredentialEndorsementX { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -31609,6 +31908,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31624,6 +31952,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -31634,11 +31963,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CTEProgramServiceDescriptorId", CTEProgramServiceDescriptorId); + keyValues.Add("CredentialEndorsement", CredentialEndorsementX); return keyValues; } @@ -31702,79 +32031,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialEndorsement)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialEndorsement) target, null); } + void IChildEntity.SetParent(object value) + { + Credential = (Credential) value; + } } -} -// Aggregate: CurriculumUsedDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CurriculumUsedDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CurriculumUsedDescriptor table of the CurriculumUsedDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialGradeLevel table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CurriculumUsedDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICurriculumUsedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CredentialGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICredentialGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CurriculumUsedDescriptorId + public CredentialGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Credential Credential { get; set; } + + Entities.Common.EdFi.ICredential ICredentialGradeLevel.Credential { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Credential; } + set { Credential = (Credential) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -31788,6 +32132,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31803,6 +32176,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -31813,11 +32188,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -31881,37 +32256,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICurriculumUsedDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICurriculumUsedDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + Credential = (Credential) value; + } } } -// Aggregate: DeliveryMethodDescriptor +// Aggregate: CredentialFieldDescriptor -namespace EdFi.Ods.Entities.NHibernate.DeliveryMethodDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CredentialFieldDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DeliveryMethodDescriptor table of the DeliveryMethodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialFieldDescriptor table of the CredentialFieldDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DeliveryMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDeliveryMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CredentialFieldDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICredentialFieldDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DeliveryMethodDescriptorId + public virtual int CredentialFieldDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -31996,7 +32375,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DeliveryMethodDescriptorId", DeliveryMethodDescriptorId); + keyValues.Add("CredentialFieldDescriptorId", CredentialFieldDescriptorId); return keyValues; } @@ -32060,95 +32439,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDeliveryMethodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialFieldDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDeliveryMethodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialFieldDescriptor) target, null); } } } -// Aggregate: Descriptor +// Aggregate: CredentialTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.DescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CredentialTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Descriptor table of the Descriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialTypeDescriptor table of the CredentialTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public abstract class Descriptor : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDescriptor, IHasPrimaryKeyValues, IHasAlternateKeyValues, IHasLookupColumnPropertyMap + public class CredentialTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICredentialTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public Descriptor() - { - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int DescriptorId { get; set; } + [DomainSignature] + public virtual int CredentialTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CodeValue { get; set; } - public virtual string Description { get; set; } - public virtual DateTime? EffectiveBeginDate + string IDescriptor.CodeValue { - get { return _effectiveBeginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _effectiveBeginDate = null; - } else - { - var given = (DateTime) value; - _effectiveBeginDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return CodeValue; } + set { CodeValue = value; } } - - private DateTime? _effectiveBeginDate; - - public virtual DateTime? EffectiveEndDate + string IDescriptor.Description { - get { return _effectiveEndDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _effectiveEndDate = null; - } else - { - var given = (DateTime) value; - _effectiveEndDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return Description; } + set { Description = value; } } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - private DateTime? _effectiveEndDate; - - public virtual string Namespace { get; set; } - public virtual string ShortDescription { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -32188,20 +32554,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DescriptorId", DescriptorId); + keyValues.Add("CredentialTypeDescriptorId", CredentialTypeDescriptorId); return keyValues; } - // Provide alternate key information - OrderedDictionary IHasAlternateKeyValues.GetAlternateKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - keyValues.Add("Namespace", Namespace); - keyValues.Add("CodeValue", CodeValue); - return keyValues; - } #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -32259,36 +32616,115 @@ public override int GetHashCode() return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICredentialTypeDescriptor) target, null); + } + } } -// Aggregate: DescriptorMapping +// Aggregate: CreditCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.DescriptorMappingAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CreditCategoryDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.CreditCategoryDescriptor table of the CreditCategoryDescriptor aggregate in the ODS database. /// - public class DescriptorMappingReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class CreditCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICreditCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string MappedNamespace { get; set; } - public virtual string MappedValue { get; set; } - public virtual string Namespace { get; set; } - public virtual string Value { get; set; } + [DomainSignature] + public virtual int CreditCategoryDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -32297,10 +32733,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("MappedNamespace", MappedNamespace); - keyValues.Add("MappedValue", MappedValue); - keyValues.Add("Namespace", Namespace); - keyValues.Add("Value", Value); + keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); return keyValues; } @@ -32321,8 +32754,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -32339,52 +32782,92 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICreditCategoryDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICreditCategoryDescriptor) target, null); + } + } +} +// Aggregate: CreditTypeDescriptor +namespace EdFi.Ods.Entities.NHibernate.CreditTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DescriptorMapping table of the DescriptorMapping aggregate in the ODS database. + /// A class which represents the edfi.CreditTypeDescriptor table of the CreditTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DescriptorMapping : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDescriptorMapping, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public DescriptorMapping() - { - DescriptorMappingModelEntities = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string MappedNamespace { get; set; } - [DomainSignature] - public virtual string MappedValue { get; set; } - [DomainSignature] - public virtual string Namespace { get; set; } - [DomainSignature] - public virtual string Value { get; set; } + public virtual int CreditTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -32400,35 +32883,6 @@ public DescriptorMapping() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -32439,53 +32893,6 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _descriptorMappingModelEntities; - private ICollection _descriptorMappingModelEntitiesCovariant; - public virtual ICollection DescriptorMappingModelEntities - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _descriptorMappingModelEntities) - if (item.DescriptorMapping == null) - item.DescriptorMapping = this; - // ------------------------------------------------------------- - - return _descriptorMappingModelEntities; - } - set - { - _descriptorMappingModelEntities = value; - _descriptorMappingModelEntitiesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDescriptorMapping.DescriptorMappingModelEntities - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _descriptorMappingModelEntities) - if (item.DescriptorMapping == null) - item.DescriptorMapping = this; - // ------------------------------------------------------------- - - return _descriptorMappingModelEntitiesCovariant; - } - set - { - DescriptorMappingModelEntities = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -32505,10 +32912,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("MappedNamespace", MappedNamespace); - keyValues.Add("MappedValue", MappedValue); - keyValues.Add("Namespace", Namespace); - keyValues.Add("Value", Value); + keyValues.Add("CreditTypeDescriptorId", CreditTypeDescriptorId); return keyValues; } @@ -32572,32 +32976,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMapping)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICreditTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDescriptorMapping) target, null); + this.MapTo((Entities.Common.EdFi.ICreditTypeDescriptor) target, null); } } +} +// Aggregate: CrisisEvent + +namespace EdFi.Ods.Entities.NHibernate.CrisisEventAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class CrisisEventReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string CrisisEventName { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CrisisEventName", CrisisEventName); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DescriptorMappingModelEntity table of the DescriptorMapping aggregate in the ODS database. + /// A class which represents the edfi.CrisisEvent table of the CrisisEvent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DescriptorMappingModelEntity : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDescriptorMappingModelEntity, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class CrisisEvent : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICrisisEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DescriptorMappingModelEntity() + public CrisisEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -32605,62 +33090,93 @@ public DescriptorMappingModelEntity() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DescriptorMapping DescriptorMapping { get; set; } + [DomainSignature] + public virtual string CrisisEventName { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.IDescriptorMapping IDescriptorMappingModelEntity.DescriptorMapping + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string CrisisDescription { get; set; } + public virtual DateTime? CrisisEndDate { - get { return DescriptorMapping; } - set { DescriptorMapping = (DescriptorMapping) value; } + get { return _crisisEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _crisisEndDate = null; + } else + { + var given = (DateTime) value; + _crisisEndDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - [DomainSignature] - public virtual int ModelEntityDescriptorId + private DateTime? _crisisEndDate; + + public virtual DateTime? CrisisStartDate + { + get { return _crisisStartDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _crisisStartDate = null; + } else + { + var given = (DateTime) value; + _crisisStartDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _crisisStartDate; + + public virtual int CrisisTypeDescriptorId { get { - if (_modelEntityDescriptorId == default(int)) - _modelEntityDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ModelEntityDescriptor", _modelEntityDescriptor); + if (_crisisTypeDescriptorId == default(int)) + _crisisTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CrisisTypeDescriptor", _crisisTypeDescriptor); - return _modelEntityDescriptorId; + return _crisisTypeDescriptorId; } set { - _modelEntityDescriptorId = value; - _modelEntityDescriptor = null; + _crisisTypeDescriptorId = value; + _crisisTypeDescriptor = null; } } - private int _modelEntityDescriptorId; - private string _modelEntityDescriptor; + private int _crisisTypeDescriptorId; + private string _crisisTypeDescriptor; - public virtual string ModelEntityDescriptor + public virtual string CrisisTypeDescriptor { get { - if (_modelEntityDescriptor == null) - _modelEntityDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ModelEntityDescriptor", _modelEntityDescriptorId); + if (_crisisTypeDescriptor == null) + _crisisTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CrisisTypeDescriptor", _crisisTypeDescriptorId); - return _modelEntityDescriptor; + return _crisisTypeDescriptor; } set { - _modelEntityDescriptor = value; - _modelEntityDescriptorId = default(int); + _crisisTypeDescriptor = value; + _crisisTypeDescriptorId = default(int); } } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -32713,7 +33229,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ModelEntityDescriptor", new LookupColumnDetails { PropertyName = "ModelEntityDescriptorId", LookupTypeName = "ModelEntityDescriptor"} }, + { "CrisisTypeDescriptor", new LookupColumnDetails { PropertyName = "CrisisTypeDescriptorId", LookupTypeName = "CrisisTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -32724,11 +33240,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (DescriptorMapping as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ModelEntityDescriptorId", ModelEntityDescriptorId); + keyValues.Add("CrisisEventName", CrisisEventName); return keyValues; } @@ -32792,41 +33308,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMappingModelEntity)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICrisisEvent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDescriptorMappingModelEntity) target, null); + this.MapTo((Entities.Common.EdFi.ICrisisEvent) target, null); } - void IChildEntity.SetParent(object value) - { - DescriptorMapping = (DescriptorMapping) value; - } } } -// Aggregate: DiagnosisDescriptor +// Aggregate: CrisisTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.DiagnosisDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CrisisTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DiagnosisDescriptor table of the DiagnosisDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CrisisTypeDescriptor table of the CrisisTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DiagnosisDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDiagnosisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CrisisTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICrisisTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DiagnosisDescriptorId + public virtual int CrisisTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -32911,7 +33423,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); + keyValues.Add("CrisisTypeDescriptorId", CrisisTypeDescriptorId); return keyValues; } @@ -32975,37 +33487,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDiagnosisDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICrisisTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDiagnosisDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICrisisTypeDescriptor) target, null); } } } -// Aggregate: DiplomaLevelDescriptor +// Aggregate: CTEProgramServiceDescriptor -namespace EdFi.Ods.Entities.NHibernate.DiplomaLevelDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CTEProgramServiceDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DiplomaLevelDescriptor table of the DiplomaLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CTEProgramServiceDescriptor table of the CTEProgramServiceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DiplomaLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDiplomaLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CTEProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICTEProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DiplomaLevelDescriptorId + public virtual int CTEProgramServiceDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -33090,7 +33602,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiplomaLevelDescriptorId", DiplomaLevelDescriptorId); + keyValues.Add("CTEProgramServiceDescriptorId", CTEProgramServiceDescriptorId); return keyValues; } @@ -33154,37 +33666,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDiplomaLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor) target, null); } } } -// Aggregate: DiplomaTypeDescriptor +// Aggregate: CurriculumUsedDescriptor -namespace EdFi.Ods.Entities.NHibernate.DiplomaTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CurriculumUsedDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DiplomaTypeDescriptor table of the DiplomaTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CurriculumUsedDescriptor table of the CurriculumUsedDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DiplomaTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDiplomaTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class CurriculumUsedDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICurriculumUsedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DiplomaTypeDescriptorId + public virtual int CurriculumUsedDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -33269,7 +33781,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiplomaTypeDescriptorId", DiplomaTypeDescriptorId); + keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); return keyValues; } @@ -33333,37 +33845,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICurriculumUsedDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDiplomaTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICurriculumUsedDescriptor) target, null); } } } -// Aggregate: DisabilityDescriptor +// Aggregate: DeliveryMethodDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisabilityDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DeliveryMethodDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisabilityDescriptor table of the DisabilityDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DeliveryMethodDescriptor table of the DeliveryMethodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class DeliveryMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDeliveryMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisabilityDescriptorId + public virtual int DeliveryMethodDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -33448,7 +33960,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisabilityDescriptorId", DisabilityDescriptorId); + keyValues.Add("DeliveryMethodDescriptorId", DeliveryMethodDescriptorId); return keyValues; } @@ -33512,261 +34024,95 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDeliveryMethodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisabilityDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDeliveryMethodDescriptor) target, null); } } } -// Aggregate: DisabilityDesignationDescriptor +// Aggregate: Descriptor -namespace EdFi.Ods.Entities.NHibernate.DisabilityDesignationDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisabilityDesignationDescriptor table of the DisabilityDesignationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.Descriptor table of the Descriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisabilityDesignationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisabilityDesignationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public abstract class Descriptor : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDescriptor, IHasPrimaryKeyValues, IHasAlternateKeyValues, IHasLookupColumnPropertyMap { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int DisabilityDesignationDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + public Descriptor() { - get { return ShortDescription; } - set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // One-to-one relationships + // Primary Key // ------------------------------------------------------------- + public virtual int DescriptorId { get; set; } // ------------------------------------------------------------- // ============================================================= - // Extensions + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + // Properties // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("DisabilityDesignationDescriptorId", DisabilityDesignationDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + public virtual string CodeValue { get; set; } + public virtual string Description { get; set; } + public virtual DateTime? EffectiveBeginDate { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) + get { return _effectiveBeginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + _effectiveBeginDate = null; + } else { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + var given = (DateTime) value; + _effectiveBeginDate = new DateTime(given.Year, given.Month, given.Day); } } - - return true; } - public override int GetHashCode() + private DateTime? _effectiveBeginDate; + + public virtual DateTime? EffectiveEndDate { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) + get { return _effectiveEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else + _effectiveEndDate = null; + } else { - hashCode.Add(entry.Value); + var given = (DateTime) value; + _effectiveEndDate = new DateTime(given.Year, given.Month, given.Day); } } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor) target, null); } - } -} -// Aggregate: DisabilityDeterminationSourceTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.DisabilityDeterminationSourceTypeDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.DisabilityDeterminationSourceTypeDescriptor table of the DisabilityDeterminationSourceTypeDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class DisabilityDeterminationSourceTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int DisabilityDeterminationSourceTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } + private DateTime? _effectiveEndDate; - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + public virtual string Namespace { get; set; } + public virtual string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33806,11 +34152,20 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisabilityDeterminationSourceTypeDescriptorId", DisabilityDeterminationSourceTypeDescriptorId); + keyValues.Add("DescriptorId", DescriptorId); return keyValues; } + // Provide alternate key information + OrderedDictionary IHasAlternateKeyValues.GetAlternateKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + keyValues.Add("Namespace", Namespace); + keyValues.Add("CodeValue", CodeValue); + return keyValues; + } #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -33868,33 +34223,24 @@ public override int GetHashCode() return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor) target, null); - } - } } -// Aggregate: DisciplineAction +// Aggregate: DescriptorMapping -namespace EdFi.Ods.Entities.NHibernate.DisciplineActionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DescriptorMappingAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class DisciplineActionReferenceData : IHasPrimaryKeyValues + public class DescriptorMappingReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string DisciplineActionIdentifier { get; set; } - public virtual DateTime DisciplineDate { get; set; } - public virtual int StudentUSI { get; set; } + public virtual string MappedNamespace { get; set; } + public virtual string MappedValue { get; set; } + public virtual string Namespace { get; set; } + public virtual string Value { get; set; } // ------------------------------------------------------------- /// @@ -33915,9 +34261,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); - keyValues.Add("DisciplineDate", DisciplineDate); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("MappedNamespace", MappedNamespace); + keyValues.Add("MappedValue", MappedValue); + keyValues.Add("Namespace", Namespace); + keyValues.Add("Value", Value); return keyValues; } @@ -33968,22 +34315,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineAction table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DescriptorMapping table of the DescriptorMapping aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineAction : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDisciplineAction, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DescriptorMapping : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDescriptorMapping, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineAction() + public DescriptorMapping() { - DisciplineActionDisciplines = new HashSet(); - DisciplineActionStaffs = new HashSet(); - DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + DescriptorMappingModelEntities = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -33992,66 +34337,13 @@ public DisciplineAction() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string DisciplineActionIdentifier { get; set; } + public virtual string MappedNamespace { get; set; } [DomainSignature] - public virtual DateTime DisciplineDate - { - get { return _disciplineDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _disciplineDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _disciplineDate; - - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId - { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } - } + public virtual string MappedValue { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual string Value { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -34062,46 +34354,6 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? ActualDisciplineActionLength { get; set; } - public virtual long? AssignmentSchoolId { get; set; } - public virtual decimal? DisciplineActionLength { get; set; } - public virtual int? DisciplineActionLengthDifferenceReasonDescriptorId - { - get - { - if (_disciplineActionLengthDifferenceReasonDescriptorId == default(int?)) - _disciplineActionLengthDifferenceReasonDescriptorId = string.IsNullOrWhiteSpace(_disciplineActionLengthDifferenceReasonDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptor); - - return _disciplineActionLengthDifferenceReasonDescriptorId; - } - set - { - _disciplineActionLengthDifferenceReasonDescriptorId = value; - _disciplineActionLengthDifferenceReasonDescriptor = null; - } - } - - private int? _disciplineActionLengthDifferenceReasonDescriptorId; - private string _disciplineActionLengthDifferenceReasonDescriptor; - - public virtual string DisciplineActionLengthDifferenceReasonDescriptor - { - get - { - if (_disciplineActionLengthDifferenceReasonDescriptor == null) - _disciplineActionLengthDifferenceReasonDescriptor = _disciplineActionLengthDifferenceReasonDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptorId.Value); - - return _disciplineActionLengthDifferenceReasonDescriptor; - } - set - { - _disciplineActionLengthDifferenceReasonDescriptor = value; - _disciplineActionLengthDifferenceReasonDescriptorId = default(int?); - } - } - public virtual bool? IEPPlacementMeetingIndicator { get; set; } - public virtual bool? RelatedToZeroTolerancePolicy { get; set; } - public virtual long ResponsibilitySchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -34146,151 +34398,15 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData AssignmentSchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the AssignmentSchool resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolResourceId - { - get { return AssignmentSchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ResponsibilitySchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the ResponsibilitySchool resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolResourceId - { - get { return ResponsibilitySchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } - - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineAction.StudentResourceId - { - get { return StudentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _disciplineActionDisciplines; - private ICollection _disciplineActionDisciplinesCovariant; - public virtual ICollection DisciplineActionDisciplines - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionDisciplines) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- - - return _disciplineActionDisciplines; - } - set - { - _disciplineActionDisciplines = value; - _disciplineActionDisciplinesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionDisciplines - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionDisciplines) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- - - return _disciplineActionDisciplinesCovariant; - } - set - { - DisciplineActionDisciplines = new HashSet(value.Cast()); - } - } - - - private ICollection _disciplineActionStaffs; - private ICollection _disciplineActionStaffsCovariant; - public virtual ICollection DisciplineActionStaffs - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionStaffs) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- - - return _disciplineActionStaffs; - } - set - { - _disciplineActionStaffs = value; - _disciplineActionStaffsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStaffs - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionStaffs) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- - - return _disciplineActionStaffsCovariant; - } - set - { - DisciplineActionStaffs = new HashSet(value.Cast()); - } - } - - - private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociations; - private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; - public virtual ICollection DisciplineActionStudentDisciplineIncidentBehaviorAssociations + private ICollection _descriptorMappingModelEntities; + private ICollection _descriptorMappingModelEntitiesCovariant; + public virtual ICollection DescriptorMappingModelEntities { get { @@ -34299,38 +34415,38 @@ public virtual ICollection(value); + _descriptorMappingModelEntities = value; + _descriptorMappingModelEntitiesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStudentDisciplineIncidentBehaviorAssociations + ICollection Entities.Common.EdFi.IDescriptorMapping.DescriptorMappingModelEntities { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineActionStudentDisciplineIncidentBehaviorAssociations) - if (item.DisciplineAction == null) - item.DisciplineAction = this; + foreach (var item in _descriptorMappingModelEntities) + if (item.DescriptorMapping == null) + item.DescriptorMapping = this; // ------------------------------------------------------------- - return _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; + return _descriptorMappingModelEntitiesCovariant; } set { - DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(value.Cast()); + DescriptorMappingModelEntities = new HashSet(value.Cast()); } } @@ -34339,7 +34455,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DisciplineActionLengthDifferenceReasonDescriptor", new LookupColumnDetails { PropertyName = "DisciplineActionLengthDifferenceReasonDescriptorId", LookupTypeName = "DisciplineActionLengthDifferenceReasonDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -34354,9 +34469,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); - keyValues.Add("DisciplineDate", DisciplineDate); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("MappedNamespace", MappedNamespace); + keyValues.Add("MappedValue", MappedValue); + keyValues.Add("Namespace", Namespace); + keyValues.Add("Value", Value); return keyValues; } @@ -34420,12 +34536,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineAction)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMapping)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineAction) target, null); + this.MapTo((Entities.Common.EdFi.IDescriptorMapping) target, null); } } @@ -34433,19 +34549,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionDiscipline table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DescriptorMappingModelEntity table of the DescriptorMapping aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionDiscipline : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineActionDiscipline, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DescriptorMappingModelEntity : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDescriptorMappingModelEntity, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineActionDiscipline() + public DescriptorMappingModelEntity() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -34454,47 +34570,47 @@ public DisciplineActionDiscipline() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual DisciplineAction DisciplineAction { get; set; } + public virtual DescriptorMapping DescriptorMapping { get; set; } - Entities.Common.EdFi.IDisciplineAction IDisciplineActionDiscipline.DisciplineAction + Entities.Common.EdFi.IDescriptorMapping IDescriptorMappingModelEntity.DescriptorMapping { - get { return DisciplineAction; } - set { DisciplineAction = (DisciplineAction) value; } + get { return DescriptorMapping; } + set { DescriptorMapping = (DescriptorMapping) value; } } [DomainSignature] - public virtual int DisciplineDescriptorId + public virtual int ModelEntityDescriptorId { get { - if (_disciplineDescriptorId == default(int)) - _disciplineDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineDescriptor", _disciplineDescriptor); + if (_modelEntityDescriptorId == default(int)) + _modelEntityDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ModelEntityDescriptor", _modelEntityDescriptor); - return _disciplineDescriptorId; + return _modelEntityDescriptorId; } set { - _disciplineDescriptorId = value; - _disciplineDescriptor = null; + _modelEntityDescriptorId = value; + _modelEntityDescriptor = null; } } - private int _disciplineDescriptorId; - private string _disciplineDescriptor; + private int _modelEntityDescriptorId; + private string _modelEntityDescriptor; - public virtual string DisciplineDescriptor + public virtual string ModelEntityDescriptor { get { - if (_disciplineDescriptor == null) - _disciplineDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineDescriptor", _disciplineDescriptorId); + if (_modelEntityDescriptor == null) + _modelEntityDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ModelEntityDescriptor", _modelEntityDescriptorId); - return _disciplineDescriptor; + return _modelEntityDescriptor; } set { - _disciplineDescriptor = value; - _disciplineDescriptorId = default(int); + _modelEntityDescriptor = value; + _modelEntityDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -34561,7 +34677,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DisciplineDescriptor", new LookupColumnDetails { PropertyName = "DisciplineDescriptorId", LookupTypeName = "DisciplineDescriptor"} }, + { "ModelEntityDescriptor", new LookupColumnDetails { PropertyName = "ModelEntityDescriptorId", LookupTypeName = "ModelEntityDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -34573,10 +34689,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DescriptorMapping as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); + keyValues.Add("ModelEntityDescriptorId", ModelEntityDescriptorId); return keyValues; } @@ -34640,106 +34756,81 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionDiscipline)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMappingModelEntity)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionDiscipline) target, null); + this.MapTo((Entities.Common.EdFi.IDescriptorMappingModelEntity) target, null); } void IChildEntity.SetParent(object value) { - DisciplineAction = (DisciplineAction) value; + DescriptorMapping = (DescriptorMapping) value; } } +} +// Aggregate: DiagnosisDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DiagnosisDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionStaff table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DiagnosisDescriptor table of the DiagnosisDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionStaff : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineActionStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DiagnosisDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDiagnosisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineActionStaff() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int DiagnosisDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineAction DisciplineAction { get; set; } - - Entities.Common.EdFi.IDisciplineAction IDisciplineActionStaff.DisciplineAction + string IDescriptor.CodeValue { - get { return DisciplineAction; } - set { DisciplineAction = (DisciplineAction) value; } + get { return CodeValue; } + set { CodeValue = value; } } - - [Display(Name="StaffUniqueId")][DomainSignature] - public virtual int StaffUSI + string IDescriptor.Description { - get - { - if (_staffUSI == default(int) && _staffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) - { - _staffUSI = usi; - } - } - - return _staffUSI; - } - set - { - _staffUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); - } + get { return Description; } + set { Description = value; } } - - private int _staffUSI; - private string _staffUniqueId; - - public virtual string StaffUniqueId + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_staffUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) - { - _staffUniqueId = uniqueId; - } - } - - return _staffUniqueId; - } - set - { - if (_staffUniqueId != value) - _staffUSI = default(int); - - _staffUniqueId = value; - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -34755,60 +34846,11 @@ public virtual string StaffUniqueId // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } - - /// - /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IDisciplineActionStaff.StaffDiscriminator - { - get { return StaffReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineActionStaff.StaffResourceId - { - get { return StaffReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -34829,11 +34871,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("StaffUSI", StaffUSI); + keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); return keyValues; } @@ -34897,96 +34939,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStaff)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDiagnosisDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionStaff) target, null); + this.MapTo((Entities.Common.EdFi.IDiagnosisDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - DisciplineAction = (DisciplineAction) value; - } } +} +// Aggregate: DiplomaLevelDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DiplomaLevelDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionStudentDisciplineIncidentBehaviorAssociation table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DiplomaLevelDescriptor table of the DiplomaLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionStudentDisciplineIncidentBehaviorAssociation : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DiplomaLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDiplomaLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public DisciplineActionStudentDisciplineIncidentBehaviorAssociation() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineAction DisciplineAction { get; set; } - - Entities.Common.EdFi.IDisciplineAction IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.DisciplineAction - { - get { return DisciplineAction; } - set { DisciplineAction = (DisciplineAction) value; } - } - [DomainSignature] - public virtual int BehaviorDescriptorId - { - get - { - if (_behaviorDescriptorId == default(int)) - _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); - - return _behaviorDescriptorId; - } - set - { - _behaviorDescriptorId = value; - _behaviorDescriptor = null; - } - } - - private int _behaviorDescriptorId; - private string _behaviorDescriptor; - - public virtual string BehaviorDescriptor + public virtual int DiplomaLevelDescriptorId { - get - { - if (_behaviorDescriptor == null) - _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); - - return _behaviorDescriptor; - } - set - { - _behaviorDescriptor = value; - _behaviorDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - [DomainSignature] - public virtual string IncidentIdentifier { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -35002,60 +35025,11 @@ public virtual string BehaviorDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.StudentDisciplineIncidentBehaviorAssociationAggregate.EdFi.StudentDisciplineIncidentBehaviorAssociationReferenceData StudentDisciplineIncidentBehaviorAssociationReferenceData { get; set; } - - /// - /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDiscriminator - { - get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationResourceId - { - get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -35066,7 +35040,6 @@ string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAs // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -35077,13 +35050,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("DiplomaLevelDescriptorId", DiplomaLevelDescriptorId); return keyValues; } @@ -35147,41 +35118,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IDiplomaLevelDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - DisciplineAction = (DisciplineAction) value; - } } } -// Aggregate: DisciplineActionLengthDifferenceReasonDescriptor +// Aggregate: DiplomaTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisciplineActionLengthDifferenceReasonDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DiplomaTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionLengthDifferenceReasonDescriptor table of the DisciplineActionLengthDifferenceReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DiplomaTypeDescriptor table of the DiplomaTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionLengthDifferenceReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class DiplomaTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDiplomaTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisciplineActionLengthDifferenceReasonDescriptorId + public virtual int DiplomaTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -35266,7 +35233,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineActionLengthDifferenceReasonDescriptorId", DisciplineActionLengthDifferenceReasonDescriptorId); + keyValues.Add("DiplomaTypeDescriptorId", DiplomaTypeDescriptorId); return keyValues; } @@ -35330,37 +35297,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDiplomaTypeDescriptor) target, null); } } } -// Aggregate: DisciplineDescriptor +// Aggregate: DisabilityDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisciplineDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisabilityDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineDescriptor table of the DisciplineDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisabilityDescriptor table of the DisabilityDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisciplineDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class DisabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisciplineDescriptorId + public virtual int DisabilityDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -35445,7 +35412,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); + keyValues.Add("DisabilityDescriptorId", DisabilityDescriptorId); return keyValues; } @@ -35509,30 +35476,389 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisabilityDescriptor) target, null); } } } -// Aggregate: DisciplineIncident +// Aggregate: DisabilityDesignationDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisabilityDesignationDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.DisabilityDesignationDescriptor table of the DisabilityDesignationDescriptor aggregate in the ODS database. /// - public class DisciplineIncidentReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class DisabilityDesignationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisabilityDesignationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string IncidentIdentifier { get; set; } - public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual int DisabilityDesignationDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("DisabilityDesignationDescriptorId", DisabilityDesignationDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor) target, null); + } + + } +} +// Aggregate: DisabilityDeterminationSourceTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DisabilityDeterminationSourceTypeDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.DisabilityDeterminationSourceTypeDescriptor table of the DisabilityDeterminationSourceTypeDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class DisabilityDeterminationSourceTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int DisabilityDeterminationSourceTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("DisabilityDeterminationSourceTypeDescriptorId", DisabilityDeterminationSourceTypeDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor) target, null); + } + + } +} +// Aggregate: DisciplineAction + +namespace EdFi.Ods.Entities.NHibernate.DisciplineActionAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class DisciplineActionReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string DisciplineActionIdentifier { get; set; } + public virtual DateTime DisciplineDate { get; set; } + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// @@ -35553,8 +35879,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); + keyValues.Add("DisciplineDate", DisciplineDate); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -35605,22 +35932,22 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncident table of the DisciplineIncident aggregate in the ODS database. + /// A class which represents the edfi.DisciplineAction table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncident : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDisciplineIncident, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineAction : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDisciplineAction, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineIncident() + public DisciplineAction() { - DisciplineIncidentBehaviors = new HashSet(); - DisciplineIncidentExternalParticipants = new HashSet(); - DisciplineIncidentWeapons = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + DisciplineActionDisciplines = new HashSet(); + DisciplineActionStaffs = new HashSet(); + DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -35629,102 +35956,116 @@ public DisciplineIncident() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string IncidentIdentifier { get; set; } + public virtual string DisciplineActionIdentifier { get; set; } [DomainSignature] - public virtual long SchoolId { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CaseNumber { get; set; } - public virtual decimal? IncidentCost { get; set; } - public virtual DateTime IncidentDate + public virtual DateTime DisciplineDate { - get { return _incidentDate; } + get { return _disciplineDate; } //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _incidentDate = new DateTime(value.Year, value.Month, value.Day); } + set { _disciplineDate = new DateTime(value.Year, value.Month, value.Day); } } - private DateTime _incidentDate; + private DateTime _disciplineDate; - public virtual string IncidentDescription { get; set; } - public virtual int? IncidentLocationDescriptorId + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI { get { - if (_incidentLocationDescriptorId == default(int?)) - _incidentLocationDescriptorId = string.IsNullOrWhiteSpace(_incidentLocationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IncidentLocationDescriptor", _incidentLocationDescriptor); + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - return _incidentLocationDescriptorId; + return _studentUSI; } set { - _incidentLocationDescriptorId = value; - _incidentLocationDescriptor = null; + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); } } - private int? _incidentLocationDescriptorId; - private string _incidentLocationDescriptor; + private int _studentUSI; + private string _studentUniqueId; - public virtual string IncidentLocationDescriptor + public virtual string StudentUniqueId { get { - if (_incidentLocationDescriptor == null) - _incidentLocationDescriptor = _incidentLocationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IncidentLocationDescriptor", _incidentLocationDescriptorId.Value); - - return _incidentLocationDescriptor; + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; } set { - _incidentLocationDescriptor = value; - _incidentLocationDescriptorId = default(int?); + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; } } - public virtual TimeSpan? IncidentTime { get; set; } - public virtual bool? ReportedToLawEnforcement { get; set; } - public virtual int? ReporterDescriptionDescriptorId + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual decimal? ActualDisciplineActionLength { get; set; } + public virtual long? AssignmentSchoolId { get; set; } + public virtual decimal? DisciplineActionLength { get; set; } + public virtual int? DisciplineActionLengthDifferenceReasonDescriptorId { get { - if (_reporterDescriptionDescriptorId == default(int?)) - _reporterDescriptionDescriptorId = string.IsNullOrWhiteSpace(_reporterDescriptionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReporterDescriptionDescriptor", _reporterDescriptionDescriptor); + if (_disciplineActionLengthDifferenceReasonDescriptorId == default(int?)) + _disciplineActionLengthDifferenceReasonDescriptorId = string.IsNullOrWhiteSpace(_disciplineActionLengthDifferenceReasonDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptor); - return _reporterDescriptionDescriptorId; + return _disciplineActionLengthDifferenceReasonDescriptorId; } set { - _reporterDescriptionDescriptorId = value; - _reporterDescriptionDescriptor = null; + _disciplineActionLengthDifferenceReasonDescriptorId = value; + _disciplineActionLengthDifferenceReasonDescriptor = null; } } - private int? _reporterDescriptionDescriptorId; - private string _reporterDescriptionDescriptor; + private int? _disciplineActionLengthDifferenceReasonDescriptorId; + private string _disciplineActionLengthDifferenceReasonDescriptor; - public virtual string ReporterDescriptionDescriptor + public virtual string DisciplineActionLengthDifferenceReasonDescriptor { get { - if (_reporterDescriptionDescriptor == null) - _reporterDescriptionDescriptor = _reporterDescriptionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReporterDescriptionDescriptor", _reporterDescriptionDescriptorId.Value); + if (_disciplineActionLengthDifferenceReasonDescriptor == null) + _disciplineActionLengthDifferenceReasonDescriptor = _disciplineActionLengthDifferenceReasonDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptorId.Value); - return _reporterDescriptionDescriptor; + return _disciplineActionLengthDifferenceReasonDescriptor; } set { - _reporterDescriptionDescriptor = value; - _reporterDescriptionDescriptorId = default(int?); + _disciplineActionLengthDifferenceReasonDescriptor = value; + _disciplineActionLengthDifferenceReasonDescriptorId = default(int?); } } - public virtual string ReporterName { get; set; } + public virtual bool? IEPPlacementMeetingIndicator { get; set; } + public virtual bool? RelatedToZeroTolerancePolicy { get; set; } + public virtual long ResponsibilitySchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -35769,14 +36110,45 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData AssignmentSchoolReferenceData { get; set; } /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the AssignmentSchool resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IDisciplineIncident.SchoolResourceId + Guid? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolResourceId { - get { return SchoolReferenceData?.Id; } + get { return AssignmentSchoolReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ResponsibilitySchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the ResponsibilitySchool resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolResourceId + { + get { return ResponsibilitySchoolReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineAction.StudentResourceId + { + get { return StudentReferenceData?.Id; } set { } } @@ -35786,9 +36158,9 @@ public IDictionary Extensions // Collections // ------------------------------------------------------------- - private ICollection _disciplineIncidentBehaviors; - private ICollection _disciplineIncidentBehaviorsCovariant; - public virtual ICollection DisciplineIncidentBehaviors + private ICollection _disciplineActionDisciplines; + private ICollection _disciplineActionDisciplinesCovariant; + public virtual ICollection DisciplineActionDisciplines { get { @@ -35797,45 +36169,45 @@ public virtual ICollection(value); + _disciplineActionDisciplines = value; + _disciplineActionDisciplinesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentBehaviors + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionDisciplines { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineIncidentBehaviors) - if (item.DisciplineIncident == null) - item.DisciplineIncident = this; + foreach (var item in _disciplineActionDisciplines) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentBehaviorsCovariant; + return _disciplineActionDisciplinesCovariant; } set { - DisciplineIncidentBehaviors = new HashSet(value.Cast()); + DisciplineActionDisciplines = new HashSet(value.Cast()); } } - private ICollection _disciplineIncidentExternalParticipants; - private ICollection _disciplineIncidentExternalParticipantsCovariant; - public virtual ICollection DisciplineIncidentExternalParticipants + private ICollection _disciplineActionStaffs; + private ICollection _disciplineActionStaffsCovariant; + public virtual ICollection DisciplineActionStaffs { get { @@ -35844,45 +36216,45 @@ public virtual ICollection(value); + _disciplineActionStaffs = value; + _disciplineActionStaffsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentExternalParticipants + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStaffs { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineIncidentExternalParticipants) - if (item.DisciplineIncident == null) - item.DisciplineIncident = this; + foreach (var item in _disciplineActionStaffs) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentExternalParticipantsCovariant; + return _disciplineActionStaffsCovariant; } set { - DisciplineIncidentExternalParticipants = new HashSet(value.Cast()); + DisciplineActionStaffs = new HashSet(value.Cast()); } } - private ICollection _disciplineIncidentWeapons; - private ICollection _disciplineIncidentWeaponsCovariant; - public virtual ICollection DisciplineIncidentWeapons + private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociations; + private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; + public virtual ICollection DisciplineActionStudentDisciplineIncidentBehaviorAssociations { get { @@ -35891,38 +36263,38 @@ public virtual ICollection(value); + _disciplineActionStudentDisciplineIncidentBehaviorAssociations = value; + _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentWeapons + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStudentDisciplineIncidentBehaviorAssociations { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineIncidentWeapons) - if (item.DisciplineIncident == null) - item.DisciplineIncident = this; + foreach (var item in _disciplineActionStudentDisciplineIncidentBehaviorAssociations) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentWeaponsCovariant; + return _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; } set { - DisciplineIncidentWeapons = new HashSet(value.Cast()); + DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(value.Cast()); } } @@ -35931,8 +36303,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IncidentLocationDescriptor", new LookupColumnDetails { PropertyName = "IncidentLocationDescriptorId", LookupTypeName = "IncidentLocationDescriptor"} }, - { "ReporterDescriptionDescriptor", new LookupColumnDetails { PropertyName = "ReporterDescriptionDescriptorId", LookupTypeName = "ReporterDescriptionDescriptor"} }, + { "DisciplineActionLengthDifferenceReasonDescriptor", new LookupColumnDetails { PropertyName = "DisciplineActionLengthDifferenceReasonDescriptorId", LookupTypeName = "DisciplineActionLengthDifferenceReasonDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -35947,8 +36318,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); + keyValues.Add("DisciplineDate", DisciplineDate); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -36012,12 +36384,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncident)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineAction)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncident) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineAction) target, null); } } @@ -36025,19 +36397,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncidentBehavior table of the DisciplineIncident aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionDiscipline table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncidentBehavior : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineIncidentBehavior, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineActionDiscipline : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineActionDiscipline, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineIncidentBehavior() + public DisciplineActionDiscipline() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -36046,47 +36418,47 @@ public DisciplineIncidentBehavior() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual DisciplineIncident DisciplineIncident { get; set; } + public virtual DisciplineAction DisciplineAction { get; set; } - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentBehavior.DisciplineIncident + Entities.Common.EdFi.IDisciplineAction IDisciplineActionDiscipline.DisciplineAction { - get { return DisciplineIncident; } - set { DisciplineIncident = (DisciplineIncident) value; } + get { return DisciplineAction; } + set { DisciplineAction = (DisciplineAction) value; } } [DomainSignature] - public virtual int BehaviorDescriptorId + public virtual int DisciplineDescriptorId { get { - if (_behaviorDescriptorId == default(int)) - _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); + if (_disciplineDescriptorId == default(int)) + _disciplineDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineDescriptor", _disciplineDescriptor); - return _behaviorDescriptorId; + return _disciplineDescriptorId; } set { - _behaviorDescriptorId = value; - _behaviorDescriptor = null; + _disciplineDescriptorId = value; + _disciplineDescriptor = null; } } - private int _behaviorDescriptorId; - private string _behaviorDescriptor; + private int _disciplineDescriptorId; + private string _disciplineDescriptor; - public virtual string BehaviorDescriptor + public virtual string DisciplineDescriptor { get { - if (_behaviorDescriptor == null) - _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); + if (_disciplineDescriptor == null) + _disciplineDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineDescriptor", _disciplineDescriptorId); - return _behaviorDescriptor; + return _disciplineDescriptor; } set { - _behaviorDescriptor = value; - _behaviorDescriptorId = default(int); + _disciplineDescriptor = value; + _disciplineDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -36099,7 +36471,6 @@ public virtual string BehaviorDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -36154,7 +36525,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, + { "DisciplineDescriptor", new LookupColumnDetails { PropertyName = "DisciplineDescriptorId", LookupTypeName = "DisciplineDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -36166,10 +36537,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); return keyValues; } @@ -36233,36 +36604,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentBehavior)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionDiscipline)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentBehavior) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionDiscipline) target, null); } void IChildEntity.SetParent(object value) { - DisciplineIncident = (DisciplineIncident) value; + DisciplineAction = (DisciplineAction) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncidentExternalParticipant table of the DisciplineIncident aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionStaff table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncidentExternalParticipant : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineIncidentExternalParticipant, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineActionStaff : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineActionStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineIncidentExternalParticipant() + public DisciplineActionStaff() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -36271,53 +36642,63 @@ public DisciplineIncidentExternalParticipant() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual DisciplineIncident DisciplineIncident { get; set; } + public virtual DisciplineAction DisciplineAction { get; set; } - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentExternalParticipant.DisciplineIncident + Entities.Common.EdFi.IDisciplineAction IDisciplineActionStaff.DisciplineAction { - get { return DisciplineIncident; } - set { DisciplineIncident = (DisciplineIncident) value; } + get { return DisciplineAction; } + set { DisciplineAction = (DisciplineAction) value; } } - [DomainSignature] - public virtual int DisciplineIncidentParticipationCodeDescriptorId + [Display(Name="StaffUniqueId")][DomainSignature] + public virtual int StaffUSI { get { - if (_disciplineIncidentParticipationCodeDescriptorId == default(int)) - _disciplineIncidentParticipationCodeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptor); + if (_staffUSI == default(int) && _staffUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) + { + _staffUSI = usi; + } + } - return _disciplineIncidentParticipationCodeDescriptorId; + return _staffUSI; } set { - _disciplineIncidentParticipationCodeDescriptorId = value; - _disciplineIncidentParticipationCodeDescriptor = null; + _staffUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); } } - private int _disciplineIncidentParticipationCodeDescriptorId; - private string _disciplineIncidentParticipationCodeDescriptor; + private int _staffUSI; + private string _staffUniqueId; - public virtual string DisciplineIncidentParticipationCodeDescriptor + public virtual string StaffUniqueId { get { - if (_disciplineIncidentParticipationCodeDescriptor == null) - _disciplineIncidentParticipationCodeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptorId); - - return _disciplineIncidentParticipationCodeDescriptor; + if (_staffUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) + { + _staffUniqueId = uniqueId; + } + } + + return _staffUniqueId; } set { - _disciplineIncidentParticipationCodeDescriptor = value; - _disciplineIncidentParticipationCodeDescriptorId = default(int); + if (_staffUniqueId != value) + _staffUSI = default(int); + + _staffUniqueId = value; } } - [DomainSignature] - public virtual string FirstName { get; set; } - [DomainSignature] - public virtual string LastSurname { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -36372,6 +36753,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } + + /// + /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IDisciplineActionStaff.StaffDiscriminator + { + get { return StaffReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineActionStaff.StaffResourceId + { + get { return StaffReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -36382,7 +36783,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DisciplineIncidentParticipationCodeDescriptor", new LookupColumnDetails { PropertyName = "DisciplineIncidentParticipationCodeDescriptorId", LookupTypeName = "DisciplineIncidentParticipationCodeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -36394,12 +36794,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); - keyValues.Add("FirstName", FirstName); - keyValues.Add("LastSurname", LastSurname); + keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -36463,36 +36861,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStaff)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionStaff) target, null); } void IChildEntity.SetParent(object value) { - DisciplineIncident = (DisciplineIncident) value; + DisciplineAction = (DisciplineAction) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncidentWeapon table of the DisciplineIncident aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionStudentDisciplineIncidentBehaviorAssociation table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncidentWeapon : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineIncidentWeapon, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineActionStudentDisciplineIncidentBehaviorAssociation : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineIncidentWeapon() + public DisciplineActionStudentDisciplineIncidentBehaviorAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -36501,49 +36899,53 @@ public DisciplineIncidentWeapon() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual DisciplineIncident DisciplineIncident { get; set; } + public virtual DisciplineAction DisciplineAction { get; set; } - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentWeapon.DisciplineIncident + Entities.Common.EdFi.IDisciplineAction IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.DisciplineAction { - get { return DisciplineIncident; } - set { DisciplineIncident = (DisciplineIncident) value; } + get { return DisciplineAction; } + set { DisciplineAction = (DisciplineAction) value; } } [DomainSignature] - public virtual int WeaponDescriptorId + public virtual int BehaviorDescriptorId { get { - if (_weaponDescriptorId == default(int)) - _weaponDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("WeaponDescriptor", _weaponDescriptor); + if (_behaviorDescriptorId == default(int)) + _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); - return _weaponDescriptorId; + return _behaviorDescriptorId; } set { - _weaponDescriptorId = value; - _weaponDescriptor = null; + _behaviorDescriptorId = value; + _behaviorDescriptor = null; } } - private int _weaponDescriptorId; - private string _weaponDescriptor; + private int _behaviorDescriptorId; + private string _behaviorDescriptor; - public virtual string WeaponDescriptor + public virtual string BehaviorDescriptor { get { - if (_weaponDescriptor == null) - _weaponDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("WeaponDescriptor", _weaponDescriptorId); + if (_behaviorDescriptor == null) + _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); - return _weaponDescriptor; + return _behaviorDescriptor; } set { - _weaponDescriptor = value; - _weaponDescriptorId = default(int); + _behaviorDescriptor = value; + _behaviorDescriptorId = default(int); } } + [DomainSignature] + public virtual string IncidentIdentifier { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -36598,6 +37000,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.StudentDisciplineIncidentBehaviorAssociationAggregate.EdFi.StudentDisciplineIncidentBehaviorAssociationReferenceData StudentDisciplineIncidentBehaviorAssociationReferenceData { get; set; } + + /// + /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDiscriminator + { + get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationResourceId + { + get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -36608,7 +37030,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "WeaponDescriptor", new LookupColumnDetails { PropertyName = "WeaponDescriptorId", LookupTypeName = "WeaponDescriptor"} }, + { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -36620,10 +37042,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("WeaponDescriptorId", WeaponDescriptorId); + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); return keyValues; } @@ -36687,41 +37111,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentWeapon)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentWeapon) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation) target, null); } void IChildEntity.SetParent(object value) { - DisciplineIncident = (DisciplineIncident) value; + DisciplineAction = (DisciplineAction) value; } } } -// Aggregate: DisciplineIncidentParticipationCodeDescriptor +// Aggregate: DisciplineActionLengthDifferenceReasonDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentParticipationCodeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisciplineActionLengthDifferenceReasonDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncidentParticipationCodeDescriptor table of the DisciplineIncidentParticipationCodeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionLengthDifferenceReasonDescriptor table of the DisciplineActionLengthDifferenceReasonDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncidentParticipationCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class DisciplineActionLengthDifferenceReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisciplineIncidentParticipationCodeDescriptorId + public virtual int DisciplineActionLengthDifferenceReasonDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -36806,7 +37230,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); + keyValues.Add("DisciplineActionLengthDifferenceReasonDescriptorId", DisciplineActionLengthDifferenceReasonDescriptorId); return keyValues; } @@ -36870,37 +37294,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor) target, null); } } } -// Aggregate: DisplacedStudentStatusDescriptor +// Aggregate: DisciplineDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisplacedStudentStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisciplineDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisplacedStudentStatusDescriptor table of the DisplacedStudentStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisciplineDescriptor table of the DisciplineDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisplacedStudentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisplacedStudentStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class DisciplineDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisciplineDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisplacedStudentStatusDescriptorId + public virtual int DisciplineDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -36985,7 +37409,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisplacedStudentStatusDescriptorId", DisplacedStudentStatusDescriptorId); + keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); return keyValues; } @@ -37049,257 +37473,80 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineDescriptor) target, null); } } } -// Aggregate: EducationalEnvironmentDescriptor +// Aggregate: DisciplineIncident -namespace EdFi.Ods.Entities.NHibernate.EducationalEnvironmentDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.EducationalEnvironmentDescriptor table of the EducationalEnvironmentDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class EducationalEnvironmentDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEducationalEnvironmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class DisciplineIncidentReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int EducationalEnvironmentDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual string IncidentIdentifier { get; set; } + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get { return Description; } - set { Description = value; } + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); + + return keyValues; } - DateTime? IDescriptor.EffectiveBeginDate + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationalEnvironmentDescriptorId", EducationalEnvironmentDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor) target, null); - } - - } -} -// Aggregate: EducationContent - -namespace EdFi.Ods.Entities.NHibernate.EducationContentAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class EducationContentReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string ContentIdentifier { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("ContentIdentifier", ContentIdentifier); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() + + public override int GetHashCode() { var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); @@ -37322,26 +37569,22 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContent table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncident table of the DisciplineIncident aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContent : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineIncident : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDisciplineIncident, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationContent() + public DisciplineIncident() { - EducationContentAppropriateGradeLevels = new HashSet(); - EducationContentAppropriateSexes = new HashSet(); - EducationContentAuthors = new HashSet(); - EducationContentDerivativeSourceEducationContents = new HashSet(); - EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(); - EducationContentDerivativeSourceURIs = new HashSet(); - EducationContentLanguages = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + DisciplineIncidentBehaviors = new HashSet(); + DisciplineIncidentExternalParticipants = new HashSet(); + DisciplineIncidentWeapons = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -37350,7 +37593,9 @@ public EducationContent() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string ContentIdentifier { get; set; } + public virtual string IncidentIdentifier { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -37361,139 +37606,89 @@ public EducationContent() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool? AdditionalAuthorsIndicator { get; set; } - public virtual int? ContentClassDescriptorId + public virtual string CaseNumber { get; set; } + public virtual decimal? IncidentCost { get; set; } + public virtual DateTime IncidentDate { - get - { - if (_contentClassDescriptorId == default(int?)) - _contentClassDescriptorId = string.IsNullOrWhiteSpace(_contentClassDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ContentClassDescriptor", _contentClassDescriptor); - - return _contentClassDescriptorId; - } - set - { - _contentClassDescriptorId = value; - _contentClassDescriptor = null; - } + get { return _incidentDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _incidentDate = new DateTime(value.Year, value.Month, value.Day); } } - private int? _contentClassDescriptorId; - private string _contentClassDescriptor; - - public virtual string ContentClassDescriptor - { - get - { - if (_contentClassDescriptor == null) - _contentClassDescriptor = _contentClassDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ContentClassDescriptor", _contentClassDescriptorId.Value); - - return _contentClassDescriptor; - } - set - { - _contentClassDescriptor = value; - _contentClassDescriptorId = default(int?); - } - } - public virtual decimal? Cost { get; set; } - public virtual int? CostRateDescriptorId + private DateTime _incidentDate; + + public virtual string IncidentDescription { get; set; } + public virtual int? IncidentLocationDescriptorId { get { - if (_costRateDescriptorId == default(int?)) - _costRateDescriptorId = string.IsNullOrWhiteSpace(_costRateDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CostRateDescriptor", _costRateDescriptor); + if (_incidentLocationDescriptorId == default(int?)) + _incidentLocationDescriptorId = string.IsNullOrWhiteSpace(_incidentLocationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IncidentLocationDescriptor", _incidentLocationDescriptor); - return _costRateDescriptorId; + return _incidentLocationDescriptorId; } set { - _costRateDescriptorId = value; - _costRateDescriptor = null; + _incidentLocationDescriptorId = value; + _incidentLocationDescriptor = null; } } - private int? _costRateDescriptorId; - private string _costRateDescriptor; + private int? _incidentLocationDescriptorId; + private string _incidentLocationDescriptor; - public virtual string CostRateDescriptor + public virtual string IncidentLocationDescriptor { get { - if (_costRateDescriptor == null) - _costRateDescriptor = _costRateDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CostRateDescriptor", _costRateDescriptorId.Value); + if (_incidentLocationDescriptor == null) + _incidentLocationDescriptor = _incidentLocationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IncidentLocationDescriptor", _incidentLocationDescriptorId.Value); - return _costRateDescriptor; + return _incidentLocationDescriptor; } set { - _costRateDescriptor = value; - _costRateDescriptorId = default(int?); + _incidentLocationDescriptor = value; + _incidentLocationDescriptorId = default(int?); } } - public virtual string Description { get; set; } - public virtual int? InteractivityStyleDescriptorId + public virtual TimeSpan? IncidentTime { get; set; } + public virtual bool? ReportedToLawEnforcement { get; set; } + public virtual int? ReporterDescriptionDescriptorId { get { - if (_interactivityStyleDescriptorId == default(int?)) - _interactivityStyleDescriptorId = string.IsNullOrWhiteSpace(_interactivityStyleDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InteractivityStyleDescriptor", _interactivityStyleDescriptor); + if (_reporterDescriptionDescriptorId == default(int?)) + _reporterDescriptionDescriptorId = string.IsNullOrWhiteSpace(_reporterDescriptionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReporterDescriptionDescriptor", _reporterDescriptionDescriptor); - return _interactivityStyleDescriptorId; + return _reporterDescriptionDescriptorId; } set { - _interactivityStyleDescriptorId = value; - _interactivityStyleDescriptor = null; + _reporterDescriptionDescriptorId = value; + _reporterDescriptionDescriptor = null; } } - private int? _interactivityStyleDescriptorId; - private string _interactivityStyleDescriptor; + private int? _reporterDescriptionDescriptorId; + private string _reporterDescriptionDescriptor; - public virtual string InteractivityStyleDescriptor + public virtual string ReporterDescriptionDescriptor { get { - if (_interactivityStyleDescriptor == null) - _interactivityStyleDescriptor = _interactivityStyleDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InteractivityStyleDescriptor", _interactivityStyleDescriptorId.Value); + if (_reporterDescriptionDescriptor == null) + _reporterDescriptionDescriptor = _reporterDescriptionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReporterDescriptionDescriptor", _reporterDescriptionDescriptorId.Value); - return _interactivityStyleDescriptor; + return _reporterDescriptionDescriptor; } set { - _interactivityStyleDescriptor = value; - _interactivityStyleDescriptorId = default(int?); - } - } - public virtual string LearningResourceMetadataURI { get; set; } - public virtual string LearningStandardId { get; set; } - public virtual string Namespace { get; set; } - public virtual DateTime? PublicationDate - { - get { return _publicationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _publicationDate = null; - } else - { - var given = (DateTime) value; - _publicationDate = new DateTime(given.Year, given.Month, given.Day); - } + _reporterDescriptionDescriptor = value; + _reporterDescriptionDescriptorId = default(int?); } } - - private DateTime? _publicationDate; - - public virtual short? PublicationYear { get; set; } - public virtual string Publisher { get; set; } - public virtual string ShortDescription { get; set; } - public virtual string TimeRequired { get; set; } - public virtual string UseRightsURL { get; set; } - public virtual string Version { get; set; } + public virtual string ReporterName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -37538,23 +37733,14 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IEducationContent.LearningStandardResourceId + Guid? Entities.Common.EdFi.IDisciplineIncident.SchoolResourceId { - get { return LearningStandardReferenceData?.Id; } + get { return SchoolReferenceData?.Id; } set { } } @@ -37564,197 +37750,9 @@ string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _educationContentAppropriateGradeLevels; - private ICollection _educationContentAppropriateGradeLevelsCovariant; - public virtual ICollection EducationContentAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentAppropriateGradeLevels) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentAppropriateGradeLevels; - } - set - { - _educationContentAppropriateGradeLevels = value; - _educationContentAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentAppropriateGradeLevels) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentAppropriateGradeLevelsCovariant; - } - set - { - EducationContentAppropriateGradeLevels = new HashSet(value.Cast()); - } - } - - - private ICollection _educationContentAppropriateSexes; - private ICollection _educationContentAppropriateSexesCovariant; - public virtual ICollection EducationContentAppropriateSexes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentAppropriateSexes) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentAppropriateSexes; - } - set - { - _educationContentAppropriateSexes = value; - _educationContentAppropriateSexesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateSexes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentAppropriateSexes) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentAppropriateSexesCovariant; - } - set - { - EducationContentAppropriateSexes = new HashSet(value.Cast()); - } - } - - - private ICollection _educationContentAuthors; - private ICollection _educationContentAuthorsCovariant; - public virtual ICollection EducationContentAuthors - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentAuthors) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentAuthors; - } - set - { - _educationContentAuthors = value; - _educationContentAuthorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAuthors - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentAuthors) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentAuthorsCovariant; - } - set - { - EducationContentAuthors = new HashSet(value.Cast()); - } - } - - - private ICollection _educationContentDerivativeSourceEducationContents; - private ICollection _educationContentDerivativeSourceEducationContentsCovariant; - public virtual ICollection EducationContentDerivativeSourceEducationContents - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceEducationContents) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentDerivativeSourceEducationContents; - } - set - { - _educationContentDerivativeSourceEducationContents = value; - _educationContentDerivativeSourceEducationContentsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceEducationContents - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceEducationContents) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentDerivativeSourceEducationContentsCovariant; - } - set - { - EducationContentDerivativeSourceEducationContents = new HashSet(value.Cast()); - } - } - - - private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIs; - private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; - public virtual ICollection EducationContentDerivativeSourceLearningResourceMetadataURIs + private ICollection _disciplineIncidentBehaviors; + private ICollection _disciplineIncidentBehaviorsCovariant; + public virtual ICollection DisciplineIncidentBehaviors { get { @@ -37763,45 +37761,45 @@ public virtual ICollection(value); + _disciplineIncidentBehaviors = value; + _disciplineIncidentBehaviorsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceLearningResourceMetadataURIs + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentBehaviors { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) - if (item.EducationContent == null) - item.EducationContent = this; + foreach (var item in _disciplineIncidentBehaviors) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; + return _disciplineIncidentBehaviorsCovariant; } set { - EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(value.Cast()); + DisciplineIncidentBehaviors = new HashSet(value.Cast()); } } - private ICollection _educationContentDerivativeSourceURIs; - private ICollection _educationContentDerivativeSourceURIsCovariant; - public virtual ICollection EducationContentDerivativeSourceURIs + private ICollection _disciplineIncidentExternalParticipants; + private ICollection _disciplineIncidentExternalParticipantsCovariant; + public virtual ICollection DisciplineIncidentExternalParticipants { get { @@ -37810,45 +37808,45 @@ public virtual ICollection(value); + _disciplineIncidentExternalParticipants = value; + _disciplineIncidentExternalParticipantsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceURIs + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentExternalParticipants { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceURIs) - if (item.EducationContent == null) - item.EducationContent = this; + foreach (var item in _disciplineIncidentExternalParticipants) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentDerivativeSourceURIsCovariant; + return _disciplineIncidentExternalParticipantsCovariant; } set { - EducationContentDerivativeSourceURIs = new HashSet(value.Cast()); + DisciplineIncidentExternalParticipants = new HashSet(value.Cast()); } } - private ICollection _educationContentLanguages; - private ICollection _educationContentLanguagesCovariant; - public virtual ICollection EducationContentLanguages + private ICollection _disciplineIncidentWeapons; + private ICollection _disciplineIncidentWeaponsCovariant; + public virtual ICollection DisciplineIncidentWeapons { get { @@ -37857,38 +37855,38 @@ public virtual ICollection(value); + _disciplineIncidentWeapons = value; + _disciplineIncidentWeaponsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentLanguages + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentWeapons { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationContentLanguages) - if (item.EducationContent == null) - item.EducationContent = this; + foreach (var item in _disciplineIncidentWeapons) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentLanguagesCovariant; + return _disciplineIncidentWeaponsCovariant; } set { - EducationContentLanguages = new HashSet(value.Cast()); + DisciplineIncidentWeapons = new HashSet(value.Cast()); } } @@ -37897,9 +37895,8 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ContentClassDescriptor", new LookupColumnDetails { PropertyName = "ContentClassDescriptorId", LookupTypeName = "ContentClassDescriptor"} }, - { "CostRateDescriptor", new LookupColumnDetails { PropertyName = "CostRateDescriptorId", LookupTypeName = "CostRateDescriptor"} }, - { "InteractivityStyleDescriptor", new LookupColumnDetails { PropertyName = "InteractivityStyleDescriptorId", LookupTypeName = "InteractivityStyleDescriptor"} }, + { "IncidentLocationDescriptor", new LookupColumnDetails { PropertyName = "IncidentLocationDescriptorId", LookupTypeName = "IncidentLocationDescriptor"} }, + { "ReporterDescriptionDescriptor", new LookupColumnDetails { PropertyName = "ReporterDescriptionDescriptorId", LookupTypeName = "ReporterDescriptionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -37914,7 +37911,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ContentIdentifier", ContentIdentifier); + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); return keyValues; } @@ -37978,12 +37976,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncident)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContent) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncident) target, null); } } @@ -37991,19 +37989,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentAppropriateGradeLevel table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncidentBehavior table of the DisciplineIncident aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineIncidentBehavior : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineIncidentBehavior, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationContentAppropriateGradeLevel() + public DisciplineIncidentBehavior() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -38012,47 +38010,47 @@ public EducationContentAppropriateGradeLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } + public virtual DisciplineIncident DisciplineIncident { get; set; } - Entities.Common.EdFi.IEducationContent IEducationContentAppropriateGradeLevel.EducationContent + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentBehavior.DisciplineIncident { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return DisciplineIncident; } + set { DisciplineIncident = (DisciplineIncident) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId + public virtual int BehaviorDescriptorId { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_behaviorDescriptorId == default(int)) + _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); - return _gradeLevelDescriptorId; + return _behaviorDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _behaviorDescriptorId = value; + _behaviorDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int _behaviorDescriptorId; + private string _behaviorDescriptor; - public virtual string GradeLevelDescriptor + public virtual string BehaviorDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_behaviorDescriptor == null) + _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); - return _gradeLevelDescriptor; + return _behaviorDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _behaviorDescriptor = value; + _behaviorDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -38065,6 +38063,7 @@ public virtual string GradeLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -38119,7 +38118,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -38131,10 +38130,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); return keyValues; } @@ -38198,36 +38197,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentBehavior)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentBehavior) target, null); } void IChildEntity.SetParent(object value) { - EducationContent = (EducationContent) value; + DisciplineIncident = (DisciplineIncident) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentAppropriateSex table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncidentExternalParticipant table of the DisciplineIncident aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentAppropriateSex : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineIncidentExternalParticipant : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineIncidentExternalParticipant, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationContentAppropriateSex() + public DisciplineIncidentExternalParticipant() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -38236,49 +38235,53 @@ public EducationContentAppropriateSex() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } + public virtual DisciplineIncident DisciplineIncident { get; set; } - Entities.Common.EdFi.IEducationContent IEducationContentAppropriateSex.EducationContent + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentExternalParticipant.DisciplineIncident { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return DisciplineIncident; } + set { DisciplineIncident = (DisciplineIncident) value; } } [DomainSignature] - public virtual int SexDescriptorId + public virtual int DisciplineIncidentParticipationCodeDescriptorId { get { - if (_sexDescriptorId == default(int)) - _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); + if (_disciplineIncidentParticipationCodeDescriptorId == default(int)) + _disciplineIncidentParticipationCodeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptor); - return _sexDescriptorId; + return _disciplineIncidentParticipationCodeDescriptorId; } set { - _sexDescriptorId = value; - _sexDescriptor = null; + _disciplineIncidentParticipationCodeDescriptorId = value; + _disciplineIncidentParticipationCodeDescriptor = null; } } - private int _sexDescriptorId; - private string _sexDescriptor; + private int _disciplineIncidentParticipationCodeDescriptorId; + private string _disciplineIncidentParticipationCodeDescriptor; - public virtual string SexDescriptor + public virtual string DisciplineIncidentParticipationCodeDescriptor { get { - if (_sexDescriptor == null) - _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); + if (_disciplineIncidentParticipationCodeDescriptor == null) + _disciplineIncidentParticipationCodeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptorId); - return _sexDescriptor; + return _disciplineIncidentParticipationCodeDescriptor; } set { - _sexDescriptor = value; - _sexDescriptorId = default(int); + _disciplineIncidentParticipationCodeDescriptor = value; + _disciplineIncidentParticipationCodeDescriptorId = default(int); } } + [DomainSignature] + public virtual string FirstName { get; set; } + [DomainSignature] + public virtual string LastSurname { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -38343,7 +38346,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, + { "DisciplineIncidentParticipationCodeDescriptor", new LookupColumnDetails { PropertyName = "DisciplineIncidentParticipationCodeDescriptorId", LookupTypeName = "DisciplineIncidentParticipationCodeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -38355,10 +38358,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("SexDescriptorId", SexDescriptorId); + keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); + keyValues.Add("FirstName", FirstName); + keyValues.Add("LastSurname", LastSurname); return keyValues; } @@ -38422,36 +38427,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateSex)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateSex) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant) target, null); } void IChildEntity.SetParent(object value) { - EducationContent = (EducationContent) value; + DisciplineIncident = (DisciplineIncident) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentAuthor table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncidentWeapon table of the DisciplineIncident aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentAuthor : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineIncidentWeapon : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineIncidentWeapon, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationContentAuthor() + public DisciplineIncidentWeapon() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -38460,16 +38465,49 @@ public EducationContentAuthor() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } + public virtual DisciplineIncident DisciplineIncident { get; set; } - Entities.Common.EdFi.IEducationContent IEducationContentAuthor.EducationContent + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentWeapon.DisciplineIncident { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return DisciplineIncident; } + set { DisciplineIncident = (DisciplineIncident) value; } } [DomainSignature] - public virtual string Author { get; set; } + public virtual int WeaponDescriptorId + { + get + { + if (_weaponDescriptorId == default(int)) + _weaponDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("WeaponDescriptor", _weaponDescriptor); + + return _weaponDescriptorId; + } + set + { + _weaponDescriptorId = value; + _weaponDescriptor = null; + } + } + + private int _weaponDescriptorId; + private string _weaponDescriptor; + + public virtual string WeaponDescriptor + { + get + { + if (_weaponDescriptor == null) + _weaponDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("WeaponDescriptor", _weaponDescriptorId); + + return _weaponDescriptor; + } + set + { + _weaponDescriptor = value; + _weaponDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -38534,6 +38572,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "WeaponDescriptor", new LookupColumnDetails { PropertyName = "WeaponDescriptorId", LookupTypeName = "WeaponDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -38545,10 +38584,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("Author", Author); + keyValues.Add("WeaponDescriptorId", WeaponDescriptorId); return keyValues; } @@ -38612,59 +38651,81 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAuthor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentWeapon)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentAuthor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentWeapon) target, null); } void IChildEntity.SetParent(object value) { - EducationContent = (EducationContent) value; + DisciplineIncident = (DisciplineIncident) value; } } +} +// Aggregate: DisciplineIncidentParticipationCodeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentParticipationCodeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentDerivativeSourceEducationContent table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncidentParticipationCodeDescriptor table of the DisciplineIncidentParticipationCodeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceEducationContent : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisciplineIncidentParticipationCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentDerivativeSourceEducationContent() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducationContent.EducationContent + [DomainSignature] + public virtual int DisciplineIncidentParticipationCodeDescriptorId { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string DerivativeSourceContentIdentifier { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -38680,60 +38741,11 @@ Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducatio // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData DerivativeSourceEducationContentReferenceData { get; set; } - - /// - /// Read-only property that allows the DerivativeSourceEducationContent discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentDiscriminator - { - get { return DerivativeSourceEducationContentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the DerivativeSourceEducationContent resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentResourceId - { - get { return DerivativeSourceEducationContentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -38754,11 +38766,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DerivativeSourceContentIdentifier", DerivativeSourceContentIdentifier); + keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); return keyValues; } @@ -38822,249 +38834,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } +} +// Aggregate: DisplacedStudentStatusDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DisplacedStudentStatusDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentDerivativeSourceLearningResourceMetadataURI table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisplacedStudentStatusDescriptor table of the DisplacedStudentStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class DisplacedStudentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisplacedStudentStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentDerivativeSourceLearningResourceMetadataURI() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceLearningResourceMetadataURI.EducationContent + [DomainSignature] + public virtual int DisplacedStudentStatusDescriptorId { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string DerivativeSourceLearningResourceMetadataURI { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("DerivativeSourceLearningResourceMetadataURI", DerivativeSourceLearningResourceMetadataURI); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() + string IDescriptor.CodeValue { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); + get { return CodeValue; } + set { CodeValue = value; } } - #endregion - bool ISynchronizable.Synchronize(object target) + string IDescriptor.Description { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)target); + get { return Description; } + set { Description = value; } } - - void IMappable.Map(object target) + DateTime? IDescriptor.EffectiveBeginDate { - this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI) target, null); + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - - void IChildEntity.SetParent(object value) + DateTime? IDescriptor.EffectiveEndDate { - EducationContent = (EducationContent) value; + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.EducationContentDerivativeSourceURI table of the EducationContent aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentDerivativeSourceURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentDerivativeSourceURI() + string IDescriptor.Namespace { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return Namespace; } + set { Namespace = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.EducationContent + string IDescriptor.ShortDescription { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return ShortDescription; } + set { ShortDescription = value; } } - - [DomainSignature] - public virtual string DerivativeSourceURI { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -39080,35 +38920,6 @@ Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.Educ // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39134,11 +38945,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DerivativeSourceURI", DerivativeSourceURI); + keyValues.Add("DisplacedStudentStatusDescriptorId", DisplacedStudentStatusDescriptorId); return keyValues; } @@ -39202,92 +39013,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI) target, null); + this.MapTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } +} +// Aggregate: EducationalEnvironmentDescriptor + +namespace EdFi.Ods.Entities.NHibernate.EducationalEnvironmentDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentLanguage table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.EducationalEnvironmentDescriptor table of the EducationalEnvironmentDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentLanguage : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationalEnvironmentDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEducationalEnvironmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentLanguage() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentLanguage.EducationContent - { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } - } - [DomainSignature] - public virtual int LanguageDescriptorId - { - get - { - if (_languageDescriptorId == default(int)) - _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); - - return _languageDescriptorId; - } - set - { - _languageDescriptorId = value; - _languageDescriptor = null; - } - } - - private int _languageDescriptorId; - private string _languageDescriptor; - - public virtual string LanguageDescriptor + public virtual int EducationalEnvironmentDescriptorId { - get - { - if (_languageDescriptor == null) - _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); - - return _languageDescriptor; - } - set - { - _languageDescriptor = value; - _languageDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -39303,35 +39099,6 @@ public virtual string LanguageDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39347,7 +39114,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -39358,11 +39124,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); + keyValues.Add("EducationalEnvironmentDescriptorId", EducationalEnvironmentDescriptorId); return keyValues; } @@ -39426,33 +39192,29 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentLanguage)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentLanguage) target, null); + this.MapTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } } -// Aggregate: EducationOrganization +// Aggregate: EducationContent -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationContentAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class EducationOrganizationReferenceData : IHasPrimaryKeyValues + public class EducationContentReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } + public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- /// @@ -39473,7 +39235,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ContentIdentifier", ContentIdentifier); return keyValues; } @@ -39524,23 +39286,26 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganization table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContent table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public abstract class EducationOrganization : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEducationOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap + public class EducationContent : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganization() + public EducationContent() { - EducationOrganizationAddresses = new HashSet(); - EducationOrganizationCategories = new HashSet(); - EducationOrganizationIdentificationCodes = new HashSet(); - EducationOrganizationIndicators = new HashSet(); - EducationOrganizationInstitutionTelephones = new HashSet(); - EducationOrganizationInternationalAddresses = new HashSet(); + EducationContentAppropriateGradeLevels = new HashSet(); + EducationContentAppropriateSexes = new HashSet(); + EducationContentAuthors = new HashSet(); + EducationContentDerivativeSourceEducationContents = new HashSet(); + EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(); + EducationContentDerivativeSourceURIs = new HashSet(); + EducationContentLanguages = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -39548,7 +39313,8 @@ public EducationOrganization() // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39559,43 +39325,139 @@ public EducationOrganization() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string NameOfInstitution { get; set; } - public virtual int? OperationalStatusDescriptorId + public virtual bool? AdditionalAuthorsIndicator { get; set; } + public virtual int? ContentClassDescriptorId { get { - if (_operationalStatusDescriptorId == default(int?)) - _operationalStatusDescriptorId = string.IsNullOrWhiteSpace(_operationalStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OperationalStatusDescriptor", _operationalStatusDescriptor); + if (_contentClassDescriptorId == default(int?)) + _contentClassDescriptorId = string.IsNullOrWhiteSpace(_contentClassDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ContentClassDescriptor", _contentClassDescriptor); - return _operationalStatusDescriptorId; + return _contentClassDescriptorId; } set { - _operationalStatusDescriptorId = value; - _operationalStatusDescriptor = null; + _contentClassDescriptorId = value; + _contentClassDescriptor = null; } } - private int? _operationalStatusDescriptorId; - private string _operationalStatusDescriptor; + private int? _contentClassDescriptorId; + private string _contentClassDescriptor; - public virtual string OperationalStatusDescriptor + public virtual string ContentClassDescriptor { get { - if (_operationalStatusDescriptor == null) - _operationalStatusDescriptor = _operationalStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OperationalStatusDescriptor", _operationalStatusDescriptorId.Value); + if (_contentClassDescriptor == null) + _contentClassDescriptor = _contentClassDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ContentClassDescriptor", _contentClassDescriptorId.Value); - return _operationalStatusDescriptor; + return _contentClassDescriptor; } set { - _operationalStatusDescriptor = value; - _operationalStatusDescriptorId = default(int?); + _contentClassDescriptor = value; + _contentClassDescriptorId = default(int?); } } - public virtual string ShortNameOfInstitution { get; set; } - public virtual string WebSite { get; set; } + public virtual decimal? Cost { get; set; } + public virtual int? CostRateDescriptorId + { + get + { + if (_costRateDescriptorId == default(int?)) + _costRateDescriptorId = string.IsNullOrWhiteSpace(_costRateDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CostRateDescriptor", _costRateDescriptor); + + return _costRateDescriptorId; + } + set + { + _costRateDescriptorId = value; + _costRateDescriptor = null; + } + } + + private int? _costRateDescriptorId; + private string _costRateDescriptor; + + public virtual string CostRateDescriptor + { + get + { + if (_costRateDescriptor == null) + _costRateDescriptor = _costRateDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CostRateDescriptor", _costRateDescriptorId.Value); + + return _costRateDescriptor; + } + set + { + _costRateDescriptor = value; + _costRateDescriptorId = default(int?); + } + } + public virtual string Description { get; set; } + public virtual int? InteractivityStyleDescriptorId + { + get + { + if (_interactivityStyleDescriptorId == default(int?)) + _interactivityStyleDescriptorId = string.IsNullOrWhiteSpace(_interactivityStyleDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InteractivityStyleDescriptor", _interactivityStyleDescriptor); + + return _interactivityStyleDescriptorId; + } + set + { + _interactivityStyleDescriptorId = value; + _interactivityStyleDescriptor = null; + } + } + + private int? _interactivityStyleDescriptorId; + private string _interactivityStyleDescriptor; + + public virtual string InteractivityStyleDescriptor + { + get + { + if (_interactivityStyleDescriptor == null) + _interactivityStyleDescriptor = _interactivityStyleDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InteractivityStyleDescriptor", _interactivityStyleDescriptorId.Value); + + return _interactivityStyleDescriptor; + } + set + { + _interactivityStyleDescriptor = value; + _interactivityStyleDescriptorId = default(int?); + } + } + public virtual string LearningResourceMetadataURI { get; set; } + public virtual string LearningStandardId { get; set; } + public virtual string Namespace { get; set; } + public virtual DateTime? PublicationDate + { + get { return _publicationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _publicationDate = null; + } else + { + var given = (DateTime) value; + _publicationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _publicationDate; + + public virtual short? PublicationYear { get; set; } + public virtual string Publisher { get; set; } + public virtual string ShortDescription { get; set; } + public virtual string TimeRequired { get; set; } + public virtual string UseRightsURL { get; set; } + public virtual string Version { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39606,20 +39468,69 @@ public virtual string OperationalStatusDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator + { + get { return LearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationContent.LearningStandardResourceId + { + get { return LearningStandardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - public virtual ICollection EducationOrganizationAddresses + private ICollection _educationContentAppropriateGradeLevels; + private ICollection _educationContentAppropriateGradeLevelsCovariant; + public virtual ICollection EducationContentAppropriateGradeLevels { get { @@ -39628,45 +39539,45 @@ public virtual ICollection(value); + _educationContentAppropriateGradeLevels = value; + _educationContentAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateGradeLevels { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationAddresses) - if (item.EducationOrganization == null) - item.EducationOrganization = this; + foreach (var item in _educationContentAppropriateGradeLevels) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationAddressesCovariant; + return _educationContentAppropriateGradeLevelsCovariant; } set { - EducationOrganizationAddresses = new HashSet(value.Cast()); + EducationContentAppropriateGradeLevels = new HashSet(value.Cast()); } } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - public virtual ICollection EducationOrganizationCategories + private ICollection _educationContentAppropriateSexes; + private ICollection _educationContentAppropriateSexesCovariant; + public virtual ICollection EducationContentAppropriateSexes { get { @@ -39675,45 +39586,45 @@ public virtual ICollection(value); + _educationContentAppropriateSexes = value; + _educationContentAppropriateSexesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateSexes { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationCategories) - if (item.EducationOrganization == null) - item.EducationOrganization = this; + foreach (var item in _educationContentAppropriateSexes) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationCategoriesCovariant; + return _educationContentAppropriateSexesCovariant; } set { - EducationOrganizationCategories = new HashSet(value.Cast()); + EducationContentAppropriateSexes = new HashSet(value.Cast()); } } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - public virtual ICollection EducationOrganizationIdentificationCodes + private ICollection _educationContentAuthors; + private ICollection _educationContentAuthorsCovariant; + public virtual ICollection EducationContentAuthors { get { @@ -39722,45 +39633,45 @@ public virtual ICollection(value); + _educationContentAuthors = value; + _educationContentAuthorsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAuthors { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIdentificationCodes) - if (item.EducationOrganization == null) - item.EducationOrganization = this; + foreach (var item in _educationContentAuthors) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationIdentificationCodesCovariant; + return _educationContentAuthorsCovariant; } set { - EducationOrganizationIdentificationCodes = new HashSet(value.Cast()); + EducationContentAuthors = new HashSet(value.Cast()); } } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - public virtual ICollection EducationOrganizationIndicators + private ICollection _educationContentDerivativeSourceEducationContents; + private ICollection _educationContentDerivativeSourceEducationContentsCovariant; + public virtual ICollection EducationContentDerivativeSourceEducationContents { get { @@ -39769,45 +39680,45 @@ public virtual ICollection(value); + _educationContentDerivativeSourceEducationContents = value; + _educationContentDerivativeSourceEducationContentsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceEducationContents { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIndicators) - if (item.EducationOrganization == null) - item.EducationOrganization = this; + foreach (var item in _educationContentDerivativeSourceEducationContents) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationIndicatorsCovariant; + return _educationContentDerivativeSourceEducationContentsCovariant; } set { - EducationOrganizationIndicators = new HashSet(value.Cast()); + EducationContentDerivativeSourceEducationContents = new HashSet(value.Cast()); } } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - public virtual ICollection EducationOrganizationInstitutionTelephones + private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIs; + private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; + public virtual ICollection EducationContentDerivativeSourceLearningResourceMetadataURIs { get { @@ -39816,45 +39727,45 @@ public virtual ICollection(value); + _educationContentDerivativeSourceLearningResourceMetadataURIs = value; + _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceLearningResourceMetadataURIs { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationInstitutionTelephones) - if (item.EducationOrganization == null) - item.EducationOrganization = this; + foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationInstitutionTelephonesCovariant; + return _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; } set { - EducationOrganizationInstitutionTelephones = new HashSet(value.Cast()); + EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(value.Cast()); } } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - public virtual ICollection EducationOrganizationInternationalAddresses + private ICollection _educationContentDerivativeSourceURIs; + private ICollection _educationContentDerivativeSourceURIsCovariant; + public virtual ICollection EducationContentDerivativeSourceURIs { get { @@ -39863,38 +39774,85 @@ public virtual ICollection(value); + _educationContentDerivativeSourceURIs = value; + _educationContentDerivativeSourceURIsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceURIs { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationInternationalAddresses) - if (item.EducationOrganization == null) - item.EducationOrganization = this; + foreach (var item in _educationContentDerivativeSourceURIs) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationInternationalAddressesCovariant; + return _educationContentDerivativeSourceURIsCovariant; } set { - EducationOrganizationInternationalAddresses = new HashSet(value.Cast()); + EducationContentDerivativeSourceURIs = new HashSet(value.Cast()); + } + } + + + private ICollection _educationContentLanguages; + private ICollection _educationContentLanguagesCovariant; + public virtual ICollection EducationContentLanguages + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationContentLanguages) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- + + return _educationContentLanguages; + } + set + { + _educationContentLanguages = value; + _educationContentLanguagesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentLanguages + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationContentLanguages) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- + + return _educationContentLanguagesCovariant; + } + set + { + EducationContentLanguages = new HashSet(value.Cast()); } } @@ -39903,7 +39861,9 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + { "ContentClassDescriptor", new LookupColumnDetails { PropertyName = "ContentClassDescriptorId", LookupTypeName = "ContentClassDescriptor"} }, + { "CostRateDescriptor", new LookupColumnDetails { PropertyName = "CostRateDescriptorId", LookupTypeName = "CostRateDescriptor"} }, + { "InteractivityStyleDescriptor", new LookupColumnDetails { PropertyName = "InteractivityStyleDescriptorId", LookupTypeName = "InteractivityStyleDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -39918,7 +39878,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ContentIdentifier", ContentIdentifier); return keyValues; } @@ -39980,25 +39940,34 @@ public override int GetHashCode() return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContent)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IEducationContent) target, null); + } + } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationAddress table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentAppropriateGradeLevel table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationContentAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationAddress() + public EducationContentAppropriateGradeLevel() { - EducationOrganizationAddressPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -40007,90 +39976,49 @@ public EducationOrganizationAddress() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } - - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationAddress.EducationOrganization - { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } - } + public virtual EducationContent EducationContent { get; set; } - [DomainSignature] - public virtual int AddressTypeDescriptorId + Entities.Common.EdFi.IEducationContent IEducationContentAppropriateGradeLevel.EducationContent { - get - { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); - - return _addressTypeDescriptorId; - } - set - { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; - } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; - - public virtual string AddressTypeDescriptor - { - get - { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); - - return _addressTypeDescriptor; - } - set - { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); - } - } [DomainSignature] - public virtual string City { get; set; } - [DomainSignature] - public virtual string PostalCode { get; set; } - [DomainSignature] - public virtual int StateAbbreviationDescriptorId + public virtual int GradeLevelDescriptorId { get { - if (_stateAbbreviationDescriptorId == default(int)) - _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - return _stateAbbreviationDescriptorId; + return _gradeLevelDescriptorId; } set { - _stateAbbreviationDescriptorId = value; - _stateAbbreviationDescriptor = null; + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; } } - private int _stateAbbreviationDescriptorId; - private string _stateAbbreviationDescriptor; + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; - public virtual string StateAbbreviationDescriptor + public virtual string GradeLevelDescriptor { get { - if (_stateAbbreviationDescriptor == null) - _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - return _stateAbbreviationDescriptor; + return _gradeLevelDescriptor; } set { - _stateAbbreviationDescriptor = value; - _stateAbbreviationDescriptorId = default(int); + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); } } - [DomainSignature] - public virtual string StreetNumberName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40101,48 +40029,6 @@ public virtual string StateAbbreviationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string ApartmentRoomSuiteNumber { get; set; } - public virtual string BuildingSiteNumber { get; set; } - public virtual string CongressionalDistrict { get; set; } - public virtual string CountyFIPSCode { get; set; } - public virtual bool? DoNotPublishIndicator { get; set; } - public virtual string Latitude { get; set; } - public virtual int? LocaleDescriptorId - { - get - { - if (_localeDescriptorId == default(int?)) - _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); - - return _localeDescriptorId; - } - set - { - _localeDescriptorId = value; - _localeDescriptor = null; - } - } - - private int? _localeDescriptorId; - private string _localeDescriptor; - - public virtual string LocaleDescriptor - { - get - { - if (_localeDescriptor == null) - _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); - - return _localeDescriptor; - } - set - { - _localeDescriptor = value; - _localeDescriptorId = default(int?); - } - } - public virtual string Longitude { get; set; } - public virtual string NameOfCounty { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40192,61 +40078,12 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _educationOrganizationAddressPeriods; - private ICollection _educationOrganizationAddressPeriodsCovariant; - public virtual ICollection EducationOrganizationAddressPeriods - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationAddressPeriods) - if (item.EducationOrganizationAddress == null) - item.EducationOrganizationAddress = this; - // ------------------------------------------------------------- - - return _educationOrganizationAddressPeriods; - } - set - { - _educationOrganizationAddressPeriods = value; - _educationOrganizationAddressPeriodsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganizationAddress.EducationOrganizationAddressPeriods - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationAddressPeriods) - if (item.EducationOrganizationAddress == null) - item.EducationOrganizationAddress = this; - // ------------------------------------------------------------- - - return _educationOrganizationAddressPeriodsCovariant; - } - set - { - EducationOrganizationAddressPeriods = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -40258,14 +40095,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); - keyValues.Add("City", City); - keyValues.Add("PostalCode", PostalCode); - keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); - keyValues.Add("StreetNumberName", StreetNumberName); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -40329,36 +40162,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddress)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddress) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationAddressPeriod table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentAppropriateSex table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationAddressPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationContentAppropriateSex : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationAddressPeriod() + public EducationContentAppropriateSex() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -40367,24 +40200,49 @@ public EducationOrganizationAddressPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationOrganizationAddress EducationOrganizationAddress { get; set; } + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganizationAddress IEducationOrganizationAddressPeriod.EducationOrganizationAddress + Entities.Common.EdFi.IEducationContent IEducationContentAppropriateSex.EducationContent { - get { return EducationOrganizationAddress; } - set { EducationOrganizationAddress = (EducationOrganizationAddress) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual DateTime BeginDate + public virtual int SexDescriptorId { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_sexDescriptorId == default(int)) + _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); + + return _sexDescriptorId; + } + set + { + _sexDescriptorId = value; + _sexDescriptor = null; + } } - private DateTime _beginDate; - + private int _sexDescriptorId; + private string _sexDescriptor; + + public virtual string SexDescriptor + { + get + { + if (_sexDescriptor == null) + _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); + + return _sexDescriptor; + } + set + { + _sexDescriptor = value; + _sexDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -40395,25 +40253,6 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - // ------------------------------------------------------------- // ============================================================= @@ -40468,8 +40307,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -40481,10 +40319,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganizationAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("BeginDate", BeginDate); + keyValues.Add("SexDescriptorId", SexDescriptorId); return keyValues; } @@ -40548,36 +40386,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateSex)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateSex) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganizationAddress = (EducationOrganizationAddress) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationCategory table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentAuthor table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationCategory : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationContentAuthor : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationCategory() + public EducationContentAuthor() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -40586,49 +40424,16 @@ public EducationOrganizationCategory() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationCategory.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentAuthor.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int EducationOrganizationCategoryDescriptorId - { - get - { - if (_educationOrganizationCategoryDescriptorId == default(int)) - _educationOrganizationCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptor); - - return _educationOrganizationCategoryDescriptorId; - } - set - { - _educationOrganizationCategoryDescriptorId = value; - _educationOrganizationCategoryDescriptor = null; - } - } - - private int _educationOrganizationCategoryDescriptorId; - private string _educationOrganizationCategoryDescriptor; - - public virtual string EducationOrganizationCategoryDescriptor - { - get - { - if (_educationOrganizationCategoryDescriptor == null) - _educationOrganizationCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptorId); - - return _educationOrganizationCategoryDescriptor; - } - set - { - _educationOrganizationCategoryDescriptor = value; - _educationOrganizationCategoryDescriptorId = default(int); - } - } + public virtual string Author { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40693,7 +40498,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EducationOrganizationCategoryDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationCategoryDescriptorId", LookupTypeName = "EducationOrganizationCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -40705,10 +40509,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationCategoryDescriptorId", EducationOrganizationCategoryDescriptorId); + keyValues.Add("Author", Author); return keyValues; } @@ -40772,36 +40576,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationCategory)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAuthor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationCategory) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentAuthor) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationIdentificationCode table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentDerivativeSourceEducationContent table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationContentDerivativeSourceEducationContent : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationIdentificationCode() + public EducationContentDerivativeSourceEducationContent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -40810,49 +40614,16 @@ public EducationOrganizationIdentificationCode() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIdentificationCode.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducationContent.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int EducationOrganizationIdentificationSystemDescriptorId - { - get - { - if (_educationOrganizationIdentificationSystemDescriptorId == default(int)) - _educationOrganizationIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptor); - - return _educationOrganizationIdentificationSystemDescriptorId; - } - set - { - _educationOrganizationIdentificationSystemDescriptorId = value; - _educationOrganizationIdentificationSystemDescriptor = null; - } - } - - private int _educationOrganizationIdentificationSystemDescriptorId; - private string _educationOrganizationIdentificationSystemDescriptor; - - public virtual string EducationOrganizationIdentificationSystemDescriptor - { - get - { - if (_educationOrganizationIdentificationSystemDescriptor == null) - _educationOrganizationIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptorId); - - return _educationOrganizationIdentificationSystemDescriptor; - } - set - { - _educationOrganizationIdentificationSystemDescriptor = value; - _educationOrganizationIdentificationSystemDescriptorId = default(int); - } - } + public virtual string DerivativeSourceContentIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40863,7 +40634,6 @@ public virtual string EducationOrganizationIdentificationSystemDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40908,6 +40678,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData DerivativeSourceEducationContentReferenceData { get; set; } + + /// + /// Read-only property that allows the DerivativeSourceEducationContent discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentDiscriminator + { + get { return DerivativeSourceEducationContentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the DerivativeSourceEducationContent resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentResourceId + { + get { return DerivativeSourceEducationContentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -40918,7 +40708,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EducationOrganizationIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationIdentificationSystemDescriptorId", LookupTypeName = "EducationOrganizationIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -40930,10 +40719,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationIdentificationSystemDescriptorId", EducationOrganizationIdentificationSystemDescriptorId); + keyValues.Add("DerivativeSourceContentIdentifier", DerivativeSourceContentIdentifier); return keyValues; } @@ -40997,37 +40786,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationIndicator table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentDerivativeSourceLearningResourceMetadataURI table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicator : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationIndicator, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationContentDerivativeSourceLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationIndicator() + public EducationContentDerivativeSourceLearningResourceMetadataURI() { - EducationOrganizationIndicatorPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -41036,49 +40824,16 @@ public EducationOrganizationIndicator() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIndicator.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceLearningResourceMetadataURI.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int IndicatorDescriptorId - { - get - { - if (_indicatorDescriptorId == default(int)) - _indicatorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorDescriptor", _indicatorDescriptor); - - return _indicatorDescriptorId; - } - set - { - _indicatorDescriptorId = value; - _indicatorDescriptor = null; - } - } - - private int _indicatorDescriptorId; - private string _indicatorDescriptor; - - public virtual string IndicatorDescriptor - { - get - { - if (_indicatorDescriptor == null) - _indicatorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorDescriptor", _indicatorDescriptorId); - - return _indicatorDescriptor; - } - set - { - _indicatorDescriptor = value; - _indicatorDescriptorId = default(int); - } - } + public virtual string DerivativeSourceLearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41089,76 +40844,6 @@ public virtual string IndicatorDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string DesignatedBy { get; set; } - public virtual int? IndicatorGroupDescriptorId - { - get - { - if (_indicatorGroupDescriptorId == default(int?)) - _indicatorGroupDescriptorId = string.IsNullOrWhiteSpace(_indicatorGroupDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorGroupDescriptor", _indicatorGroupDescriptor); - - return _indicatorGroupDescriptorId; - } - set - { - _indicatorGroupDescriptorId = value; - _indicatorGroupDescriptor = null; - } - } - - private int? _indicatorGroupDescriptorId; - private string _indicatorGroupDescriptor; - - public virtual string IndicatorGroupDescriptor - { - get - { - if (_indicatorGroupDescriptor == null) - _indicatorGroupDescriptor = _indicatorGroupDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorGroupDescriptor", _indicatorGroupDescriptorId.Value); - - return _indicatorGroupDescriptor; - } - set - { - _indicatorGroupDescriptor = value; - _indicatorGroupDescriptorId = default(int?); - } - } - public virtual int? IndicatorLevelDescriptorId - { - get - { - if (_indicatorLevelDescriptorId == default(int?)) - _indicatorLevelDescriptorId = string.IsNullOrWhiteSpace(_indicatorLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorLevelDescriptor", _indicatorLevelDescriptor); - - return _indicatorLevelDescriptorId; - } - set - { - _indicatorLevelDescriptorId = value; - _indicatorLevelDescriptor = null; - } - } - - private int? _indicatorLevelDescriptorId; - private string _indicatorLevelDescriptor; - - public virtual string IndicatorLevelDescriptor - { - get - { - if (_indicatorLevelDescriptor == null) - _indicatorLevelDescriptor = _indicatorLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorLevelDescriptor", _indicatorLevelDescriptorId.Value); - - return _indicatorLevelDescriptor; - } - set - { - _indicatorLevelDescriptor = value; - _indicatorLevelDescriptorId = default(int?); - } - } - public virtual string IndicatorValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41208,61 +40893,11 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _educationOrganizationIndicatorPeriods; - private ICollection _educationOrganizationIndicatorPeriodsCovariant; - public virtual ICollection EducationOrganizationIndicatorPeriods - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIndicatorPeriods) - if (item.EducationOrganizationIndicator == null) - item.EducationOrganizationIndicator = this; - // ------------------------------------------------------------- - - return _educationOrganizationIndicatorPeriods; - } - set - { - _educationOrganizationIndicatorPeriods = value; - _educationOrganizationIndicatorPeriodsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganizationIndicator.EducationOrganizationIndicatorPeriods - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIndicatorPeriods) - if (item.EducationOrganizationIndicator == null) - item.EducationOrganizationIndicator = this; - // ------------------------------------------------------------- - - return _educationOrganizationIndicatorPeriodsCovariant; - } - set - { - EducationOrganizationIndicatorPeriods = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, - { "IndicatorGroupDescriptor", new LookupColumnDetails { PropertyName = "IndicatorGroupDescriptorId", LookupTypeName = "IndicatorGroupDescriptor"} }, - { "IndicatorLevelDescriptor", new LookupColumnDetails { PropertyName = "IndicatorLevelDescriptorId", LookupTypeName = "IndicatorLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -41274,10 +40909,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IndicatorDescriptorId", IndicatorDescriptorId); + keyValues.Add("DerivativeSourceLearningResourceMetadataURI", DerivativeSourceLearningResourceMetadataURI); return keyValues; } @@ -41341,36 +40976,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicator)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicator) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationIndicatorPeriod table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentDerivativeSourceURI table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicatorPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationContentDerivativeSourceURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentDerivativeSourceURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationIndicatorPeriod() + public EducationContentDerivativeSourceURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -41379,24 +41014,16 @@ public EducationOrganizationIndicatorPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationOrganizationIndicator EducationOrganizationIndicator { get; set; } + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganizationIndicator IEducationOrganizationIndicatorPeriod.EducationOrganizationIndicator + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.EducationContent { - get { return EducationOrganizationIndicator; } - set { EducationOrganizationIndicator = (EducationOrganizationIndicator) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual DateTime BeginDate - { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _beginDate; - + public virtual string DerivativeSourceURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41407,25 +41034,6 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - // ------------------------------------------------------------- // ============================================================= @@ -41480,7 +41088,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -41492,10 +41099,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganizationIndicator as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("BeginDate", BeginDate); + keyValues.Add("DerivativeSourceURI", DerivativeSourceURI); return keyValues; } @@ -41559,36 +41166,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganizationIndicator = (EducationOrganizationIndicator) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationInstitutionTelephone table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentLanguage table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationInstitutionTelephone : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationContentLanguage : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationInstitutionTelephone() + public EducationContentLanguage() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -41597,47 +41204,47 @@ public EducationOrganizationInstitutionTelephone() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInstitutionTelephone.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentLanguage.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int InstitutionTelephoneNumberTypeDescriptorId + public virtual int LanguageDescriptorId { get { - if (_institutionTelephoneNumberTypeDescriptorId == default(int)) - _institutionTelephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptor); + if (_languageDescriptorId == default(int)) + _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); - return _institutionTelephoneNumberTypeDescriptorId; + return _languageDescriptorId; } set { - _institutionTelephoneNumberTypeDescriptorId = value; - _institutionTelephoneNumberTypeDescriptor = null; + _languageDescriptorId = value; + _languageDescriptor = null; } } - private int _institutionTelephoneNumberTypeDescriptorId; - private string _institutionTelephoneNumberTypeDescriptor; + private int _languageDescriptorId; + private string _languageDescriptor; - public virtual string InstitutionTelephoneNumberTypeDescriptor + public virtual string LanguageDescriptor { get { - if (_institutionTelephoneNumberTypeDescriptor == null) - _institutionTelephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptorId); + if (_languageDescriptor == null) + _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); - return _institutionTelephoneNumberTypeDescriptor; + return _languageDescriptor; } set { - _institutionTelephoneNumberTypeDescriptor = value; - _institutionTelephoneNumberTypeDescriptorId = default(int); + _languageDescriptor = value; + _languageDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -41650,7 +41257,6 @@ public virtual string InstitutionTelephoneNumberTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string TelephoneNumber { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41705,7 +41311,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "InstitutionTelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "InstitutionTelephoneNumberTypeDescriptorId", LookupTypeName = "InstitutionTelephoneNumberTypeDescriptor"} }, + { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -41717,10 +41323,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("InstitutionTelephoneNumberTypeDescriptorId", InstitutionTelephoneNumberTypeDescriptorId); + keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); return keyValues; } @@ -41784,36 +41390,121 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentLanguage)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentLanguage) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; + } + } +} +// Aggregate: EducationOrganization + +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class EducationOrganizationReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationInternationalAddress table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganization table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationInternationalAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public abstract class EducationOrganization : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEducationOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationInternationalAddress() + public EducationOrganization() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + EducationOrganizationAddresses = new HashSet(); + EducationOrganizationCategories = new HashSet(); + EducationOrganizationIdentificationCodes = new HashSet(); + EducationOrganizationIndicators = new HashSet(); + EducationOrganizationInstitutionTelephones = new HashSet(); + EducationOrganizationInternationalAddresses = new HashSet(); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -41821,194 +41512,362 @@ public EducationOrganizationInternationalAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + public virtual long EducationOrganizationId { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInternationalAddress.EducationOrganization - { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - [DomainSignature] - public virtual int AddressTypeDescriptorId + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string NameOfInstitution { get; set; } + public virtual int? OperationalStatusDescriptorId { get { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + if (_operationalStatusDescriptorId == default(int?)) + _operationalStatusDescriptorId = string.IsNullOrWhiteSpace(_operationalStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OperationalStatusDescriptor", _operationalStatusDescriptor); - return _addressTypeDescriptorId; + return _operationalStatusDescriptorId; } set { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; + _operationalStatusDescriptorId = value; + _operationalStatusDescriptor = null; } } - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; + private int? _operationalStatusDescriptorId; + private string _operationalStatusDescriptor; - public virtual string AddressTypeDescriptor + public virtual string OperationalStatusDescriptor { get { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + if (_operationalStatusDescriptor == null) + _operationalStatusDescriptor = _operationalStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OperationalStatusDescriptor", _operationalStatusDescriptorId.Value); - return _addressTypeDescriptor; + return _operationalStatusDescriptor; } set { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); + _operationalStatusDescriptor = value; + _operationalStatusDescriptorId = default(int?); } } + public virtual string ShortNameOfInstitution { get; set; } + public virtual string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= - // Inherited Properties + // One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Properties + // Extensions // ------------------------------------------------------------- - public virtual string AddressLine1 { get; set; } - public virtual string AddressLine2 { get; set; } - public virtual string AddressLine3 { get; set; } - public virtual string AddressLine4 { get; set; } - public virtual DateTime? BeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; + public virtual ICollection EducationOrganizationAddresses { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationAddresses; + } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); } } - private DateTime? _beginDate; - - public virtual int CountryDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses { get { - if (_countryDescriptorId == default(int)) - _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - return _countryDescriptorId; - } + return _educationOrganizationAddressesCovariant; + } set { - _countryDescriptorId = value; - _countryDescriptor = null; + EducationOrganizationAddresses = new HashSet(value.Cast()); } } - private int _countryDescriptorId; - private string _countryDescriptor; - public virtual string CountryDescriptor + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + public virtual ICollection EducationOrganizationCategories { get { - if (_countryDescriptor == null) - _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); - - return _countryDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationCategories) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationCategories; } set { - _countryDescriptor = value; - _countryDescriptorId = default(int); + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); } } - public virtual DateTime? EndDate + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationCategories) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationCategoriesCovariant; + } + set + { + EducationOrganizationCategories = new HashSet(value.Cast()); } } - private DateTime? _endDate; - - public virtual string Latitude { get; set; } - public virtual string Longitude { get; set; } - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + public virtual ICollection EducationOrganizationIdentificationCodes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIdentificationCodes) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; + return _educationOrganizationIdentificationCodes; + } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } - public IDictionary Extensions + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes { - get => _extensions; + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIdentificationCodes) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationIdentificationCodesCovariant; + } set { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } + EducationOrganizationIdentificationCodes = new HashSet(value.Cast()); + } + } - _extensions = value; + + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + public virtual ICollection EducationOrganizationIndicators + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIndicators) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationIndicators; + } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIndicators) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _educationOrganizationIndicatorsCovariant; + } + set + { + EducationOrganizationIndicators = new HashSet(value.Cast()); + } + } + + + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + public virtual ICollection EducationOrganizationInstitutionTelephones + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationInstitutionTelephones) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationInstitutionTelephones; + } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationInstitutionTelephones) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationInstitutionTelephonesCovariant; + } + set + { + EducationOrganizationInstitutionTelephones = new HashSet(value.Cast()); + } + } + + + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + public virtual ICollection EducationOrganizationInternationalAddresses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationInternationalAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationInternationalAddresses; + } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationInternationalAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationInternationalAddressesCovariant; + } + set + { + EducationOrganizationInternationalAddresses = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -42019,11 +41878,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -42085,88 +41944,169 @@ public override int GetHashCode() return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress) target, null); - } - - void IChildEntity.SetParent(object value) - { - EducationOrganization = (EducationOrganization) value; - } } -} -// Aggregate: EducationOrganizationAssociationTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationAssociationTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationAssociationTypeDescriptor table of the EducationOrganizationAssociationTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationAddress table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationAssociationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int EducationOrganizationAssociationTypeDescriptorId + public EducationOrganizationAddress() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + EducationOrganizationAddressPeriods = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description + [DomainSignature, JsonIgnore] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationAddress.EducationOrganization { - get { return Description; } - set { Description = value; } + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } } - DateTime? IDescriptor.EffectiveBeginDate + + [DomainSignature] + public virtual int AddressTypeDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + + return _addressTypeDescriptorId; + } + set + { + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; + + public virtual string AddressTypeDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + + return _addressTypeDescriptor; + } + set + { + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); + } } - string IDescriptor.Namespace + [DomainSignature] + public virtual string City { get; set; } + [DomainSignature] + public virtual string PostalCode { get; set; } + [DomainSignature] + public virtual int StateAbbreviationDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_stateAbbreviationDescriptorId == default(int)) + _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); + + return _stateAbbreviationDescriptorId; + } + set + { + _stateAbbreviationDescriptorId = value; + _stateAbbreviationDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _stateAbbreviationDescriptorId; + private string _stateAbbreviationDescriptor; + + public virtual string StateAbbreviationDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_stateAbbreviationDescriptor == null) + _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); + + return _stateAbbreviationDescriptor; + } + set + { + _stateAbbreviationDescriptor = value; + _stateAbbreviationDescriptorId = default(int); + } } + [DomainSignature] + public virtual string StreetNumberName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string ApartmentRoomSuiteNumber { get; set; } + public virtual string BuildingSiteNumber { get; set; } + public virtual string CongressionalDistrict { get; set; } + public virtual string CountyFIPSCode { get; set; } + public virtual bool? DoNotPublishIndicator { get; set; } + public virtual string Latitude { get; set; } + public virtual int? LocaleDescriptorId + { + get + { + if (_localeDescriptorId == default(int?)) + _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); + + return _localeDescriptorId; + } + set + { + _localeDescriptorId = value; + _localeDescriptor = null; + } + } + + private int? _localeDescriptorId; + private string _localeDescriptor; + + public virtual string LocaleDescriptor + { + get + { + if (_localeDescriptor == null) + _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); + + return _localeDescriptor; + } + set + { + _localeDescriptor = value; + _localeDescriptorId = default(int?); + } + } + public virtual string Longitude { get; set; } + public virtual string NameOfCounty { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42177,6 +42117,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42187,11 +42156,61 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _educationOrganizationAddressPeriods; + private ICollection _educationOrganizationAddressPeriodsCovariant; + public virtual ICollection EducationOrganizationAddressPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationAddressPeriods) + if (item.EducationOrganizationAddress == null) + item.EducationOrganizationAddress = this; + // ------------------------------------------------------------- + + return _educationOrganizationAddressPeriods; + } + set + { + _educationOrganizationAddressPeriods = value; + _educationOrganizationAddressPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganizationAddress.EducationOrganizationAddressPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationAddressPeriods) + if (item.EducationOrganizationAddress == null) + item.EducationOrganizationAddress = this; + // ------------------------------------------------------------- + + return _educationOrganizationAddressPeriodsCovariant; + } + set + { + EducationOrganizationAddressPeriods = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -42202,11 +42221,15 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationAssociationTypeDescriptorId", EducationOrganizationAssociationTypeDescriptorId); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("City", City); + keyValues.Add("PostalCode", PostalCode); + keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); + keyValues.Add("StreetNumberName", StreetNumberName); return keyValues; } @@ -42270,82 +42293,91 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddress) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: EducationOrganizationCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationCategoryDescriptor table of the EducationOrganizationCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationAddressPeriod table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationAddressPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationAddressPeriod() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual EducationOrganizationAddress EducationOrganizationAddress { get; set; } + + Entities.Common.EdFi.IEducationOrganizationAddress IEducationOrganizationAddressPeriod.EducationOrganizationAddress + { + get { return EducationOrganizationAddress; } + set { EducationOrganizationAddress = (EducationOrganizationAddress) value; } + } + [DomainSignature] - public virtual int EducationOrganizationCategoryDescriptorId + public virtual DateTime BeginDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _beginDate; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -42356,6 +42388,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42371,6 +42432,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -42381,11 +42444,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganizationAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationCategoryDescriptorId", EducationOrganizationCategoryDescriptorId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -42449,79 +42512,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganizationAddress = (EducationOrganizationAddress) value; + } } -} -// Aggregate: EducationOrganizationIdentificationSystemDescriptor - -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationIdentificationSystemDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationIdentificationSystemDescriptor table of the EducationOrganizationIdentificationSystemDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationCategory table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationCategory : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int EducationOrganizationIdentificationSystemDescriptorId + public EducationOrganizationCategory() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue + [DomainSignature, JsonIgnore] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationCategory.EducationOrganization { - get { return CodeValue; } - set { CodeValue = value; } + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } } - string IDescriptor.Description + + [DomainSignature] + public virtual int EducationOrganizationCategoryDescriptorId { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_educationOrganizationCategoryDescriptorId == default(int)) + _educationOrganizationCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptor); + + return _educationOrganizationCategoryDescriptorId; + } + set + { + _educationOrganizationCategoryDescriptorId = value; + _educationOrganizationCategoryDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _educationOrganizationCategoryDescriptorId; + private string _educationOrganizationCategoryDescriptor; + + public virtual string EducationOrganizationCategoryDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_educationOrganizationCategoryDescriptor == null) + _educationOrganizationCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptorId); + + return _educationOrganizationCategoryDescriptor; + } + set + { + _educationOrganizationCategoryDescriptor = value; + _educationOrganizationCategoryDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -42535,6 +42613,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42550,6 +42657,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "EducationOrganizationCategoryDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationCategoryDescriptorId", LookupTypeName = "EducationOrganizationCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -42560,11 +42668,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationIdentificationSystemDescriptorId", EducationOrganizationIdentificationSystemDescriptorId); + keyValues.Add("EducationOrganizationCategoryDescriptorId", EducationOrganizationCategoryDescriptorId); return keyValues; } @@ -42628,117 +42736,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationCategory)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor) target, null); - } - - } -} -// Aggregate: EducationOrganizationInterventionPrescriptionAssociation - -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationInterventionPrescriptionAssociationAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class EducationOrganizationInterventionPrescriptionAssociationReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } - public virtual string InterventionPrescriptionIdentificationCode { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("InterventionPrescriptionEducationOrganizationId", InterventionPrescriptionEducationOrganizationId); - keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.IEducationOrganizationCategory) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + EducationOrganization = (EducationOrganization) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationInterventionPrescriptionAssociation table of the EducationOrganizationInterventionPrescriptionAssociation aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationIdentificationCode table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationInterventionPrescriptionAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationOrganizationIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationInterventionPrescriptionAssociation() + public EducationOrganizationIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -42746,12 +42773,50 @@ public EducationOrganizationInterventionPrescriptionAssociation() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIdentificationCode.EducationOrganization + { + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } + } + [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string InterventionPrescriptionIdentificationCode { get; set; } + public virtual int EducationOrganizationIdentificationSystemDescriptorId + { + get + { + if (_educationOrganizationIdentificationSystemDescriptorId == default(int)) + _educationOrganizationIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptor); + + return _educationOrganizationIdentificationSystemDescriptorId; + } + set + { + _educationOrganizationIdentificationSystemDescriptorId = value; + _educationOrganizationIdentificationSystemDescriptor = null; + } + } + + private int _educationOrganizationIdentificationSystemDescriptorId; + private string _educationOrganizationIdentificationSystemDescriptor; + + public virtual string EducationOrganizationIdentificationSystemDescriptor + { + get + { + if (_educationOrganizationIdentificationSystemDescriptor == null) + _educationOrganizationIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptorId); + + return _educationOrganizationIdentificationSystemDescriptor; + } + set + { + _educationOrganizationIdentificationSystemDescriptor = value; + _educationOrganizationIdentificationSystemDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -42762,44 +42827,7 @@ public EducationOrganizationInterventionPrescriptionAssociation() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? BeginDate - { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _beginDate; - - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42844,46 +42872,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } - - /// - /// Read-only property that allows the InterventionPrescription discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionDiscriminator - { - get { return InterventionPrescriptionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the InterventionPrescription resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionResourceId - { - get { return InterventionPrescriptionReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -42894,6 +42882,7 @@ string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssoci // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "EducationOrganizationIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationIdentificationSystemDescriptorId", LookupTypeName = "EducationOrganizationIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -42904,13 +42893,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("InterventionPrescriptionEducationOrganizationId", InterventionPrescriptionEducationOrganizationId); - keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); + keyValues.Add("EducationOrganizationIdentificationSystemDescriptorId", EducationOrganizationIdentificationSystemDescriptorId); return keyValues; } @@ -42974,35 +42961,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: EducationOrganizationNetwork - -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationNetworkAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationNetwork table of the EducationOrganizationNetwork aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationIndicator table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationNetwork : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.IEducationOrganizationNetwork, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationOrganizationIndicator : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationIndicator, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public EducationOrganizationNetwork() + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationIndicator() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + EducationOrganizationIndicatorPeriods = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -43010,77 +42999,130 @@ public EducationOrganizationNetwork() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIndicator.EducationOrganization + { + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } + } + [DomainSignature] - public virtual long EducationOrganizationNetworkId + public virtual int IndicatorDescriptorId { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } + get + { + if (_indicatorDescriptorId == default(int)) + _indicatorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorDescriptor", _indicatorDescriptor); + + return _indicatorDescriptorId; + } + set + { + _indicatorDescriptorId = value; + _indicatorDescriptor = null; + } + } + + private int _indicatorDescriptorId; + private string _indicatorDescriptor; + + public virtual string IndicatorDescriptor + { + get + { + if (_indicatorDescriptor == null) + _indicatorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorDescriptor", _indicatorDescriptorId); + + return _indicatorDescriptor; + } + set + { + _indicatorDescriptor = value; + _indicatorDescriptorId = default(int); + } } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor - { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } - } - string IEducationOrganization.ShortNameOfInstitution - { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } - } - string IEducationOrganization.WebSite - { - get { return WebSite; } - set { WebSite = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int NetworkPurposeDescriptorId + public virtual string DesignatedBy { get; set; } + public virtual int? IndicatorGroupDescriptorId { get { - if (_networkPurposeDescriptorId == default(int)) - _networkPurposeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("NetworkPurposeDescriptor", _networkPurposeDescriptor); + if (_indicatorGroupDescriptorId == default(int?)) + _indicatorGroupDescriptorId = string.IsNullOrWhiteSpace(_indicatorGroupDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorGroupDescriptor", _indicatorGroupDescriptor); - return _networkPurposeDescriptorId; + return _indicatorGroupDescriptorId; } set { - _networkPurposeDescriptorId = value; - _networkPurposeDescriptor = null; + _indicatorGroupDescriptorId = value; + _indicatorGroupDescriptor = null; } } - private int _networkPurposeDescriptorId; - private string _networkPurposeDescriptor; + private int? _indicatorGroupDescriptorId; + private string _indicatorGroupDescriptor; - public virtual string NetworkPurposeDescriptor + public virtual string IndicatorGroupDescriptor { get { - if (_networkPurposeDescriptor == null) - _networkPurposeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("NetworkPurposeDescriptor", _networkPurposeDescriptorId); + if (_indicatorGroupDescriptor == null) + _indicatorGroupDescriptor = _indicatorGroupDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorGroupDescriptor", _indicatorGroupDescriptorId.Value); - return _networkPurposeDescriptor; + return _indicatorGroupDescriptor; } set { - _networkPurposeDescriptor = value; - _networkPurposeDescriptorId = default(int); + _indicatorGroupDescriptor = value; + _indicatorGroupDescriptorId = default(int?); } } + public virtual int? IndicatorLevelDescriptorId + { + get + { + if (_indicatorLevelDescriptorId == default(int?)) + _indicatorLevelDescriptorId = string.IsNullOrWhiteSpace(_indicatorLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorLevelDescriptor", _indicatorLevelDescriptor); + + return _indicatorLevelDescriptorId; + } + set + { + _indicatorLevelDescriptorId = value; + _indicatorLevelDescriptor = null; + } + } + + private int? _indicatorLevelDescriptorId; + private string _indicatorLevelDescriptor; + + public virtual string IndicatorLevelDescriptor + { + get + { + if (_indicatorLevelDescriptor == null) + _indicatorLevelDescriptor = _indicatorLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorLevelDescriptor", _indicatorLevelDescriptorId.Value); + + return _indicatorLevelDescriptor; + } + set + { + _indicatorLevelDescriptor = value; + _indicatorLevelDescriptorId = default(int?); + } + } + public virtual string IndicatorValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43130,13 +43172,61 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _educationOrganizationIndicatorPeriods; + private ICollection _educationOrganizationIndicatorPeriodsCovariant; + public virtual ICollection EducationOrganizationIndicatorPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIndicatorPeriods) + if (item.EducationOrganizationIndicator == null) + item.EducationOrganizationIndicator = this; + // ------------------------------------------------------------- + + return _educationOrganizationIndicatorPeriods; + } + set + { + _educationOrganizationIndicatorPeriods = value; + _educationOrganizationIndicatorPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganizationIndicator.EducationOrganizationIndicatorPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIndicatorPeriods) + if (item.EducationOrganizationIndicator == null) + item.EducationOrganizationIndicator = this; + // ------------------------------------------------------------- + + return _educationOrganizationIndicatorPeriodsCovariant; + } + set + { + EducationOrganizationIndicatorPeriods = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "NetworkPurposeDescriptor", new LookupColumnDetails { PropertyName = "NetworkPurposeDescriptorId", LookupTypeName = "NetworkPurposeDescriptor"} }, - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, + { "IndicatorGroupDescriptor", new LookupColumnDetails { PropertyName = "IndicatorGroupDescriptorId", LookupTypeName = "IndicatorGroupDescriptor"} }, + { "IndicatorLevelDescriptor", new LookupColumnDetails { PropertyName = "IndicatorLevelDescriptorId", LookupTypeName = "IndicatorLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -43147,11 +43237,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationNetworkId", EducationOrganizationNetworkId); + keyValues.Add("IndicatorDescriptorId", IndicatorDescriptorId); return keyValues; } @@ -43215,115 +43305,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationNetwork)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicator)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationNetwork) target, null); - } - - } -} -// Aggregate: EducationOrganizationNetworkAssociation - -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationNetworkAssociationAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class EducationOrganizationNetworkAssociationReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long EducationOrganizationNetworkId { get; set; } - public virtual long MemberEducationOrganizationId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationOrganizationNetworkId", EducationOrganizationNetworkId); - keyValues.Add("MemberEducationOrganizationId", MemberEducationOrganizationId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicator) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + EducationOrganization = (EducationOrganization) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationNetworkAssociation table of the EducationOrganizationNetworkAssociation aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationIndicatorPeriod table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationNetworkAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEducationOrganizationNetworkAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationOrganizationIndicatorPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationNetworkAssociation() + public EducationOrganizationIndicatorPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -43331,10 +43342,25 @@ public EducationOrganizationNetworkAssociation() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual EducationOrganizationIndicator EducationOrganizationIndicator { get; set; } + + Entities.Common.EdFi.IEducationOrganizationIndicator IEducationOrganizationIndicatorPeriod.EducationOrganizationIndicator + { + get { return EducationOrganizationIndicator; } + set { EducationOrganizationIndicator = (EducationOrganizationIndicator) value; } + } + [DomainSignature] - public virtual long EducationOrganizationNetworkId { get; set; } - [DomainSignature] - public virtual long MemberEducationOrganizationId { get; set; } + public virtual DateTime BeginDate + { + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _beginDate; + // ------------------------------------------------------------- // ============================================================= @@ -43345,25 +43371,6 @@ public EducationOrganizationNetworkAssociation() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? BeginDate - { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _beginDate; - public virtual DateTime? EndDate { get { return _endDate; } @@ -43427,37 +43434,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationNetworkReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganizationNetwork resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.EducationOrganizationNetworkResourceId - { - get { return EducationOrganizationNetworkReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MemberEducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the MemberEducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationDiscriminator - { - get { return MemberEducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the MemberEducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationResourceId - { - get { return MemberEducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -43468,6 +43444,7 @@ string Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEduca // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -43478,12 +43455,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganizationIndicator as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationNetworkId", EducationOrganizationNetworkId); - keyValues.Add("MemberEducationOrganizationId", MemberEducationOrganizationId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -43547,115 +43523,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationNetworkAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationNetworkAssociation) target, null); - } - - } -} -// Aggregate: EducationOrganizationPeerAssociation - -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationPeerAssociationAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class EducationOrganizationPeerAssociationReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual long PeerEducationOrganizationId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("PeerEducationOrganizationId", PeerEducationOrganizationId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + EducationOrganizationIndicator = (EducationOrganizationIndicator) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationPeerAssociation table of the EducationOrganizationPeerAssociation aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationInstitutionTelephone table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationPeerAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEducationOrganizationPeerAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationOrganizationInstitutionTelephone : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationPeerAssociation() + public EducationOrganizationInstitutionTelephone() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -43663,10 +43560,50 @@ public EducationOrganizationPeerAssociation() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInstitutionTelephone.EducationOrganization + { + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } + } + [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual long PeerEducationOrganizationId { get; set; } + public virtual int InstitutionTelephoneNumberTypeDescriptorId + { + get + { + if (_institutionTelephoneNumberTypeDescriptorId == default(int)) + _institutionTelephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptor); + + return _institutionTelephoneNumberTypeDescriptorId; + } + set + { + _institutionTelephoneNumberTypeDescriptorId = value; + _institutionTelephoneNumberTypeDescriptor = null; + } + } + + private int _institutionTelephoneNumberTypeDescriptorId; + private string _institutionTelephoneNumberTypeDescriptor; + + public virtual string InstitutionTelephoneNumberTypeDescriptor + { + get + { + if (_institutionTelephoneNumberTypeDescriptor == null) + _institutionTelephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptorId); + + return _institutionTelephoneNumberTypeDescriptor; + } + set + { + _institutionTelephoneNumberTypeDescriptor = value; + _institutionTelephoneNumberTypeDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -43677,6 +43614,7 @@ public EducationOrganizationPeerAssociation() // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string TelephoneNumber { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43721,46 +43659,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData PeerEducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the PeerEducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationDiscriminator - { - get { return PeerEducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the PeerEducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationResourceId - { - get { return PeerEducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -43771,6 +43669,7 @@ string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationO // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "InstitutionTelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "InstitutionTelephoneNumberTypeDescriptorId", LookupTypeName = "InstitutionTelephoneNumberTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -43781,12 +43680,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("PeerEducationOrganizationId", PeerEducationOrganizationId); + keyValues.Add("InstitutionTelephoneNumberTypeDescriptorId", InstitutionTelephoneNumberTypeDescriptorId); return keyValues; } @@ -43850,259 +43748,175 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationPeerAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationPeerAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: EducationPlanDescriptor - -namespace EdFi.Ods.Entities.NHibernate.EducationPlanDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationPlanDescriptor table of the EducationPlanDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationInternationalAddress table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationPlanDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEducationPlanDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationInternationalAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int EducationPlanDescriptorId + public EducationOrganizationInternationalAddress() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInternationalAddress.EducationOrganization { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AddressTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + + return _addressTypeDescriptorId; + } + set + { + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; + + public virtual string AddressTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + + return _addressTypeDescriptor; + } + set + { + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Extensions - // ------------------------------------------------------------- + // Properties // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationPlanDescriptorId", EducationPlanDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + public virtual string AddressLine1 { get; set; } + public virtual string AddressLine2 { get; set; } + public virtual string AddressLine3 { get; set; } + public virtual string AddressLine4 { get; set; } + public virtual DateTime? BeginDate { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + _beginDate = null; + } else { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); } } - - return true; } - public override int GetHashCode() + private DateTime? _beginDate; + + public virtual int CountryDescriptorId { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + get + { + if (_countryDescriptorId == default(int)) + _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); - foreach (DictionaryEntry entry in keyValues) + return _countryDescriptorId; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + _countryDescriptorId = value; + _countryDescriptor = null; } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationPlanDescriptor)target); } - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IEducationPlanDescriptor) target, null); - } - - } -} -// Aggregate: EducationServiceCenter - -namespace EdFi.Ods.Entities.NHibernate.EducationServiceCenterAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.EducationServiceCenter table of the EducationServiceCenter aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class EducationServiceCenter : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.IEducationServiceCenter, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public EducationServiceCenter() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual long EducationServiceCenterId - { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } - } - - // ------------------------------------------------------------- + private int _countryDescriptorId; + private string _countryDescriptor; - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor - { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } - } - string IEducationOrganization.ShortNameOfInstitution + public virtual string CountryDescriptor { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } + get + { + if (_countryDescriptor == null) + _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); + + return _countryDescriptor; + } + set + { + _countryDescriptor = value; + _countryDescriptorId = default(int); + } } - string IEducationOrganization.WebSite + public virtual DateTime? EndDate { - get { return WebSite; } - set { WebSite = value; } + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual long? StateEducationAgencyId { get; set; } + private DateTime? _endDate; + + public virtual string Latitude { get; set; } + public virtual string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -44147,17 +43961,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData StateEducationAgencyReferenceData { get; set; } - - /// - /// Read-only property that allows the StateEducationAgency resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationServiceCenter.StateEducationAgencyResourceId - { - get { return StateEducationAgencyReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -44168,7 +43971,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -44179,11 +43983,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationServiceCenterId", EducationServiceCenterId); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); return keyValues; } @@ -44247,37 +44051,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationServiceCenter)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationServiceCenter) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } } -// Aggregate: ElectronicMailTypeDescriptor +// Aggregate: EducationOrganizationAssociationTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.ElectronicMailTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationAssociationTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ElectronicMailTypeDescriptor table of the ElectronicMailTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationAssociationTypeDescriptor table of the EducationOrganizationAssociationTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ElectronicMailTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IElectronicMailTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationAssociationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ElectronicMailTypeDescriptorId + public virtual int EducationOrganizationAssociationTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -44362,7 +44170,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ElectronicMailTypeDescriptorId", ElectronicMailTypeDescriptorId); + keyValues.Add("EducationOrganizationAssociationTypeDescriptorId", EducationOrganizationAssociationTypeDescriptorId); return keyValues; } @@ -44426,37 +44234,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IElectronicMailTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IElectronicMailTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor) target, null); } } } -// Aggregate: EligibilityDelayReasonDescriptor +// Aggregate: EducationOrganizationCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.EligibilityDelayReasonDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EligibilityDelayReasonDescriptor table of the EligibilityDelayReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationCategoryDescriptor table of the EducationOrganizationCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EligibilityDelayReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEligibilityDelayReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EligibilityDelayReasonDescriptorId + public virtual int EducationOrganizationCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -44541,7 +44349,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EligibilityDelayReasonDescriptorId", EligibilityDelayReasonDescriptorId); + keyValues.Add("EducationOrganizationCategoryDescriptorId", EducationOrganizationCategoryDescriptorId); return keyValues; } @@ -44605,37 +44413,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEligibilityDelayReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEligibilityDelayReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor) target, null); } } } -// Aggregate: EligibilityEvaluationTypeDescriptor +// Aggregate: EducationOrganizationIdentificationSystemDescriptor -namespace EdFi.Ods.Entities.NHibernate.EligibilityEvaluationTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationIdentificationSystemDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EligibilityEvaluationTypeDescriptor table of the EligibilityEvaluationTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationIdentificationSystemDescriptor table of the EducationOrganizationIdentificationSystemDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EligibilityEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EligibilityEvaluationTypeDescriptorId + public virtual int EducationOrganizationIdentificationSystemDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -44720,7 +44528,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EligibilityEvaluationTypeDescriptorId", EligibilityEvaluationTypeDescriptorId); + keyValues.Add("EducationOrganizationIdentificationSystemDescriptorId", EducationOrganizationIdentificationSystemDescriptorId); return keyValues; } @@ -44784,113 +44592,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor) target, null); } } } -// Aggregate: EmploymentStatusDescriptor +// Aggregate: EducationOrganizationInterventionPrescriptionAssociation -namespace EdFi.Ods.Entities.NHibernate.EmploymentStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationInterventionPrescriptionAssociationAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.EmploymentStatusDescriptor table of the EmploymentStatusDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class EmploymentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEmploymentStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationInterventionPrescriptionAssociationReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int EmploymentStatusDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } + public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -44899,7 +44637,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EmploymentStatusDescriptorId", EmploymentStatusDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("InterventionPrescriptionEducationOrganizationId", InterventionPrescriptionEducationOrganizationId); + keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); return keyValues; } @@ -44920,18 +44660,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -44948,97 +44678,92 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IEmploymentStatusDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IEmploymentStatusDescriptor) target, null); - } - } -} -// Aggregate: EnrollmentTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.EnrollmentTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EnrollmentTypeDescriptor table of the EnrollmentTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationInterventionPrescriptionAssociation table of the EducationOrganizationInterventionPrescriptionAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EnrollmentTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEnrollmentTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationInterventionPrescriptionAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationInterventionPrescriptionAssociation() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EnrollmentTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual DateTime? BeginDate + { + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _beginDate; + + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -45049,11 +44774,80 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } + + /// + /// Read-only property that allows the InterventionPrescription discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionDiscriminator + { + get { return InterventionPrescriptionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the InterventionPrescription resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionResourceId + { + get { return InterventionPrescriptionReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -45078,7 +44872,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EnrollmentTypeDescriptorId", EnrollmentTypeDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("InterventionPrescriptionEducationOrganizationId", InterventionPrescriptionEducationOrganizationId); + keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); return keyValues; } @@ -45142,40 +44938,47 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEnrollmentTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEnrollmentTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation) target, null); } } } -// Aggregate: EntryGradeLevelReasonDescriptor +// Aggregate: EducationOrganizationNetwork -namespace EdFi.Ods.Entities.NHibernate.EntryGradeLevelReasonDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationNetworkAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EntryGradeLevelReasonDescriptor table of the EntryGradeLevelReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationNetwork table of the EducationOrganizationNetwork aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EntryGradeLevelReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationNetwork : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.IEducationOrganizationNetwork, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public EducationOrganizationNetwork() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EntryGradeLevelReasonDescriptorId + public virtual long EducationOrganizationNetworkId { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } } // ------------------------------------------------------------- @@ -45183,41 +44986,65 @@ public virtual int EntryGradeLevelReasonDescriptorId // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + string IEducationOrganization.NameOfInstitution { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } } - DateTime? IDescriptor.EffectiveEndDate + string IEducationOrganization.OperationalStatusDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } } - string IDescriptor.Namespace + string IEducationOrganization.ShortNameOfInstitution { - get { return Namespace; } - set { Namespace = value; } + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } } - string IDescriptor.ShortDescription + string IEducationOrganization.WebSite { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return WebSite; } + set { WebSite = value; } } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual int NetworkPurposeDescriptorId + { + get + { + if (_networkPurposeDescriptorId == default(int)) + _networkPurposeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("NetworkPurposeDescriptor", _networkPurposeDescriptor); + + return _networkPurposeDescriptorId; + } + set + { + _networkPurposeDescriptorId = value; + _networkPurposeDescriptor = null; + } + } + + private int _networkPurposeDescriptorId; + private string _networkPurposeDescriptor; + + public virtual string NetworkPurposeDescriptor + { + get + { + if (_networkPurposeDescriptor == null) + _networkPurposeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("NetworkPurposeDescriptor", _networkPurposeDescriptorId); + + return _networkPurposeDescriptor; + } + set + { + _networkPurposeDescriptor = value; + _networkPurposeDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -45228,6 +45055,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -45243,6 +45099,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "NetworkPurposeDescriptor", new LookupColumnDetails { PropertyName = "NetworkPurposeDescriptorId", LookupTypeName = "NetworkPurposeDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -45257,7 +45115,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EntryGradeLevelReasonDescriptorId", EntryGradeLevelReasonDescriptorId); + keyValues.Add("EducationOrganizationNetworkId", EducationOrganizationNetworkId); return keyValues; } @@ -45321,113 +45179,42 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationNetwork)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationNetwork) target, null); } } } -// Aggregate: EntryTypeDescriptor +// Aggregate: EducationOrganizationNetworkAssociation -namespace EdFi.Ods.Entities.NHibernate.EntryTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationNetworkAssociationAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.EntryTypeDescriptor table of the EntryTypeDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class EntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEntryTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationNetworkAssociationReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int EntryTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual long EducationOrganizationNetworkId { get; set; } + public virtual long MemberEducationOrganizationId { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -45436,7 +45223,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EntryTypeDescriptorId", EntryTypeDescriptorId); + keyValues.Add("EducationOrganizationNetworkId", EducationOrganizationNetworkId); + keyValues.Add("MemberEducationOrganizationId", MemberEducationOrganizationId); return keyValues; } @@ -45457,18 +45245,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -45485,97 +45263,90 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IEntryTypeDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IEntryTypeDescriptor) target, null); - } - } -} -// Aggregate: EvaluationDelayReasonDescriptor -namespace EdFi.Ods.Entities.NHibernate.EvaluationDelayReasonDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EvaluationDelayReasonDescriptor table of the EvaluationDelayReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationNetworkAssociation table of the EducationOrganizationNetworkAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EvaluationDelayReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEvaluationDelayReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationOrganizationNetworkAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEducationOrganizationNetworkAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationNetworkAssociation() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EvaluationDelayReasonDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual long EducationOrganizationNetworkId { get; set; } + [DomainSignature] + public virtual long MemberEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual DateTime? BeginDate + { + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _beginDate; + + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -45586,11 +45357,71 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationNetworkReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganizationNetwork resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.EducationOrganizationNetworkResourceId + { + get { return EducationOrganizationNetworkReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MemberEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the MemberEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationDiscriminator + { + get { return MemberEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the MemberEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationResourceId + { + get { return MemberEducationOrganizationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -45615,7 +45446,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EvaluationDelayReasonDescriptorId", EvaluationDelayReasonDescriptorId); + keyValues.Add("EducationOrganizationNetworkId", EducationOrganizationNetworkId); + keyValues.Add("MemberEducationOrganizationId", MemberEducationOrganizationId); return keyValues; } @@ -45679,36 +45511,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEvaluationDelayReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationNetworkAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEvaluationDelayReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationNetworkAssociation) target, null); } } } -// Aggregate: EvaluationRubricDimension +// Aggregate: EducationOrganizationPeerAssociation -namespace EdFi.Ods.Entities.NHibernate.EvaluationRubricDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationPeerAssociationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class EvaluationRubricDimensionReferenceData : IHasPrimaryKeyValues + public class EducationOrganizationPeerAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int EvaluationRubricRating { get; set; } - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual string ProgramEvaluationElementTitle { get; set; } - public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } - public virtual string ProgramEvaluationTitle { get; set; } - public virtual int ProgramEvaluationTypeDescriptorId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual long PeerEducationOrganizationId { get; set; } // ------------------------------------------------------------- /// @@ -45729,14 +45555,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EvaluationRubricRating", EvaluationRubricRating); - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("PeerEducationOrganizationId", PeerEducationOrganizationId); return keyValues; } @@ -45787,19 +45607,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EvaluationRubricDimension table of the EvaluationRubricDimension aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationPeerAssociation table of the EducationOrganizationPeerAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EvaluationRubricDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEvaluationRubricDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EducationOrganizationPeerAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEducationOrganizationPeerAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EvaluationRubricDimension() + public EducationOrganizationPeerAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -45808,120 +45628,9 @@ public EvaluationRubricDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EvaluationRubricRating { get; set; } - [DomainSignature] - public virtual long ProgramEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramEvaluationElementTitle { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationPeriodDescriptorId - { - get - { - if (_programEvaluationPeriodDescriptorId == default(int)) - _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); - - return _programEvaluationPeriodDescriptorId; - } - set - { - _programEvaluationPeriodDescriptorId = value; - _programEvaluationPeriodDescriptor = null; - } - } - - private int _programEvaluationPeriodDescriptorId; - private string _programEvaluationPeriodDescriptor; - - public virtual string ProgramEvaluationPeriodDescriptor - { - get - { - if (_programEvaluationPeriodDescriptor == null) - _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); - - return _programEvaluationPeriodDescriptor; - } - set - { - _programEvaluationPeriodDescriptor = value; - _programEvaluationPeriodDescriptorId = default(int); - } - } - [DomainSignature] - public virtual string ProgramEvaluationTitle { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationTypeDescriptorId - { - get - { - if (_programEvaluationTypeDescriptorId == default(int)) - _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); - - return _programEvaluationTypeDescriptorId; - } - set - { - _programEvaluationTypeDescriptorId = value; - _programEvaluationTypeDescriptor = null; - } - } - - private int _programEvaluationTypeDescriptorId; - private string _programEvaluationTypeDescriptor; - - public virtual string ProgramEvaluationTypeDescriptor - { - get - { - if (_programEvaluationTypeDescriptor == null) - _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); - - return _programEvaluationTypeDescriptor; - } - set - { - _programEvaluationTypeDescriptor = value; - _programEvaluationTypeDescriptorId = default(int); - } - } - [DomainSignature] - public virtual string ProgramName { get; set; } + public virtual long EducationOrganizationId { get; set; } [DomainSignature] - public virtual int ProgramTypeDescriptorId - { - get - { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - - return _programTypeDescriptorId; - } - set - { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; - } - } - - private int _programTypeDescriptorId; - private string _programTypeDescriptor; - - public virtual string ProgramTypeDescriptor - { - get - { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - - return _programTypeDescriptor; - } - set - { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); - } - } + public virtual long PeerEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -45932,42 +45641,6 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string EvaluationCriterionDescription { get; set; } - public virtual int? EvaluationRubricRatingLevelDescriptorId - { - get - { - if (_evaluationRubricRatingLevelDescriptorId == default(int?)) - _evaluationRubricRatingLevelDescriptorId = string.IsNullOrWhiteSpace(_evaluationRubricRatingLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _evaluationRubricRatingLevelDescriptor); - - return _evaluationRubricRatingLevelDescriptorId; - } - set - { - _evaluationRubricRatingLevelDescriptorId = value; - _evaluationRubricRatingLevelDescriptor = null; - } - } - - private int? _evaluationRubricRatingLevelDescriptorId; - private string _evaluationRubricRatingLevelDescriptor; - - public virtual string EvaluationRubricRatingLevelDescriptor - { - get - { - if (_evaluationRubricRatingLevelDescriptor == null) - _evaluationRubricRatingLevelDescriptor = _evaluationRubricRatingLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _evaluationRubricRatingLevelDescriptorId.Value); - - return _evaluationRubricRatingLevelDescriptor; - } - set - { - _evaluationRubricRatingLevelDescriptor = value; - _evaluationRubricRatingLevelDescriptorId = default(int?); - } - } - public virtual int? RubricDimensionSortOrder { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46012,23 +45685,43 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramEvaluationElementAggregate.EdFi.ProgramEvaluationElementReferenceData ProgramEvaluationElementReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the ProgramEvaluationElement discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementDiscriminator + string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationDiscriminator { - get { return ProgramEvaluationElementReferenceData?.Discriminator; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ProgramEvaluationElement resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementResourceId + Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationResourceId { - get { return ProgramEvaluationElementReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData PeerEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the PeerEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationDiscriminator + { + get { return PeerEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the PeerEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationResourceId + { + get { return PeerEducationOrganizationReferenceData?.Id; } set { } } @@ -46042,10 +45735,6 @@ string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementD // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EvaluationRubricRatingLevelDescriptor", new LookupColumnDetails { PropertyName = "EvaluationRubricRatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, - { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, - { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -46060,14 +45749,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EvaluationRubricRating", EvaluationRubricRating); - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("PeerEducationOrganizationId", PeerEducationOrganizationId); return keyValues; } @@ -46131,37 +45814,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEvaluationRubricDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationPeerAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEvaluationRubricDimension) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationPeerAssociation) target, null); } } } -// Aggregate: EventCircumstanceDescriptor +// Aggregate: EducationPlanDescriptor -namespace EdFi.Ods.Entities.NHibernate.EventCircumstanceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationPlanDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EventCircumstanceDescriptor table of the EventCircumstanceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationPlanDescriptor table of the EducationPlanDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EventCircumstanceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEventCircumstanceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationPlanDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEducationPlanDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EventCircumstanceDescriptorId + public virtual int EducationPlanDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -46246,7 +45929,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EventCircumstanceDescriptorId", EventCircumstanceDescriptorId); + keyValues.Add("EducationPlanDescriptorId", EducationPlanDescriptorId); return keyValues; } @@ -46310,40 +45993,47 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEventCircumstanceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationPlanDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEventCircumstanceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationPlanDescriptor) target, null); } } } -// Aggregate: ExitWithdrawTypeDescriptor +// Aggregate: EducationServiceCenter -namespace EdFi.Ods.Entities.NHibernate.ExitWithdrawTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationServiceCenterAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ExitWithdrawTypeDescriptor table of the ExitWithdrawTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationServiceCenter table of the EducationServiceCenter aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ExitWithdrawTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IExitWithdrawTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EducationServiceCenter : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.IEducationServiceCenter, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public EducationServiceCenter() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ExitWithdrawTypeDescriptorId + public virtual long EducationServiceCenterId { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } } // ------------------------------------------------------------- @@ -46351,41 +46041,32 @@ public virtual int ExitWithdrawTypeDescriptorId // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + string IEducationOrganization.NameOfInstitution { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } } - DateTime? IDescriptor.EffectiveEndDate + string IEducationOrganization.OperationalStatusDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } } - string IDescriptor.Namespace + string IEducationOrganization.ShortNameOfInstitution { - get { return Namespace; } - set { Namespace = value; } + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } } - string IDescriptor.ShortDescription + string IEducationOrganization.WebSite { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return WebSite; } + set { WebSite = value; } } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual long? StateEducationAgencyId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46396,11 +46077,51 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData StateEducationAgencyReferenceData { get; set; } + + /// + /// Read-only property that allows the StateEducationAgency resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationServiceCenter.StateEducationAgencyResourceId + { + get { return StateEducationAgencyReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -46411,6 +46132,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -46425,7 +46147,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ExitWithdrawTypeDescriptorId", ExitWithdrawTypeDescriptorId); + keyValues.Add("EducationServiceCenterId", EducationServiceCenterId); return keyValues; } @@ -46489,43 +46211,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IExitWithdrawTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationServiceCenter)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IExitWithdrawTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationServiceCenter) target, null); } } } -// Aggregate: FeederSchoolAssociation +// Aggregate: ElectronicMailTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.FeederSchoolAssociationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ElectronicMailTypeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.ElectronicMailTypeDescriptor table of the ElectronicMailTypeDescriptor aggregate in the ODS database. /// - public class FeederSchoolAssociationReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class ElectronicMailTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IElectronicMailTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual DateTime BeginDate { get; set; } - public virtual long FeederSchoolId { get; set; } - public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual int ElectronicMailTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -46534,9 +46326,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("FeederSchoolId", FeederSchoolId); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("ElectronicMailTypeDescriptorId", ElectronicMailTypeDescriptorId); return keyValues; } @@ -46557,8 +46347,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -46575,82 +46375,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IElectronicMailTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IElectronicMailTypeDescriptor) target, null); + } + } +} +// Aggregate: EligibilityDelayReasonDescriptor +namespace EdFi.Ods.Entities.NHibernate.EligibilityDelayReasonDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FeederSchoolAssociation table of the FeederSchoolAssociation aggregate in the ODS database. + /// A class which represents the edfi.EligibilityDelayReasonDescriptor table of the EligibilityDelayReasonDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FeederSchoolAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IFeederSchoolAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EligibilityDelayReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEligibilityDelayReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public FeederSchoolAssociation() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual DateTime BeginDate + public virtual int EligibilityDelayReasonDescriptorId { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - private DateTime _beginDate; - [DomainSignature] - public virtual long FeederSchoolId { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - - public virtual string FeederRelationshipDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46661,62 +46476,11 @@ public virtual DateTime? EndDate // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData FeederSchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the FeederSchool resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolResourceId - { - get { return FeederSchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IFeederSchoolAssociation.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -46741,9 +46505,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("FeederSchoolId", FeederSchoolId); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("EligibilityDelayReasonDescriptorId", EligibilityDelayReasonDescriptorId); return keyValues; } @@ -46807,37 +46569,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFeederSchoolAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEligibilityDelayReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFeederSchoolAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IEligibilityDelayReasonDescriptor) target, null); } } } -// Aggregate: FinancialCollectionDescriptor +// Aggregate: EligibilityEvaluationTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.FinancialCollectionDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EligibilityEvaluationTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FinancialCollectionDescriptor table of the FinancialCollectionDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EligibilityEvaluationTypeDescriptor table of the EligibilityEvaluationTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FinancialCollectionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IFinancialCollectionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class EligibilityEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int FinancialCollectionDescriptorId + public virtual int EligibilityEvaluationTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -46922,7 +46684,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("FinancialCollectionDescriptorId", FinancialCollectionDescriptorId); + keyValues.Add("EligibilityEvaluationTypeDescriptorId", EligibilityEvaluationTypeDescriptorId); return keyValues; } @@ -46986,42 +46748,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFinancialCollectionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFinancialCollectionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor) target, null); } } } -// Aggregate: FunctionDimension +// Aggregate: EmploymentStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.FunctionDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EmploymentStatusDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.EmploymentStatusDescriptor table of the EmploymentStatusDescriptor aggregate in the ODS database. /// - public class FunctionDimensionReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class EmploymentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEmploymentStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } + [DomainSignature] + public virtual int EmploymentStatusDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -47030,8 +46863,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("EmploymentStatusDescriptorId", EmploymentStatusDescriptorId); return keyValues; } @@ -47052,8 +46884,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -47070,54 +46912,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IEmploymentStatusDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IEmploymentStatusDescriptor) target, null); + } + } +} +// Aggregate: EnrollmentTypeDescriptor +namespace EdFi.Ods.Entities.NHibernate.EnrollmentTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FunctionDimension table of the FunctionDimension aggregate in the ODS database. + /// A class which represents the edfi.EnrollmentTypeDescriptor table of the EnrollmentTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FunctionDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IFunctionDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EnrollmentTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEnrollmentTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public FunctionDimension() - { - FunctionDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string Code { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual int EnrollmentTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47128,35 +47013,6 @@ public FunctionDimension() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47167,53 +47023,6 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _functionDimensionReportingTags; - private ICollection _functionDimensionReportingTagsCovariant; - public virtual ICollection FunctionDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _functionDimensionReportingTags) - if (item.FunctionDimension == null) - item.FunctionDimension = this; - // ------------------------------------------------------------- - - return _functionDimensionReportingTags; - } - set - { - _functionDimensionReportingTags = value; - _functionDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IFunctionDimension.FunctionDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _functionDimensionReportingTags) - if (item.FunctionDimension == null) - item.FunctionDimension = this; - // ------------------------------------------------------------- - - return _functionDimensionReportingTagsCovariant; - } - set - { - FunctionDimensionReportingTags = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -47233,8 +47042,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("EnrollmentTypeDescriptorId", EnrollmentTypeDescriptorId); return keyValues; } @@ -47298,88 +47106,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEnrollmentTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFunctionDimension) target, null); + this.MapTo((Entities.Common.EdFi.IEnrollmentTypeDescriptor) target, null); } } +} +// Aggregate: EntryGradeLevelReasonDescriptor + +namespace EdFi.Ods.Entities.NHibernate.EntryGradeLevelReasonDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FunctionDimensionReportingTag table of the FunctionDimension aggregate in the ODS database. + /// A class which represents the edfi.EntryGradeLevelReasonDescriptor table of the EntryGradeLevelReasonDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FunctionDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IFunctionDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EntryGradeLevelReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public FunctionDimensionReportingTag() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual FunctionDimension FunctionDimension { get; set; } - - Entities.Common.EdFi.IFunctionDimension IFunctionDimensionReportingTag.FunctionDimension - { - get { return FunctionDimension; } - set { FunctionDimension = (FunctionDimension) value; } - } - [DomainSignature] - public virtual int ReportingTagDescriptorId - { - get - { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - - return _reportingTagDescriptorId; - } - set - { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; - } - } - - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; - - public virtual string ReportingTagDescriptor + public virtual int EntryGradeLevelReasonDescriptorId { - get - { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - - return _reportingTagDescriptor; - } - set - { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -47395,35 +47192,6 @@ public virtual string ReportingTagDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47439,7 +47207,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -47450,11 +47217,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (FunctionDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("EntryGradeLevelReasonDescriptorId", EntryGradeLevelReasonDescriptorId); return keyValues; } @@ -47518,46 +47285,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFunctionDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - FunctionDimension = (FunctionDimension) value; - } } } -// Aggregate: FundDimension +// Aggregate: EntryTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.FundDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EntryTypeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.EntryTypeDescriptor table of the EntryTypeDescriptor aggregate in the ODS database. /// - public class FundDimensionReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class EntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEntryTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } + [DomainSignature] + public virtual int EntryTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -47566,8 +47400,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("EntryTypeDescriptorId", EntryTypeDescriptorId); return keyValues; } @@ -47588,8 +47421,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -47606,54 +47449,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IEntryTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IEntryTypeDescriptor) target, null); + } + } +} +// Aggregate: EvaluationDelayReasonDescriptor +namespace EdFi.Ods.Entities.NHibernate.EvaluationDelayReasonDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FundDimension table of the FundDimension aggregate in the ODS database. + /// A class which represents the edfi.EvaluationDelayReasonDescriptor table of the EvaluationDelayReasonDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FundDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IFundDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EvaluationDelayReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEvaluationDelayReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public FundDimension() - { - FundDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string Code { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual int EvaluationDelayReasonDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47664,36 +47550,7 @@ public FundDimension() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // Reference Data @@ -47703,53 +47560,6 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _fundDimensionReportingTags; - private ICollection _fundDimensionReportingTagsCovariant; - public virtual ICollection FundDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _fundDimensionReportingTags) - if (item.FundDimension == null) - item.FundDimension = this; - // ------------------------------------------------------------- - - return _fundDimensionReportingTags; - } - set - { - _fundDimensionReportingTags = value; - _fundDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IFundDimension.FundDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _fundDimensionReportingTags) - if (item.FundDimension == null) - item.FundDimension = this; - // ------------------------------------------------------------- - - return _fundDimensionReportingTagsCovariant; - } - set - { - FundDimensionReportingTags = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -47769,8 +47579,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("EvaluationDelayReasonDescriptorId", EvaluationDelayReasonDescriptorId); return keyValues; } @@ -47834,32 +47643,127 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFundDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEvaluationDelayReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFundDimension) target, null); + this.MapTo((Entities.Common.EdFi.IEvaluationDelayReasonDescriptor) target, null); + } + + } +} +// Aggregate: EvaluationRubricDimension + +namespace EdFi.Ods.Entities.NHibernate.EvaluationRubricDimensionAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class EvaluationRubricDimensionReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual int EvaluationRubricRating { get; set; } + public virtual long ProgramEducationOrganizationId { get; set; } + public virtual string ProgramEvaluationElementTitle { get; set; } + public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + public virtual string ProgramEvaluationTitle { get; set; } + public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + public virtual string ProgramName { get; set; } + public virtual int ProgramTypeDescriptorId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EvaluationRubricRating", EvaluationRubricRating); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; } + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FundDimensionReportingTag table of the FundDimension aggregate in the ODS database. + /// A class which represents the edfi.EvaluationRubricDimension table of the EvaluationRubricDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FundDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IFundDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class EvaluationRubricDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEvaluationRubricDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public FundDimensionReportingTag() + public EvaluationRubricDimension() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -47867,48 +47771,119 @@ public FundDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual FundDimension FundDimension { get; set; } + [DomainSignature] + public virtual int EvaluationRubricRating { get; set; } + [DomainSignature] + public virtual long ProgramEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ProgramEvaluationElementTitle { get; set; } + [DomainSignature] + public virtual int ProgramEvaluationPeriodDescriptorId + { + get + { + if (_programEvaluationPeriodDescriptorId == default(int)) + _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); - Entities.Common.EdFi.IFundDimension IFundDimensionReportingTag.FundDimension + return _programEvaluationPeriodDescriptorId; + } + set + { + _programEvaluationPeriodDescriptorId = value; + _programEvaluationPeriodDescriptor = null; + } + } + + private int _programEvaluationPeriodDescriptorId; + private string _programEvaluationPeriodDescriptor; + + public virtual string ProgramEvaluationPeriodDescriptor { - get { return FundDimension; } - set { FundDimension = (FundDimension) value; } + get + { + if (_programEvaluationPeriodDescriptor == null) + _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); + + return _programEvaluationPeriodDescriptor; + } + set + { + _programEvaluationPeriodDescriptor = value; + _programEvaluationPeriodDescriptorId = default(int); + } + } + [DomainSignature] + public virtual string ProgramEvaluationTitle { get; set; } + [DomainSignature] + public virtual int ProgramEvaluationTypeDescriptorId + { + get + { + if (_programEvaluationTypeDescriptorId == default(int)) + _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); + + return _programEvaluationTypeDescriptorId; + } + set + { + _programEvaluationTypeDescriptorId = value; + _programEvaluationTypeDescriptor = null; + } } + private int _programEvaluationTypeDescriptorId; + private string _programEvaluationTypeDescriptor; + + public virtual string ProgramEvaluationTypeDescriptor + { + get + { + if (_programEvaluationTypeDescriptor == null) + _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); + + return _programEvaluationTypeDescriptor; + } + set + { + _programEvaluationTypeDescriptor = value; + _programEvaluationTypeDescriptorId = default(int); + } + } [DomainSignature] - public virtual int ReportingTagDescriptorId + public virtual string ProgramName { get; set; } + [DomainSignature] + public virtual int ProgramTypeDescriptorId { get { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - return _reportingTagDescriptorId; + return _programTypeDescriptorId; } set { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; + _programTypeDescriptorId = value; + _programTypeDescriptor = null; } } - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; + private int _programTypeDescriptorId; + private string _programTypeDescriptor; - public virtual string ReportingTagDescriptor + public virtual string ProgramTypeDescriptor { get { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - return _reportingTagDescriptor; + return _programTypeDescriptor; } set { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -47921,6 +47896,42 @@ public virtual string ReportingTagDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string EvaluationCriterionDescription { get; set; } + public virtual int? EvaluationRubricRatingLevelDescriptorId + { + get + { + if (_evaluationRubricRatingLevelDescriptorId == default(int?)) + _evaluationRubricRatingLevelDescriptorId = string.IsNullOrWhiteSpace(_evaluationRubricRatingLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _evaluationRubricRatingLevelDescriptor); + + return _evaluationRubricRatingLevelDescriptorId; + } + set + { + _evaluationRubricRatingLevelDescriptorId = value; + _evaluationRubricRatingLevelDescriptor = null; + } + } + + private int? _evaluationRubricRatingLevelDescriptorId; + private string _evaluationRubricRatingLevelDescriptor; + + public virtual string EvaluationRubricRatingLevelDescriptor + { + get + { + if (_evaluationRubricRatingLevelDescriptor == null) + _evaluationRubricRatingLevelDescriptor = _evaluationRubricRatingLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _evaluationRubricRatingLevelDescriptorId.Value); + + return _evaluationRubricRatingLevelDescriptor; + } + set + { + _evaluationRubricRatingLevelDescriptor = value; + _evaluationRubricRatingLevelDescriptorId = default(int?); + } + } + public virtual int? RubricDimensionSortOrder { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47965,6 +47976,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramEvaluationElementAggregate.EdFi.ProgramEvaluationElementReferenceData ProgramEvaluationElementReferenceData { get; set; } + + /// + /// Read-only property that allows the ProgramEvaluationElement discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementDiscriminator + { + get { return ProgramEvaluationElementReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProgramEvaluationElement resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementResourceId + { + get { return ProgramEvaluationElementReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -47975,7 +48006,10 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + { "EvaluationRubricRatingLevelDescriptor", new LookupColumnDetails { PropertyName = "EvaluationRubricRatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, + { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, + { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -47986,11 +48020,18 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (FundDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("EvaluationRubricRating", EvaluationRubricRating); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -48054,291 +48095,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFundDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEvaluationRubricDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFundDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IEvaluationRubricDimension) target, null); } - void IChildEntity.SetParent(object value) - { - FundDimension = (FundDimension) value; - } } } -// Aggregate: GeneralStudentProgramAssociation +// Aggregate: EventCircumstanceDescriptor -namespace EdFi.Ods.Entities.NHibernate.GeneralStudentProgramAssociationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EventCircumstanceDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class GeneralStudentProgramAssociationReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual DateTime BeginDate { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId { get; set; } - public virtual int StudentUSI { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); - keyValues.Add("StudentUSI", StudentUSI); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GeneralStudentProgramAssociation table of the GeneralStudentProgramAssociation aggregate in the ODS database. + /// A class which represents the edfi.EventCircumstanceDescriptor table of the EventCircumstanceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GeneralStudentProgramAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap + public class EventCircumstanceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEventCircumstanceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public GeneralStudentProgramAssociation() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int EventCircumstanceDescriptorId { - GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - public virtual DateTime BeginDate + string IDescriptor.CodeValue { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get { return CodeValue; } + set { CodeValue = value; } } - - private DateTime _beginDate; - - public virtual long EducationOrganizationId { get; set; } - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId + string IDescriptor.Description { - get - { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - - return _programTypeDescriptorId; - } - set - { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _programTypeDescriptorId; - private string _programTypeDescriptor; - - public virtual string ProgramTypeDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - - return _programTypeDescriptor; - } - set - { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - public virtual int StudentUSI + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId + string IDescriptor.Namespace { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - - public virtual int? ReasonExitedDescriptorId - { - get - { - if (_reasonExitedDescriptorId == default(int?)) - _reasonExitedDescriptorId = string.IsNullOrWhiteSpace(_reasonExitedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReasonExitedDescriptor", _reasonExitedDescriptor); - - return _reasonExitedDescriptorId; - } - set - { - _reasonExitedDescriptorId = value; - _reasonExitedDescriptor = null; - } - } - - private int? _reasonExitedDescriptorId; - private string _reasonExitedDescriptor; - - public virtual string ReasonExitedDescriptor - { - get - { - if (_reasonExitedDescriptor == null) - _reasonExitedDescriptor = _reasonExitedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReasonExitedDescriptor", _reasonExitedDescriptorId.Value); - - return _reasonExitedDescriptor; - } - set - { - _reasonExitedDescriptor = value; - _reasonExitedDescriptorId = default(int?); - } - } - public virtual bool? ServedOutsideOfRegularSession { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48354,125 +48186,16 @@ public virtual string ReasonExitedDescriptor // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } - - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } - - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentResourceId - { - get { return StudentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _generalStudentProgramAssociationProgramParticipationStatuses; - private ICollection _generalStudentProgramAssociationProgramParticipationStatusesCovariant; - public virtual ICollection GeneralStudentProgramAssociationProgramParticipationStatuses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) - if (item.GeneralStudentProgramAssociation == null) - item.GeneralStudentProgramAssociation = this; - // ------------------------------------------------------------- - - return _generalStudentProgramAssociationProgramParticipationStatuses; - } - set - { - _generalStudentProgramAssociationProgramParticipationStatuses = value; - _generalStudentProgramAssociationProgramParticipationStatusesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGeneralStudentProgramAssociation.GeneralStudentProgramAssociationProgramParticipationStatuses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) - if (item.GeneralStudentProgramAssociation == null) - item.GeneralStudentProgramAssociation = this; - // ------------------------------------------------------------- - - return _generalStudentProgramAssociationProgramParticipationStatusesCovariant; - } - set - { - GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "ReasonExitedDescriptor", new LookupColumnDetails { PropertyName = "ReasonExitedDescriptorId", LookupTypeName = "ReasonExitedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -48487,12 +48210,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("EventCircumstanceDescriptorId", EventCircumstanceDescriptorId); return keyValues; } @@ -48556,123 +48274,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEventCircumstanceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IEventCircumstanceDescriptor) target, null); } } +} +// Aggregate: ExitWithdrawTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ExitWithdrawTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GeneralStudentProgramAssociationProgramParticipationStatus table of the GeneralStudentProgramAssociation aggregate in the ODS database. + /// A class which represents the edfi.ExitWithdrawTypeDescriptor table of the ExitWithdrawTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GeneralStudentProgramAssociationProgramParticipationStatus : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ExitWithdrawTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IExitWithdrawTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public GeneralStudentProgramAssociationProgramParticipationStatus() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int ExitWithdrawTypeDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GeneralStudentProgramAssociation GeneralStudentProgramAssociation { get; set; } - - Entities.Common.EdFi.IGeneralStudentProgramAssociation IGeneralStudentProgramAssociationProgramParticipationStatus.GeneralStudentProgramAssociation + string IDescriptor.CodeValue { - get { return GeneralStudentProgramAssociation; } - set { GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; } + get { return CodeValue; } + set { CodeValue = value; } } - - [DomainSignature] - public virtual int ParticipationStatusDescriptorId + string IDescriptor.Description { - get - { - if (_participationStatusDescriptorId == default(int)) - _participationStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ParticipationStatusDescriptor", _participationStatusDescriptor); - - return _participationStatusDescriptorId; - } - set - { - _participationStatusDescriptorId = value; - _participationStatusDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _participationStatusDescriptorId; - private string _participationStatusDescriptor; - - public virtual string ParticipationStatusDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_participationStatusDescriptor == null) - _participationStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ParticipationStatusDescriptor", _participationStatusDescriptorId); - - return _participationStatusDescriptor; - } - set - { - _participationStatusDescriptor = value; - _participationStatusDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - [DomainSignature] - public virtual DateTime StatusBeginDate + DateTime? IDescriptor.EffectiveEndDate { - get { return _statusBeginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _statusBeginDate = new DateTime(value.Year, value.Month, value.Day); } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - - private DateTime _statusBeginDate; - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string DesignatedBy { get; set; } - public virtual DateTime? StatusEndDate - { - get { return _statusEndDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _statusEndDate = null; - } else - { - var given = (DateTime) value; - _statusEndDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _statusEndDate; - // ------------------------------------------------------------- // ============================================================= @@ -48683,35 +48360,6 @@ public virtual DateTime? StatusEndDate // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48727,8 +48375,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ParticipationStatusDescriptor", new LookupColumnDetails { PropertyName = "ParticipationStatusDescriptorId", LookupTypeName = "ParticipationStatusDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -48739,12 +48385,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (GeneralStudentProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ParticipationStatusDescriptorId", ParticipationStatusDescriptorId); - keyValues.Add("StatusBeginDate", StatusBeginDate); + keyValues.Add("ExitWithdrawTypeDescriptorId", ExitWithdrawTypeDescriptorId); return keyValues; } @@ -48808,43 +48453,31 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target); + return this.SynchronizeTo((Entities.Common.EdFi.IExitWithdrawTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus) target, null); + this.MapTo((Entities.Common.EdFi.IExitWithdrawTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; - } } } -// Aggregate: Grade +// Aggregate: FeederSchoolAssociation -namespace EdFi.Ods.Entities.NHibernate.GradeAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.FeederSchoolAssociationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class GradeReferenceData : IHasPrimaryKeyValues + public class FeederSchoolAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- public virtual DateTime BeginDate { get; set; } - public virtual int GradeTypeDescriptorId { get; set; } - public virtual int GradingPeriodDescriptorId { get; set; } - public virtual string GradingPeriodName { get; set; } - public virtual short GradingPeriodSchoolYear { get; set; } - public virtual string LocalCourseCode { get; set; } + public virtual long FeederSchoolId { get; set; } public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual string SectionIdentifier { get; set; } - public virtual string SessionName { get; set; } - public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// @@ -48866,16 +48499,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("BeginDate", BeginDate); - keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); - keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); - keyValues.Add("GradingPeriodName", GradingPeriodName); - keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); - keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("FeederSchoolId", FeederSchoolId); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); - keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -48926,20 +48551,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Grade table of the Grade aggregate in the ODS database. + /// A class which represents the edfi.FeederSchoolAssociation table of the FeederSchoolAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Grade : AggregateRootWithCompositeKey, IHasCascadableKeyValues, - Entities.Common.EdFi.IGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class FeederSchoolAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IFeederSchoolAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Grade() + public FeederSchoolAssociation() { - GradeLearningStandardGrades = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -48958,206 +48582,39 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] - public virtual int GradeTypeDescriptorId - { - get - { - if (_gradeTypeDescriptorId == default(int)) - _gradeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeTypeDescriptor", _gradeTypeDescriptor); + public virtual long FeederSchoolId { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + // ------------------------------------------------------------- - return _gradeTypeDescriptorId; - } - set - { - _gradeTypeDescriptorId = value; - _gradeTypeDescriptor = null; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } } } - private int _gradeTypeDescriptorId; - private string _gradeTypeDescriptor; - - public virtual string GradeTypeDescriptor - { - get - { - if (_gradeTypeDescriptor == null) - _gradeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeTypeDescriptor", _gradeTypeDescriptorId); - - return _gradeTypeDescriptor; - } - set - { - _gradeTypeDescriptor = value; - _gradeTypeDescriptorId = default(int); - } - } - [DomainSignature] - public virtual int GradingPeriodDescriptorId - { - get - { - if (_gradingPeriodDescriptorId == default(int)) - _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); - - return _gradingPeriodDescriptorId; - } - set - { - _gradingPeriodDescriptorId = value; - _gradingPeriodDescriptor = null; - } - } - - private int _gradingPeriodDescriptorId; - private string _gradingPeriodDescriptor; - - public virtual string GradingPeriodDescriptor - { - get - { - if (_gradingPeriodDescriptor == null) - _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); - - return _gradingPeriodDescriptor; - } - set - { - _gradingPeriodDescriptor = value; - _gradingPeriodDescriptorId = default(int); - } - } - [DomainSignature] - public virtual string GradingPeriodName { get; set; } - [DomainSignature] - public virtual short GradingPeriodSchoolYear { get; set; } - [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [DomainSignature] - public virtual string SectionIdentifier { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId - { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime? CurrentGradeAsOfDate - { - get { return _currentGradeAsOfDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _currentGradeAsOfDate = null; - } else - { - var given = (DateTime) value; - _currentGradeAsOfDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _currentGradeAsOfDate; + private DateTime? _endDate; - public virtual bool? CurrentGradeIndicator { get; set; } - public virtual string DiagnosticStatement { get; set; } - public virtual string GradeEarnedDescription { get; set; } - public virtual string LetterGradeEarned { get; set; } - public virtual decimal? NumericGradeEarned { get; set; } - public virtual int? PerformanceBaseConversionDescriptorId - { - get - { - if (_performanceBaseConversionDescriptorId == default(int?)) - _performanceBaseConversionDescriptorId = string.IsNullOrWhiteSpace(_performanceBaseConversionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptor); - - return _performanceBaseConversionDescriptorId; - } - set - { - _performanceBaseConversionDescriptorId = value; - _performanceBaseConversionDescriptor = null; - } - } - - private int? _performanceBaseConversionDescriptorId; - private string _performanceBaseConversionDescriptor; - - public virtual string PerformanceBaseConversionDescriptor - { - get - { - if (_performanceBaseConversionDescriptor == null) - _performanceBaseConversionDescriptor = _performanceBaseConversionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptorId.Value); - - return _performanceBaseConversionDescriptor; - } - set - { - _performanceBaseConversionDescriptor = value; - _performanceBaseConversionDescriptorId = default(int?); - } - } + public virtual string FeederRelationshipDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -49202,43 +48659,25 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } - - /// - /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGrade.GradingPeriodDiscriminator - { - get { return GradingPeriodReferenceData?.Discriminator; } - set { } - } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData FeederSchoolReferenceData { get; set; } /// - /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the FeederSchool resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IGrade.GradingPeriodResourceId + Guid? Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolResourceId { - get { return GradingPeriodReferenceData?.Id; } + get { return FeederSchoolReferenceData?.Id; } set { } } - public virtual NHibernate.StudentSectionAssociationAggregate.EdFi.StudentSectionAssociationReferenceData StudentSectionAssociationReferenceData { get; set; } - - /// - /// Read-only property that allows the StudentSectionAssociation discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGrade.StudentSectionAssociationDiscriminator - { - get { return StudentSectionAssociationReferenceData?.Discriminator; } - set { } - } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the StudentSectionAssociation resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IGrade.StudentSectionAssociationResourceId + Guid? Entities.Common.EdFi.IFeederSchoolAssociation.SchoolResourceId { - get { return StudentSectionAssociationReferenceData?.Id; } + get { return SchoolReferenceData?.Id; } set { } } @@ -49247,61 +48686,11 @@ string Entities.Common.EdFi.IGrade.StudentSectionAssociationDiscriminator //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _gradeLearningStandardGrades; - private ICollection _gradeLearningStandardGradesCovariant; - public virtual ICollection GradeLearningStandardGrades - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _gradeLearningStandardGrades) - if (item.Grade == null) - item.Grade = this; - // ------------------------------------------------------------- - - return _gradeLearningStandardGrades; - } - set - { - _gradeLearningStandardGrades = value; - _gradeLearningStandardGradesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGrade.GradeLearningStandardGrades - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _gradeLearningStandardGrades) - if (item.Grade == null) - item.Grade = this; - // ------------------------------------------------------------- - - return _gradeLearningStandardGradesCovariant; - } - set - { - GradeLearningStandardGrades = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeTypeDescriptor", new LookupColumnDetails { PropertyName = "GradeTypeDescriptorId", LookupTypeName = "GradeTypeDescriptor"} }, - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, - { "PerformanceBaseConversionDescriptor", new LookupColumnDetails { PropertyName = "PerformanceBaseConversionDescriptorId", LookupTypeName = "PerformanceBaseConversionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -49317,26 +48706,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("BeginDate", BeginDate); - keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); - keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); - keyValues.Add("GradingPeriodName", GradingPeriodName); - keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); - keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("FeederSchoolId", FeederSchoolId); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); - keyValues.Add("StudentUSI", StudentUSI); return keyValues; } - /// - /// Gets or sets the capturing the new key values that have - /// not been modified directly on the entity. - /// - OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } - #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -49396,97 +48771,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGrade)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFeederSchoolAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGrade) target, null); + this.MapTo((Entities.Common.EdFi.IFeederSchoolAssociation) target, null); } } +} +// Aggregate: FinancialCollectionDescriptor + +namespace EdFi.Ods.Entities.NHibernate.FinancialCollectionDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradeLearningStandardGrade table of the Grade aggregate in the ODS database. + /// A class which represents the edfi.FinancialCollectionDescriptor table of the FinancialCollectionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradeLearningStandardGrade : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGradeLearningStandardGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class FinancialCollectionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IFinancialCollectionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public GradeLearningStandardGrade() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Grade Grade { get; set; } - - Entities.Common.EdFi.IGrade IGradeLearningStandardGrade.Grade + [DomainSignature] + public virtual int FinancialCollectionDescriptorId { - get { return Grade; } - set { Grade = (Grade) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string LearningStandardId { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string DiagnosticStatement { get; set; } - public virtual string LetterGradeEarned { get; set; } - public virtual decimal? NumericGradeEarned { get; set; } - public virtual int? PerformanceBaseConversionDescriptorId - { - get - { - if (_performanceBaseConversionDescriptorId == default(int?)) - _performanceBaseConversionDescriptorId = string.IsNullOrWhiteSpace(_performanceBaseConversionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptor); - - return _performanceBaseConversionDescriptorId; - } - set - { - _performanceBaseConversionDescriptorId = value; - _performanceBaseConversionDescriptor = null; - } - } - - private int? _performanceBaseConversionDescriptorId; - private string _performanceBaseConversionDescriptor; - - public virtual string PerformanceBaseConversionDescriptor - { - get - { - if (_performanceBaseConversionDescriptor == null) - _performanceBaseConversionDescriptor = _performanceBaseConversionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptorId.Value); - - return _performanceBaseConversionDescriptor; - } - set - { - _performanceBaseConversionDescriptor = value; - _performanceBaseConversionDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -49497,60 +48857,11 @@ public virtual string PerformanceBaseConversionDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardResourceId - { - get { return LearningStandardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -49561,9 +48872,6 @@ string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardDiscrimi // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeTypeDescriptor", new LookupColumnDetails { PropertyName = "GradeTypeDescriptorId", LookupTypeName = "GradeTypeDescriptor"} }, - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, - { "PerformanceBaseConversionDescriptor", new LookupColumnDetails { PropertyName = "PerformanceBaseConversionDescriptorId", LookupTypeName = "PerformanceBaseConversionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -49574,11 +48882,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Grade as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("FinancialCollectionDescriptorId", FinancialCollectionDescriptorId); return keyValues; } @@ -49642,34 +48950,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradeLearningStandardGrade)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFinancialCollectionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradeLearningStandardGrade) target, null); + this.MapTo((Entities.Common.EdFi.IFinancialCollectionDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Grade = (Grade) value; - } } } -// Aggregate: GradebookEntry +// Aggregate: FunctionDimension -namespace EdFi.Ods.Entities.NHibernate.GradebookEntryAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.FunctionDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class GradebookEntryReferenceData : IHasPrimaryKeyValues + public class FunctionDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string GradebookEntryIdentifier { get; set; } - public virtual string Namespace { get; set; } + public virtual string Code { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// @@ -49690,8 +48994,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradebookEntryIdentifier", GradebookEntryIdentifier); - keyValues.Add("Namespace", Namespace); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -49742,20 +49046,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradebookEntry table of the GradebookEntry aggregate in the ODS database. + /// A class which represents the edfi.FunctionDimension table of the FunctionDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradebookEntry : AggregateRootWithCompositeKey, IHasCascadableKeyValues, - Entities.Common.EdFi.IGradebookEntry, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class FunctionDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IFunctionDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GradebookEntry() + public FunctionDimension() { - GradebookEntryLearningStandards = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + FunctionDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -49764,9 +49068,9 @@ public GradebookEntry() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string GradebookEntryIdentifier { get; set; } + public virtual string Code { get; set; } [DomainSignature] - public virtual string Namespace { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -49777,113 +49081,7 @@ public GradebookEntry() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime DateAssigned - { - get { return _dateAssigned; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _dateAssigned = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _dateAssigned; - - public virtual string Description { get; set; } - public virtual DateTime? DueDate - { - get { return _dueDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _dueDate = null; - } else - { - var given = (DateTime) value; - _dueDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _dueDate; - - public virtual TimeSpan? DueTime { get; set; } - public virtual int? GradebookEntryTypeDescriptorId - { - get - { - if (_gradebookEntryTypeDescriptorId == default(int?)) - _gradebookEntryTypeDescriptorId = string.IsNullOrWhiteSpace(_gradebookEntryTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradebookEntryTypeDescriptor", _gradebookEntryTypeDescriptor); - - return _gradebookEntryTypeDescriptorId; - } - set - { - _gradebookEntryTypeDescriptorId = value; - _gradebookEntryTypeDescriptor = null; - } - } - - private int? _gradebookEntryTypeDescriptorId; - private string _gradebookEntryTypeDescriptor; - - public virtual string GradebookEntryTypeDescriptor - { - get - { - if (_gradebookEntryTypeDescriptor == null) - _gradebookEntryTypeDescriptor = _gradebookEntryTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradebookEntryTypeDescriptor", _gradebookEntryTypeDescriptorId.Value); - - return _gradebookEntryTypeDescriptor; - } - set - { - _gradebookEntryTypeDescriptor = value; - _gradebookEntryTypeDescriptorId = default(int?); - } - } - public virtual int? GradingPeriodDescriptorId - { - get - { - if (_gradingPeriodDescriptorId == default(int?)) - _gradingPeriodDescriptorId = string.IsNullOrWhiteSpace(_gradingPeriodDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); - - return _gradingPeriodDescriptorId; - } - set - { - _gradingPeriodDescriptorId = value; - _gradingPeriodDescriptor = null; - } - } - - private int? _gradingPeriodDescriptorId; - private string _gradingPeriodDescriptor; - - public virtual string GradingPeriodDescriptor - { - get - { - if (_gradingPeriodDescriptor == null) - _gradingPeriodDescriptor = _gradingPeriodDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId.Value); - - return _gradingPeriodDescriptor; - } - set - { - _gradingPeriodDescriptor = value; - _gradingPeriodDescriptorId = default(int?); - } - } - public virtual string GradingPeriodName { get; set; } - public virtual string LocalCourseCode { get; set; } - public virtual decimal? MaxPoints { get; set; } - public virtual long? SchoolId { get; set; } - public virtual short? SchoolYear { get; set; } - public virtual string SectionIdentifier { get; set; } - public virtual string SessionName { get; set; } - public virtual string SourceSectionIdentifier { get; set; } - public virtual string Title { get; set; } + public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -49928,55 +49126,15 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } - - /// - /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGradebookEntry.GradingPeriodDiscriminator - { - get { return GradingPeriodReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGradebookEntry.GradingPeriodResourceId - { - get { return GradingPeriodReferenceData?.Id; } - set { } - } - - public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } - - /// - /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGradebookEntry.SectionDiscriminator - { - get { return SectionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGradebookEntry.SectionResourceId - { - get { return SectionReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _gradebookEntryLearningStandards; - private ICollection _gradebookEntryLearningStandardsCovariant; - public virtual ICollection GradebookEntryLearningStandards + private ICollection _functionDimensionReportingTags; + private ICollection _functionDimensionReportingTagsCovariant; + public virtual ICollection FunctionDimensionReportingTags { get { @@ -49985,38 +49143,38 @@ public virtual ICollection(value); + _functionDimensionReportingTags = value; + _functionDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGradebookEntry.GradebookEntryLearningStandards + ICollection Entities.Common.EdFi.IFunctionDimension.FunctionDimensionReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _gradebookEntryLearningStandards) - if (item.GradebookEntry == null) - item.GradebookEntry = this; + foreach (var item in _functionDimensionReportingTags) + if (item.FunctionDimension == null) + item.FunctionDimension = this; // ------------------------------------------------------------- - return _gradebookEntryLearningStandardsCovariant; + return _functionDimensionReportingTagsCovariant; } set { - GradebookEntryLearningStandards = new HashSet(value.Cast()); + FunctionDimensionReportingTags = new HashSet(value.Cast()); } } @@ -50025,8 +49183,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradebookEntryTypeDescriptor", new LookupColumnDetails { PropertyName = "GradebookEntryTypeDescriptorId", LookupTypeName = "GradebookEntryTypeDescriptor"} }, - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -50041,18 +49197,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradebookEntryIdentifier", GradebookEntryIdentifier); - keyValues.Add("Namespace", Namespace); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } - /// - /// Gets or sets the capturing the new key values that have - /// not been modified directly on the entity. - /// - OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } - #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -50112,12 +49262,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradebookEntry)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradebookEntry) target, null); + this.MapTo((Entities.Common.EdFi.IFunctionDimension) target, null); } } @@ -50125,19 +49275,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradebookEntryLearningStandard table of the GradebookEntry aggregate in the ODS database. + /// A class which represents the edfi.FunctionDimensionReportingTag table of the FunctionDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradebookEntryLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGradebookEntryLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class FunctionDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IFunctionDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GradebookEntryLearningStandard() + public FunctionDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -50146,16 +49296,49 @@ public GradebookEntryLearningStandard() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual GradebookEntry GradebookEntry { get; set; } + public virtual FunctionDimension FunctionDimension { get; set; } - Entities.Common.EdFi.IGradebookEntry IGradebookEntryLearningStandard.GradebookEntry + Entities.Common.EdFi.IFunctionDimension IFunctionDimensionReportingTag.FunctionDimension { - get { return GradebookEntry; } - set { GradebookEntry = (GradebookEntry) value; } + get { return FunctionDimension; } + set { FunctionDimension = (FunctionDimension) value; } } [DomainSignature] - public virtual string LearningStandardId { get; set; } + public virtual int ReportingTagDescriptorId + { + get + { + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + + return _reportingTagDescriptorId; + } + set + { + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; + } + } + + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; + + public virtual string ReportingTagDescriptor + { + get + { + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + + return _reportingTagDescriptor; + } + set + { + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -50210,26 +49393,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardResourceId - { - get { return LearningStandardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -50240,6 +49403,7 @@ string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardDisc // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -50251,10 +49415,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GradebookEntry as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (FunctionDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -50318,86 +49482,142 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradebookEntryLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradebookEntryLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IFunctionDimensionReportingTag) target, null); } void IChildEntity.SetParent(object value) { - GradebookEntry = (GradebookEntry) value; + FunctionDimension = (FunctionDimension) value; } } } -// Aggregate: GradebookEntryTypeDescriptor +// Aggregate: FundDimension -namespace EdFi.Ods.Entities.NHibernate.GradebookEntryTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.FundDimensionAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class FundDimensionReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string Code { get; set; } + public virtual int FiscalYear { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradebookEntryTypeDescriptor table of the GradebookEntryTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.FundDimension table of the FundDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradebookEntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IGradebookEntryTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class FundDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IFundDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public FundDimension() + { + FundDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int GradebookEntryTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual string Code { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -50408,6 +49628,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -50418,6 +49667,53 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _fundDimensionReportingTags; + private ICollection _fundDimensionReportingTagsCovariant; + public virtual ICollection FundDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _fundDimensionReportingTags) + if (item.FundDimension == null) + item.FundDimension = this; + // ------------------------------------------------------------- + + return _fundDimensionReportingTags; + } + set + { + _fundDimensionReportingTags = value; + _fundDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IFundDimension.FundDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _fundDimensionReportingTags) + if (item.FundDimension == null) + item.FundDimension = this; + // ------------------------------------------------------------- + + return _fundDimensionReportingTagsCovariant; + } + set + { + FundDimensionReportingTags = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map @@ -50437,7 +49733,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradebookEntryTypeDescriptorId", GradebookEntryTypeDescriptorId); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -50501,79 +49798,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradebookEntryTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFundDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradebookEntryTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IFundDimension) target, null); } } -} -// Aggregate: GradeLevelDescriptor - -namespace EdFi.Ods.Entities.NHibernate.GradeLevelDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradeLevelDescriptor table of the GradeLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.FundDimensionReportingTag table of the FundDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradeLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IGradeLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class FundDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IFundDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int GradeLevelDescriptorId + public FundDimensionReportingTag() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue + [DomainSignature, JsonIgnore] + public virtual FundDimension FundDimension { get; set; } + + Entities.Common.EdFi.IFundDimension IFundDimensionReportingTag.FundDimension { - get { return CodeValue; } - set { CodeValue = value; } + get { return FundDimension; } + set { FundDimension = (FundDimension) value; } } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int ReportingTagDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + + return _reportingTagDescriptorId; + } + set + { + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; + + public virtual string ReportingTagDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + + return _reportingTagDescriptor; + } + set + { + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -50587,6 +49895,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -50602,6 +49939,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -50612,11 +49950,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (FundDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -50680,82 +50018,291 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradeLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFundDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradeLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IFundDimensionReportingTag) target, null); } + void IChildEntity.SetParent(object value) + { + FundDimension = (FundDimension) value; + } } } -// Aggregate: GradePointAverageTypeDescriptor +// Aggregate: GeneralStudentProgramAssociation -namespace EdFi.Ods.Entities.NHibernate.GradePointAverageTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GeneralStudentProgramAssociationAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class GeneralStudentProgramAssociationReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual DateTime BeginDate { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual long ProgramEducationOrganizationId { get; set; } + public virtual string ProgramName { get; set; } + public virtual int ProgramTypeDescriptorId { get; set; } + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradePointAverageTypeDescriptor table of the GradePointAverageTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GeneralStudentProgramAssociation table of the GeneralStudentProgramAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradePointAverageTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IGradePointAverageTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GeneralStudentProgramAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int GradePointAverageTypeDescriptorId + public GeneralStudentProgramAssociation() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description + public virtual DateTime BeginDate { - get { return Description; } - set { Description = value; } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } - DateTime? IDescriptor.EffectiveBeginDate + + private DateTime _beginDate; + + public virtual long EducationOrganizationId { get; set; } + public virtual long ProgramEducationOrganizationId { get; set; } + public virtual string ProgramName { get; set; } + public virtual int ProgramTypeDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + public virtual string ProgramTypeDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } } - string IDescriptor.Namespace + public virtual int StudentUSI { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } } - string IDescriptor.ShortDescription + + private int _studentUSI; + private string _studentUniqueId; + + public virtual string StudentUniqueId { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + + public virtual int? ReasonExitedDescriptorId + { + get + { + if (_reasonExitedDescriptorId == default(int?)) + _reasonExitedDescriptorId = string.IsNullOrWhiteSpace(_reasonExitedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReasonExitedDescriptor", _reasonExitedDescriptor); + + return _reasonExitedDescriptorId; + } + set + { + _reasonExitedDescriptorId = value; + _reasonExitedDescriptor = null; + } + } + + private int? _reasonExitedDescriptorId; + private string _reasonExitedDescriptor; + + public virtual string ReasonExitedDescriptor + { + get + { + if (_reasonExitedDescriptor == null) + _reasonExitedDescriptor = _reasonExitedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReasonExitedDescriptor", _reasonExitedDescriptorId.Value); + + return _reasonExitedDescriptor; + } + set + { + _reasonExitedDescriptor = value; + _reasonExitedDescriptorId = default(int?); + } + } + public virtual bool? ServedOutsideOfRegularSession { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -50771,16 +50318,125 @@ string IDescriptor.ShortDescription // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramDiscriminator + { + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentResourceId + { + get { return StudentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _generalStudentProgramAssociationProgramParticipationStatuses; + private ICollection _generalStudentProgramAssociationProgramParticipationStatusesCovariant; + public virtual ICollection GeneralStudentProgramAssociationProgramParticipationStatuses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) + if (item.GeneralStudentProgramAssociation == null) + item.GeneralStudentProgramAssociation = this; + // ------------------------------------------------------------- + + return _generalStudentProgramAssociationProgramParticipationStatuses; + } + set + { + _generalStudentProgramAssociationProgramParticipationStatuses = value; + _generalStudentProgramAssociationProgramParticipationStatusesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGeneralStudentProgramAssociation.GeneralStudentProgramAssociationProgramParticipationStatuses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) + if (item.GeneralStudentProgramAssociation == null) + item.GeneralStudentProgramAssociation = this; + // ------------------------------------------------------------- + + return _generalStudentProgramAssociationProgramParticipationStatusesCovariant; + } + set + { + GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "ReasonExitedDescriptor", new LookupColumnDetails { PropertyName = "ReasonExitedDescriptorId", LookupTypeName = "ReasonExitedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -50795,7 +50451,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -50859,82 +50520,123 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradePointAverageTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradePointAverageTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation) target, null); } } -} -// Aggregate: GradeTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.GradeTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradeTypeDescriptor table of the GradeTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GeneralStudentProgramAssociationProgramParticipationStatus table of the GeneralStudentProgramAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IGradeTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GeneralStudentProgramAssociationProgramParticipationStatus : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int GradeTypeDescriptorId + public GeneralStudentProgramAssociationProgramParticipationStatus() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + [DomainSignature, JsonIgnore] + public virtual GeneralStudentProgramAssociation GeneralStudentProgramAssociation { get; set; } + + Entities.Common.EdFi.IGeneralStudentProgramAssociation IGeneralStudentProgramAssociationProgramParticipationStatus.GeneralStudentProgramAssociation { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return GeneralStudentProgramAssociation; } + set { GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; } } - DateTime? IDescriptor.EffectiveEndDate + + [DomainSignature] + public virtual int ParticipationStatusDescriptorId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_participationStatusDescriptorId == default(int)) + _participationStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ParticipationStatusDescriptor", _participationStatusDescriptor); + + return _participationStatusDescriptorId; + } + set + { + _participationStatusDescriptorId = value; + _participationStatusDescriptor = null; + } } - string IDescriptor.Namespace + + private int _participationStatusDescriptorId; + private string _participationStatusDescriptor; + + public virtual string ParticipationStatusDescriptor { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_participationStatusDescriptor == null) + _participationStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ParticipationStatusDescriptor", _participationStatusDescriptorId); + + return _participationStatusDescriptor; + } + set + { + _participationStatusDescriptor = value; + _participationStatusDescriptorId = default(int); + } } - string IDescriptor.ShortDescription + [DomainSignature] + public virtual DateTime StatusBeginDate { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return _statusBeginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _statusBeginDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _statusBeginDate; + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string DesignatedBy { get; set; } + public virtual DateTime? StatusEndDate + { + get { return _statusEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _statusEndDate = null; + } else + { + var given = (DateTime) value; + _statusEndDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _statusEndDate; + // ------------------------------------------------------------- // ============================================================= @@ -50945,6 +50647,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -50960,6 +50691,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ParticipationStatusDescriptor", new LookupColumnDetails { PropertyName = "ParticipationStatusDescriptorId", LookupTypeName = "ParticipationStatusDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -50970,11 +50703,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GeneralStudentProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); + keyValues.Add("ParticipationStatusDescriptorId", ParticipationStatusDescriptorId); + keyValues.Add("StatusBeginDate", StatusBeginDate); return keyValues; } @@ -51038,32 +50772,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradeTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradeTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus) target, null); } + void IChildEntity.SetParent(object value) + { + GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; + } } } -// Aggregate: GradingPeriod +// Aggregate: Grade -namespace EdFi.Ods.Entities.NHibernate.GradingPeriodAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GradeAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class GradingPeriodReferenceData : IHasPrimaryKeyValues + public class GradeReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + public virtual DateTime BeginDate { get; set; } + public virtual int GradeTypeDescriptorId { get; set; } public virtual int GradingPeriodDescriptorId { get; set; } public virtual string GradingPeriodName { get; set; } + public virtual short GradingPeriodSchoolYear { get; set; } + public virtual string LocalCourseCode { get; set; } public virtual long SchoolId { get; set; } public virtual short SchoolYear { get; set; } + public virtual string SectionIdentifier { get; set; } + public virtual string SessionName { get; set; } + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// @@ -51084,10 +50829,17 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); + keyValues.Add("LocalCourseCode", LocalCourseCode); keyValues.Add("SchoolId", SchoolId); keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -51138,19 +50890,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradingPeriod table of the GradingPeriod aggregate in the ODS database. + /// A class which represents the edfi.Grade table of the Grade aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradingPeriod : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IGradingPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Grade : AggregateRootWithCompositeKey, IHasCascadableKeyValues, + Entities.Common.EdFi.IGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GradingPeriod() + public Grade() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + GradeLearningStandardGrades = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -51159,6 +50912,51 @@ public GradingPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature] + public virtual DateTime BeginDate + { + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _beginDate; + + [DomainSignature] + public virtual int GradeTypeDescriptorId + { + get + { + if (_gradeTypeDescriptorId == default(int)) + _gradeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeTypeDescriptor", _gradeTypeDescriptor); + + return _gradeTypeDescriptorId; + } + set + { + _gradeTypeDescriptorId = value; + _gradeTypeDescriptor = null; + } + } + + private int _gradeTypeDescriptorId; + private string _gradeTypeDescriptor; + + public virtual string GradeTypeDescriptor + { + get + { + if (_gradeTypeDescriptor == null) + _gradeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeTypeDescriptor", _gradeTypeDescriptorId); + + return _gradeTypeDescriptor; + } + set + { + _gradeTypeDescriptor = value; + _gradeTypeDescriptorId = default(int); + } + } + [DomainSignature] public virtual int GradingPeriodDescriptorId { get @@ -51196,9 +50994,66 @@ public virtual string GradingPeriodDescriptor [DomainSignature] public virtual string GradingPeriodName { get; set; } [DomainSignature] + public virtual short GradingPeriodSchoolYear { get; set; } + [DomainSignature] + public virtual string LocalCourseCode { get; set; } + [DomainSignature] public virtual long SchoolId { get; set; } [DomainSignature] public virtual short SchoolYear { get; set; } + [DomainSignature] + public virtual string SectionIdentifier { get; set; } + [DomainSignature] + public virtual string SessionName { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI + { + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } + + private int _studentUSI; + private string _studentUniqueId; + + public virtual string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -51209,26 +51064,64 @@ public virtual string GradingPeriodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime BeginDate + public virtual DateTime? CurrentGradeAsOfDate { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get { return _currentGradeAsOfDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _currentGradeAsOfDate = null; + } else + { + var given = (DateTime) value; + _currentGradeAsOfDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - private DateTime _beginDate; + private DateTime? _currentGradeAsOfDate; - public virtual DateTime EndDate + public virtual bool? CurrentGradeIndicator { get; set; } + public virtual string DiagnosticStatement { get; set; } + public virtual string GradeEarnedDescription { get; set; } + public virtual string LetterGradeEarned { get; set; } + public virtual decimal? NumericGradeEarned { get; set; } + public virtual int? PerformanceBaseConversionDescriptorId { - get { return _endDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _endDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_performanceBaseConversionDescriptorId == default(int?)) + _performanceBaseConversionDescriptorId = string.IsNullOrWhiteSpace(_performanceBaseConversionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptor); + + return _performanceBaseConversionDescriptorId; + } + set + { + _performanceBaseConversionDescriptorId = value; + _performanceBaseConversionDescriptor = null; + } } - private DateTime _endDate; - - public virtual int? PeriodSequence { get; set; } - public virtual int TotalInstructionalDays { get; set; } + private int? _performanceBaseConversionDescriptorId; + private string _performanceBaseConversionDescriptor; + + public virtual string PerformanceBaseConversionDescriptor + { + get + { + if (_performanceBaseConversionDescriptor == null) + _performanceBaseConversionDescriptor = _performanceBaseConversionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptorId.Value); + + return _performanceBaseConversionDescriptor; + } + set + { + _performanceBaseConversionDescriptor = value; + _performanceBaseConversionDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -51273,25 +51166,43 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IGradingPeriod.SchoolResourceId + string Entities.Common.EdFi.IGrade.GradingPeriodDiscriminator { - get { return SchoolReferenceData?.Id; } + get { return GradingPeriodReferenceData?.Discriminator; } set { } } - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + /// + /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGrade.GradingPeriodResourceId + { + get { return GradingPeriodReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentSectionAssociationAggregate.EdFi.StudentSectionAssociationReferenceData StudentSectionAssociationReferenceData { get; set; } /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the StudentSectionAssociation discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IGradingPeriod.SchoolYearTypeResourceId + string Entities.Common.EdFi.IGrade.StudentSectionAssociationDiscriminator { - get { return SchoolYearTypeReferenceData?.Id; } + get { return StudentSectionAssociationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentSectionAssociation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGrade.StudentSectionAssociationResourceId + { + get { return StudentSectionAssociationReferenceData?.Id; } set { } } @@ -51300,12 +51211,61 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _gradeLearningStandardGrades; + private ICollection _gradeLearningStandardGradesCovariant; + public virtual ICollection GradeLearningStandardGrades + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _gradeLearningStandardGrades) + if (item.Grade == null) + item.Grade = this; + // ------------------------------------------------------------- + + return _gradeLearningStandardGrades; + } + set + { + _gradeLearningStandardGrades = value; + _gradeLearningStandardGradesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGrade.GradeLearningStandardGrades + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _gradeLearningStandardGrades) + if (item.Grade == null) + item.Grade = this; + // ------------------------------------------------------------- + + return _gradeLearningStandardGradesCovariant; + } + set + { + GradeLearningStandardGrades = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeTypeDescriptor", new LookupColumnDetails { PropertyName = "GradeTypeDescriptorId", LookupTypeName = "GradeTypeDescriptor"} }, { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, + { "PerformanceBaseConversionDescriptor", new LookupColumnDetails { PropertyName = "PerformanceBaseConversionDescriptorId", LookupTypeName = "PerformanceBaseConversionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -51320,14 +51280,27 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); + keyValues.Add("LocalCourseCode", LocalCourseCode); keyValues.Add("SchoolId", SchoolId); keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } + /// + /// Gets or sets the capturing the new key values that have + /// not been modified directly on the entity. + /// + OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } + #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -51387,84 +51360,99 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradingPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGrade)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradingPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IGrade) target, null); } } -} -// Aggregate: GradingPeriodDescriptor - -namespace EdFi.Ods.Entities.NHibernate.GradingPeriodDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GradingPeriodDescriptor table of the GradingPeriodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GradeLearningStandardGrade table of the Grade aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GradingPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IGradingPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GradeLearningStandardGrade : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGradeLearningStandardGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public GradeLearningStandardGrade() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int GradingPeriodDescriptorId + [DomainSignature, JsonIgnore] + public virtual Grade Grade { get; set; } + + Entities.Common.EdFi.IGrade IGradeLearningStandardGrade.Grade { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return Grade; } + set { Grade = (Grade) value; } } - + + [DomainSignature] + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string DiagnosticStatement { get; set; } + public virtual string LetterGradeEarned { get; set; } + public virtual decimal? NumericGradeEarned { get; set; } + public virtual int? PerformanceBaseConversionDescriptorId { - get { return CodeValue; } - set { CodeValue = value; } + get + { + if (_performanceBaseConversionDescriptorId == default(int?)) + _performanceBaseConversionDescriptorId = string.IsNullOrWhiteSpace(_performanceBaseConversionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptor); + + return _performanceBaseConversionDescriptorId; + } + set + { + _performanceBaseConversionDescriptorId = value; + _performanceBaseConversionDescriptor = null; + } } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + + private int? _performanceBaseConversionDescriptorId; + private string _performanceBaseConversionDescriptor; + + public virtual string PerformanceBaseConversionDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_performanceBaseConversionDescriptor == null) + _performanceBaseConversionDescriptor = _performanceBaseConversionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceBaseConversionDescriptor", _performanceBaseConversionDescriptorId.Value); + + return _performanceBaseConversionDescriptor; + } + set + { + _performanceBaseConversionDescriptor = value; + _performanceBaseConversionDescriptorId = default(int?); + } } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -51473,11 +51461,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardDiscriminator + { + get { return LearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardResourceId + { + get { return LearningStandardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -51488,6 +51525,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeTypeDescriptor", new LookupColumnDetails { PropertyName = "GradeTypeDescriptorId", LookupTypeName = "GradeTypeDescriptor"} }, + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, + { "PerformanceBaseConversionDescriptor", new LookupColumnDetails { PropertyName = "PerformanceBaseConversionDescriptorId", LookupTypeName = "PerformanceBaseConversionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -51498,11 +51538,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Grade as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -51566,31 +51606,34 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGradingPeriodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradeLearningStandardGrade)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGradingPeriodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGradeLearningStandardGrade) target, null); } + void IChildEntity.SetParent(object value) + { + Grade = (Grade) value; + } } } -// Aggregate: GraduationPlan +// Aggregate: GradebookEntry -namespace EdFi.Ods.Entities.NHibernate.GraduationPlanAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GradebookEntryAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class GraduationPlanReferenceData : IHasPrimaryKeyValues + public class GradebookEntryReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual int GraduationPlanTypeDescriptorId { get; set; } - public virtual short GraduationSchoolYear { get; set; } + public virtual string GradebookEntryIdentifier { get; set; } + public virtual string Namespace { get; set; } // ------------------------------------------------------------- /// @@ -51611,9 +51654,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("GraduationPlanTypeDescriptorId", GraduationPlanTypeDescriptorId); - keyValues.Add("GraduationSchoolYear", GraduationSchoolYear); + keyValues.Add("GradebookEntryIdentifier", GradebookEntryIdentifier); + keyValues.Add("Namespace", Namespace); return keyValues; } @@ -51664,23 +51706,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlan table of the GraduationPlan aggregate in the ODS database. + /// A class which represents the edfi.GradebookEntry table of the GradebookEntry aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlan : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IGraduationPlan, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradebookEntry : AggregateRootWithCompositeKey, IHasCascadableKeyValues, + Entities.Common.EdFi.IGradebookEntry, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GraduationPlan() + public GradebookEntry() { - GraduationPlanCreditsByCourses = new HashSet(); - GraduationPlanCreditsByCreditCategories = new HashSet(); - GraduationPlanCreditsBySubjects = new HashSet(); - GraduationPlanRequiredAssessments = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + GradebookEntryLearningStandards = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -51689,91 +51728,126 @@ public GraduationPlan() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long EducationOrganizationId { get; set; } + public virtual string GradebookEntryIdentifier { get; set; } [DomainSignature] - public virtual int GraduationPlanTypeDescriptorId + public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime DateAssigned + { + get { return _dateAssigned; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _dateAssigned = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _dateAssigned; + + public virtual string Description { get; set; } + public virtual DateTime? DueDate + { + get { return _dueDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _dueDate = null; + } else + { + var given = (DateTime) value; + _dueDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _dueDate; + + public virtual TimeSpan? DueTime { get; set; } + public virtual int? GradebookEntryTypeDescriptorId { get { - if (_graduationPlanTypeDescriptorId == default(int)) - _graduationPlanTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GraduationPlanTypeDescriptor", _graduationPlanTypeDescriptor); + if (_gradebookEntryTypeDescriptorId == default(int?)) + _gradebookEntryTypeDescriptorId = string.IsNullOrWhiteSpace(_gradebookEntryTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradebookEntryTypeDescriptor", _gradebookEntryTypeDescriptor); - return _graduationPlanTypeDescriptorId; + return _gradebookEntryTypeDescriptorId; } set { - _graduationPlanTypeDescriptorId = value; - _graduationPlanTypeDescriptor = null; + _gradebookEntryTypeDescriptorId = value; + _gradebookEntryTypeDescriptor = null; } } - private int _graduationPlanTypeDescriptorId; - private string _graduationPlanTypeDescriptor; + private int? _gradebookEntryTypeDescriptorId; + private string _gradebookEntryTypeDescriptor; - public virtual string GraduationPlanTypeDescriptor + public virtual string GradebookEntryTypeDescriptor { get { - if (_graduationPlanTypeDescriptor == null) - _graduationPlanTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GraduationPlanTypeDescriptor", _graduationPlanTypeDescriptorId); + if (_gradebookEntryTypeDescriptor == null) + _gradebookEntryTypeDescriptor = _gradebookEntryTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradebookEntryTypeDescriptor", _gradebookEntryTypeDescriptorId.Value); - return _graduationPlanTypeDescriptor; + return _gradebookEntryTypeDescriptor; } set { - _graduationPlanTypeDescriptor = value; - _graduationPlanTypeDescriptorId = default(int); + _gradebookEntryTypeDescriptor = value; + _gradebookEntryTypeDescriptorId = default(int?); } } - [DomainSignature] - public virtual short GraduationSchoolYear { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual bool? IndividualPlan { get; set; } - public virtual decimal? TotalRequiredCreditConversion { get; set; } - public virtual decimal TotalRequiredCredits { get; set; } - public virtual int? TotalRequiredCreditTypeDescriptorId + public virtual int? GradingPeriodDescriptorId { get { - if (_totalRequiredCreditTypeDescriptorId == default(int?)) - _totalRequiredCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_totalRequiredCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _totalRequiredCreditTypeDescriptor); + if (_gradingPeriodDescriptorId == default(int?)) + _gradingPeriodDescriptorId = string.IsNullOrWhiteSpace(_gradingPeriodDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); - return _totalRequiredCreditTypeDescriptorId; + return _gradingPeriodDescriptorId; } set { - _totalRequiredCreditTypeDescriptorId = value; - _totalRequiredCreditTypeDescriptor = null; + _gradingPeriodDescriptorId = value; + _gradingPeriodDescriptor = null; } } - private int? _totalRequiredCreditTypeDescriptorId; - private string _totalRequiredCreditTypeDescriptor; + private int? _gradingPeriodDescriptorId; + private string _gradingPeriodDescriptor; - public virtual string TotalRequiredCreditTypeDescriptor + public virtual string GradingPeriodDescriptor { get { - if (_totalRequiredCreditTypeDescriptor == null) - _totalRequiredCreditTypeDescriptor = _totalRequiredCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _totalRequiredCreditTypeDescriptorId.Value); + if (_gradingPeriodDescriptor == null) + _gradingPeriodDescriptor = _gradingPeriodDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId.Value); - return _totalRequiredCreditTypeDescriptor; + return _gradingPeriodDescriptor; } set { - _totalRequiredCreditTypeDescriptor = value; - _totalRequiredCreditTypeDescriptorId = default(int?); + _gradingPeriodDescriptor = value; + _gradingPeriodDescriptorId = default(int?); } } + public virtual string GradingPeriodName { get; set; } + public virtual string LocalCourseCode { get; set; } + public virtual decimal? MaxPoints { get; set; } + public virtual long? SchoolId { get; set; } + public virtual short? SchoolYear { get; set; } + public virtual string SectionIdentifier { get; set; } + public virtual string SessionName { get; set; } + public virtual string SourceSectionIdentifier { get; set; } + public virtual string Title { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -51818,34 +51892,43 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IGradebookEntry.GradingPeriodDiscriminator { - get { return EducationOrganizationReferenceData?.Discriminator; } + get { return GradingPeriodReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IGraduationPlan.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IGradebookEntry.GradingPeriodResourceId { - get { return EducationOrganizationReferenceData?.Id; } + get { return GradingPeriodReferenceData?.Id; } set { } } - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData GraduationSchoolYearTypeReferenceData { get; set; } + public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// - /// Read-only property that allows the GraduationSchoolYearType resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IGraduationPlan.GraduationSchoolYearTypeResourceId + string Entities.Common.EdFi.IGradebookEntry.SectionDiscriminator { - get { return GraduationSchoolYearTypeReferenceData?.Id; } + get { return SectionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGradebookEntry.SectionResourceId + { + get { return SectionReferenceData?.Id; } set { } } @@ -51855,150 +51938,9 @@ string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _graduationPlanCreditsByCourses; - private ICollection _graduationPlanCreditsByCoursesCovariant; - public virtual ICollection GraduationPlanCreditsByCourses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsByCourses) - if (item.GraduationPlan == null) - item.GraduationPlan = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsByCourses; - } - set - { - _graduationPlanCreditsByCourses = value; - _graduationPlanCreditsByCoursesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCourses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsByCourses) - if (item.GraduationPlan == null) - item.GraduationPlan = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsByCoursesCovariant; - } - set - { - GraduationPlanCreditsByCourses = new HashSet(value.Cast()); - } - } - - - private ICollection _graduationPlanCreditsByCreditCategories; - private ICollection _graduationPlanCreditsByCreditCategoriesCovariant; - public virtual ICollection GraduationPlanCreditsByCreditCategories - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsByCreditCategories) - if (item.GraduationPlan == null) - item.GraduationPlan = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsByCreditCategories; - } - set - { - _graduationPlanCreditsByCreditCategories = value; - _graduationPlanCreditsByCreditCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCreditCategories - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsByCreditCategories) - if (item.GraduationPlan == null) - item.GraduationPlan = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsByCreditCategoriesCovariant; - } - set - { - GraduationPlanCreditsByCreditCategories = new HashSet(value.Cast()); - } - } - - - private ICollection _graduationPlanCreditsBySubjects; - private ICollection _graduationPlanCreditsBySubjectsCovariant; - public virtual ICollection GraduationPlanCreditsBySubjects - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsBySubjects) - if (item.GraduationPlan == null) - item.GraduationPlan = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsBySubjects; - } - set - { - _graduationPlanCreditsBySubjects = value; - _graduationPlanCreditsBySubjectsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsBySubjects - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsBySubjects) - if (item.GraduationPlan == null) - item.GraduationPlan = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsBySubjectsCovariant; - } - set - { - GraduationPlanCreditsBySubjects = new HashSet(value.Cast()); - } - } - - - private ICollection _graduationPlanRequiredAssessments; - private ICollection _graduationPlanRequiredAssessmentsCovariant; - public virtual ICollection GraduationPlanRequiredAssessments + private ICollection _gradebookEntryLearningStandards; + private ICollection _gradebookEntryLearningStandardsCovariant; + public virtual ICollection GradebookEntryLearningStandards { get { @@ -52007,38 +51949,38 @@ public virtual ICollection(value); + _gradebookEntryLearningStandards = value; + _gradebookEntryLearningStandardsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanRequiredAssessments + ICollection Entities.Common.EdFi.IGradebookEntry.GradebookEntryLearningStandards { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _graduationPlanRequiredAssessments) - if (item.GraduationPlan == null) - item.GraduationPlan = this; + foreach (var item in _gradebookEntryLearningStandards) + if (item.GradebookEntry == null) + item.GradebookEntry = this; // ------------------------------------------------------------- - return _graduationPlanRequiredAssessmentsCovariant; + return _gradebookEntryLearningStandardsCovariant; } set { - GraduationPlanRequiredAssessments = new HashSet(value.Cast()); + GradebookEntryLearningStandards = new HashSet(value.Cast()); } } @@ -52047,8 +51989,8 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, - { "TotalRequiredCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "TotalRequiredCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "GradebookEntryTypeDescriptor", new LookupColumnDetails { PropertyName = "GradebookEntryTypeDescriptorId", LookupTypeName = "GradebookEntryTypeDescriptor"} }, + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -52063,13 +52005,18 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("GraduationPlanTypeDescriptorId", GraduationPlanTypeDescriptorId); - keyValues.Add("GraduationSchoolYear", GraduationSchoolYear); + keyValues.Add("GradebookEntryIdentifier", GradebookEntryIdentifier); + keyValues.Add("Namespace", Namespace); return keyValues; } + /// + /// Gets or sets the capturing the new key values that have + /// not been modified directly on the entity. + /// + OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } + #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -52129,12 +52076,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlan)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradebookEntry)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlan) target, null); + this.MapTo((Entities.Common.EdFi.IGradebookEntry) target, null); } } @@ -52142,20 +52089,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlanCreditsByCourse table of the GraduationPlan aggregate in the ODS database. + /// A class which represents the edfi.GradebookEntryLearningStandard table of the GradebookEntry aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsByCourse : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGraduationPlanCreditsByCourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradebookEntryLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGradebookEntryLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GraduationPlanCreditsByCourse() + public GradebookEntryLearningStandard() { - GraduationPlanCreditsByCourseCourses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -52164,16 +52110,16 @@ public GraduationPlanCreditsByCourse() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual GraduationPlan GraduationPlan { get; set; } + public virtual GradebookEntry GradebookEntry { get; set; } - Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPlan + Entities.Common.EdFi.IGradebookEntry IGradebookEntryLearningStandard.GradebookEntry { - get { return GraduationPlan; } - set { GraduationPlan = (GraduationPlan) value; } + get { return GradebookEntry; } + set { GradebookEntry = (GradebookEntry) value; } } [DomainSignature] - public virtual string CourseSetName { get; set; } + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -52184,76 +52130,6 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPl // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? CreditConversion { get; set; } - public virtual decimal Credits { get; set; } - public virtual int? CreditTypeDescriptorId - { - get - { - if (_creditTypeDescriptorId == default(int?)) - _creditTypeDescriptorId = string.IsNullOrWhiteSpace(_creditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _creditTypeDescriptor); - - return _creditTypeDescriptorId; - } - set - { - _creditTypeDescriptorId = value; - _creditTypeDescriptor = null; - } - } - - private int? _creditTypeDescriptorId; - private string _creditTypeDescriptor; - - public virtual string CreditTypeDescriptor - { - get - { - if (_creditTypeDescriptor == null) - _creditTypeDescriptor = _creditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _creditTypeDescriptorId.Value); - - return _creditTypeDescriptor; - } - set - { - _creditTypeDescriptor = value; - _creditTypeDescriptorId = default(int?); - } - } - public virtual int? WhenTakenGradeLevelDescriptorId - { - get - { - if (_whenTakenGradeLevelDescriptorId == default(int?)) - _whenTakenGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenTakenGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenTakenGradeLevelDescriptor); - - return _whenTakenGradeLevelDescriptorId; - } - set - { - _whenTakenGradeLevelDescriptorId = value; - _whenTakenGradeLevelDescriptor = null; - } - } - - private int? _whenTakenGradeLevelDescriptorId; - private string _whenTakenGradeLevelDescriptor; - - public virtual string WhenTakenGradeLevelDescriptor - { - get - { - if (_whenTakenGradeLevelDescriptor == null) - _whenTakenGradeLevelDescriptor = _whenTakenGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenTakenGradeLevelDescriptorId.Value); - - return _whenTakenGradeLevelDescriptor; - } - set - { - _whenTakenGradeLevelDescriptor = value; - _whenTakenGradeLevelDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -52298,66 +52174,36 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - private ICollection _graduationPlanCreditsByCourseCourses; - private ICollection _graduationPlanCreditsByCourseCoursesCovariant; - public virtual ICollection GraduationPlanCreditsByCourseCourses + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardDiscriminator { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsByCourseCourses) - if (item.GraduationPlanCreditsByCourse == null) - item.GraduationPlanCreditsByCourse = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsByCourseCourses; - } - set - { - _graduationPlanCreditsByCourseCourses = value; - _graduationPlanCreditsByCourseCoursesCovariant = new CovariantCollectionAdapter(value); - } + get { return LearningStandardReferenceData?.Discriminator; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlanCreditsByCourse.GraduationPlanCreditsByCourseCourses + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardResourceId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanCreditsByCourseCourses) - if (item.GraduationPlanCreditsByCourse == null) - item.GraduationPlanCreditsByCourse = this; - // ------------------------------------------------------------- - - return _graduationPlanCreditsByCourseCoursesCovariant; - } - set - { - GraduationPlanCreditsByCourseCourses = new HashSet(value.Cast()); - } + get { return LearningStandardReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, - { "WhenTakenGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenTakenGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -52369,10 +52215,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GradebookEntry as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CourseSetName", CourseSetName); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -52436,61 +52282,81 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourse)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradebookEntryLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourse) target, null); + this.MapTo((Entities.Common.EdFi.IGradebookEntryLearningStandard) target, null); } void IChildEntity.SetParent(object value) { - GraduationPlan = (GraduationPlan) value; + GradebookEntry = (GradebookEntry) value; } } +} +// Aggregate: GradebookEntryTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.GradebookEntryTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlanCreditsByCourseCourse table of the GraduationPlan aggregate in the ODS database. + /// A class which represents the edfi.GradebookEntryTypeDescriptor table of the GradebookEntryTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsByCourseCourse : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradebookEntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IGradebookEntryTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public GraduationPlanCreditsByCourseCourse() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GraduationPlanCreditsByCourse GraduationPlanCreditsByCourse { get; set; } - - Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCourseCourse.GraduationPlanCreditsByCourse + [DomainSignature] + public virtual int GradebookEntryTypeDescriptorId { - get { return GraduationPlanCreditsByCourse; } - set { GraduationPlanCreditsByCourse = (GraduationPlanCreditsByCourse) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string CourseCode { get; set; } - [DomainSignature] - public virtual long CourseEducationOrganizationId { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -52506,60 +52372,11 @@ Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCour // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } - - /// - /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseDiscriminator - { - get { return CourseReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseResourceId - { - get { return CourseReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -52570,7 +52387,6 @@ string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseDiscrimin // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -52581,12 +52397,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (GraduationPlanCreditsByCourse as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); + keyValues.Add("GradebookEntryTypeDescriptorId", GradebookEntryTypeDescriptorId); return keyValues; } @@ -52650,133 +52465,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradebookEntryTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse) target, null); + this.MapTo((Entities.Common.EdFi.IGradebookEntryTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - GraduationPlanCreditsByCourse = (GraduationPlanCreditsByCourse) value; - } } +} +// Aggregate: GradeLevelDescriptor + +namespace EdFi.Ods.Entities.NHibernate.GradeLevelDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlanCreditsByCreditCategory table of the GraduationPlan aggregate in the ODS database. + /// A class which represents the edfi.GradeLevelDescriptor table of the GradeLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsByCreditCategory : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradeLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IGradeLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public GraduationPlanCreditsByCreditCategory() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GraduationPlan GraduationPlan { get; set; } - - Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCreditCategory.GraduationPlan - { - get { return GraduationPlan; } - set { GraduationPlan = (GraduationPlan) value; } - } - [DomainSignature] - public virtual int CreditCategoryDescriptorId - { - get - { - if (_creditCategoryDescriptorId == default(int)) - _creditCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditCategoryDescriptor", _creditCategoryDescriptor); - - return _creditCategoryDescriptorId; - } - set - { - _creditCategoryDescriptorId = value; - _creditCategoryDescriptor = null; - } - } - - private int _creditCategoryDescriptorId; - private string _creditCategoryDescriptor; - - public virtual string CreditCategoryDescriptor + public virtual int GradeLevelDescriptorId { - get - { - if (_creditCategoryDescriptor == null) - _creditCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditCategoryDescriptor", _creditCategoryDescriptorId); - - return _creditCategoryDescriptor; - } - set - { - _creditCategoryDescriptor = value; - _creditCategoryDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? CreditConversion { get; set; } - public virtual decimal Credits { get; set; } - public virtual int? CreditTypeDescriptorId - { - get - { - if (_creditTypeDescriptorId == default(int?)) - _creditTypeDescriptorId = string.IsNullOrWhiteSpace(_creditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _creditTypeDescriptor); - - return _creditTypeDescriptorId; - } - set - { - _creditTypeDescriptorId = value; - _creditTypeDescriptor = null; - } - } - - private int? _creditTypeDescriptorId; - private string _creditTypeDescriptor; - - public virtual string CreditTypeDescriptor - { - get - { - if (_creditTypeDescriptor == null) - _creditTypeDescriptor = _creditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _creditTypeDescriptorId.Value); - - return _creditTypeDescriptor; - } - set - { - _creditTypeDescriptor = value; - _creditTypeDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -52787,35 +52551,6 @@ public virtual string CreditTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -52831,9 +52566,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CreditCategoryDescriptor", new LookupColumnDetails { PropertyName = "CreditCategoryDescriptorId", LookupTypeName = "CreditCategoryDescriptor"} }, - { "CreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -52844,11 +52576,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -52912,133 +52644,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradeLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory) target, null); + this.MapTo((Entities.Common.EdFi.IGradeLevelDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - GraduationPlan = (GraduationPlan) value; - } } +} +// Aggregate: GradePointAverageTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.GradePointAverageTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlanCreditsBySubject table of the GraduationPlan aggregate in the ODS database. + /// A class which represents the edfi.GradePointAverageTypeDescriptor table of the GradePointAverageTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsBySubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGraduationPlanCreditsBySubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradePointAverageTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IGradePointAverageTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public GraduationPlanCreditsBySubject() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GraduationPlan GraduationPlan { get; set; } - - Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsBySubject.GraduationPlan + [DomainSignature] + public virtual int GradePointAverageTypeDescriptorId { - get { return GraduationPlan; } - set { GraduationPlan = (GraduationPlan) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + + // ------------------------------------------------------------- - [DomainSignature] - public virtual int AcademicSubjectDescriptorId + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue { - get - { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } + get { return CodeValue; } + set { CodeValue = value; } } - - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor + string IDescriptor.Description { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); - } + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? CreditConversion { get; set; } - public virtual decimal Credits { get; set; } - public virtual int? CreditTypeDescriptorId - { - get - { - if (_creditTypeDescriptorId == default(int?)) - _creditTypeDescriptorId = string.IsNullOrWhiteSpace(_creditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _creditTypeDescriptor); - - return _creditTypeDescriptorId; - } - set - { - _creditTypeDescriptorId = value; - _creditTypeDescriptor = null; - } - } - - private int? _creditTypeDescriptorId; - private string _creditTypeDescriptor; - - public virtual string CreditTypeDescriptor - { - get - { - if (_creditTypeDescriptor == null) - _creditTypeDescriptor = _creditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _creditTypeDescriptorId.Value); - - return _creditTypeDescriptor; - } - set - { - _creditTypeDescriptor = value; - _creditTypeDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -53049,35 +52730,6 @@ public virtual string CreditTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -53093,9 +52745,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "CreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -53106,11 +52755,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); return keyValues; } @@ -53174,63 +52823,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsBySubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradePointAverageTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsBySubject) target, null); + this.MapTo((Entities.Common.EdFi.IGradePointAverageTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - GraduationPlan = (GraduationPlan) value; - } } +} +// Aggregate: GradeTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.GradeTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlanRequiredAssessment table of the GraduationPlan aggregate in the ODS database. + /// A class which represents the edfi.GradeTypeDescriptor table of the GradeTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessment : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGraduationPlanRequiredAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IGradeTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public GraduationPlanRequiredAssessment() - { - GraduationPlanRequiredAssessmentPerformanceLevelPersistentList = new HashSet(); - GraduationPlanRequiredAssessmentScores = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GraduationPlan GraduationPlan { get; set; } - - Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.GraduationPlan + [DomainSignature] + public virtual int GradeTypeDescriptorId { - get { return GraduationPlan; } - set { GraduationPlan = (GraduationPlan) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string AssessmentIdentifier { get; set; } - [DomainSignature] - public virtual string Namespace { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -53241,181 +52904,26 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.Graduatio // ============================================================= // One-to-one relationships // ------------------------------------------------------------- - public virtual Entities.NHibernate.GraduationPlanAggregate.EdFi.GraduationPlanRequiredAssessmentPerformanceLevel GraduationPlanRequiredAssessmentPerformanceLevel - { - get - { - // Return the item in the list, if one exists - if (GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Any()) - return GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.First(); - - // No reference is present - return null; - } - set - { - // Delete the existing object - if (GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Any()) - GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Clear(); - - // If we're setting a value, add it to the list now - if (value != null) - { - // Set the back-reference to the parent - value.GraduationPlanRequiredAssessment = this; - - GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Add(value); - } - } - } - - Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentPerformanceLevel - { - get { return GraduationPlanRequiredAssessmentPerformanceLevel; } - set { GraduationPlanRequiredAssessmentPerformanceLevel = (Entities.NHibernate.GraduationPlanAggregate.EdFi.GraduationPlanRequiredAssessmentPerformanceLevel) value; } - } - - private ICollection _graduationPlanRequiredAssessmentPerformanceLevelPersistentList; - - public virtual ICollection GraduationPlanRequiredAssessmentPerformanceLevelPersistentList - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanRequiredAssessmentPerformanceLevelPersistentList) - if (item.GraduationPlanRequiredAssessment == null) - item.GraduationPlanRequiredAssessment = this; - // ------------------------------------------------------------- - - return _graduationPlanRequiredAssessmentPerformanceLevelPersistentList; - } - set - { - _graduationPlanRequiredAssessmentPerformanceLevelPersistentList = value; - } - } - // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } - - /// - /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscriminator - { - get { return AssessmentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentResourceId - { - get { return AssessmentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _graduationPlanRequiredAssessmentScores; - private ICollection _graduationPlanRequiredAssessmentScoresCovariant; - public virtual ICollection GraduationPlanRequiredAssessmentScores - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanRequiredAssessmentScores) - if (item.GraduationPlanRequiredAssessment == null) - item.GraduationPlanRequiredAssessment = this; - // ------------------------------------------------------------- - - return _graduationPlanRequiredAssessmentScores; - } - set - { - _graduationPlanRequiredAssessmentScores = value; - _graduationPlanRequiredAssessmentScoresCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentScores - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _graduationPlanRequiredAssessmentScores) - if (item.GraduationPlanRequiredAssessment == null) - item.GraduationPlanRequiredAssessment = this; - // ------------------------------------------------------------- - - return _graduationPlanRequiredAssessmentScoresCovariant; - } - set - { - GraduationPlanRequiredAssessmentScores = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -53426,12 +52934,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("Namespace", Namespace); + keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); return keyValues; } @@ -53495,239 +53002,56 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessment)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradeTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessment) target, null); + this.MapTo((Entities.Common.EdFi.IGradeTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - GraduationPlan = (GraduationPlan) value; - } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 +} +// Aggregate: GradingPeriod +namespace EdFi.Ods.Entities.NHibernate.GradingPeriodAggregate.EdFi +{ /// - /// A class which represents the edfi.GraduationPlanRequiredAssessmentPerformanceLevel table of the GraduationPlan aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradingPeriodReferenceData : IHasPrimaryKeyValues { - public virtual void SuspendReferenceAssignmentCheck() { } - - public GraduationPlanRequiredAssessmentPerformanceLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { get; set; } - - Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentPerformanceLevel.GraduationPlanRequiredAssessment - { - get { return GraduationPlanRequiredAssessment; } - set { GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int AssessmentReportingMethodDescriptorId - { - get - { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - - return _assessmentReportingMethodDescriptorId; - } - set - { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; - } - } - - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; - - public virtual string AssessmentReportingMethodDescriptor - { - get - { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); - - return _assessmentReportingMethodDescriptor; - } - set - { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); - } - } - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } - public virtual int PerformanceLevelDescriptorId - { - get - { - if (_performanceLevelDescriptorId == default(int)) - _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); - - return _performanceLevelDescriptorId; - } - set - { - _performanceLevelDescriptorId = value; - _performanceLevelDescriptor = null; - } - } - - private int _performanceLevelDescriptorId; - private string _performanceLevelDescriptor; - - public virtual string PerformanceLevelDescriptor - { - get - { - if (_performanceLevelDescriptor == null) - _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); - - return _performanceLevelDescriptor; - } - set - { - _performanceLevelDescriptor = value; - _performanceLevelDescriptorId = default(int); - } - } - public virtual string PerformanceLevelIndicatorName { get; set; } - public virtual int? ResultDatatypeTypeDescriptorId - { - get - { - if (_resultDatatypeTypeDescriptorId == default(int?)) - _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - - return _resultDatatypeTypeDescriptorId; - } - set - { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; - } - } - - private int? _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; - - public virtual string ResultDatatypeTypeDescriptor - { - get - { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); - - return _resultDatatypeTypeDescriptor; - } - set - { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int?); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual int GradingPeriodDescriptorId { get; set; } + public virtual string GradingPeriodName { get; set; } + public virtual long SchoolId { get; set; } + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, - { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); + keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -53748,18 +53072,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -53776,51 +53090,31 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel) target, null); - } - - void IChildEntity.SetParent(object value) - { - GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; - } } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlanRequiredAssessmentScore table of the GraduationPlan aggregate in the ODS database. + /// A class which represents the edfi.GradingPeriod table of the GradingPeriod aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessmentScore : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class GradingPeriod : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IGradingPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GraduationPlanRequiredAssessmentScore() + public GradingPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -53828,50 +53122,47 @@ public GraduationPlanRequiredAssessmentScore() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { get; set; } - - Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentScore.GraduationPlanRequiredAssessment - { - get { return GraduationPlanRequiredAssessment; } - set { GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; } - } - [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId + public virtual int GradingPeriodDescriptorId { get { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + if (_gradingPeriodDescriptorId == default(int)) + _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); - return _assessmentReportingMethodDescriptorId; + return _gradingPeriodDescriptorId; } set { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; + _gradingPeriodDescriptorId = value; + _gradingPeriodDescriptor = null; } } - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; + private int _gradingPeriodDescriptorId; + private string _gradingPeriodDescriptor; - public virtual string AssessmentReportingMethodDescriptor + public virtual string GradingPeriodDescriptor { get { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + if (_gradingPeriodDescriptor == null) + _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); - return _assessmentReportingMethodDescriptor; + return _gradingPeriodDescriptor; } set { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); + _gradingPeriodDescriptor = value; + _gradingPeriodDescriptorId = default(int); } } + [DomainSignature] + public virtual string GradingPeriodName { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -53882,42 +53173,26 @@ public virtual string AssessmentReportingMethodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } - public virtual int? ResultDatatypeTypeDescriptorId + public virtual DateTime BeginDate { - get - { - if (_resultDatatypeTypeDescriptorId == default(int?)) - _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - - return _resultDatatypeTypeDescriptorId; - } - set - { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; - } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } - private int? _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; - - public virtual string ResultDatatypeTypeDescriptor + private DateTime _beginDate; + + public virtual DateTime EndDate { - get - { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); - - return _resultDatatypeTypeDescriptor; - } - set - { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int?); - } + get { return _endDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _endDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _endDate; + + public virtual int? PeriodSequence { get; set; } + public virtual int TotalInstructionalDays { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -53962,6 +53237,28 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGradingPeriod.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGradingPeriod.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -53972,9 +53269,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -53985,11 +53280,14 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); + keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -54053,41 +53351,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradingPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore) target, null); + this.MapTo((Entities.Common.EdFi.IGradingPeriod) target, null); } - void IChildEntity.SetParent(object value) - { - GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; - } } } -// Aggregate: GraduationPlanTypeDescriptor +// Aggregate: GradingPeriodDescriptor -namespace EdFi.Ods.Entities.NHibernate.GraduationPlanTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GradingPeriodDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GraduationPlanTypeDescriptor table of the GraduationPlanTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GradingPeriodDescriptor table of the GradingPeriodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GraduationPlanTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IGraduationPlanTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GradingPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IGradingPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int GraduationPlanTypeDescriptorId + public virtual int GradingPeriodDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -54172,7 +53466,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GraduationPlanTypeDescriptorId", GraduationPlanTypeDescriptorId); + keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); return keyValues; } @@ -54236,113 +53530,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGradingPeriodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGraduationPlanTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGradingPeriodDescriptor) target, null); } } } -// Aggregate: GunFreeSchoolsActReportingStatusDescriptor +// Aggregate: GraduationPlan -namespace EdFi.Ods.Entities.NHibernate.GunFreeSchoolsActReportingStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GraduationPlanAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.GunFreeSchoolsActReportingStatusDescriptor table of the GunFreeSchoolsActReportingStatusDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class GunFreeSchoolsActReportingStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int GunFreeSchoolsActReportingStatusDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual int GraduationPlanTypeDescriptorId { get; set; } + public virtual short GraduationSchoolYear { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -54351,7 +53575,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GunFreeSchoolsActReportingStatusDescriptorId", GunFreeSchoolsActReportingStatusDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("GraduationPlanTypeDescriptorId", GraduationPlanTypeDescriptorId); + keyValues.Add("GraduationSchoolYear", GraduationSchoolYear); return keyValues; } @@ -54372,18 +53598,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -54400,122 +53616,403 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor) target, null); - } - } -} -// Aggregate: HomelessPrimaryNighttimeResidenceDescriptor -namespace EdFi.Ods.Entities.NHibernate.HomelessPrimaryNighttimeResidenceDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.HomelessPrimaryNighttimeResidenceDescriptor table of the HomelessPrimaryNighttimeResidenceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlan table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class HomelessPrimaryNighttimeResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlan : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IGraduationPlan, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int HomelessPrimaryNighttimeResidenceDescriptorId + public GraduationPlan() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + GraduationPlanCreditsByCourses = new HashSet(); + GraduationPlanCreditsByCreditCategories = new HashSet(); + GraduationPlanCreditsBySubjects = new HashSet(); + GraduationPlanRequiredAssessments = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int GraduationPlanTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_graduationPlanTypeDescriptorId == default(int)) + _graduationPlanTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GraduationPlanTypeDescriptor", _graduationPlanTypeDescriptor); + + return _graduationPlanTypeDescriptorId; + } + set + { + _graduationPlanTypeDescriptorId = value; + _graduationPlanTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _graduationPlanTypeDescriptorId; + private string _graduationPlanTypeDescriptor; + + public virtual string GraduationPlanTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_graduationPlanTypeDescriptor == null) + _graduationPlanTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GraduationPlanTypeDescriptor", _graduationPlanTypeDescriptorId); + + return _graduationPlanTypeDescriptor; + } + set + { + _graduationPlanTypeDescriptor = value; + _graduationPlanTypeDescriptorId = default(int); + } } + [DomainSignature] + public virtual short GraduationSchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= - // Properties + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- + // Properties + // ------------------------------------------------------------- + public virtual bool? IndividualPlan { get; set; } + public virtual decimal? TotalRequiredCreditConversion { get; set; } + public virtual decimal TotalRequiredCredits { get; set; } + public virtual int? TotalRequiredCreditTypeDescriptorId + { + get + { + if (_totalRequiredCreditTypeDescriptorId == default(int?)) + _totalRequiredCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_totalRequiredCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _totalRequiredCreditTypeDescriptor); + + return _totalRequiredCreditTypeDescriptorId; + } + set + { + _totalRequiredCreditTypeDescriptorId = value; + _totalRequiredCreditTypeDescriptor = null; + } + } + + private int? _totalRequiredCreditTypeDescriptorId; + private string _totalRequiredCreditTypeDescriptor; + + public virtual string TotalRequiredCreditTypeDescriptor + { + get + { + if (_totalRequiredCreditTypeDescriptor == null) + _totalRequiredCreditTypeDescriptor = _totalRequiredCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _totalRequiredCreditTypeDescriptorId.Value); + + return _totalRequiredCreditTypeDescriptor; + } + set + { + _totalRequiredCreditTypeDescriptor = value; + _totalRequiredCreditTypeDescriptorId = default(int?); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGraduationPlan.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData GraduationSchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the GraduationSchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGraduationPlan.GraduationSchoolYearTypeResourceId + { + get { return GraduationSchoolYearTypeReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _graduationPlanCreditsByCourses; + private ICollection _graduationPlanCreditsByCoursesCovariant; + public virtual ICollection GraduationPlanCreditsByCourses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsByCourses) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsByCourses; + } + set + { + _graduationPlanCreditsByCourses = value; + _graduationPlanCreditsByCoursesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCourses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsByCourses) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsByCoursesCovariant; + } + set + { + GraduationPlanCreditsByCourses = new HashSet(value.Cast()); + } + } + + + private ICollection _graduationPlanCreditsByCreditCategories; + private ICollection _graduationPlanCreditsByCreditCategoriesCovariant; + public virtual ICollection GraduationPlanCreditsByCreditCategories + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsByCreditCategories) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsByCreditCategories; + } + set + { + _graduationPlanCreditsByCreditCategories = value; + _graduationPlanCreditsByCreditCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCreditCategories + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsByCreditCategories) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsByCreditCategoriesCovariant; + } + set + { + GraduationPlanCreditsByCreditCategories = new HashSet(value.Cast()); + } + } + + + private ICollection _graduationPlanCreditsBySubjects; + private ICollection _graduationPlanCreditsBySubjectsCovariant; + public virtual ICollection GraduationPlanCreditsBySubjects + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsBySubjects) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsBySubjects; + } + set + { + _graduationPlanCreditsBySubjects = value; + _graduationPlanCreditsBySubjectsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsBySubjects + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsBySubjects) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsBySubjectsCovariant; + } + set + { + GraduationPlanCreditsBySubjects = new HashSet(value.Cast()); + } + } + + + private ICollection _graduationPlanRequiredAssessments; + private ICollection _graduationPlanRequiredAssessmentsCovariant; + public virtual ICollection GraduationPlanRequiredAssessments + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanRequiredAssessments) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanRequiredAssessments; + } + set + { + _graduationPlanRequiredAssessments = value; + _graduationPlanRequiredAssessmentsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanRequiredAssessments + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanRequiredAssessments) + if (item.GraduationPlan == null) + item.GraduationPlan = this; + // ------------------------------------------------------------- + + return _graduationPlanRequiredAssessmentsCovariant; + } + set + { + GraduationPlanRequiredAssessments = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, + { "TotalRequiredCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "TotalRequiredCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -54530,7 +54027,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("HomelessPrimaryNighttimeResidenceDescriptorId", HomelessPrimaryNighttimeResidenceDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("GraduationPlanTypeDescriptorId", GraduationPlanTypeDescriptorId); + keyValues.Add("GraduationSchoolYear", GraduationSchoolYear); return keyValues; } @@ -54594,84 +54093,133 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlan)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlan) target, null); } } -} -// Aggregate: HomelessProgramServiceDescriptor - -namespace EdFi.Ods.Entities.NHibernate.HomelessProgramServiceDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.HomelessProgramServiceDescriptor table of the HomelessProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanCreditsByCourse table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class HomelessProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IHomelessProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanCreditsByCourse : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGraduationPlanCreditsByCourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public GraduationPlanCreditsByCourse() + { + GraduationPlanCreditsByCourseCourses = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int HomelessProgramServiceDescriptorId + [DomainSignature, JsonIgnore] + public virtual GraduationPlan GraduationPlan { get; set; } + + Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPlan { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return GraduationPlan; } + set { GraduationPlan = (GraduationPlan) value; } } - + + [DomainSignature] + public virtual string CourseSetName { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual decimal? CreditConversion { get; set; } + public virtual decimal Credits { get; set; } + public virtual int? CreditTypeDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_creditTypeDescriptorId == default(int?)) + _creditTypeDescriptorId = string.IsNullOrWhiteSpace(_creditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _creditTypeDescriptor); + + return _creditTypeDescriptorId; + } + set + { + _creditTypeDescriptorId = value; + _creditTypeDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int? _creditTypeDescriptorId; + private string _creditTypeDescriptor; + + public virtual string CreditTypeDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_creditTypeDescriptor == null) + _creditTypeDescriptor = _creditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _creditTypeDescriptorId.Value); + + return _creditTypeDescriptor; + } + set + { + _creditTypeDescriptor = value; + _creditTypeDescriptorId = default(int?); + } } - string IDescriptor.Namespace + public virtual int? WhenTakenGradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_whenTakenGradeLevelDescriptorId == default(int?)) + _whenTakenGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenTakenGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenTakenGradeLevelDescriptor); + + return _whenTakenGradeLevelDescriptorId; + } + set + { + _whenTakenGradeLevelDescriptorId = value; + _whenTakenGradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int? _whenTakenGradeLevelDescriptorId; + private string _whenTakenGradeLevelDescriptor; + + public virtual string WhenTakenGradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_whenTakenGradeLevelDescriptor == null) + _whenTakenGradeLevelDescriptor = _whenTakenGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenTakenGradeLevelDescriptorId.Value); + + return _whenTakenGradeLevelDescriptor; + } + set + { + _whenTakenGradeLevelDescriptor = value; + _whenTakenGradeLevelDescriptorId = default(int?); + } } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -54680,6 +54228,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -54690,11 +54267,61 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _graduationPlanCreditsByCourseCourses; + private ICollection _graduationPlanCreditsByCourseCoursesCovariant; + public virtual ICollection GraduationPlanCreditsByCourseCourses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsByCourseCourses) + if (item.GraduationPlanCreditsByCourse == null) + item.GraduationPlanCreditsByCourse = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsByCourseCourses; + } + set + { + _graduationPlanCreditsByCourseCourses = value; + _graduationPlanCreditsByCourseCoursesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlanCreditsByCourse.GraduationPlanCreditsByCourseCourses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanCreditsByCourseCourses) + if (item.GraduationPlanCreditsByCourse == null) + item.GraduationPlanCreditsByCourse = this; + // ------------------------------------------------------------- + + return _graduationPlanCreditsByCourseCoursesCovariant; + } + set + { + GraduationPlanCreditsByCourseCourses = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, + { "WhenTakenGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenTakenGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -54705,11 +54332,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("HomelessProgramServiceDescriptorId", HomelessProgramServiceDescriptorId); + keyValues.Add("CourseSetName", CourseSetName); return keyValues; } @@ -54773,77 +54400,61 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IHomelessProgramServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourse)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IHomelessProgramServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourse) target, null); } + void IChildEntity.SetParent(object value) + { + GraduationPlan = (GraduationPlan) value; + } } -} -// Aggregate: IDEAPartDescriptor - -namespace EdFi.Ods.Entities.NHibernate.IDEAPartDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.IDEAPartDescriptor table of the IDEAPartDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanCreditsByCourseCourse table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class IDEAPartDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IIDEAPartDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanCreditsByCourseCourse : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public GraduationPlanCreditsByCourseCourse() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int IDEAPartDescriptorId + [DomainSignature, JsonIgnore] + public virtual GraduationPlanCreditsByCourse GraduationPlanCreditsByCourse { get; set; } + + Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCourseCourse.GraduationPlanCreditsByCourse { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return GraduationPlanCreditsByCourse; } + set { GraduationPlanCreditsByCourse = (GraduationPlanCreditsByCourse) value; } } - + + [DomainSignature] + public virtual string CourseCode { get; set; } + [DomainSignature] + public virtual long CourseEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -54859,11 +54470,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } + + /// + /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseDiscriminator + { + get { return CourseReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseResourceId + { + get { return CourseReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -54874,6 +54534,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -54884,11 +54545,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GraduationPlanCreditsByCourse as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IDEAPartDescriptorId", IDEAPartDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); return keyValues; } @@ -54952,82 +54614,133 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IIDEAPartDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IIDEAPartDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse) target, null); } + void IChildEntity.SetParent(object value) + { + GraduationPlanCreditsByCourse = (GraduationPlanCreditsByCourse) value; + } } -} -// Aggregate: IdentificationDocumentUseDescriptor - -namespace EdFi.Ods.Entities.NHibernate.IdentificationDocumentUseDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.IdentificationDocumentUseDescriptor table of the IdentificationDocumentUseDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanCreditsByCreditCategory table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class IdentificationDocumentUseDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IIdentificationDocumentUseDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanCreditsByCreditCategory : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int IdentificationDocumentUseDescriptorId + public GraduationPlanCreditsByCreditCategory() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual GraduationPlan GraduationPlan { get; set; } + + Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCreditCategory.GraduationPlan { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return GraduationPlan; } + set { GraduationPlan = (GraduationPlan) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int CreditCategoryDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_creditCategoryDescriptorId == default(int)) + _creditCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditCategoryDescriptor", _creditCategoryDescriptor); + + return _creditCategoryDescriptorId; + } + set + { + _creditCategoryDescriptorId = value; + _creditCategoryDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _creditCategoryDescriptorId; + private string _creditCategoryDescriptor; + + public virtual string CreditCategoryDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_creditCategoryDescriptor == null) + _creditCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditCategoryDescriptor", _creditCategoryDescriptorId); + + return _creditCategoryDescriptor; + } + set + { + _creditCategoryDescriptor = value; + _creditCategoryDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? CreditConversion { get; set; } + public virtual decimal Credits { get; set; } + public virtual int? CreditTypeDescriptorId + { + get + { + if (_creditTypeDescriptorId == default(int?)) + _creditTypeDescriptorId = string.IsNullOrWhiteSpace(_creditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _creditTypeDescriptor); + + return _creditTypeDescriptorId; + } + set + { + _creditTypeDescriptorId = value; + _creditTypeDescriptor = null; + } + } + + private int? _creditTypeDescriptorId; + private string _creditTypeDescriptor; + + public virtual string CreditTypeDescriptor + { + get + { + if (_creditTypeDescriptor == null) + _creditTypeDescriptor = _creditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _creditTypeDescriptorId.Value); + + return _creditTypeDescriptor; + } + set + { + _creditTypeDescriptor = value; + _creditTypeDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -55038,6 +54751,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -55053,6 +54795,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CreditCategoryDescriptor", new LookupColumnDetails { PropertyName = "CreditCategoryDescriptorId", LookupTypeName = "CreditCategoryDescriptor"} }, + { "CreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -55063,11 +54808,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); + keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); return keyValues; } @@ -55131,82 +54876,133 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IIdentificationDocumentUseDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IIdentificationDocumentUseDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory) target, null); } + void IChildEntity.SetParent(object value) + { + GraduationPlan = (GraduationPlan) value; + } } -} -// Aggregate: ImmunizationTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ImmunizationTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ImmunizationTypeDescriptor table of the ImmunizationTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanCreditsBySubject table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ImmunizationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IImmunizationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanCreditsBySubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGraduationPlanCreditsBySubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ImmunizationTypeDescriptorId + public GraduationPlanCreditsBySubject() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual GraduationPlan GraduationPlan { get; set; } + + Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsBySubject.GraduationPlan { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return GraduationPlan; } + set { GraduationPlan = (GraduationPlan) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AcademicSubjectDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + public virtual string AcademicSubjectDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? CreditConversion { get; set; } + public virtual decimal Credits { get; set; } + public virtual int? CreditTypeDescriptorId + { + get + { + if (_creditTypeDescriptorId == default(int?)) + _creditTypeDescriptorId = string.IsNullOrWhiteSpace(_creditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _creditTypeDescriptor); + + return _creditTypeDescriptorId; + } + set + { + _creditTypeDescriptorId = value; + _creditTypeDescriptor = null; + } + } + + private int? _creditTypeDescriptorId; + private string _creditTypeDescriptor; + + public virtual string CreditTypeDescriptor + { + get + { + if (_creditTypeDescriptor == null) + _creditTypeDescriptor = _creditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _creditTypeDescriptorId.Value); + + return _creditTypeDescriptor; + } + set + { + _creditTypeDescriptor = value; + _creditTypeDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -55217,6 +55013,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -55232,6 +55057,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, + { "CreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -55242,11 +55070,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ImmunizationTypeDescriptorId", ImmunizationTypeDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -55310,77 +55138,63 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IImmunizationTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanCreditsBySubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IImmunizationTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanCreditsBySubject) target, null); } + void IChildEntity.SetParent(object value) + { + GraduationPlan = (GraduationPlan) value; + } } -} -// Aggregate: IncidentLocationDescriptor - -namespace EdFi.Ods.Entities.NHibernate.IncidentLocationDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.IncidentLocationDescriptor table of the IncidentLocationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanRequiredAssessment table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class IncidentLocationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IIncidentLocationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanRequiredAssessment : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGraduationPlanRequiredAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int IncidentLocationDescriptorId + public GraduationPlanRequiredAssessment() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + GraduationPlanRequiredAssessmentPerformanceLevelPersistentList = new HashSet(); + GraduationPlanRequiredAssessmentScores = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + [DomainSignature, JsonIgnore] + public virtual GraduationPlan GraduationPlan { get; set; } + + Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.GraduationPlan { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return GraduationPlan; } + set { GraduationPlan = (GraduationPlan) value; } } + + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -55391,26 +55205,181 @@ string IDescriptor.ShortDescription // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + public virtual Entities.NHibernate.GraduationPlanAggregate.EdFi.GraduationPlanRequiredAssessmentPerformanceLevel GraduationPlanRequiredAssessmentPerformanceLevel + { + get + { + // Return the item in the list, if one exists + if (GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Any()) + return GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.First(); + + // No reference is present + return null; + } + set + { + // Delete the existing object + if (GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Any()) + GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Clear(); + + // If we're setting a value, add it to the list now + if (value != null) + { + // Set the back-reference to the parent + value.GraduationPlanRequiredAssessment = this; + + GraduationPlanRequiredAssessmentPerformanceLevelPersistentList.Add(value); + } + } + } + + Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentPerformanceLevel + { + get { return GraduationPlanRequiredAssessmentPerformanceLevel; } + set { GraduationPlanRequiredAssessmentPerformanceLevel = (Entities.NHibernate.GraduationPlanAggregate.EdFi.GraduationPlanRequiredAssessmentPerformanceLevel) value; } + } + + private ICollection _graduationPlanRequiredAssessmentPerformanceLevelPersistentList; + + public virtual ICollection GraduationPlanRequiredAssessmentPerformanceLevelPersistentList + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanRequiredAssessmentPerformanceLevelPersistentList) + if (item.GraduationPlanRequiredAssessment == null) + item.GraduationPlanRequiredAssessment = this; + // ------------------------------------------------------------- + + return _graduationPlanRequiredAssessmentPerformanceLevelPersistentList; + } + set + { + _graduationPlanRequiredAssessmentPerformanceLevelPersistentList = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscriminator + { + get { return AssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentResourceId + { + get { return AssessmentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _graduationPlanRequiredAssessmentScores; + private ICollection _graduationPlanRequiredAssessmentScoresCovariant; + public virtual ICollection GraduationPlanRequiredAssessmentScores + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanRequiredAssessmentScores) + if (item.GraduationPlanRequiredAssessment == null) + item.GraduationPlanRequiredAssessment = this; + // ------------------------------------------------------------- + + return _graduationPlanRequiredAssessmentScores; + } + set + { + _graduationPlanRequiredAssessmentScores = value; + _graduationPlanRequiredAssessmentScoresCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentScores + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _graduationPlanRequiredAssessmentScores) + if (item.GraduationPlanRequiredAssessment == null) + item.GraduationPlanRequiredAssessment = this; + // ------------------------------------------------------------- + + return _graduationPlanRequiredAssessmentScoresCovariant; + } + set + { + GraduationPlanRequiredAssessmentScores = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -55421,11 +55390,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IncidentLocationDescriptorId", IncidentLocationDescriptorId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); return keyValues; } @@ -55489,84 +55459,169 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IIncidentLocationDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IIncidentLocationDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessment) target, null); } + void IChildEntity.SetParent(object value) + { + GraduationPlan = (GraduationPlan) value; + } } -} -// Aggregate: IndicatorDescriptor - -namespace EdFi.Ods.Entities.NHibernate.IndicatorDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.IndicatorDescriptor table of the IndicatorDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanRequiredAssessmentPerformanceLevel table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class IndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanRequiredAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public GraduationPlanRequiredAssessmentPerformanceLevel() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int IndicatorDescriptorId + [DomainSignature, JsonIgnore] + public virtual GraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { get; set; } + + Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentPerformanceLevel.GraduationPlanRequiredAssessment { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return GraduationPlanRequiredAssessment; } + set { GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; } } - + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int AssessmentReportingMethodDescriptorId { - get { return CodeValue; } - set { CodeValue = value; } + get + { + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } } - string IDescriptor.Description + + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; + + public virtual string AssessmentReportingMethodDescriptor { - get { return Description; } - set { Description = value; } + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } } - DateTime? IDescriptor.EffectiveBeginDate + public virtual string MaximumScore { get; set; } + public virtual string MinimumScore { get; set; } + public virtual int PerformanceLevelDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_performanceLevelDescriptorId == default(int)) + _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); + + return _performanceLevelDescriptorId; + } + set + { + _performanceLevelDescriptorId = value; + _performanceLevelDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _performanceLevelDescriptorId; + private string _performanceLevelDescriptor; + + public virtual string PerformanceLevelDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_performanceLevelDescriptor == null) + _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); + + return _performanceLevelDescriptor; + } + set + { + _performanceLevelDescriptor = value; + _performanceLevelDescriptorId = default(int); + } } - string IDescriptor.Namespace + public virtual string PerformanceLevelIndicatorName { get; set; } + public virtual int? ResultDatatypeTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_resultDatatypeTypeDescriptorId == default(int?)) + _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + + return _resultDatatypeTypeDescriptorId; + } + set + { + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int? _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; + + public virtual string ResultDatatypeTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); + + return _resultDatatypeTypeDescriptor; + } + set + { + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int?); + } } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -55575,6 +55630,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -55590,6 +55674,10 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, + { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -55600,11 +55688,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IndicatorDescriptorId", IndicatorDescriptorId); return keyValues; } @@ -55668,82 +55755,133 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IIndicatorDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IIndicatorDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel) target, null); } + void IChildEntity.SetParent(object value) + { + GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; + } } -} -// Aggregate: IndicatorGroupDescriptor - -namespace EdFi.Ods.Entities.NHibernate.IndicatorGroupDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.IndicatorGroupDescriptor table of the IndicatorGroupDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanRequiredAssessmentScore table of the GraduationPlan aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class IndicatorGroupDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IIndicatorGroupDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanRequiredAssessmentScore : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int IndicatorGroupDescriptorId + public GraduationPlanRequiredAssessmentScore() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual GraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { get; set; } + + Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentScore.GraduationPlanRequiredAssessment { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return GraduationPlanRequiredAssessment; } + set { GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; + + public virtual string AssessmentReportingMethodDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string MaximumScore { get; set; } + public virtual string MinimumScore { get; set; } + public virtual int? ResultDatatypeTypeDescriptorId + { + get + { + if (_resultDatatypeTypeDescriptorId == default(int?)) + _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + + return _resultDatatypeTypeDescriptorId; + } + set + { + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; + } + } + + private int? _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; + + public virtual string ResultDatatypeTypeDescriptor + { + get + { + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); + + return _resultDatatypeTypeDescriptor; + } + set + { + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -55754,6 +55892,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -55769,6 +55936,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "GraduationPlanTypeDescriptor", new LookupColumnDetails { PropertyName = "GraduationPlanTypeDescriptorId", LookupTypeName = "GraduationPlanTypeDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -55779,11 +55949,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IndicatorGroupDescriptorId", IndicatorGroupDescriptorId); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); return keyValues; } @@ -55847,37 +56017,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IIndicatorGroupDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IIndicatorGroupDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore) target, null); } + void IChildEntity.SetParent(object value) + { + GraduationPlanRequiredAssessment = (GraduationPlanRequiredAssessment) value; + } } } -// Aggregate: IndicatorLevelDescriptor +// Aggregate: GraduationPlanTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.IndicatorLevelDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GraduationPlanTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.IndicatorLevelDescriptor table of the IndicatorLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GraduationPlanTypeDescriptor table of the GraduationPlanTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class IndicatorLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IIndicatorLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GraduationPlanTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IGraduationPlanTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int IndicatorLevelDescriptorId + public virtual int GraduationPlanTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -55962,7 +56136,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IndicatorLevelDescriptorId", IndicatorLevelDescriptorId); + keyValues.Add("GraduationPlanTypeDescriptorId", GraduationPlanTypeDescriptorId); return keyValues; } @@ -56026,37 +56200,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IIndicatorLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGraduationPlanTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IIndicatorLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGraduationPlanTypeDescriptor) target, null); } } } -// Aggregate: InstitutionTelephoneNumberTypeDescriptor +// Aggregate: GunFreeSchoolsActReportingStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.InstitutionTelephoneNumberTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GunFreeSchoolsActReportingStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InstitutionTelephoneNumberTypeDescriptor table of the InstitutionTelephoneNumberTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GunFreeSchoolsActReportingStatusDescriptor table of the GunFreeSchoolsActReportingStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InstitutionTelephoneNumberTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class GunFreeSchoolsActReportingStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int InstitutionTelephoneNumberTypeDescriptorId + public virtual int GunFreeSchoolsActReportingStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -56141,7 +56315,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("InstitutionTelephoneNumberTypeDescriptorId", InstitutionTelephoneNumberTypeDescriptorId); + keyValues.Add("GunFreeSchoolsActReportingStatusDescriptorId", GunFreeSchoolsActReportingStatusDescriptorId); return keyValues; } @@ -56205,37 +56379,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor) target, null); } } } -// Aggregate: InteractivityStyleDescriptor +// Aggregate: HomelessPrimaryNighttimeResidenceDescriptor -namespace EdFi.Ods.Entities.NHibernate.InteractivityStyleDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.HomelessPrimaryNighttimeResidenceDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InteractivityStyleDescriptor table of the InteractivityStyleDescriptor aggregate in the ODS database. + /// A class which represents the edfi.HomelessPrimaryNighttimeResidenceDescriptor table of the HomelessPrimaryNighttimeResidenceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InteractivityStyleDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IInteractivityStyleDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class HomelessPrimaryNighttimeResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int InteractivityStyleDescriptorId + public virtual int HomelessPrimaryNighttimeResidenceDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -56320,7 +56494,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("InteractivityStyleDescriptorId", InteractivityStyleDescriptorId); + keyValues.Add("HomelessPrimaryNighttimeResidenceDescriptorId", HomelessPrimaryNighttimeResidenceDescriptorId); return keyValues; } @@ -56384,37 +56558,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInteractivityStyleDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInteractivityStyleDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor) target, null); } } } -// Aggregate: InternetAccessDescriptor +// Aggregate: HomelessProgramServiceDescriptor -namespace EdFi.Ods.Entities.NHibernate.InternetAccessDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.HomelessProgramServiceDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InternetAccessDescriptor table of the InternetAccessDescriptor aggregate in the ODS database. + /// A class which represents the edfi.HomelessProgramServiceDescriptor table of the HomelessProgramServiceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InternetAccessDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IInternetAccessDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class HomelessProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IHomelessProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int InternetAccessDescriptorId + public virtual int HomelessProgramServiceDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -56499,7 +56673,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("InternetAccessDescriptorId", InternetAccessDescriptorId); + keyValues.Add("HomelessProgramServiceDescriptorId", HomelessProgramServiceDescriptorId); return keyValues; } @@ -56563,37 +56737,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInternetAccessDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IHomelessProgramServiceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInternetAccessDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IHomelessProgramServiceDescriptor) target, null); } } } -// Aggregate: InternetAccessTypeInResidenceDescriptor +// Aggregate: IDEAPartDescriptor -namespace EdFi.Ods.Entities.NHibernate.InternetAccessTypeInResidenceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.IDEAPartDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InternetAccessTypeInResidenceDescriptor table of the InternetAccessTypeInResidenceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.IDEAPartDescriptor table of the IDEAPartDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InternetAccessTypeInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class IDEAPartDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IIDEAPartDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int InternetAccessTypeInResidenceDescriptorId + public virtual int IDEAPartDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -56678,7 +56852,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("InternetAccessTypeInResidenceDescriptorId", InternetAccessTypeInResidenceDescriptorId); + keyValues.Add("IDEAPartDescriptorId", IDEAPartDescriptorId); return keyValues; } @@ -56742,37 +56916,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IIDEAPartDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IIDEAPartDescriptor) target, null); } } } -// Aggregate: InternetPerformanceInResidenceDescriptor +// Aggregate: IdentificationDocumentUseDescriptor -namespace EdFi.Ods.Entities.NHibernate.InternetPerformanceInResidenceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.IdentificationDocumentUseDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InternetPerformanceInResidenceDescriptor table of the InternetPerformanceInResidenceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.IdentificationDocumentUseDescriptor table of the IdentificationDocumentUseDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InternetPerformanceInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class IdentificationDocumentUseDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IIdentificationDocumentUseDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int InternetPerformanceInResidenceDescriptorId + public virtual int IdentificationDocumentUseDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -56857,7 +57031,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("InternetPerformanceInResidenceDescriptorId", InternetPerformanceInResidenceDescriptorId); + keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); return keyValues; } @@ -56921,42 +57095,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IIdentificationDocumentUseDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IIdentificationDocumentUseDescriptor) target, null); } } } -// Aggregate: Intervention +// Aggregate: ImmunizationTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.InterventionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ImmunizationTypeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.ImmunizationTypeDescriptor table of the ImmunizationTypeDescriptor aggregate in the ODS database. /// - public class InterventionReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class ImmunizationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IImmunizationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual string InterventionIdentificationCode { get; set; } + [DomainSignature] + public virtual int ImmunizationTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -56965,8 +57210,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("InterventionIdentificationCode", InterventionIdentificationCode); + keyValues.Add("ImmunizationTypeDescriptorId", ImmunizationTypeDescriptorId); return keyValues; } @@ -56987,8 +57231,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -57005,161 +57259,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IImmunizationTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IImmunizationTypeDescriptor) target, null); + } + } +} +// Aggregate: IncidentLocationDescriptor +namespace EdFi.Ods.Entities.NHibernate.IncidentLocationDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Intervention table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.IncidentLocationDescriptor table of the IncidentLocationDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Intervention : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IIntervention, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class IncidentLocationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IIncidentLocationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public Intervention() - { - InterventionAppropriateGradeLevels = new HashSet(); - InterventionAppropriateSexes = new HashSet(); - InterventionDiagnoses = new HashSet(); - InterventionEducationContents = new HashSet(); - InterventionInterventionPrescriptions = new HashSet(); - InterventionLearningResourceMetadataURIs = new HashSet(); - InterventionMeetingTimes = new HashSet(); - InterventionPopulationServeds = new HashSet(); - InterventionStaffs = new HashSet(); - InterventionURIs = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string InterventionIdentificationCode { get; set; } + public virtual int IncidentLocationDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime BeginDate + string IDescriptor.CodeValue { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get { return CodeValue; } + set { CodeValue = value; } } - - private DateTime _beginDate; - - public virtual int DeliveryMethodDescriptorId + string IDescriptor.Description { - get - { - if (_deliveryMethodDescriptorId == default(int)) - _deliveryMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DeliveryMethodDescriptor", _deliveryMethodDescriptor); - - return _deliveryMethodDescriptorId; - } - set - { - _deliveryMethodDescriptorId = value; - _deliveryMethodDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _deliveryMethodDescriptorId; - private string _deliveryMethodDescriptor; - - public virtual string DeliveryMethodDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_deliveryMethodDescriptor == null) - _deliveryMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DeliveryMethodDescriptor", _deliveryMethodDescriptorId); - - return _deliveryMethodDescriptor; - } - set - { - _deliveryMethodDescriptor = value; - _deliveryMethodDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - public virtual DateTime? EndDate + DateTime? IDescriptor.EffectiveEndDate { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private DateTime? _endDate; - - public virtual int InterventionClassDescriptorId + string IDescriptor.Namespace { - get - { - if (_interventionClassDescriptorId == default(int)) - _interventionClassDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InterventionClassDescriptor", _interventionClassDescriptor); - - return _interventionClassDescriptorId; - } - set - { - _interventionClassDescriptorId = value; - _interventionClassDescriptor = null; - } + get { return Namespace; } + set { Namespace = value; } } - - private int _interventionClassDescriptorId; - private string _interventionClassDescriptor; - - public virtual string InterventionClassDescriptor + string IDescriptor.ShortDescription { - get - { - if (_interventionClassDescriptor == null) - _interventionClassDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InterventionClassDescriptor", _interventionClassDescriptorId); - - return _interventionClassDescriptor; - } - set - { - _interventionClassDescriptor = value; - _interventionClassDescriptorId = default(int); - } + get { return ShortDescription; } + set { ShortDescription = value; } } - public virtual int? MaxDosage { get; set; } - public virtual int? MinDosage { get; set; } - public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -57170,542 +57360,21 @@ public virtual string InterventionClassDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IIntervention.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IIntervention.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _interventionAppropriateGradeLevels; - private ICollection _interventionAppropriateGradeLevelsCovariant; - public virtual ICollection InterventionAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionAppropriateGradeLevels) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionAppropriateGradeLevels; - } - set - { - _interventionAppropriateGradeLevels = value; - _interventionAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionAppropriateGradeLevels) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionAppropriateGradeLevelsCovariant; - } - set - { - InterventionAppropriateGradeLevels = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionAppropriateSexes; - private ICollection _interventionAppropriateSexesCovariant; - public virtual ICollection InterventionAppropriateSexes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionAppropriateSexes) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionAppropriateSexes; - } - set - { - _interventionAppropriateSexes = value; - _interventionAppropriateSexesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateSexes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionAppropriateSexes) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionAppropriateSexesCovariant; - } - set - { - InterventionAppropriateSexes = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionDiagnoses; - private ICollection _interventionDiagnosesCovariant; - public virtual ICollection InterventionDiagnoses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionDiagnoses) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionDiagnoses; - } - set - { - _interventionDiagnoses = value; - _interventionDiagnosesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionDiagnoses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionDiagnoses) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionDiagnosesCovariant; - } - set - { - InterventionDiagnoses = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionEducationContents; - private ICollection _interventionEducationContentsCovariant; - public virtual ICollection InterventionEducationContents - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionEducationContents) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionEducationContents; - } - set - { - _interventionEducationContents = value; - _interventionEducationContentsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionEducationContents - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionEducationContents) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionEducationContentsCovariant; - } - set - { - InterventionEducationContents = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionInterventionPrescriptions; - private ICollection _interventionInterventionPrescriptionsCovariant; - public virtual ICollection InterventionInterventionPrescriptions - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionInterventionPrescriptions) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionInterventionPrescriptions; - } - set - { - _interventionInterventionPrescriptions = value; - _interventionInterventionPrescriptionsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionInterventionPrescriptions - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionInterventionPrescriptions) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionInterventionPrescriptionsCovariant; - } - set - { - InterventionInterventionPrescriptions = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionLearningResourceMetadataURIs; - private ICollection _interventionLearningResourceMetadataURIsCovariant; - public virtual ICollection InterventionLearningResourceMetadataURIs - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionLearningResourceMetadataURIs) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionLearningResourceMetadataURIs; - } - set - { - _interventionLearningResourceMetadataURIs = value; - _interventionLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionLearningResourceMetadataURIs - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionLearningResourceMetadataURIs) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionLearningResourceMetadataURIsCovariant; - } - set - { - InterventionLearningResourceMetadataURIs = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionMeetingTimes; - private ICollection _interventionMeetingTimesCovariant; - public virtual ICollection InterventionMeetingTimes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionMeetingTimes) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionMeetingTimes; - } - set - { - _interventionMeetingTimes = value; - _interventionMeetingTimesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionMeetingTimes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionMeetingTimes) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionMeetingTimesCovariant; - } - set - { - InterventionMeetingTimes = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionPopulationServeds; - private ICollection _interventionPopulationServedsCovariant; - public virtual ICollection InterventionPopulationServeds - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPopulationServeds) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionPopulationServeds; - } - set - { - _interventionPopulationServeds = value; - _interventionPopulationServedsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionPopulationServeds - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPopulationServeds) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionPopulationServedsCovariant; - } - set - { - InterventionPopulationServeds = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionStaffs; - private ICollection _interventionStaffsCovariant; - public virtual ICollection InterventionStaffs - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionStaffs) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionStaffs; - } - set - { - _interventionStaffs = value; - _interventionStaffsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionStaffs - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionStaffs) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionStaffsCovariant; - } - set - { - InterventionStaffs = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionURIs; - private ICollection _interventionURIsCovariant; - public virtual ICollection InterventionURIs - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionURIs) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionURIs; - } - set - { - _interventionURIs = value; - _interventionURIsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionURIs - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionURIs) - if (item.Intervention == null) - item.Intervention = this; - // ------------------------------------------------------------- - - return _interventionURIsCovariant; - } - set - { - InterventionURIs = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DeliveryMethodDescriptor", new LookupColumnDetails { PropertyName = "DeliveryMethodDescriptorId", LookupTypeName = "DeliveryMethodDescriptor"} }, - { "InterventionClassDescriptor", new LookupColumnDetails { PropertyName = "InterventionClassDescriptorId", LookupTypeName = "InterventionClassDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -57720,8 +57389,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("InterventionIdentificationCode", InterventionIdentificationCode); + keyValues.Add("IncidentLocationDescriptorId", IncidentLocationDescriptorId); return keyValues; } @@ -57785,88 +57453,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IIntervention)target); + return this.SynchronizeTo((Entities.Common.EdFi.IIncidentLocationDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IIntervention) target, null); + this.MapTo((Entities.Common.EdFi.IIncidentLocationDescriptor) target, null); } } +} +// Aggregate: IndicatorDescriptor + +namespace EdFi.Ods.Entities.NHibernate.IndicatorDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionAppropriateGradeLevel table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.IndicatorDescriptor table of the IndicatorDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class IndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionAppropriateGradeLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionAppropriateGradeLevel.Intervention - { - get { return Intervention; } - set { Intervention = (Intervention) value; } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + public virtual int IndicatorDescriptorId { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -57882,35 +57539,6 @@ public virtual string GradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -57926,7 +57554,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -57937,11 +57564,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("IndicatorDescriptorId", IndicatorDescriptorId); return keyValues; } @@ -58005,92 +57632,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionAppropriateGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IIndicatorDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionAppropriateGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IIndicatorDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } +} +// Aggregate: IndicatorGroupDescriptor + +namespace EdFi.Ods.Entities.NHibernate.IndicatorGroupDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionAppropriateSex table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.IndicatorGroupDescriptor table of the IndicatorGroupDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionAppropriateSex : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class IndicatorGroupDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IIndicatorGroupDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionAppropriateSex() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int IndicatorGroupDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionAppropriateSex.Intervention + string IDescriptor.CodeValue { - get { return Intervention; } - set { Intervention = (Intervention) value; } + get { return CodeValue; } + set { CodeValue = value; } } - - [DomainSignature] - public virtual int SexDescriptorId + string IDescriptor.Description { - get - { - if (_sexDescriptorId == default(int)) - _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); - - return _sexDescriptorId; - } - set - { - _sexDescriptorId = value; - _sexDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _sexDescriptorId; - private string _sexDescriptor; - - public virtual string SexDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_sexDescriptor == null) - _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); - - return _sexDescriptor; - } - set - { - _sexDescriptor = value; - _sexDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -58106,35 +57718,6 @@ public virtual string SexDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -58150,7 +57733,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -58161,11 +57743,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SexDescriptorId", SexDescriptorId); + keyValues.Add("IndicatorGroupDescriptorId", IndicatorGroupDescriptorId); return keyValues; } @@ -58229,92 +57811,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionAppropriateSex)target); + return this.SynchronizeTo((Entities.Common.EdFi.IIndicatorGroupDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionAppropriateSex) target, null); + this.MapTo((Entities.Common.EdFi.IIndicatorGroupDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } +} +// Aggregate: IndicatorLevelDescriptor + +namespace EdFi.Ods.Entities.NHibernate.IndicatorLevelDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionDiagnosis table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.IndicatorLevelDescriptor table of the IndicatorLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionDiagnosis : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionDiagnosis, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class IndicatorLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IIndicatorLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionDiagnosis() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionDiagnosis.Intervention - { - get { return Intervention; } - set { Intervention = (Intervention) value; } - } - [DomainSignature] - public virtual int DiagnosisDescriptorId - { - get - { - if (_diagnosisDescriptorId == default(int)) - _diagnosisDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiagnosisDescriptor", _diagnosisDescriptor); - - return _diagnosisDescriptorId; - } - set - { - _diagnosisDescriptorId = value; - _diagnosisDescriptor = null; - } - } - - private int _diagnosisDescriptorId; - private string _diagnosisDescriptor; - - public virtual string DiagnosisDescriptor + public virtual int IndicatorLevelDescriptorId { - get - { - if (_diagnosisDescriptor == null) - _diagnosisDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiagnosisDescriptor", _diagnosisDescriptorId); - - return _diagnosisDescriptor; - } - set - { - _diagnosisDescriptor = value; - _diagnosisDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -58330,35 +57897,6 @@ public virtual string DiagnosisDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -58374,7 +57912,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DiagnosisDescriptor", new LookupColumnDetails { PropertyName = "DiagnosisDescriptorId", LookupTypeName = "DiagnosisDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -58385,11 +57922,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); + keyValues.Add("IndicatorLevelDescriptorId", IndicatorLevelDescriptorId); return keyValues; } @@ -58453,59 +57990,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionDiagnosis)target); + return this.SynchronizeTo((Entities.Common.EdFi.IIndicatorLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionDiagnosis) target, null); + this.MapTo((Entities.Common.EdFi.IIndicatorLevelDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } +} +// Aggregate: InstitutionTelephoneNumberTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.InstitutionTelephoneNumberTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionEducationContent table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.InstitutionTelephoneNumberTypeDescriptor table of the InstitutionTelephoneNumberTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionEducationContent : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InstitutionTelephoneNumberTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionEducationContent() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention + [DomainSignature] + public virtual int InstitutionTelephoneNumberTypeDescriptorId { - get { return Intervention; } - set { Intervention = (Intervention) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string ContentIdentifier { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -58521,60 +58076,11 @@ Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationContent discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IInterventionEducationContent.EducationContentDiscriminator - { - get { return EducationContentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationContent resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IInterventionEducationContent.EducationContentResourceId - { - get { return EducationContentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -58595,11 +58101,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ContentIdentifier", ContentIdentifier); + keyValues.Add("InstitutionTelephoneNumberTypeDescriptorId", InstitutionTelephoneNumberTypeDescriptorId); return keyValues; } @@ -58663,61 +58169,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionEducationContent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionEducationContent) target, null); + this.MapTo((Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } +} +// Aggregate: InteractivityStyleDescriptor + +namespace EdFi.Ods.Entities.NHibernate.InteractivityStyleDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionInterventionPrescription table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.InteractivityStyleDescriptor table of the InteractivityStyleDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionInterventionPrescription : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionInterventionPrescription, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InteractivityStyleDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IInteractivityStyleDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionInterventionPrescription() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Intervention + [DomainSignature] + public virtual int InteractivityStyleDescriptorId { - get { return Intervention; } - set { Intervention = (Intervention) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string InterventionPrescriptionIdentificationCode { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -58733,60 +58255,11 @@ Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Interve // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } - - /// - /// Read-only property that allows the InterventionPrescription discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionDiscriminator - { - get { return InterventionPrescriptionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the InterventionPrescription resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionResourceId - { - get { return InterventionPrescriptionReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -58807,12 +58280,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("InterventionPrescriptionEducationOrganizationId", InterventionPrescriptionEducationOrganizationId); - keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); + keyValues.Add("InteractivityStyleDescriptorId", InteractivityStyleDescriptorId); return keyValues; } @@ -58876,59 +58348,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionInterventionPrescription)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInteractivityStyleDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionInterventionPrescription) target, null); + this.MapTo((Entities.Common.EdFi.IInteractivityStyleDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } +} +// Aggregate: InternetAccessDescriptor + +namespace EdFi.Ods.Entities.NHibernate.InternetAccessDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionLearningResourceMetadataURI table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.InternetAccessDescriptor table of the InternetAccessDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InternetAccessDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IInternetAccessDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionLearningResourceMetadataURI() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Intervention + [DomainSignature] + public virtual int InternetAccessDescriptorId { - get { return Intervention; } - set { Intervention = (Intervention) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string LearningResourceMetadataURI { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -58944,35 +58434,6 @@ Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Inte // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -58998,11 +58459,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); + keyValues.Add("InternetAccessDescriptorId", InternetAccessDescriptorId); return keyValues; } @@ -59066,61 +58527,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInternetAccessDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI) target, null); + this.MapTo((Entities.Common.EdFi.IInternetAccessDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } +} +// Aggregate: InternetAccessTypeInResidenceDescriptor + +namespace EdFi.Ods.Entities.NHibernate.InternetAccessTypeInResidenceDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionMeetingTime table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.InternetAccessTypeInResidenceDescriptor table of the InternetAccessTypeInResidenceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionMeetingTime : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionMeetingTime, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InternetAccessTypeInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionMeetingTime() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention + [DomainSignature] + public virtual int InternetAccessTypeInResidenceDescriptorId { - get { return Intervention; } - set { Intervention = (Intervention) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual TimeSpan EndTime { get; set; } - [DomainSignature] - public virtual TimeSpan StartTime { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -59136,35 +58613,6 @@ Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -59190,12 +58638,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EndTime", EndTime); - keyValues.Add("StartTime", StartTime); + keyValues.Add("InternetAccessTypeInResidenceDescriptorId", InternetAccessTypeInResidenceDescriptorId); return keyValues; } @@ -59259,92 +58706,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionMeetingTime)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionMeetingTime) target, null); + this.MapTo((Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } +} +// Aggregate: InternetPerformanceInResidenceDescriptor + +namespace EdFi.Ods.Entities.NHibernate.InternetPerformanceInResidenceDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPopulationServed table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.InternetPerformanceInResidenceDescriptor table of the InternetPerformanceInResidenceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPopulationServed : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InternetPerformanceInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionPopulationServed() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } - - Entities.Common.EdFi.IIntervention IInterventionPopulationServed.Intervention - { - get { return Intervention; } - set { Intervention = (Intervention) value; } - } - [DomainSignature] - public virtual int PopulationServedDescriptorId - { - get - { - if (_populationServedDescriptorId == default(int)) - _populationServedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); - - return _populationServedDescriptorId; - } - set - { - _populationServedDescriptorId = value; - _populationServedDescriptor = null; - } - } - - private int _populationServedDescriptorId; - private string _populationServedDescriptor; - - public virtual string PopulationServedDescriptor + public virtual int InternetPerformanceInResidenceDescriptorId { - get - { - if (_populationServedDescriptor == null) - _populationServedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId); - - return _populationServedDescriptor; - } - set - { - _populationServedDescriptor = value; - _populationServedDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -59360,35 +58792,6 @@ public virtual string PopulationServedDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -59404,7 +58807,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -59415,11 +58817,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); + keyValues.Add("InternetPerformanceInResidenceDescriptorId", InternetPerformanceInResidenceDescriptorId); return keyValues; } @@ -59483,36 +58885,125 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPopulationServed)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPopulationServed) target, null); + this.MapTo((Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: Intervention + +namespace EdFi.Ods.Entities.NHibernate.InterventionAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class InterventionReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual string InterventionIdentificationCode { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - Intervention = (Intervention) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("InterventionIdentificationCode", InterventionIdentificationCode); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStaff table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.Intervention table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStaff : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Intervention : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IIntervention, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStaff() + public Intervention() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + InterventionAppropriateGradeLevels = new HashSet(); + InterventionAppropriateSexes = new HashSet(); + InterventionDiagnoses = new HashSet(); + InterventionEducationContents = new HashSet(); + InterventionInterventionPrescriptions = new HashSet(); + InterventionLearningResourceMetadataURIs = new HashSet(); + InterventionMeetingTimes = new HashSet(); + InterventionPopulationServeds = new HashSet(); + InterventionStaffs = new HashSet(); + InterventionURIs = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -59520,74 +59011,119 @@ public InterventionStaff() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Intervention Intervention { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string InterventionIdentificationCode { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.IIntervention IInterventionStaff.Intervention + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime BeginDate { - get { return Intervention; } - set { Intervention = (Intervention) value; } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } - [Display(Name="StaffUniqueId")][DomainSignature] - public virtual int StaffUSI + private DateTime _beginDate; + + public virtual int DeliveryMethodDescriptorId { get { - if (_staffUSI == default(int) && _staffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) - { - _staffUSI = usi; - } - } + if (_deliveryMethodDescriptorId == default(int)) + _deliveryMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DeliveryMethodDescriptor", _deliveryMethodDescriptor); - return _staffUSI; + return _deliveryMethodDescriptorId; } set { - _staffUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); + _deliveryMethodDescriptorId = value; + _deliveryMethodDescriptor = null; } } - private int _staffUSI; - private string _staffUniqueId; + private int _deliveryMethodDescriptorId; + private string _deliveryMethodDescriptor; - public virtual string StaffUniqueId + public virtual string DeliveryMethodDescriptor { get { - if (_staffUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) - { - _staffUniqueId = uniqueId; - } - } - - return _staffUniqueId; + if (_deliveryMethodDescriptor == null) + _deliveryMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DeliveryMethodDescriptor", _deliveryMethodDescriptorId); + + return _deliveryMethodDescriptor; } set { - if (_staffUniqueId != value) - _staffUSI = default(int); - - _staffUniqueId = value; + _deliveryMethodDescriptor = value; + _deliveryMethodDescriptorId = default(int); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + + public virtual int InterventionClassDescriptorId + { + get + { + if (_interventionClassDescriptorId == default(int)) + _interventionClassDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InterventionClassDescriptor", _interventionClassDescriptor); + + return _interventionClassDescriptorId; + } + set + { + _interventionClassDescriptorId = value; + _interventionClassDescriptor = null; + } + } + + private int _interventionClassDescriptorId; + private string _interventionClassDescriptor; + + public virtual string InterventionClassDescriptor + { + get + { + if (_interventionClassDescriptor == null) + _interventionClassDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InterventionClassDescriptor", _interventionClassDescriptorId); + + return _interventionClassDescriptor; + } + set + { + _interventionClassDescriptor = value; + _interventionClassDescriptorId = default(int); + } + } + public virtual int? MaxDosage { get; set; } + public virtual int? MinDosage { get; set; } + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -59632,23 +59168,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IInterventionStaff.StaffDiscriminator + string Entities.Common.EdFi.IIntervention.EducationOrganizationDiscriminator { - get { return StaffReferenceData?.Discriminator; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IInterventionStaff.StaffResourceId + Guid? Entities.Common.EdFi.IIntervention.EducationOrganizationResourceId { - get { return StaffReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Id; } set { } } @@ -59657,11 +59193,483 @@ string Entities.Common.EdFi.IInterventionStaff.StaffDiscriminator //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _interventionAppropriateGradeLevels; + private ICollection _interventionAppropriateGradeLevelsCovariant; + public virtual ICollection InterventionAppropriateGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionAppropriateGradeLevels) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionAppropriateGradeLevels; + } + set + { + _interventionAppropriateGradeLevels = value; + _interventionAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionAppropriateGradeLevels) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionAppropriateGradeLevelsCovariant; + } + set + { + InterventionAppropriateGradeLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionAppropriateSexes; + private ICollection _interventionAppropriateSexesCovariant; + public virtual ICollection InterventionAppropriateSexes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionAppropriateSexes) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionAppropriateSexes; + } + set + { + _interventionAppropriateSexes = value; + _interventionAppropriateSexesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateSexes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionAppropriateSexes) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionAppropriateSexesCovariant; + } + set + { + InterventionAppropriateSexes = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionDiagnoses; + private ICollection _interventionDiagnosesCovariant; + public virtual ICollection InterventionDiagnoses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionDiagnoses) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionDiagnoses; + } + set + { + _interventionDiagnoses = value; + _interventionDiagnosesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionDiagnoses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionDiagnoses) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionDiagnosesCovariant; + } + set + { + InterventionDiagnoses = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionEducationContents; + private ICollection _interventionEducationContentsCovariant; + public virtual ICollection InterventionEducationContents + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionEducationContents) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionEducationContents; + } + set + { + _interventionEducationContents = value; + _interventionEducationContentsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionEducationContents + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionEducationContents) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionEducationContentsCovariant; + } + set + { + InterventionEducationContents = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionInterventionPrescriptions; + private ICollection _interventionInterventionPrescriptionsCovariant; + public virtual ICollection InterventionInterventionPrescriptions + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionInterventionPrescriptions) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionInterventionPrescriptions; + } + set + { + _interventionInterventionPrescriptions = value; + _interventionInterventionPrescriptionsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionInterventionPrescriptions + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionInterventionPrescriptions) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionInterventionPrescriptionsCovariant; + } + set + { + InterventionInterventionPrescriptions = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionLearningResourceMetadataURIs; + private ICollection _interventionLearningResourceMetadataURIsCovariant; + public virtual ICollection InterventionLearningResourceMetadataURIs + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionLearningResourceMetadataURIs) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionLearningResourceMetadataURIs; + } + set + { + _interventionLearningResourceMetadataURIs = value; + _interventionLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionLearningResourceMetadataURIs + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionLearningResourceMetadataURIs) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionLearningResourceMetadataURIsCovariant; + } + set + { + InterventionLearningResourceMetadataURIs = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionMeetingTimes; + private ICollection _interventionMeetingTimesCovariant; + public virtual ICollection InterventionMeetingTimes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionMeetingTimes) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionMeetingTimes; + } + set + { + _interventionMeetingTimes = value; + _interventionMeetingTimesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionMeetingTimes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionMeetingTimes) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionMeetingTimesCovariant; + } + set + { + InterventionMeetingTimes = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionPopulationServeds; + private ICollection _interventionPopulationServedsCovariant; + public virtual ICollection InterventionPopulationServeds + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionPopulationServeds) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionPopulationServeds; + } + set + { + _interventionPopulationServeds = value; + _interventionPopulationServedsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionPopulationServeds + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionPopulationServeds) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionPopulationServedsCovariant; + } + set + { + InterventionPopulationServeds = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStaffs; + private ICollection _interventionStaffsCovariant; + public virtual ICollection InterventionStaffs + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStaffs) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionStaffs; + } + set + { + _interventionStaffs = value; + _interventionStaffsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionStaffs + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStaffs) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionStaffsCovariant; + } + set + { + InterventionStaffs = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionURIs; + private ICollection _interventionURIsCovariant; + public virtual ICollection InterventionURIs + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionURIs) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionURIs; + } + set + { + _interventionURIs = value; + _interventionURIsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionURIs + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionURIs) + if (item.Intervention == null) + item.Intervention = this; + // ------------------------------------------------------------- + + return _interventionURIsCovariant; + } + set + { + InterventionURIs = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "DeliveryMethodDescriptor", new LookupColumnDetails { PropertyName = "DeliveryMethodDescriptorId", LookupTypeName = "DeliveryMethodDescriptor"} }, + { "InterventionClassDescriptor", new LookupColumnDetails { PropertyName = "InterventionClassDescriptorId", LookupTypeName = "InterventionClassDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -59672,11 +59680,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("StaffUSI", StaffUSI); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("InterventionIdentificationCode", InterventionIdentificationCode); return keyValues; } @@ -59740,36 +59749,32 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStaff)target); + return this.SynchronizeTo((Entities.Common.EdFi.IIntervention)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStaff) target, null); + this.MapTo((Entities.Common.EdFi.IIntervention) target, null); } - void IChildEntity.SetParent(object value) - { - Intervention = (Intervention) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionURI table of the Intervention aggregate in the ODS database. + /// A class which represents the edfi.InterventionAppropriateGradeLevel table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionURI() + public InterventionAppropriateGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -59780,14 +59785,47 @@ public InterventionURI() [DomainSignature, JsonIgnore] public virtual Intervention Intervention { get; set; } - Entities.Common.EdFi.IIntervention IInterventionURI.Intervention + Entities.Common.EdFi.IIntervention IInterventionAppropriateGradeLevel.Intervention { get { return Intervention; } set { Intervention = (Intervention) value; } } [DomainSignature] - public virtual string URI { get; set; } + public virtual int GradeLevelDescriptorId + { + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } + } + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor + { + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -59852,6 +59890,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -59866,7 +59905,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("URI", URI); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -59930,12 +59969,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionAppropriateGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionURI) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionAppropriateGradeLevel) target, null); } void IChildEntity.SetParent(object value) @@ -59943,70 +59982,81 @@ void IChildEntity.SetParent(object value) Intervention = (Intervention) value; } } -} -// Aggregate: InterventionClassDescriptor - -namespace EdFi.Ods.Entities.NHibernate.InterventionClassDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionClassDescriptor table of the InterventionClassDescriptor aggregate in the ODS database. + /// A class which represents the edfi.InterventionAppropriateSex table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionClassDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IInterventionClassDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class InterventionAppropriateSex : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int InterventionClassDescriptorId + public InterventionAppropriateSex() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Intervention Intervention { get; set; } + + Entities.Common.EdFi.IIntervention IInterventionAppropriateSex.Intervention { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Intervention; } + set { Intervention = (Intervention) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int SexDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_sexDescriptorId == default(int)) + _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); + + return _sexDescriptorId; + } + set + { + _sexDescriptorId = value; + _sexDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _sexDescriptorId; + private string _sexDescriptor; + + public virtual string SexDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_sexDescriptor == null) + _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); + + return _sexDescriptor; + } + set + { + _sexDescriptor = value; + _sexDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -60020,6 +60070,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -60035,6 +60114,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -60045,11 +60125,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("InterventionClassDescriptorId", InterventionClassDescriptorId); + keyValues.Add("SexDescriptorId", SexDescriptorId); return keyValues; } @@ -60113,79 +60193,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionClassDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionAppropriateSex)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionClassDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionAppropriateSex) target, null); } + void IChildEntity.SetParent(object value) + { + Intervention = (Intervention) value; + } } -} -// Aggregate: InterventionEffectivenessRatingDescriptor - -namespace EdFi.Ods.Entities.NHibernate.InterventionEffectivenessRatingDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionEffectivenessRatingDescriptor table of the InterventionEffectivenessRatingDescriptor aggregate in the ODS database. + /// A class which represents the edfi.InterventionDiagnosis table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionEffectivenessRatingDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class InterventionDiagnosis : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionDiagnosis, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int InterventionEffectivenessRatingDescriptorId + public InterventionDiagnosis() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Intervention Intervention { get; set; } + + Entities.Common.EdFi.IIntervention IInterventionDiagnosis.Intervention { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Intervention; } + set { Intervention = (Intervention) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int DiagnosisDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_diagnosisDescriptorId == default(int)) + _diagnosisDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiagnosisDescriptor", _diagnosisDescriptor); + + return _diagnosisDescriptorId; + } + set + { + _diagnosisDescriptorId = value; + _diagnosisDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _diagnosisDescriptorId; + private string _diagnosisDescriptor; + + public virtual string DiagnosisDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_diagnosisDescriptor == null) + _diagnosisDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiagnosisDescriptor", _diagnosisDescriptorId); + + return _diagnosisDescriptor; + } + set + { + _diagnosisDescriptor = value; + _diagnosisDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -60199,6 +60294,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -60214,6 +60338,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "DiagnosisDescriptor", new LookupColumnDetails { PropertyName = "DiagnosisDescriptorId", LookupTypeName = "DiagnosisDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -60224,11 +60349,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("InterventionEffectivenessRatingDescriptorId", InterventionEffectivenessRatingDescriptorId); + keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); return keyValues; } @@ -60292,52 +60417,153 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionDiagnosis)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionDiagnosis) target, null); } + void IChildEntity.SetParent(object value) + { + Intervention = (Intervention) value; + } } -} -// Aggregate: InterventionPrescription +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 -namespace EdFi.Ods.Entities.NHibernate.InterventionPrescriptionAggregate.EdFi -{ /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.InterventionEducationContent table of the Intervention aggregate in the ODS database. /// - public class InterventionPrescriptionReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class InterventionEducationContent : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public InterventionEducationContent() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual string InterventionPrescriptionIdentificationCode { get; set; } + [DomainSignature, JsonIgnore] + public virtual Intervention Intervention { get; set; } + + Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention + { + get { return Intervention; } + set { Intervention = (Intervention) value; } + } + + [DomainSignature] + public virtual string ContentIdentifier { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } /// - /// The id of the referenced entity (used as the resource identifier in the API). + /// Read-only property that allows the EducationContent discriminator value to be mapped to the resource reference. /// - public virtual Guid? Id { get; set; } + string Entities.Common.EdFi.IInterventionEducationContent.EducationContentDiscriminator + { + get { return EducationContentReferenceData?.Discriminator; } + set { } + } /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. + /// Read-only property that allows the EducationContent resource identifier value to be mapped to the resource reference. /// - public virtual string Discriminator { get; set; } + Guid? Entities.Common.EdFi.IInterventionEducationContent.EducationContentResourceId + { + get { return EducationContentReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); + keyValues.Add("ContentIdentifier", ContentIdentifier); return keyValues; } @@ -60358,8 +60584,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -60376,38 +60612,51 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion - } + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionEducationContent)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IInterventionEducationContent) target, null); + } + void IChildEntity.SetParent(object value) + { + Intervention = (Intervention) value; + } + } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescription table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionInterventionPrescription table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescription : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IInterventionPrescription, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionInterventionPrescription : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionInterventionPrescription, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionPrescription() + public InterventionInterventionPrescription() { - InterventionPrescriptionAppropriateGradeLevels = new HashSet(); - InterventionPrescriptionAppropriateSexes = new HashSet(); - InterventionPrescriptionDiagnoses = new HashSet(); - InterventionPrescriptionEducationContents = new HashSet(); - InterventionPrescriptionLearningResourceMetadataURIs = new HashSet(); - InterventionPrescriptionPopulationServeds = new HashSet(); - InterventionPrescriptionURIs = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -60415,8 +60664,17 @@ public InterventionPrescription() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Intervention Intervention { get; set; } + + Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Intervention + { + get { return Intervention; } + set { Intervention = (Intervention) value; } + } + [DomainSignature] - public virtual long EducationOrganizationId { get; set; } + public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } [DomainSignature] public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- @@ -60429,77 +60687,6 @@ public InterventionPrescription() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int DeliveryMethodDescriptorId - { - get - { - if (_deliveryMethodDescriptorId == default(int)) - _deliveryMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DeliveryMethodDescriptor", _deliveryMethodDescriptor); - - return _deliveryMethodDescriptorId; - } - set - { - _deliveryMethodDescriptorId = value; - _deliveryMethodDescriptor = null; - } - } - - private int _deliveryMethodDescriptorId; - private string _deliveryMethodDescriptor; - - public virtual string DeliveryMethodDescriptor - { - get - { - if (_deliveryMethodDescriptor == null) - _deliveryMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DeliveryMethodDescriptor", _deliveryMethodDescriptorId); - - return _deliveryMethodDescriptor; - } - set - { - _deliveryMethodDescriptor = value; - _deliveryMethodDescriptorId = default(int); - } - } - public virtual int InterventionClassDescriptorId - { - get - { - if (_interventionClassDescriptorId == default(int)) - _interventionClassDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InterventionClassDescriptor", _interventionClassDescriptor); - - return _interventionClassDescriptorId; - } - set - { - _interventionClassDescriptorId = value; - _interventionClassDescriptor = null; - } - } - - private int _interventionClassDescriptorId; - private string _interventionClassDescriptor; - - public virtual string InterventionClassDescriptor - { - get - { - if (_interventionClassDescriptor == null) - _interventionClassDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InterventionClassDescriptor", _interventionClassDescriptorId); - - return _interventionClassDescriptor; - } - set - { - _interventionClassDescriptor = value; - _interventionClassDescriptorId = default(int); - } - } - public virtual int? MaxDosage { get; set; } - public virtual int? MinDosage { get; set; } - public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -60544,23 +60731,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// Read-only property that allows the InterventionPrescription discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionDiscriminator { - get { return EducationOrganizationReferenceData?.Discriminator; } + get { return InterventionPrescriptionReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the InterventionPrescription resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionResourceId { - get { return EducationOrganizationReferenceData?.Id; } + get { return InterventionPrescriptionReferenceData?.Id; } set { } } @@ -60569,342 +60756,11 @@ string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscr //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _interventionPrescriptionAppropriateGradeLevels; - private ICollection _interventionPrescriptionAppropriateGradeLevelsCovariant; - public virtual ICollection InterventionPrescriptionAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionAppropriateGradeLevels) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionAppropriateGradeLevels; - } - set - { - _interventionPrescriptionAppropriateGradeLevels = value; - _interventionPrescriptionAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionAppropriateGradeLevels) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionAppropriateGradeLevelsCovariant; - } - set - { - InterventionPrescriptionAppropriateGradeLevels = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionPrescriptionAppropriateSexes; - private ICollection _interventionPrescriptionAppropriateSexesCovariant; - public virtual ICollection InterventionPrescriptionAppropriateSexes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionAppropriateSexes) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionAppropriateSexes; - } - set - { - _interventionPrescriptionAppropriateSexes = value; - _interventionPrescriptionAppropriateSexesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateSexes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionAppropriateSexes) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionAppropriateSexesCovariant; - } - set - { - InterventionPrescriptionAppropriateSexes = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionPrescriptionDiagnoses; - private ICollection _interventionPrescriptionDiagnosesCovariant; - public virtual ICollection InterventionPrescriptionDiagnoses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionDiagnoses) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionDiagnoses; - } - set - { - _interventionPrescriptionDiagnoses = value; - _interventionPrescriptionDiagnosesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionDiagnoses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionDiagnoses) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionDiagnosesCovariant; - } - set - { - InterventionPrescriptionDiagnoses = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionPrescriptionEducationContents; - private ICollection _interventionPrescriptionEducationContentsCovariant; - public virtual ICollection InterventionPrescriptionEducationContents - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionEducationContents) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionEducationContents; - } - set - { - _interventionPrescriptionEducationContents = value; - _interventionPrescriptionEducationContentsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionEducationContents - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionEducationContents) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionEducationContentsCovariant; - } - set - { - InterventionPrescriptionEducationContents = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionPrescriptionLearningResourceMetadataURIs; - private ICollection _interventionPrescriptionLearningResourceMetadataURIsCovariant; - public virtual ICollection InterventionPrescriptionLearningResourceMetadataURIs - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionLearningResourceMetadataURIs) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionLearningResourceMetadataURIs; - } - set - { - _interventionPrescriptionLearningResourceMetadataURIs = value; - _interventionPrescriptionLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionLearningResourceMetadataURIs - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionLearningResourceMetadataURIs) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionLearningResourceMetadataURIsCovariant; - } - set - { - InterventionPrescriptionLearningResourceMetadataURIs = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionPrescriptionPopulationServeds; - private ICollection _interventionPrescriptionPopulationServedsCovariant; - public virtual ICollection InterventionPrescriptionPopulationServeds - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionPopulationServeds) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionPopulationServeds; - } - set - { - _interventionPrescriptionPopulationServeds = value; - _interventionPrescriptionPopulationServedsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionPopulationServeds - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionPopulationServeds) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionPopulationServedsCovariant; - } - set - { - InterventionPrescriptionPopulationServeds = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionPrescriptionURIs; - private ICollection _interventionPrescriptionURIsCovariant; - public virtual ICollection InterventionPrescriptionURIs - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionURIs) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionURIs; - } - set - { - _interventionPrescriptionURIs = value; - _interventionPrescriptionURIsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionURIs - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionPrescriptionURIs) - if (item.InterventionPrescription == null) - item.InterventionPrescription = this; - // ------------------------------------------------------------- - - return _interventionPrescriptionURIsCovariant; - } - set - { - InterventionPrescriptionURIs = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DeliveryMethodDescriptor", new LookupColumnDetails { PropertyName = "DeliveryMethodDescriptorId", LookupTypeName = "DeliveryMethodDescriptor"} }, - { "InterventionClassDescriptor", new LookupColumnDetails { PropertyName = "InterventionClassDescriptorId", LookupTypeName = "InterventionClassDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -60915,11 +60771,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("InterventionPrescriptionEducationOrganizationId", InterventionPrescriptionEducationOrganizationId); keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); return keyValues; @@ -60984,32 +60840,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescription)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionInterventionPrescription)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescription) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionInterventionPrescription) target, null); } + void IChildEntity.SetParent(object value) + { + Intervention = (Intervention) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescriptionAppropriateGradeLevel table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionLearningResourceMetadataURI table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionPrescriptionAppropriateGradeLevel() + public InterventionLearningResourceMetadataURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61018,49 +60878,16 @@ public InterventionPrescriptionAppropriateGradeLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionPrescription InterventionPrescription { get; set; } + public virtual Intervention Intervention { get; set; } - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateGradeLevel.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Intervention { - get { return InterventionPrescription; } - set { InterventionPrescription = (InterventionPrescription) value; } + get { return Intervention; } + set { Intervention = (Intervention) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor - { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } - } + public virtual string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61125,7 +60952,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -61137,10 +60963,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); return keyValues; } @@ -61204,36 +61030,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI) target, null); } void IChildEntity.SetParent(object value) { - InterventionPrescription = (InterventionPrescription) value; + Intervention = (Intervention) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescriptionAppropriateSex table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionMeetingTime table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionAppropriateSex : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionMeetingTime : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionMeetingTime, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionPrescriptionAppropriateSex() + public InterventionMeetingTime() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61242,49 +61068,18 @@ public InterventionPrescriptionAppropriateSex() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionPrescription InterventionPrescription { get; set; } + public virtual Intervention Intervention { get; set; } - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateSex.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention { - get { return InterventionPrescription; } - set { InterventionPrescription = (InterventionPrescription) value; } + get { return Intervention; } + set { Intervention = (Intervention) value; } } [DomainSignature] - public virtual int SexDescriptorId - { - get - { - if (_sexDescriptorId == default(int)) - _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); - - return _sexDescriptorId; - } - set - { - _sexDescriptorId = value; - _sexDescriptor = null; - } - } - - private int _sexDescriptorId; - private string _sexDescriptor; - - public virtual string SexDescriptor - { - get - { - if (_sexDescriptor == null) - _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); - - return _sexDescriptor; - } - set - { - _sexDescriptor = value; - _sexDescriptorId = default(int); - } - } + public virtual TimeSpan EndTime { get; set; } + [DomainSignature] + public virtual TimeSpan StartTime { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61349,7 +61144,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -61361,10 +61155,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("SexDescriptorId", SexDescriptorId); + keyValues.Add("EndTime", EndTime); + keyValues.Add("StartTime", StartTime); return keyValues; } @@ -61428,36 +61223,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionMeetingTime)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionMeetingTime) target, null); } void IChildEntity.SetParent(object value) { - InterventionPrescription = (InterventionPrescription) value; + Intervention = (Intervention) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescriptionDiagnosis table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionPopulationServed table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionDiagnosis : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPrescriptionDiagnosis, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPopulationServed : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionPrescriptionDiagnosis() + public InterventionPopulationServed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61466,47 +61261,47 @@ public InterventionPrescriptionDiagnosis() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionPrescription InterventionPrescription { get; set; } + public virtual Intervention Intervention { get; set; } - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionDiagnosis.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionPopulationServed.Intervention { - get { return InterventionPrescription; } - set { InterventionPrescription = (InterventionPrescription) value; } + get { return Intervention; } + set { Intervention = (Intervention) value; } } [DomainSignature] - public virtual int DiagnosisDescriptorId + public virtual int PopulationServedDescriptorId { get { - if (_diagnosisDescriptorId == default(int)) - _diagnosisDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiagnosisDescriptor", _diagnosisDescriptor); + if (_populationServedDescriptorId == default(int)) + _populationServedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); - return _diagnosisDescriptorId; + return _populationServedDescriptorId; } set { - _diagnosisDescriptorId = value; - _diagnosisDescriptor = null; + _populationServedDescriptorId = value; + _populationServedDescriptor = null; } } - private int _diagnosisDescriptorId; - private string _diagnosisDescriptor; + private int _populationServedDescriptorId; + private string _populationServedDescriptor; - public virtual string DiagnosisDescriptor + public virtual string PopulationServedDescriptor { get { - if (_diagnosisDescriptor == null) - _diagnosisDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiagnosisDescriptor", _diagnosisDescriptorId); + if (_populationServedDescriptor == null) + _populationServedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId); - return _diagnosisDescriptor; + return _populationServedDescriptor; } set { - _diagnosisDescriptor = value; - _diagnosisDescriptorId = default(int); + _populationServedDescriptor = value; + _populationServedDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -61573,7 +61368,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DiagnosisDescriptor", new LookupColumnDetails { PropertyName = "DiagnosisDescriptorId", LookupTypeName = "DiagnosisDescriptor"} }, + { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -61585,10 +61380,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); + keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); return keyValues; } @@ -61652,36 +61447,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPopulationServed)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPopulationServed) target, null); } void IChildEntity.SetParent(object value) { - InterventionPrescription = (InterventionPrescription) value; + Intervention = (Intervention) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescriptionEducationContent table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionStaff table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionEducationContent : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPrescriptionEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionStaff : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionPrescriptionEducationContent() + public InterventionStaff() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61690,16 +61485,63 @@ public InterventionPrescriptionEducationContent() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionPrescription InterventionPrescription { get; set; } + public virtual Intervention Intervention { get; set; } - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionEducationContent.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionStaff.Intervention { - get { return InterventionPrescription; } - set { InterventionPrescription = (InterventionPrescription) value; } + get { return Intervention; } + set { Intervention = (Intervention) value; } } - [DomainSignature] - public virtual string ContentIdentifier { get; set; } + [Display(Name="StaffUniqueId")][DomainSignature] + public virtual int StaffUSI + { + get + { + if (_staffUSI == default(int) && _staffUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) + { + _staffUSI = usi; + } + } + + return _staffUSI; + } + set + { + _staffUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); + } + } + + private int _staffUSI; + private string _staffUniqueId; + + public virtual string StaffUniqueId + { + get + { + if (_staffUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) + { + _staffUniqueId = uniqueId; + } + } + + return _staffUniqueId; + } + set + { + if (_staffUniqueId != value) + _staffUSI = default(int); + + _staffUniqueId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -61754,23 +61596,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// - /// Read-only property that allows the EducationContent discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentDiscriminator + string Entities.Common.EdFi.IInterventionStaff.StaffDiscriminator { - get { return EducationContentReferenceData?.Discriminator; } + get { return StaffReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the EducationContent resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentResourceId + Guid? Entities.Common.EdFi.IInterventionStaff.StaffResourceId { - get { return EducationContentReferenceData?.Id; } + get { return StaffReferenceData?.Id; } set { } } @@ -61795,10 +61637,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ContentIdentifier", ContentIdentifier); + keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -61862,36 +61704,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionEducationContent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStaff)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionEducationContent) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStaff) target, null); } void IChildEntity.SetParent(object value) { - InterventionPrescription = (InterventionPrescription) value; + Intervention = (Intervention) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescriptionLearningResourceMetadataURI table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionURI table of the Intervention aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionPrescriptionLearningResourceMetadataURI() + public InterventionURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61900,16 +61742,16 @@ public InterventionPrescriptionLearningResourceMetadataURI() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionPrescription InterventionPrescription { get; set; } + public virtual Intervention Intervention { get; set; } - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionLearningResourceMetadataURI.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionURI.Intervention { - get { return InterventionPrescription; } - set { InterventionPrescription = (InterventionPrescription) value; } + get { return Intervention; } + set { Intervention = (Intervention) value; } } [DomainSignature] - public virtual string LearningResourceMetadataURI { get; set; } + public virtual string URI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61985,10 +61827,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); + keyValues.Add("URI", URI); return keyValues; } @@ -62052,92 +61894,81 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionURI) target, null); } void IChildEntity.SetParent(object value) { - InterventionPrescription = (InterventionPrescription) value; + Intervention = (Intervention) value; } } +} +// Aggregate: InterventionClassDescriptor + +namespace EdFi.Ods.Entities.NHibernate.InterventionClassDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescriptionPopulationServed table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionClassDescriptor table of the InterventionClassDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionPopulationServed : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPrescriptionPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionClassDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IInterventionClassDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionPrescriptionPopulationServed() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual InterventionPrescription InterventionPrescription { get; set; } - - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionPopulationServed.InterventionPrescription - { - get { return InterventionPrescription; } - set { InterventionPrescription = (InterventionPrescription) value; } - } - [DomainSignature] - public virtual int PopulationServedDescriptorId - { - get - { - if (_populationServedDescriptorId == default(int)) - _populationServedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); - - return _populationServedDescriptorId; - } - set - { - _populationServedDescriptorId = value; - _populationServedDescriptor = null; - } - } - - private int _populationServedDescriptorId; - private string _populationServedDescriptor; - - public virtual string PopulationServedDescriptor + public virtual int InterventionClassDescriptorId { - get - { - if (_populationServedDescriptor == null) - _populationServedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId); - - return _populationServedDescriptor; - } - set - { - _populationServedDescriptor = value; - _populationServedDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -62153,35 +61984,6 @@ public virtual string PopulationServedDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -62197,7 +61999,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -62208,11 +62009,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); + keyValues.Add("InterventionClassDescriptorId", InterventionClassDescriptorId); return keyValues; } @@ -62276,59 +62077,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionClassDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionClassDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - InterventionPrescription = (InterventionPrescription) value; - } } +} +// Aggregate: InterventionEffectivenessRatingDescriptor + +namespace EdFi.Ods.Entities.NHibernate.InterventionEffectivenessRatingDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionPrescriptionURI table of the InterventionPrescription aggregate in the ODS database. + /// A class which represents the edfi.InterventionEffectivenessRatingDescriptor table of the InterventionEffectivenessRatingDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionPrescriptionURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionEffectivenessRatingDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionPrescriptionURI() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual InterventionPrescription InterventionPrescription { get; set; } - - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.InterventionPrescription + [DomainSignature] + public virtual int InterventionEffectivenessRatingDescriptorId { - get { return InterventionPrescription; } - set { InterventionPrescription = (InterventionPrescription) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string URI { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -62344,35 +62163,6 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.Inte // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -62398,11 +62188,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("URI", URI); + keyValues.Add("InterventionEffectivenessRatingDescriptorId", InterventionEffectivenessRatingDescriptorId); return keyValues; } @@ -62466,34 +62256,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionURI) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - InterventionPrescription = (InterventionPrescription) value; - } } } -// Aggregate: InterventionStudy +// Aggregate: InterventionPrescription -namespace EdFi.Ods.Entities.NHibernate.InterventionStudyAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.InterventionPrescriptionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class InterventionStudyReferenceData : IHasPrimaryKeyValues + public class InterventionPrescriptionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- public virtual long EducationOrganizationId { get; set; } - public virtual string InterventionStudyIdentificationCode { get; set; } + public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- /// @@ -62515,7 +62301,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("InterventionStudyIdentificationCode", InterventionStudyIdentificationCode); + keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); return keyValues; } @@ -62566,27 +62352,26 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudy table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescription table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudy : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IInterventionStudy, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescription : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IInterventionPrescription, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudy() + public InterventionPrescription() { - InterventionStudyAppropriateGradeLevels = new HashSet(); - InterventionStudyAppropriateSexes = new HashSet(); - InterventionStudyEducationContents = new HashSet(); - InterventionStudyInterventionEffectivenesses = new HashSet(); - InterventionStudyLearningResourceMetadataURIs = new HashSet(); - InterventionStudyPopulationServeds = new HashSet(); - InterventionStudyStateAbbreviations = new HashSet(); - InterventionStudyURIs = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + InterventionPrescriptionAppropriateGradeLevels = new HashSet(); + InterventionPrescriptionAppropriateSexes = new HashSet(); + InterventionPrescriptionDiagnoses = new HashSet(); + InterventionPrescriptionEducationContents = new HashSet(); + InterventionPrescriptionLearningResourceMetadataURIs = new HashSet(); + InterventionPrescriptionPopulationServeds = new HashSet(); + InterventionPrescriptionURIs = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -62597,7 +62382,7 @@ public InterventionStudy() [DomainSignature] public virtual long EducationOrganizationId { get; set; } [DomainSignature] - public virtual string InterventionStudyIdentificationCode { get; set; } + public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -62676,9 +62461,9 @@ public virtual string InterventionClassDescriptor _interventionClassDescriptorId = default(int); } } - public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } - public virtual string InterventionPrescriptionIdentificationCode { get; set; } - public virtual int Participants { get; set; } + public virtual int? MaxDosage { get; set; } + public virtual int? MinDosage { get; set; } + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -62728,7 +62513,7 @@ public IDictionary Extensions /// /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IInterventionStudy.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscriminator { get { return EducationOrganizationReferenceData?.Discriminator; } set { } @@ -62737,88 +62522,21 @@ string Entities.Common.EdFi.IInterventionStudy.EducationOrganizationDiscriminato /// /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IInterventionStudy.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationResourceId { get { return EducationOrganizationReferenceData?.Id; } set { } } - public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } - - /// - /// Read-only property that allows the InterventionPrescription discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionDiscriminator - { - get { return InterventionPrescriptionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the InterventionPrescription resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionResourceId - { - get { return InterventionPrescriptionReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _interventionStudyAppropriateGradeLevels; - private ICollection _interventionStudyAppropriateGradeLevelsCovariant; - public virtual ICollection InterventionStudyAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionStudyAppropriateGradeLevels) - if (item.InterventionStudy == null) - item.InterventionStudy = this; - // ------------------------------------------------------------- - - return _interventionStudyAppropriateGradeLevels; - } - set - { - _interventionStudyAppropriateGradeLevels = value; - _interventionStudyAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _interventionStudyAppropriateGradeLevels) - if (item.InterventionStudy == null) - item.InterventionStudy = this; - // ------------------------------------------------------------- - - return _interventionStudyAppropriateGradeLevelsCovariant; - } - set - { - InterventionStudyAppropriateGradeLevels = new HashSet(value.Cast()); - } - } - - - private ICollection _interventionStudyAppropriateSexes; - private ICollection _interventionStudyAppropriateSexesCovariant; - public virtual ICollection InterventionStudyAppropriateSexes + private ICollection _interventionPrescriptionAppropriateGradeLevels; + private ICollection _interventionPrescriptionAppropriateGradeLevelsCovariant; + public virtual ICollection InterventionPrescriptionAppropriateGradeLevels { get { @@ -62827,45 +62545,45 @@ public virtual ICollection(value); + _interventionPrescriptionAppropriateGradeLevels = value; + _interventionPrescriptionAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateSexes + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateGradeLevels { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _interventionStudyAppropriateSexes) - if (item.InterventionStudy == null) - item.InterventionStudy = this; + foreach (var item in _interventionPrescriptionAppropriateGradeLevels) + if (item.InterventionPrescription == null) + item.InterventionPrescription = this; // ------------------------------------------------------------- - return _interventionStudyAppropriateSexesCovariant; + return _interventionPrescriptionAppropriateGradeLevelsCovariant; } set { - InterventionStudyAppropriateSexes = new HashSet(value.Cast()); + InterventionPrescriptionAppropriateGradeLevels = new HashSet(value.Cast()); } } - private ICollection _interventionStudyEducationContents; - private ICollection _interventionStudyEducationContentsCovariant; - public virtual ICollection InterventionStudyEducationContents + private ICollection _interventionPrescriptionAppropriateSexes; + private ICollection _interventionPrescriptionAppropriateSexesCovariant; + public virtual ICollection InterventionPrescriptionAppropriateSexes { get { @@ -62874,45 +62592,45 @@ public virtual ICollection(value); + _interventionPrescriptionAppropriateSexes = value; + _interventionPrescriptionAppropriateSexesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyEducationContents + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateSexes { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _interventionStudyEducationContents) - if (item.InterventionStudy == null) - item.InterventionStudy = this; + foreach (var item in _interventionPrescriptionAppropriateSexes) + if (item.InterventionPrescription == null) + item.InterventionPrescription = this; // ------------------------------------------------------------- - return _interventionStudyEducationContentsCovariant; + return _interventionPrescriptionAppropriateSexesCovariant; } set { - InterventionStudyEducationContents = new HashSet(value.Cast()); + InterventionPrescriptionAppropriateSexes = new HashSet(value.Cast()); } } - private ICollection _interventionStudyInterventionEffectivenesses; - private ICollection _interventionStudyInterventionEffectivenessesCovariant; - public virtual ICollection InterventionStudyInterventionEffectivenesses + private ICollection _interventionPrescriptionDiagnoses; + private ICollection _interventionPrescriptionDiagnosesCovariant; + public virtual ICollection InterventionPrescriptionDiagnoses { get { @@ -62921,45 +62639,45 @@ public virtual ICollection(value); + _interventionPrescriptionDiagnoses = value; + _interventionPrescriptionDiagnosesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyInterventionEffectivenesses + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionDiagnoses { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _interventionStudyInterventionEffectivenesses) - if (item.InterventionStudy == null) - item.InterventionStudy = this; + foreach (var item in _interventionPrescriptionDiagnoses) + if (item.InterventionPrescription == null) + item.InterventionPrescription = this; // ------------------------------------------------------------- - return _interventionStudyInterventionEffectivenessesCovariant; + return _interventionPrescriptionDiagnosesCovariant; } set { - InterventionStudyInterventionEffectivenesses = new HashSet(value.Cast()); + InterventionPrescriptionDiagnoses = new HashSet(value.Cast()); } } - private ICollection _interventionStudyLearningResourceMetadataURIs; - private ICollection _interventionStudyLearningResourceMetadataURIsCovariant; - public virtual ICollection InterventionStudyLearningResourceMetadataURIs + private ICollection _interventionPrescriptionEducationContents; + private ICollection _interventionPrescriptionEducationContentsCovariant; + public virtual ICollection InterventionPrescriptionEducationContents { get { @@ -62968,45 +62686,45 @@ public virtual ICollection(value); + _interventionPrescriptionEducationContents = value; + _interventionPrescriptionEducationContentsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyLearningResourceMetadataURIs + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionEducationContents { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _interventionStudyLearningResourceMetadataURIs) - if (item.InterventionStudy == null) - item.InterventionStudy = this; + foreach (var item in _interventionPrescriptionEducationContents) + if (item.InterventionPrescription == null) + item.InterventionPrescription = this; // ------------------------------------------------------------- - return _interventionStudyLearningResourceMetadataURIsCovariant; + return _interventionPrescriptionEducationContentsCovariant; } set { - InterventionStudyLearningResourceMetadataURIs = new HashSet(value.Cast()); + InterventionPrescriptionEducationContents = new HashSet(value.Cast()); } } - private ICollection _interventionStudyPopulationServeds; - private ICollection _interventionStudyPopulationServedsCovariant; - public virtual ICollection InterventionStudyPopulationServeds + private ICollection _interventionPrescriptionLearningResourceMetadataURIs; + private ICollection _interventionPrescriptionLearningResourceMetadataURIsCovariant; + public virtual ICollection InterventionPrescriptionLearningResourceMetadataURIs { get { @@ -63015,45 +62733,45 @@ public virtual ICollection(value); + _interventionPrescriptionLearningResourceMetadataURIs = value; + _interventionPrescriptionLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyPopulationServeds + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionLearningResourceMetadataURIs { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _interventionStudyPopulationServeds) - if (item.InterventionStudy == null) - item.InterventionStudy = this; + foreach (var item in _interventionPrescriptionLearningResourceMetadataURIs) + if (item.InterventionPrescription == null) + item.InterventionPrescription = this; // ------------------------------------------------------------- - return _interventionStudyPopulationServedsCovariant; + return _interventionPrescriptionLearningResourceMetadataURIsCovariant; } set { - InterventionStudyPopulationServeds = new HashSet(value.Cast()); + InterventionPrescriptionLearningResourceMetadataURIs = new HashSet(value.Cast()); } } - private ICollection _interventionStudyStateAbbreviations; - private ICollection _interventionStudyStateAbbreviationsCovariant; - public virtual ICollection InterventionStudyStateAbbreviations + private ICollection _interventionPrescriptionPopulationServeds; + private ICollection _interventionPrescriptionPopulationServedsCovariant; + public virtual ICollection InterventionPrescriptionPopulationServeds { get { @@ -63062,45 +62780,45 @@ public virtual ICollection(value); + _interventionPrescriptionPopulationServeds = value; + _interventionPrescriptionPopulationServedsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyStateAbbreviations + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionPopulationServeds { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _interventionStudyStateAbbreviations) - if (item.InterventionStudy == null) - item.InterventionStudy = this; + foreach (var item in _interventionPrescriptionPopulationServeds) + if (item.InterventionPrescription == null) + item.InterventionPrescription = this; // ------------------------------------------------------------- - return _interventionStudyStateAbbreviationsCovariant; + return _interventionPrescriptionPopulationServedsCovariant; } set { - InterventionStudyStateAbbreviations = new HashSet(value.Cast()); + InterventionPrescriptionPopulationServeds = new HashSet(value.Cast()); } } - private ICollection _interventionStudyURIs; - private ICollection _interventionStudyURIsCovariant; - public virtual ICollection InterventionStudyURIs + private ICollection _interventionPrescriptionURIs; + private ICollection _interventionPrescriptionURIsCovariant; + public virtual ICollection InterventionPrescriptionURIs { get { @@ -63109,38 +62827,38 @@ public virtual ICollection(value); + _interventionPrescriptionURIs = value; + _interventionPrescriptionURIsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyURIs + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionURIs { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _interventionStudyURIs) - if (item.InterventionStudy == null) - item.InterventionStudy = this; + foreach (var item in _interventionPrescriptionURIs) + if (item.InterventionPrescription == null) + item.InterventionPrescription = this; // ------------------------------------------------------------- - return _interventionStudyURIsCovariant; + return _interventionPrescriptionURIsCovariant; } set { - InterventionStudyURIs = new HashSet(value.Cast()); + InterventionPrescriptionURIs = new HashSet(value.Cast()); } } @@ -63166,7 +62884,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("InterventionStudyIdentificationCode", InterventionStudyIdentificationCode); + keyValues.Add("InterventionPrescriptionIdentificationCode", InterventionPrescriptionIdentificationCode); return keyValues; } @@ -63230,12 +62948,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudy)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescription)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudy) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescription) target, null); } } @@ -63243,19 +62961,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudyAppropriateGradeLevel table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescriptionAppropriateGradeLevel table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudyAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescriptionAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudyAppropriateGradeLevel() + public InterventionPrescriptionAppropriateGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -63264,12 +62982,12 @@ public InterventionStudyAppropriateGradeLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } + public virtual InterventionPrescription InterventionPrescription { get; set; } - Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateGradeLevel.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateGradeLevel.InterventionPrescription { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } + get { return InterventionPrescription; } + set { InterventionPrescription = (InterventionPrescription) value; } } [DomainSignature] @@ -63383,7 +63101,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -63450,36 +63168,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel) target, null); } void IChildEntity.SetParent(object value) { - InterventionStudy = (InterventionStudy) value; + InterventionPrescription = (InterventionPrescription) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudyAppropriateSex table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescriptionAppropriateSex table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudyAppropriateSex : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescriptionAppropriateSex : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudyAppropriateSex() + public InterventionPrescriptionAppropriateSex() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -63488,12 +63206,12 @@ public InterventionStudyAppropriateSex() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } + public virtual InterventionPrescription InterventionPrescription { get; set; } - Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateSex.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateSex.InterventionPrescription { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } + get { return InterventionPrescription; } + set { InterventionPrescription = (InterventionPrescription) value; } } [DomainSignature] @@ -63607,7 +63325,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("SexDescriptorId", SexDescriptorId); @@ -63674,36 +63392,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyAppropriateSex)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudyAppropriateSex) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex) target, null); } void IChildEntity.SetParent(object value) { - InterventionStudy = (InterventionStudy) value; + InterventionPrescription = (InterventionPrescription) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudyEducationContent table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescriptionDiagnosis table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudyEducationContent : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescriptionDiagnosis : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPrescriptionDiagnosis, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudyEducationContent() + public InterventionPrescriptionDiagnosis() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -63712,16 +63430,49 @@ public InterventionStudyEducationContent() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } + public virtual InterventionPrescription InterventionPrescription { get; set; } - Entities.Common.EdFi.IInterventionStudy IInterventionStudyEducationContent.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionDiagnosis.InterventionPrescription { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } + get { return InterventionPrescription; } + set { InterventionPrescription = (InterventionPrescription) value; } } [DomainSignature] - public virtual string ContentIdentifier { get; set; } + public virtual int DiagnosisDescriptorId + { + get + { + if (_diagnosisDescriptorId == default(int)) + _diagnosisDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiagnosisDescriptor", _diagnosisDescriptor); + + return _diagnosisDescriptorId; + } + set + { + _diagnosisDescriptorId = value; + _diagnosisDescriptor = null; + } + } + + private int _diagnosisDescriptorId; + private string _diagnosisDescriptor; + + public virtual string DiagnosisDescriptor + { + get + { + if (_diagnosisDescriptor == null) + _diagnosisDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiagnosisDescriptor", _diagnosisDescriptorId); + + return _diagnosisDescriptor; + } + set + { + _diagnosisDescriptor = value; + _diagnosisDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -63776,26 +63527,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationContent discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentDiscriminator - { - get { return EducationContentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationContent resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentResourceId - { - get { return EducationContentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -63806,6 +63537,7 @@ string Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentD // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "DiagnosisDescriptor", new LookupColumnDetails { PropertyName = "DiagnosisDescriptorId", LookupTypeName = "DiagnosisDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -63817,10 +63549,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ContentIdentifier", ContentIdentifier); + keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); return keyValues; } @@ -63884,36 +63616,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyEducationContent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudyEducationContent) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis) target, null); } void IChildEntity.SetParent(object value) { - InterventionStudy = (InterventionStudy) value; + InterventionPrescription = (InterventionPrescription) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudyInterventionEffectiveness table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescriptionEducationContent table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudyInterventionEffectiveness : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescriptionEducationContent : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPrescriptionEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudyInterventionEffectiveness() + public InterventionPrescriptionEducationContent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -63922,119 +63654,16 @@ public InterventionStudyInterventionEffectiveness() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } + public virtual InterventionPrescription InterventionPrescription { get; set; } - Entities.Common.EdFi.IInterventionStudy IInterventionStudyInterventionEffectiveness.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionEducationContent.InterventionPrescription { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } + get { return InterventionPrescription; } + set { InterventionPrescription = (InterventionPrescription) value; } } [DomainSignature] - public virtual int DiagnosisDescriptorId - { - get - { - if (_diagnosisDescriptorId == default(int)) - _diagnosisDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiagnosisDescriptor", _diagnosisDescriptor); - - return _diagnosisDescriptorId; - } - set - { - _diagnosisDescriptorId = value; - _diagnosisDescriptor = null; - } - } - - private int _diagnosisDescriptorId; - private string _diagnosisDescriptor; - - public virtual string DiagnosisDescriptor - { - get - { - if (_diagnosisDescriptor == null) - _diagnosisDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiagnosisDescriptor", _diagnosisDescriptorId); - - return _diagnosisDescriptor; - } - set - { - _diagnosisDescriptor = value; - _diagnosisDescriptorId = default(int); - } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor - { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } - } - [DomainSignature] - public virtual int PopulationServedDescriptorId - { - get - { - if (_populationServedDescriptorId == default(int)) - _populationServedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); - - return _populationServedDescriptorId; - } - set - { - _populationServedDescriptorId = value; - _populationServedDescriptor = null; - } - } - - private int _populationServedDescriptorId; - private string _populationServedDescriptor; - - public virtual string PopulationServedDescriptor - { - get - { - if (_populationServedDescriptor == null) - _populationServedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId); - - return _populationServedDescriptor; - } - set - { - _populationServedDescriptor = value; - _populationServedDescriptorId = default(int); - } - } + public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -64045,41 +63674,6 @@ public virtual string PopulationServedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? ImprovementIndex { get; set; } - public virtual int InterventionEffectivenessRatingDescriptorId - { - get - { - if (_interventionEffectivenessRatingDescriptorId == default(int)) - _interventionEffectivenessRatingDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InterventionEffectivenessRatingDescriptor", _interventionEffectivenessRatingDescriptor); - - return _interventionEffectivenessRatingDescriptorId; - } - set - { - _interventionEffectivenessRatingDescriptorId = value; - _interventionEffectivenessRatingDescriptor = null; - } - } - - private int _interventionEffectivenessRatingDescriptorId; - private string _interventionEffectivenessRatingDescriptor; - - public virtual string InterventionEffectivenessRatingDescriptor - { - get - { - if (_interventionEffectivenessRatingDescriptor == null) - _interventionEffectivenessRatingDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InterventionEffectivenessRatingDescriptor", _interventionEffectivenessRatingDescriptorId); - - return _interventionEffectivenessRatingDescriptor; - } - set - { - _interventionEffectivenessRatingDescriptor = value; - _interventionEffectivenessRatingDescriptorId = default(int); - } - } // ------------------------------------------------------------- // ============================================================= @@ -64124,6 +63718,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationContent discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentDiscriminator + { + get { return EducationContentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationContent resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentResourceId + { + get { return EducationContentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -64134,10 +63748,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DiagnosisDescriptor", new LookupColumnDetails { PropertyName = "DiagnosisDescriptorId", LookupTypeName = "DiagnosisDescriptor"} }, - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, - { "InterventionEffectivenessRatingDescriptor", new LookupColumnDetails { PropertyName = "InterventionEffectivenessRatingDescriptorId", LookupTypeName = "InterventionEffectivenessRatingDescriptor"} }, - { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -64149,12 +63759,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); - keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); + keyValues.Add("ContentIdentifier", ContentIdentifier); return keyValues; } @@ -64218,36 +63826,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionEducationContent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionEducationContent) target, null); } void IChildEntity.SetParent(object value) { - InterventionStudy = (InterventionStudy) value; + InterventionPrescription = (InterventionPrescription) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudyLearningResourceMetadataURI table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescriptionLearningResourceMetadataURI table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudyLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescriptionLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudyLearningResourceMetadataURI() + public InterventionPrescriptionLearningResourceMetadataURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64256,12 +63864,12 @@ public InterventionStudyLearningResourceMetadataURI() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } + public virtual InterventionPrescription InterventionPrescription { get; set; } - Entities.Common.EdFi.IInterventionStudy IInterventionStudyLearningResourceMetadataURI.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionLearningResourceMetadataURI.InterventionPrescription { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } + get { return InterventionPrescription; } + set { InterventionPrescription = (InterventionPrescription) value; } } [DomainSignature] @@ -64341,7 +63949,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); @@ -64408,36 +64016,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI) target, null); } void IChildEntity.SetParent(object value) { - InterventionStudy = (InterventionStudy) value; + InterventionPrescription = (InterventionPrescription) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudyPopulationServed table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescriptionPopulationServed table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudyPopulationServed : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescriptionPopulationServed : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPrescriptionPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudyPopulationServed() + public InterventionPrescriptionPopulationServed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64446,12 +64054,12 @@ public InterventionStudyPopulationServed() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } + public virtual InterventionPrescription InterventionPrescription { get; set; } - Entities.Common.EdFi.IInterventionStudy IInterventionStudyPopulationServed.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionPopulationServed.InterventionPrescription { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } + get { return InterventionPrescription; } + set { InterventionPrescription = (InterventionPrescription) value; } } [DomainSignature] @@ -64565,7 +64173,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); @@ -64632,260 +64240,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyPopulationServed)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IInterventionStudyPopulationServed) target, null); - } - - void IChildEntity.SetParent(object value) - { - InterventionStudy = (InterventionStudy) value; - } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.InterventionStudyStateAbbreviation table of the InterventionStudy aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class InterventionStudyStateAbbreviation : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyStateAbbreviation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public InterventionStudyStateAbbreviation() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } - - Entities.Common.EdFi.IInterventionStudy IInterventionStudyStateAbbreviation.InterventionStudy - { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } - } - - [DomainSignature] - public virtual int StateAbbreviationDescriptorId - { - get - { - if (_stateAbbreviationDescriptorId == default(int)) - _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); - - return _stateAbbreviationDescriptorId; - } - set - { - _stateAbbreviationDescriptorId = value; - _stateAbbreviationDescriptor = null; - } - } - - private int _stateAbbreviationDescriptorId; - private string _stateAbbreviationDescriptor; - - public virtual string StateAbbreviationDescriptor - { - get - { - if (_stateAbbreviationDescriptor == null) - _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); - - return _stateAbbreviationDescriptor; - } - set - { - _stateAbbreviationDescriptor = value; - _stateAbbreviationDescriptorId = default(int); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyStateAbbreviation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudyStateAbbreviation) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed) target, null); } void IChildEntity.SetParent(object value) { - InterventionStudy = (InterventionStudy) value; + InterventionPrescription = (InterventionPrescription) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.InterventionStudyURI table of the InterventionStudy aggregate in the ODS database. + /// A class which represents the edfi.InterventionPrescriptionURI table of the InterventionPrescription aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class InterventionStudyURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IInterventionStudyURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionPrescriptionURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionPrescriptionURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public InterventionStudyURI() + public InterventionPrescriptionURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64894,12 +64278,12 @@ public InterventionStudyURI() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual InterventionStudy InterventionStudy { get; set; } + public virtual InterventionPrescription InterventionPrescription { get; set; } - Entities.Common.EdFi.IInterventionStudy IInterventionStudyURI.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.InterventionPrescription { - get { return InterventionStudy; } - set { InterventionStudy = (InterventionStudy) value; } + get { return InterventionPrescription; } + set { InterventionPrescription = (InterventionPrescription) value; } } [DomainSignature] @@ -64979,7 +64363,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("URI", URI); @@ -65046,86 +64430,219 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionPrescriptionURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IInterventionStudyURI) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionPrescriptionURI) target, null); } void IChildEntity.SetParent(object value) { - InterventionStudy = (InterventionStudy) value; + InterventionPrescription = (InterventionPrescription) value; } } } -// Aggregate: LanguageDescriptor +// Aggregate: InterventionStudy -namespace EdFi.Ods.Entities.NHibernate.LanguageDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.InterventionStudyAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class InterventionStudyReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual string InterventionStudyIdentificationCode { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("InterventionStudyIdentificationCode", InterventionStudyIdentificationCode); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LanguageDescriptor table of the LanguageDescriptor aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudy table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LanguageDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILanguageDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class InterventionStudy : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IInterventionStudy, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public InterventionStudy() + { + InterventionStudyAppropriateGradeLevels = new HashSet(); + InterventionStudyAppropriateSexes = new HashSet(); + InterventionStudyEducationContents = new HashSet(); + InterventionStudyInterventionEffectivenesses = new HashSet(); + InterventionStudyLearningResourceMetadataURIs = new HashSet(); + InterventionStudyPopulationServeds = new HashSet(); + InterventionStudyStateAbbreviations = new HashSet(); + InterventionStudyURIs = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int LanguageDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string InterventionStudyIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int DeliveryMethodDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_deliveryMethodDescriptorId == default(int)) + _deliveryMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DeliveryMethodDescriptor", _deliveryMethodDescriptor); + + return _deliveryMethodDescriptorId; + } + set + { + _deliveryMethodDescriptorId = value; + _deliveryMethodDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _deliveryMethodDescriptorId; + private string _deliveryMethodDescriptor; + + public virtual string DeliveryMethodDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_deliveryMethodDescriptor == null) + _deliveryMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DeliveryMethodDescriptor", _deliveryMethodDescriptorId); + + return _deliveryMethodDescriptor; + } + set + { + _deliveryMethodDescriptor = value; + _deliveryMethodDescriptorId = default(int); + } } - string IDescriptor.Namespace + public virtual int InterventionClassDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_interventionClassDescriptorId == default(int)) + _interventionClassDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InterventionClassDescriptor", _interventionClassDescriptor); + + return _interventionClassDescriptorId; + } + set + { + _interventionClassDescriptorId = value; + _interventionClassDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _interventionClassDescriptorId; + private string _interventionClassDescriptor; + + public virtual string InterventionClassDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_interventionClassDescriptor == null) + _interventionClassDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InterventionClassDescriptor", _interventionClassDescriptorId); + + return _interventionClassDescriptor; + } + set + { + _interventionClassDescriptor = value; + _interventionClassDescriptorId = default(int); + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } + public virtual string InterventionPrescriptionIdentificationCode { get; set; } + public virtual int Participants { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65136,21 +64653,468 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IInterventionStudy.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IInterventionStudy.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } + + /// + /// Read-only property that allows the InterventionPrescription discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionDiscriminator + { + get { return InterventionPrescriptionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the InterventionPrescription resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionResourceId + { + get { return InterventionPrescriptionReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _interventionStudyAppropriateGradeLevels; + private ICollection _interventionStudyAppropriateGradeLevelsCovariant; + public virtual ICollection InterventionStudyAppropriateGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyAppropriateGradeLevels) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyAppropriateGradeLevels; + } + set + { + _interventionStudyAppropriateGradeLevels = value; + _interventionStudyAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyAppropriateGradeLevels) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyAppropriateGradeLevelsCovariant; + } + set + { + InterventionStudyAppropriateGradeLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStudyAppropriateSexes; + private ICollection _interventionStudyAppropriateSexesCovariant; + public virtual ICollection InterventionStudyAppropriateSexes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyAppropriateSexes) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyAppropriateSexes; + } + set + { + _interventionStudyAppropriateSexes = value; + _interventionStudyAppropriateSexesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateSexes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyAppropriateSexes) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyAppropriateSexesCovariant; + } + set + { + InterventionStudyAppropriateSexes = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStudyEducationContents; + private ICollection _interventionStudyEducationContentsCovariant; + public virtual ICollection InterventionStudyEducationContents + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyEducationContents) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyEducationContents; + } + set + { + _interventionStudyEducationContents = value; + _interventionStudyEducationContentsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyEducationContents + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyEducationContents) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyEducationContentsCovariant; + } + set + { + InterventionStudyEducationContents = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStudyInterventionEffectivenesses; + private ICollection _interventionStudyInterventionEffectivenessesCovariant; + public virtual ICollection InterventionStudyInterventionEffectivenesses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyInterventionEffectivenesses) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyInterventionEffectivenesses; + } + set + { + _interventionStudyInterventionEffectivenesses = value; + _interventionStudyInterventionEffectivenessesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyInterventionEffectivenesses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyInterventionEffectivenesses) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyInterventionEffectivenessesCovariant; + } + set + { + InterventionStudyInterventionEffectivenesses = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStudyLearningResourceMetadataURIs; + private ICollection _interventionStudyLearningResourceMetadataURIsCovariant; + public virtual ICollection InterventionStudyLearningResourceMetadataURIs + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyLearningResourceMetadataURIs) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyLearningResourceMetadataURIs; + } + set + { + _interventionStudyLearningResourceMetadataURIs = value; + _interventionStudyLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyLearningResourceMetadataURIs + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyLearningResourceMetadataURIs) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyLearningResourceMetadataURIsCovariant; + } + set + { + InterventionStudyLearningResourceMetadataURIs = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStudyPopulationServeds; + private ICollection _interventionStudyPopulationServedsCovariant; + public virtual ICollection InterventionStudyPopulationServeds + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyPopulationServeds) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyPopulationServeds; + } + set + { + _interventionStudyPopulationServeds = value; + _interventionStudyPopulationServedsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyPopulationServeds + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyPopulationServeds) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyPopulationServedsCovariant; + } + set + { + InterventionStudyPopulationServeds = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStudyStateAbbreviations; + private ICollection _interventionStudyStateAbbreviationsCovariant; + public virtual ICollection InterventionStudyStateAbbreviations + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyStateAbbreviations) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyStateAbbreviations; + } + set + { + _interventionStudyStateAbbreviations = value; + _interventionStudyStateAbbreviationsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyStateAbbreviations + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyStateAbbreviations) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyStateAbbreviationsCovariant; + } + set + { + InterventionStudyStateAbbreviations = new HashSet(value.Cast()); + } + } + + + private ICollection _interventionStudyURIs; + private ICollection _interventionStudyURIsCovariant; + public virtual ICollection InterventionStudyURIs + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyURIs) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyURIs; + } + set + { + _interventionStudyURIs = value; + _interventionStudyURIsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyURIs + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _interventionStudyURIs) + if (item.InterventionStudy == null) + item.InterventionStudy = this; + // ------------------------------------------------------------- + + return _interventionStudyURIsCovariant; + } + set + { + InterventionStudyURIs = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "DeliveryMethodDescriptor", new LookupColumnDetails { PropertyName = "DeliveryMethodDescriptorId", LookupTypeName = "DeliveryMethodDescriptor"} }, + { "InterventionClassDescriptor", new LookupColumnDetails { PropertyName = "InterventionClassDescriptorId", LookupTypeName = "InterventionClassDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -65165,7 +65129,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("InterventionStudyIdentificationCode", InterventionStudyIdentificationCode); return keyValues; } @@ -65229,79 +65194,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILanguageDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudy)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILanguageDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudy) target, null); } } -} -// Aggregate: LanguageInstructionProgramServiceDescriptor - -namespace EdFi.Ods.Entities.NHibernate.LanguageInstructionProgramServiceDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LanguageInstructionProgramServiceDescriptor table of the LanguageInstructionProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudyAppropriateGradeLevel table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LanguageInstructionProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class InterventionStudyAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int LanguageInstructionProgramServiceDescriptorId + public InterventionStudyAppropriateGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual InterventionStudy InterventionStudy { get; set; } + + Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateGradeLevel.InterventionStudy { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -65315,6 +65291,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65330,6 +65335,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -65340,11 +65346,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LanguageInstructionProgramServiceDescriptorId", LanguageInstructionProgramServiceDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -65408,79 +65414,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + InterventionStudy = (InterventionStudy) value; + } } -} -// Aggregate: LanguageUseDescriptor - -namespace EdFi.Ods.Entities.NHibernate.LanguageUseDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LanguageUseDescriptor table of the LanguageUseDescriptor aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudyAppropriateSex table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LanguageUseDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILanguageUseDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class InterventionStudyAppropriateSex : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int LanguageUseDescriptorId + public InterventionStudyAppropriateSex() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual InterventionStudy InterventionStudy { get; set; } + + Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateSex.InterventionStudy { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int SexDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_sexDescriptorId == default(int)) + _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); + + return _sexDescriptorId; + } + set + { + _sexDescriptorId = value; + _sexDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _sexDescriptorId; + private string _sexDescriptor; + + public virtual string SexDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_sexDescriptor == null) + _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); + + return _sexDescriptor; + } + set + { + _sexDescriptor = value; + _sexDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -65494,6 +65515,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65509,6 +65559,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -65519,11 +65570,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); + keyValues.Add("SexDescriptorId", SexDescriptorId); return keyValues; } @@ -65587,275 +65638,70 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILanguageUseDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyAppropriateSex)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILanguageUseDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyAppropriateSex) target, null); } + void IChildEntity.SetParent(object value) + { + InterventionStudy = (InterventionStudy) value; + } } -} -// Aggregate: LearningStandard +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 -namespace EdFi.Ods.Entities.NHibernate.LearningStandardAggregate.EdFi -{ /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.InterventionStudyEducationContent table of the InterventionStudy aggregate in the ODS database. /// - public class LearningStandardReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class InterventionStudyEducationContent : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public InterventionStudyEducationContent() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string LearningStandardId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + [DomainSignature, JsonIgnore] + public virtual InterventionStudy InterventionStudy { get; set; } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + Entities.Common.EdFi.IInterventionStudy IInterventionStudyEducationContent.InterventionStudy { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); - - return keyValues; + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; + [DomainSignature] + public virtual string ContentIdentifier { get; set; } + // ------------------------------------------------------------- - if (ReferenceEquals(this, compareTo)) - return true; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (compareTo == null) - return false; + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.LearningStandard table of the LearningStandard aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class LearningStandard : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public LearningStandard() - { - LearningStandardContentStandardPersistentList = new HashSet(); - LearningStandardAcademicSubjects = new HashSet(); - LearningStandardGradeLevels = new HashSet(); - LearningStandardIdentificationCodes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual string LearningStandardId { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CourseTitle { get; set; } - public virtual string Description { get; set; } - public virtual int? LearningStandardCategoryDescriptorId - { - get - { - if (_learningStandardCategoryDescriptorId == default(int?)) - _learningStandardCategoryDescriptorId = string.IsNullOrWhiteSpace(_learningStandardCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LearningStandardCategoryDescriptor", _learningStandardCategoryDescriptor); - - return _learningStandardCategoryDescriptorId; - } - set - { - _learningStandardCategoryDescriptorId = value; - _learningStandardCategoryDescriptor = null; - } - } - - private int? _learningStandardCategoryDescriptorId; - private string _learningStandardCategoryDescriptor; - - public virtual string LearningStandardCategoryDescriptor - { - get - { - if (_learningStandardCategoryDescriptor == null) - _learningStandardCategoryDescriptor = _learningStandardCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LearningStandardCategoryDescriptor", _learningStandardCategoryDescriptorId.Value); - - return _learningStandardCategoryDescriptor; - } - set - { - _learningStandardCategoryDescriptor = value; - _learningStandardCategoryDescriptorId = default(int?); - } - } - public virtual string LearningStandardItemCode { get; set; } - public virtual int? LearningStandardScopeDescriptorId - { - get - { - if (_learningStandardScopeDescriptorId == default(int?)) - _learningStandardScopeDescriptorId = string.IsNullOrWhiteSpace(_learningStandardScopeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LearningStandardScopeDescriptor", _learningStandardScopeDescriptor); - - return _learningStandardScopeDescriptorId; - } - set - { - _learningStandardScopeDescriptorId = value; - _learningStandardScopeDescriptor = null; - } - } - - private int? _learningStandardScopeDescriptorId; - private string _learningStandardScopeDescriptor; - - public virtual string LearningStandardScopeDescriptor - { - get - { - if (_learningStandardScopeDescriptor == null) - _learningStandardScopeDescriptor = _learningStandardScopeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LearningStandardScopeDescriptor", _learningStandardScopeDescriptorId.Value); - - return _learningStandardScopeDescriptor; - } - set - { - _learningStandardScopeDescriptor = value; - _learningStandardScopeDescriptorId = default(int?); - } - } - public virtual string Namespace { get; set; } - public virtual string ParentLearningStandardId { get; set; } - public virtual string SuccessCriteria { get; set; } - public virtual string URI { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - public virtual Entities.NHibernate.LearningStandardAggregate.EdFi.LearningStandardContentStandard LearningStandardContentStandard - { - get - { - // Return the item in the list, if one exists - if (LearningStandardContentStandardPersistentList.Any()) - return LearningStandardContentStandardPersistentList.First(); - - // No reference is present - return null; - } - set - { - // Delete the existing object - if (LearningStandardContentStandardPersistentList.Any()) - LearningStandardContentStandardPersistentList.Clear(); - - // If we're setting a value, add it to the list now - if (value != null) - { - // Set the back-reference to the parent - value.LearningStandard = this; - - LearningStandardContentStandardPersistentList.Add(value); - } - } - } - - Entities.Common.EdFi.ILearningStandardContentStandard Entities.Common.EdFi.ILearningStandard.LearningStandardContentStandard - { - get { return LearningStandardContentStandard; } - set { LearningStandardContentStandard = (Entities.NHibernate.LearningStandardAggregate.EdFi.LearningStandardContentStandard) value; } - } - - private ICollection _learningStandardContentStandardPersistentList; - - public virtual ICollection LearningStandardContentStandardPersistentList - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardContentStandardPersistentList) - if (item.LearningStandard == null) - item.LearningStandard = this; - // ------------------------------------------------------------- - - return _learningStandardContentStandardPersistentList; - } - set - { - _learningStandardContentStandardPersistentList = value; - } - } - - // ------------------------------------------------------------- + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // Extensions @@ -65894,23 +65740,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData ParentLearningStandardReferenceData { get; set; } + public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } /// - /// Read-only property that allows the ParentLearningStandard discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationContent discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardDiscriminator + string Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentDiscriminator { - get { return ParentLearningStandardReferenceData?.Discriminator; } + get { return EducationContentReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ParentLearningStandard resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationContent resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ILearningStandard.ParentLearningStandardResourceId + Guid? Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentResourceId { - get { return ParentLearningStandardReferenceData?.Id; } + get { return EducationContentReferenceData?.Id; } set { } } @@ -65919,154 +65765,11 @@ string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardDiscriminato //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _learningStandardAcademicSubjects; - private ICollection _learningStandardAcademicSubjectsCovariant; - public virtual ICollection LearningStandardAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardAcademicSubjects) - if (item.LearningStandard == null) - item.LearningStandard = this; - // ------------------------------------------------------------- - - return _learningStandardAcademicSubjects; - } - set - { - _learningStandardAcademicSubjects = value; - _learningStandardAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardAcademicSubjects) - if (item.LearningStandard == null) - item.LearningStandard = this; - // ------------------------------------------------------------- - - return _learningStandardAcademicSubjectsCovariant; - } - set - { - LearningStandardAcademicSubjects = new HashSet(value.Cast()); - } - } - - - private ICollection _learningStandardGradeLevels; - private ICollection _learningStandardGradeLevelsCovariant; - public virtual ICollection LearningStandardGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardGradeLevels) - if (item.LearningStandard == null) - item.LearningStandard = this; - // ------------------------------------------------------------- - - return _learningStandardGradeLevels; - } - set - { - _learningStandardGradeLevels = value; - _learningStandardGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardGradeLevels) - if (item.LearningStandard == null) - item.LearningStandard = this; - // ------------------------------------------------------------- - - return _learningStandardGradeLevelsCovariant; - } - set - { - LearningStandardGradeLevels = new HashSet(value.Cast()); - } - } - - - private ICollection _learningStandardIdentificationCodes; - private ICollection _learningStandardIdentificationCodesCovariant; - public virtual ICollection LearningStandardIdentificationCodes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardIdentificationCodes) - if (item.LearningStandard == null) - item.LearningStandard = this; - // ------------------------------------------------------------- - - return _learningStandardIdentificationCodes; - } - set - { - _learningStandardIdentificationCodes = value; - _learningStandardIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardIdentificationCodes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardIdentificationCodes) - if (item.LearningStandard == null) - item.LearningStandard = this; - // ------------------------------------------------------------- - - return _learningStandardIdentificationCodesCovariant; - } - set - { - LearningStandardIdentificationCodes = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LearningStandardCategoryDescriptor", new LookupColumnDetails { PropertyName = "LearningStandardCategoryDescriptorId", LookupTypeName = "LearningStandardCategoryDescriptor"} }, - { "LearningStandardScopeDescriptor", new LookupColumnDetails { PropertyName = "LearningStandardScopeDescriptorId", LookupTypeName = "LearningStandardScopeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -66077,11 +65780,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("ContentIdentifier", ContentIdentifier); return keyValues; } @@ -66145,32 +65848,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyEducationContent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyEducationContent) target, null); } + void IChildEntity.SetParent(object value) + { + InterventionStudy = (InterventionStudy) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LearningStandardAcademicSubject table of the LearningStandard aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudyInterventionEffectiveness table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LearningStandardAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILearningStandardAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionStudyInterventionEffectiveness : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LearningStandardAcademicSubject() + public InterventionStudyInterventionEffectiveness() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66179,47 +65886,117 @@ public LearningStandardAcademicSubject() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual LearningStandard LearningStandard { get; set; } + public virtual InterventionStudy InterventionStudy { get; set; } - Entities.Common.EdFi.ILearningStandard ILearningStandardAcademicSubject.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyInterventionEffectiveness.InterventionStudy { - get { return LearningStandard; } - set { LearningStandard = (LearningStandard) value; } + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } [DomainSignature] - public virtual int AcademicSubjectDescriptorId + public virtual int DiagnosisDescriptorId { get { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + if (_diagnosisDescriptorId == default(int)) + _diagnosisDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiagnosisDescriptor", _diagnosisDescriptor); - return _academicSubjectDescriptorId; + return _diagnosisDescriptorId; } set { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; + _diagnosisDescriptorId = value; + _diagnosisDescriptor = null; } } - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; + private int _diagnosisDescriptorId; + private string _diagnosisDescriptor; - public virtual string AcademicSubjectDescriptor + public virtual string DiagnosisDescriptor { get { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + if (_diagnosisDescriptor == null) + _diagnosisDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiagnosisDescriptor", _diagnosisDescriptorId); - return _academicSubjectDescriptor; + return _diagnosisDescriptor; } set { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); + _diagnosisDescriptor = value; + _diagnosisDescriptorId = default(int); + } + } + [DomainSignature] + public virtual int GradeLevelDescriptorId + { + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } + } + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor + { + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } + } + [DomainSignature] + public virtual int PopulationServedDescriptorId + { + get + { + if (_populationServedDescriptorId == default(int)) + _populationServedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); + + return _populationServedDescriptorId; + } + set + { + _populationServedDescriptorId = value; + _populationServedDescriptor = null; + } + } + + private int _populationServedDescriptorId; + private string _populationServedDescriptor; + + public virtual string PopulationServedDescriptor + { + get + { + if (_populationServedDescriptor == null) + _populationServedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId); + + return _populationServedDescriptor; + } + set + { + _populationServedDescriptor = value; + _populationServedDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -66232,6 +66009,41 @@ public virtual string AcademicSubjectDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual int? ImprovementIndex { get; set; } + public virtual int InterventionEffectivenessRatingDescriptorId + { + get + { + if (_interventionEffectivenessRatingDescriptorId == default(int)) + _interventionEffectivenessRatingDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InterventionEffectivenessRatingDescriptor", _interventionEffectivenessRatingDescriptor); + + return _interventionEffectivenessRatingDescriptorId; + } + set + { + _interventionEffectivenessRatingDescriptorId = value; + _interventionEffectivenessRatingDescriptor = null; + } + } + + private int _interventionEffectivenessRatingDescriptorId; + private string _interventionEffectivenessRatingDescriptor; + + public virtual string InterventionEffectivenessRatingDescriptor + { + get + { + if (_interventionEffectivenessRatingDescriptor == null) + _interventionEffectivenessRatingDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InterventionEffectivenessRatingDescriptor", _interventionEffectivenessRatingDescriptorId); + + return _interventionEffectivenessRatingDescriptor; + } + set + { + _interventionEffectivenessRatingDescriptor = value; + _interventionEffectivenessRatingDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -66286,7 +66098,10 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, + { "DiagnosisDescriptor", new LookupColumnDetails { PropertyName = "DiagnosisDescriptorId", LookupTypeName = "DiagnosisDescriptor"} }, + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "InterventionEffectivenessRatingDescriptor", new LookupColumnDetails { PropertyName = "InterventionEffectivenessRatingDescriptorId", LookupTypeName = "InterventionEffectivenessRatingDescriptor"} }, + { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -66298,10 +66113,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); return keyValues; } @@ -66365,37 +66182,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness) target, null); } void IChildEntity.SetParent(object value) { - LearningStandard = (LearningStandard) value; + InterventionStudy = (InterventionStudy) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LearningStandardContentStandard table of the LearningStandard aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudyLearningResourceMetadataURI table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LearningStandardContentStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILearningStandardContentStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionStudyLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LearningStandardContentStandard() + public InterventionStudyLearningResourceMetadataURI() { - LearningStandardContentStandardAuthors = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66404,14 +66220,16 @@ public LearningStandardContentStandard() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual LearningStandard LearningStandard { get; set; } + public virtual InterventionStudy InterventionStudy { get; set; } - Entities.Common.EdFi.ILearningStandard ILearningStandardContentStandard.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyLearningResourceMetadataURI.InterventionStudy { - get { return LearningStandard; } - set { LearningStandard = (LearningStandard) value; } + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } + [DomainSignature] + public virtual string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -66422,102 +66240,6 @@ Entities.Common.EdFi.ILearningStandard ILearningStandardContentStandard.Learning // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? BeginDate - { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _beginDate; - - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - - public virtual long? MandatingEducationOrganizationId { get; set; } - public virtual DateTime? PublicationDate - { - get { return _publicationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _publicationDate = null; - } else - { - var given = (DateTime) value; - _publicationDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _publicationDate; - - public virtual int? PublicationStatusDescriptorId - { - get - { - if (_publicationStatusDescriptorId == default(int?)) - _publicationStatusDescriptorId = string.IsNullOrWhiteSpace(_publicationStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PublicationStatusDescriptor", _publicationStatusDescriptor); - - return _publicationStatusDescriptorId; - } - set - { - _publicationStatusDescriptorId = value; - _publicationStatusDescriptor = null; - } - } - - private int? _publicationStatusDescriptorId; - private string _publicationStatusDescriptor; - - public virtual string PublicationStatusDescriptor - { - get - { - if (_publicationStatusDescriptor == null) - _publicationStatusDescriptor = _publicationStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PublicationStatusDescriptor", _publicationStatusDescriptorId.Value); - - return _publicationStatusDescriptor; - } - set - { - _publicationStatusDescriptor = value; - _publicationStatusDescriptorId = default(int?); - } - } - public virtual short? PublicationYear { get; set; } - public virtual string Title { get; set; } - public virtual string URI { get; set; } - public virtual string Version { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -66562,84 +66284,16 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MandatingEducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the MandatingEducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationDiscriminator - { - get { return MandatingEducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the MandatingEducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationResourceId - { - get { return MandatingEducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _learningStandardContentStandardAuthors; - private ICollection _learningStandardContentStandardAuthorsCovariant; - public virtual ICollection LearningStandardContentStandardAuthors - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardContentStandardAuthors) - if (item.LearningStandardContentStandard == null) - item.LearningStandardContentStandard = this; - // ------------------------------------------------------------- - - return _learningStandardContentStandardAuthors; - } - set - { - _learningStandardContentStandardAuthors = value; - _learningStandardContentStandardAuthorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandardContentStandard.LearningStandardContentStandardAuthors - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _learningStandardContentStandardAuthors) - if (item.LearningStandardContentStandard == null) - item.LearningStandardContentStandard = this; - // ------------------------------------------------------------- - - return _learningStandardContentStandardAuthorsCovariant; - } - set - { - LearningStandardContentStandardAuthors = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "PublicationStatusDescriptor", new LookupColumnDetails { PropertyName = "PublicationStatusDescriptorId", LookupTypeName = "PublicationStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -66651,9 +66305,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values + keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); return keyValues; } @@ -66717,36 +66372,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardContentStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardContentStandard) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI) target, null); } void IChildEntity.SetParent(object value) { - LearningStandard = (LearningStandard) value; + InterventionStudy = (InterventionStudy) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LearningStandardContentStandardAuthor table of the LearningStandard aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudyPopulationServed table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LearningStandardContentStandardAuthor : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILearningStandardContentStandardAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionStudyPopulationServed : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LearningStandardContentStandardAuthor() + public InterventionStudyPopulationServed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66755,16 +66410,49 @@ public LearningStandardContentStandardAuthor() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual LearningStandardContentStandard LearningStandardContentStandard { get; set; } + public virtual InterventionStudy InterventionStudy { get; set; } - Entities.Common.EdFi.ILearningStandardContentStandard ILearningStandardContentStandardAuthor.LearningStandardContentStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyPopulationServed.InterventionStudy { - get { return LearningStandardContentStandard; } - set { LearningStandardContentStandard = (LearningStandardContentStandard) value; } + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } [DomainSignature] - public virtual string Author { get; set; } + public virtual int PopulationServedDescriptorId + { + get + { + if (_populationServedDescriptorId == default(int)) + _populationServedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); + + return _populationServedDescriptorId; + } + set + { + _populationServedDescriptorId = value; + _populationServedDescriptor = null; + } + } + + private int _populationServedDescriptorId; + private string _populationServedDescriptor; + + public virtual string PopulationServedDescriptor + { + get + { + if (_populationServedDescriptor == null) + _populationServedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId); + + return _populationServedDescriptor; + } + set + { + _populationServedDescriptor = value; + _populationServedDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -66829,6 +66517,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -66840,10 +66529,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandardContentStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("Author", Author); + keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); return keyValues; } @@ -66907,36 +66596,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardContentStandardAuthor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyPopulationServed)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardContentStandardAuthor) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyPopulationServed) target, null); } void IChildEntity.SetParent(object value) { - LearningStandardContentStandard = (LearningStandardContentStandard) value; + InterventionStudy = (InterventionStudy) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LearningStandardGradeLevel table of the LearningStandard aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudyStateAbbreviation table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LearningStandardGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILearningStandardGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionStudyStateAbbreviation : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyStateAbbreviation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LearningStandardGradeLevel() + public InterventionStudyStateAbbreviation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66945,47 +66634,47 @@ public LearningStandardGradeLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual LearningStandard LearningStandard { get; set; } + public virtual InterventionStudy InterventionStudy { get; set; } - Entities.Common.EdFi.ILearningStandard ILearningStandardGradeLevel.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyStateAbbreviation.InterventionStudy { - get { return LearningStandard; } - set { LearningStandard = (LearningStandard) value; } + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId + public virtual int StateAbbreviationDescriptorId { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_stateAbbreviationDescriptorId == default(int)) + _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); - return _gradeLevelDescriptorId; + return _stateAbbreviationDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _stateAbbreviationDescriptorId = value; + _stateAbbreviationDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int _stateAbbreviationDescriptorId; + private string _stateAbbreviationDescriptor; - public virtual string GradeLevelDescriptor + public virtual string StateAbbreviationDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_stateAbbreviationDescriptor == null) + _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); - return _gradeLevelDescriptor; + return _stateAbbreviationDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _stateAbbreviationDescriptor = value; + _stateAbbreviationDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -67052,7 +66741,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -67064,10 +66753,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); return keyValues; } @@ -67131,36 +66820,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyStateAbbreviation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyStateAbbreviation) target, null); } void IChildEntity.SetParent(object value) { - LearningStandard = (LearningStandard) value; + InterventionStudy = (InterventionStudy) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LearningStandardIdentificationCode table of the LearningStandard aggregate in the ODS database. + /// A class which represents the edfi.InterventionStudyURI table of the InterventionStudy aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LearningStandardIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILearningStandardIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class InterventionStudyURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IInterventionStudyURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LearningStandardIdentificationCode() + public InterventionStudyURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -67169,18 +66858,16 @@ public LearningStandardIdentificationCode() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual LearningStandard LearningStandard { get; set; } + public virtual InterventionStudy InterventionStudy { get; set; } - Entities.Common.EdFi.ILearningStandard ILearningStandardIdentificationCode.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyURI.InterventionStudy { - get { return LearningStandard; } - set { LearningStandard = (LearningStandard) value; } + get { return InterventionStudy; } + set { InterventionStudy = (InterventionStudy) value; } } [DomainSignature] - public virtual string ContentStandardName { get; set; } - [DomainSignature] - public virtual string IdentificationCode { get; set; } + public virtual string URI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -67256,11 +66943,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ContentStandardName", ContentStandardName); - keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("URI", URI); return keyValues; } @@ -67324,41 +67010,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.IInterventionStudyURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.IInterventionStudyURI) target, null); } void IChildEntity.SetParent(object value) { - LearningStandard = (LearningStandard) value; + InterventionStudy = (InterventionStudy) value; } } } -// Aggregate: LearningStandardCategoryDescriptor +// Aggregate: LanguageDescriptor -namespace EdFi.Ods.Entities.NHibernate.LearningStandardCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LanguageDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LearningStandardCategoryDescriptor table of the LearningStandardCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LanguageDescriptor table of the LanguageDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LearningStandardCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILearningStandardCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LanguageDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILanguageDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int LearningStandardCategoryDescriptorId + public virtual int LanguageDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -67443,7 +67129,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardCategoryDescriptorId", LearningStandardCategoryDescriptorId); + keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); return keyValues; } @@ -67507,43 +67193,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILanguageDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILanguageDescriptor) target, null); } } } -// Aggregate: LearningStandardEquivalenceAssociation +// Aggregate: LanguageInstructionProgramServiceDescriptor -namespace EdFi.Ods.Entities.NHibernate.LearningStandardEquivalenceAssociationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LanguageInstructionProgramServiceDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.LanguageInstructionProgramServiceDescriptor table of the LanguageInstructionProgramServiceDescriptor aggregate in the ODS database. /// - public class LearningStandardEquivalenceAssociationReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class LanguageInstructionProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string Namespace { get; set; } - public virtual string SourceLearningStandardId { get; set; } - public virtual string TargetLearningStandardId { get; set; } + [DomainSignature] + public virtual int LanguageInstructionProgramServiceDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -67552,261 +67308,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Namespace", Namespace); - keyValues.Add("SourceLearningStandardId", SourceLearningStandardId); - keyValues.Add("TargetLearningStandardId", TargetLearningStandardId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.LearningStandardEquivalenceAssociation table of the LearningStandardEquivalenceAssociation aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class LearningStandardEquivalenceAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILearningStandardEquivalenceAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public LearningStandardEquivalenceAssociation() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual string Namespace { get; set; } - [DomainSignature] - public virtual string SourceLearningStandardId { get; set; } - [DomainSignature] - public virtual string TargetLearningStandardId { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime? EffectiveDate - { - get { return _effectiveDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _effectiveDate = null; - } else - { - var given = (DateTime) value; - _effectiveDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _effectiveDate; - - public virtual string LearningStandardEquivalenceStrengthDescription { get; set; } - public virtual int? LearningStandardEquivalenceStrengthDescriptorId - { - get - { - if (_learningStandardEquivalenceStrengthDescriptorId == default(int?)) - _learningStandardEquivalenceStrengthDescriptorId = string.IsNullOrWhiteSpace(_learningStandardEquivalenceStrengthDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LearningStandardEquivalenceStrengthDescriptor", _learningStandardEquivalenceStrengthDescriptor); - - return _learningStandardEquivalenceStrengthDescriptorId; - } - set - { - _learningStandardEquivalenceStrengthDescriptorId = value; - _learningStandardEquivalenceStrengthDescriptor = null; - } - } - - private int? _learningStandardEquivalenceStrengthDescriptorId; - private string _learningStandardEquivalenceStrengthDescriptor; - - public virtual string LearningStandardEquivalenceStrengthDescriptor - { - get - { - if (_learningStandardEquivalenceStrengthDescriptor == null) - _learningStandardEquivalenceStrengthDescriptor = _learningStandardEquivalenceStrengthDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LearningStandardEquivalenceStrengthDescriptor", _learningStandardEquivalenceStrengthDescriptorId.Value); - - return _learningStandardEquivalenceStrengthDescriptor; - } - set - { - _learningStandardEquivalenceStrengthDescriptor = value; - _learningStandardEquivalenceStrengthDescriptorId = default(int?); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData SourceLearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the SourceLearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardDiscriminator - { - get { return SourceLearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the SourceLearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardResourceId - { - get { return SourceLearningStandardReferenceData?.Id; } - set { } - } - - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData TargetLearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the TargetLearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardDiscriminator - { - get { return TargetLearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the TargetLearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardResourceId - { - get { return TargetLearningStandardReferenceData?.Id; } - set { } - } - - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "LearningStandardEquivalenceStrengthDescriptor", new LookupColumnDetails { PropertyName = "LearningStandardEquivalenceStrengthDescriptorId", LookupTypeName = "LearningStandardEquivalenceStrengthDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("Namespace", Namespace); - keyValues.Add("SourceLearningStandardId", SourceLearningStandardId); - keyValues.Add("TargetLearningStandardId", TargetLearningStandardId); + keyValues.Add("LanguageInstructionProgramServiceDescriptorId", LanguageInstructionProgramServiceDescriptorId); return keyValues; } @@ -67870,37 +67372,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardEquivalenceAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardEquivalenceAssociation) target, null); + this.MapTo((Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor) target, null); } } } -// Aggregate: LearningStandardEquivalenceStrengthDescriptor +// Aggregate: LanguageUseDescriptor -namespace EdFi.Ods.Entities.NHibernate.LearningStandardEquivalenceStrengthDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LanguageUseDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LearningStandardEquivalenceStrengthDescriptor table of the LearningStandardEquivalenceStrengthDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LanguageUseDescriptor table of the LanguageUseDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LearningStandardEquivalenceStrengthDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LanguageUseDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILanguageUseDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int LearningStandardEquivalenceStrengthDescriptorId + public virtual int LanguageUseDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -67985,7 +67487,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardEquivalenceStrengthDescriptorId", LearningStandardEquivalenceStrengthDescriptorId); + keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); return keyValues; } @@ -68049,113 +67551,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILanguageUseDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILanguageUseDescriptor) target, null); } } } -// Aggregate: LearningStandardScopeDescriptor +// Aggregate: LearningStandard -namespace EdFi.Ods.Entities.NHibernate.LearningStandardScopeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LearningStandardAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.LearningStandardScopeDescriptor table of the LearningStandardScopeDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class LearningStandardScopeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILearningStandardScopeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LearningStandardReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int LearningStandardScopeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -68164,7 +67594,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardScopeDescriptorId", LearningStandardScopeDescriptorId); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -68185,18 +67615,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -68213,122 +67633,404 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardScopeDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ILearningStandardScopeDescriptor) target, null); - } - } -} -// Aggregate: LevelOfEducationDescriptor -namespace EdFi.Ods.Entities.NHibernate.LevelOfEducationDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LevelOfEducationDescriptor table of the LevelOfEducationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LearningStandard table of the LearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LevelOfEducationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILevelOfEducationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LearningStandard : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public LearningStandard() + { + LearningStandardContentStandardPersistentList = new HashSet(); + LearningStandardAcademicSubjects = new HashSet(); + LearningStandardGradeLevels = new HashSet(); + LearningStandardIdentificationCodes = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int LevelOfEducationDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string CourseTitle { get; set; } + public virtual string Description { get; set; } + public virtual int? LearningStandardCategoryDescriptorId { - get { return CodeValue; } - set { CodeValue = value; } + get + { + if (_learningStandardCategoryDescriptorId == default(int?)) + _learningStandardCategoryDescriptorId = string.IsNullOrWhiteSpace(_learningStandardCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LearningStandardCategoryDescriptor", _learningStandardCategoryDescriptor); + + return _learningStandardCategoryDescriptorId; + } + set + { + _learningStandardCategoryDescriptorId = value; + _learningStandardCategoryDescriptor = null; + } } - string IDescriptor.Description + + private int? _learningStandardCategoryDescriptorId; + private string _learningStandardCategoryDescriptor; + + public virtual string LearningStandardCategoryDescriptor { - get { return Description; } - set { Description = value; } + get + { + if (_learningStandardCategoryDescriptor == null) + _learningStandardCategoryDescriptor = _learningStandardCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LearningStandardCategoryDescriptor", _learningStandardCategoryDescriptorId.Value); + + return _learningStandardCategoryDescriptor; + } + set + { + _learningStandardCategoryDescriptor = value; + _learningStandardCategoryDescriptorId = default(int?); + } } - DateTime? IDescriptor.EffectiveBeginDate + public virtual string LearningStandardItemCode { get; set; } + public virtual int? LearningStandardScopeDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_learningStandardScopeDescriptorId == default(int?)) + _learningStandardScopeDescriptorId = string.IsNullOrWhiteSpace(_learningStandardScopeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LearningStandardScopeDescriptor", _learningStandardScopeDescriptor); + + return _learningStandardScopeDescriptorId; + } + set + { + _learningStandardScopeDescriptorId = value; + _learningStandardScopeDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int? _learningStandardScopeDescriptorId; + private string _learningStandardScopeDescriptor; + + public virtual string LearningStandardScopeDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_learningStandardScopeDescriptor == null) + _learningStandardScopeDescriptor = _learningStandardScopeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LearningStandardScopeDescriptor", _learningStandardScopeDescriptorId.Value); + + return _learningStandardScopeDescriptor; + } + set + { + _learningStandardScopeDescriptor = value; + _learningStandardScopeDescriptorId = default(int?); + } } - string IDescriptor.Namespace + public virtual string Namespace { get; set; } + public virtual string ParentLearningStandardId { get; set; } + public virtual string SuccessCriteria { get; set; } + public virtual string URI { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + public virtual Entities.NHibernate.LearningStandardAggregate.EdFi.LearningStandardContentStandard LearningStandardContentStandard { - get { return Namespace; } - set { Namespace = value; } + get + { + // Return the item in the list, if one exists + if (LearningStandardContentStandardPersistentList.Any()) + return LearningStandardContentStandardPersistentList.First(); + + // No reference is present + return null; + } + set + { + // Delete the existing object + if (LearningStandardContentStandardPersistentList.Any()) + LearningStandardContentStandardPersistentList.Clear(); + + // If we're setting a value, add it to the list now + if (value != null) + { + // Set the back-reference to the parent + value.LearningStandard = this; + + LearningStandardContentStandardPersistentList.Add(value); + } + } } - string IDescriptor.ShortDescription + + Entities.Common.EdFi.ILearningStandardContentStandard Entities.Common.EdFi.ILearningStandard.LearningStandardContentStandard { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return LearningStandardContentStandard; } + set { LearningStandardContentStandard = (Entities.NHibernate.LearningStandardAggregate.EdFi.LearningStandardContentStandard) value; } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private ICollection _learningStandardContentStandardPersistentList; + + public virtual ICollection LearningStandardContentStandardPersistentList + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardContentStandardPersistentList) + if (item.LearningStandard == null) + item.LearningStandard = this; + // ------------------------------------------------------------- + + return _learningStandardContentStandardPersistentList; + } + set + { + _learningStandardContentStandardPersistentList = value; + } + } - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData ParentLearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the ParentLearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardDiscriminator + { + get { return ParentLearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ParentLearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILearningStandard.ParentLearningStandardResourceId + { + get { return ParentLearningStandardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _learningStandardAcademicSubjects; + private ICollection _learningStandardAcademicSubjectsCovariant; + public virtual ICollection LearningStandardAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardAcademicSubjects) + if (item.LearningStandard == null) + item.LearningStandard = this; + // ------------------------------------------------------------- + + return _learningStandardAcademicSubjects; + } + set + { + _learningStandardAcademicSubjects = value; + _learningStandardAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardAcademicSubjects) + if (item.LearningStandard == null) + item.LearningStandard = this; + // ------------------------------------------------------------- + + return _learningStandardAcademicSubjectsCovariant; + } + set + { + LearningStandardAcademicSubjects = new HashSet(value.Cast()); + } + } + + + private ICollection _learningStandardGradeLevels; + private ICollection _learningStandardGradeLevelsCovariant; + public virtual ICollection LearningStandardGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardGradeLevels) + if (item.LearningStandard == null) + item.LearningStandard = this; + // ------------------------------------------------------------- + + return _learningStandardGradeLevels; + } + set + { + _learningStandardGradeLevels = value; + _learningStandardGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardGradeLevels) + if (item.LearningStandard == null) + item.LearningStandard = this; + // ------------------------------------------------------------- + + return _learningStandardGradeLevelsCovariant; + } + set + { + LearningStandardGradeLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _learningStandardIdentificationCodes; + private ICollection _learningStandardIdentificationCodesCovariant; + public virtual ICollection LearningStandardIdentificationCodes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardIdentificationCodes) + if (item.LearningStandard == null) + item.LearningStandard = this; + // ------------------------------------------------------------- + + return _learningStandardIdentificationCodes; + } + set + { + _learningStandardIdentificationCodes = value; + _learningStandardIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardIdentificationCodes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardIdentificationCodes) + if (item.LearningStandard == null) + item.LearningStandard = this; + // ------------------------------------------------------------- + + return _learningStandardIdentificationCodesCovariant; + } + set + { + LearningStandardIdentificationCodes = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "LearningStandardCategoryDescriptor", new LookupColumnDetails { PropertyName = "LearningStandardCategoryDescriptorId", LookupTypeName = "LearningStandardCategoryDescriptor"} }, + { "LearningStandardScopeDescriptor", new LookupColumnDetails { PropertyName = "LearningStandardScopeDescriptorId", LookupTypeName = "LearningStandardScopeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -68343,7 +68045,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LevelOfEducationDescriptorId", LevelOfEducationDescriptorId); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -68407,79 +68109,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILevelOfEducationDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILevelOfEducationDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandard) target, null); } } -} -// Aggregate: LicenseStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.LicenseStatusDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LicenseStatusDescriptor table of the LicenseStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardAcademicSubject table of the LearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LicenseStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILicenseStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LearningStandardAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILearningStandardAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int LicenseStatusDescriptorId + public LearningStandardAcademicSubject() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual LearningStandard LearningStandard { get; set; } + + Entities.Common.EdFi.ILearningStandard ILearningStandardAcademicSubject.LearningStandard { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return LearningStandard; } + set { LearningStandard = (LearningStandard) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AcademicSubjectDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + public virtual string AcademicSubjectDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -68493,6 +68206,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -68508,6 +68250,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -68518,11 +68261,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LicenseStatusDescriptorId", LicenseStatusDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -68586,107 +68329,281 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILicenseStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILicenseStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardAcademicSubject) target, null); } + void IChildEntity.SetParent(object value) + { + LearningStandard = (LearningStandard) value; + } } -} -// Aggregate: LicenseTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.LicenseTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LicenseTypeDescriptor table of the LicenseTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardContentStandard table of the LearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LicenseTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILicenseTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LearningStandardContentStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILearningStandardContentStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int LicenseTypeDescriptorId + public LearningStandardContentStandard() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + LearningStandardContentStandardAuthors = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + [DomainSignature, JsonIgnore] + public virtual LearningStandard LearningStandard { get; set; } + + Entities.Common.EdFi.ILearningStandard ILearningStandardContentStandard.LearningStandard { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return LearningStandard; } + set { LearningStandard = (LearningStandard) value; } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Extensions - // ------------------------------------------------------------- + // Properties // ------------------------------------------------------------- + public virtual DateTime? BeginDate + { + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } - // ============================================================= + private DateTime? _beginDate; + + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + + public virtual long? MandatingEducationOrganizationId { get; set; } + public virtual DateTime? PublicationDate + { + get { return _publicationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _publicationDate = null; + } else + { + var given = (DateTime) value; + _publicationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _publicationDate; + + public virtual int? PublicationStatusDescriptorId + { + get + { + if (_publicationStatusDescriptorId == default(int?)) + _publicationStatusDescriptorId = string.IsNullOrWhiteSpace(_publicationStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PublicationStatusDescriptor", _publicationStatusDescriptor); + + return _publicationStatusDescriptorId; + } + set + { + _publicationStatusDescriptorId = value; + _publicationStatusDescriptor = null; + } + } + + private int? _publicationStatusDescriptorId; + private string _publicationStatusDescriptor; + + public virtual string PublicationStatusDescriptor + { + get + { + if (_publicationStatusDescriptor == null) + _publicationStatusDescriptor = _publicationStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PublicationStatusDescriptor", _publicationStatusDescriptorId.Value); + + return _publicationStatusDescriptor; + } + set + { + _publicationStatusDescriptor = value; + _publicationStatusDescriptorId = default(int?); + } + } + public virtual short? PublicationYear { get; set; } + public virtual string Title { get; set; } + public virtual string URI { get; set; } + public virtual string Version { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MandatingEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the MandatingEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationDiscriminator + { + get { return MandatingEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the MandatingEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationResourceId + { + get { return MandatingEducationOrganizationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _learningStandardContentStandardAuthors; + private ICollection _learningStandardContentStandardAuthorsCovariant; + public virtual ICollection LearningStandardContentStandardAuthors + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardContentStandardAuthors) + if (item.LearningStandardContentStandard == null) + item.LearningStandardContentStandard = this; + // ------------------------------------------------------------- + + return _learningStandardContentStandardAuthors; + } + set + { + _learningStandardContentStandardAuthors = value; + _learningStandardContentStandardAuthorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandardContentStandard.LearningStandardContentStandardAuthors + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _learningStandardContentStandardAuthors) + if (item.LearningStandardContentStandard == null) + item.LearningStandardContentStandard = this; + // ------------------------------------------------------------- + + return _learningStandardContentStandardAuthorsCovariant; + } + set + { + LearningStandardContentStandardAuthors = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "PublicationStatusDescriptor", new LookupColumnDetails { PropertyName = "PublicationStatusDescriptorId", LookupTypeName = "PublicationStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -68697,11 +68614,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LicenseTypeDescriptorId", LicenseTypeDescriptorId); return keyValues; } @@ -68765,77 +68681,59 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILicenseTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardContentStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILicenseTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardContentStandard) target, null); } + void IChildEntity.SetParent(object value) + { + LearningStandard = (LearningStandard) value; + } } -} -// Aggregate: LimitedEnglishProficiencyDescriptor - -namespace EdFi.Ods.Entities.NHibernate.LimitedEnglishProficiencyDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LimitedEnglishProficiencyDescriptor table of the LimitedEnglishProficiencyDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardContentStandardAuthor table of the LearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LimitedEnglishProficiencyDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LearningStandardContentStandardAuthor : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILearningStandardContentStandardAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public LearningStandardContentStandardAuthor() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int LimitedEnglishProficiencyDescriptorId + [DomainSignature, JsonIgnore] + public virtual LearningStandardContentStandard LearningStandardContentStandard { get; set; } + + Entities.Common.EdFi.ILearningStandardContentStandard ILearningStandardContentStandardAuthor.LearningStandardContentStandard { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return LearningStandardContentStandard; } + set { LearningStandardContentStandard = (LearningStandardContentStandard) value; } } - + + [DomainSignature] + public virtual string Author { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -68851,6 +68749,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -68876,11 +68803,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (LearningStandardContentStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("LimitedEnglishProficiencyDescriptorId", LimitedEnglishProficiencyDescriptorId); + keyValues.Add("Author", Author); return keyValues; } @@ -68944,118 +68871,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardContentStandardAuthor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor) target, null); - } - - } -} -// Aggregate: LocalAccount - -namespace EdFi.Ods.Entities.NHibernate.LocalAccountAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class LocalAccountReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string AccountIdentifier { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.ILearningStandardContentStandardAuthor) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + LearningStandardContentStandard = (LearningStandardContentStandard) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalAccount table of the LocalAccount aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardGradeLevel table of the LearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalAccount : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILocalAccount, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LearningStandardGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILearningStandardGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LocalAccount() + public LearningStandardGradeLevel() { - LocalAccountReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -69063,12 +68908,50 @@ public LocalAccount() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual LearningStandard LearningStandard { get; set; } + + Entities.Common.EdFi.ILearningStandard ILearningStandardGradeLevel.LearningStandard + { + get { return LearningStandard; } + set { LearningStandard = (LearningStandard) value; } + } + [DomainSignature] - public virtual string AccountIdentifier { get; set; } - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual int GradeLevelDescriptorId + { + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } + } + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor + { + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -69079,9 +68962,6 @@ public LocalAccount() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AccountName { get; set; } - public virtual long ChartOfAccountEducationOrganizationId { get; set; } - public virtual string ChartOfAccountIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -69126,103 +69006,17 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ChartOfAccountAggregate.EdFi.ChartOfAccountReferenceData ChartOfAccountReferenceData { get; set; } - - /// - /// Read-only property that allows the ChartOfAccount discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILocalAccount.ChartOfAccountDiscriminator - { - get { return ChartOfAccountReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ChartOfAccount resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalAccount.ChartOfAccountResourceId - { - get { return ChartOfAccountReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalAccount.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _localAccountReportingTags; - private ICollection _localAccountReportingTagsCovariant; - public virtual ICollection LocalAccountReportingTags - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _localAccountReportingTags) - if (item.LocalAccount == null) - item.LocalAccount = this; - // ------------------------------------------------------------- - - return _localAccountReportingTags; - } - set - { - _localAccountReportingTags = value; - _localAccountReportingTagsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILocalAccount.LocalAccountReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _localAccountReportingTags) - if (item.LocalAccount == null) - item.LocalAccount = this; - // ------------------------------------------------------------- - - return _localAccountReportingTagsCovariant; - } - set - { - LocalAccountReportingTags = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -69233,13 +69027,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -69303,32 +69095,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalAccount)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalAccount) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + LearningStandard = (LearningStandard) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalAccountReportingTag table of the LocalAccount aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardIdentificationCode table of the LearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalAccountReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILocalAccountReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LearningStandardIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILearningStandardIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LocalAccountReportingTag() + public LearningStandardIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -69337,49 +69133,18 @@ public LocalAccountReportingTag() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual LocalAccount LocalAccount { get; set; } + public virtual LearningStandard LearningStandard { get; set; } - Entities.Common.EdFi.ILocalAccount ILocalAccountReportingTag.LocalAccount + Entities.Common.EdFi.ILearningStandard ILearningStandardIdentificationCode.LearningStandard { - get { return LocalAccount; } - set { LocalAccount = (LocalAccount) value; } + get { return LearningStandard; } + set { LearningStandard = (LearningStandard) value; } } [DomainSignature] - public virtual int ReportingTagDescriptorId - { - get - { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - - return _reportingTagDescriptorId; - } - set - { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; - } - } - - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; - - public virtual string ReportingTagDescriptor - { - get - { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - - return _reportingTagDescriptor; - } - set - { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); - } - } + public virtual string ContentStandardName { get; set; } + [DomainSignature] + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -69390,7 +69155,6 @@ public virtual string ReportingTagDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -69445,7 +69209,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -69457,10 +69220,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LocalAccount as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("ContentStandardName", ContentStandardName); + keyValues.Add("IdentificationCode", IdentificationCode); return keyValues; } @@ -69524,191 +69288,86 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalAccountReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalAccountReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardIdentificationCode) target, null); } void IChildEntity.SetParent(object value) { - LocalAccount = (LocalAccount) value; + LearningStandard = (LearningStandard) value; } } } -// Aggregate: LocalActual +// Aggregate: LearningStandardCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.LocalActualAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LearningStandardCategoryDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class LocalActualReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string AccountIdentifier { get; set; } - public virtual DateTime AsOfDate { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalActual table of the LocalActual aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardCategoryDescriptor table of the LearningStandardCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalActual : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILocalActual, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LearningStandardCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILearningStandardCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public LocalActual() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string AccountIdentifier { get; set; } - [DomainSignature] - public virtual DateTime AsOfDate + public virtual int LearningStandardCategoryDescriptorId { - get { return _asOfDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - private DateTime _asOfDate; - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal Amount { get; set; } - public virtual int? FinancialCollectionDescriptorId - { - get - { - if (_financialCollectionDescriptorId == default(int?)) - _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); - - return _financialCollectionDescriptorId; - } - set - { - _financialCollectionDescriptorId = value; - _financialCollectionDescriptor = null; - } - } - - private int? _financialCollectionDescriptorId; - private string _financialCollectionDescriptor; - - public virtual string FinancialCollectionDescriptor - { - get - { - if (_financialCollectionDescriptor == null) - _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); - - return _financialCollectionDescriptor; - } - set - { - _financialCollectionDescriptor = value; - _financialCollectionDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -69719,60 +69378,11 @@ public virtual string FinancialCollectionDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } - - /// - /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILocalActual.LocalAccountDiscriminator - { - get { return LocalAccountReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalActual.LocalAccountResourceId - { - get { return LocalAccountReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -69783,7 +69393,6 @@ string Entities.Common.EdFi.ILocalActual.LocalAccountDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -69798,10 +69407,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("LearningStandardCategoryDescriptorId", LearningStandardCategoryDescriptorId); return keyValues; } @@ -69865,32 +69471,31 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalActual)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalActual) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardCategoryDescriptor) target, null); } } } -// Aggregate: LocalBudget +// Aggregate: LearningStandardEquivalenceAssociation -namespace EdFi.Ods.Entities.NHibernate.LocalBudgetAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LearningStandardEquivalenceAssociationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class LocalBudgetReferenceData : IHasPrimaryKeyValues + public class LearningStandardEquivalenceAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AccountIdentifier { get; set; } - public virtual DateTime AsOfDate { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int FiscalYear { get; set; } + public virtual string Namespace { get; set; } + public virtual string SourceLearningStandardId { get; set; } + public virtual string TargetLearningStandardId { get; set; } // ------------------------------------------------------------- /// @@ -69911,10 +69516,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("Namespace", Namespace); + keyValues.Add("SourceLearningStandardId", SourceLearningStandardId); + keyValues.Add("TargetLearningStandardId", TargetLearningStandardId); return keyValues; } @@ -69965,19 +69569,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalBudget table of the LocalBudget aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardEquivalenceAssociation table of the LearningStandardEquivalenceAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalBudget : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILocalBudget, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LearningStandardEquivalenceAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILearningStandardEquivalenceAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LocalBudget() + public LearningStandardEquivalenceAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -69986,21 +69590,11 @@ public LocalBudget() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string AccountIdentifier { get; set; } - [DomainSignature] - public virtual DateTime AsOfDate - { - get { return _asOfDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _asOfDate; - + public virtual string Namespace { get; set; } [DomainSignature] - public virtual long EducationOrganizationId { get; set; } + public virtual string SourceLearningStandardId { get; set; } [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual string TargetLearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -70011,39 +69605,58 @@ public virtual DateTime AsOfDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal Amount { get; set; } - public virtual int? FinancialCollectionDescriptorId + public virtual DateTime? EffectiveDate + { + get { return _effectiveDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _effectiveDate = null; + } else + { + var given = (DateTime) value; + _effectiveDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _effectiveDate; + + public virtual string LearningStandardEquivalenceStrengthDescription { get; set; } + public virtual int? LearningStandardEquivalenceStrengthDescriptorId { get { - if (_financialCollectionDescriptorId == default(int?)) - _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); + if (_learningStandardEquivalenceStrengthDescriptorId == default(int?)) + _learningStandardEquivalenceStrengthDescriptorId = string.IsNullOrWhiteSpace(_learningStandardEquivalenceStrengthDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LearningStandardEquivalenceStrengthDescriptor", _learningStandardEquivalenceStrengthDescriptor); - return _financialCollectionDescriptorId; + return _learningStandardEquivalenceStrengthDescriptorId; } set { - _financialCollectionDescriptorId = value; - _financialCollectionDescriptor = null; + _learningStandardEquivalenceStrengthDescriptorId = value; + _learningStandardEquivalenceStrengthDescriptor = null; } } - private int? _financialCollectionDescriptorId; - private string _financialCollectionDescriptor; + private int? _learningStandardEquivalenceStrengthDescriptorId; + private string _learningStandardEquivalenceStrengthDescriptor; - public virtual string FinancialCollectionDescriptor + public virtual string LearningStandardEquivalenceStrengthDescriptor { get { - if (_financialCollectionDescriptor == null) - _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); + if (_learningStandardEquivalenceStrengthDescriptor == null) + _learningStandardEquivalenceStrengthDescriptor = _learningStandardEquivalenceStrengthDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LearningStandardEquivalenceStrengthDescriptor", _learningStandardEquivalenceStrengthDescriptorId.Value); - return _financialCollectionDescriptor; + return _learningStandardEquivalenceStrengthDescriptor; } set { - _financialCollectionDescriptor = value; - _financialCollectionDescriptorId = default(int?); + _learningStandardEquivalenceStrengthDescriptor = value; + _learningStandardEquivalenceStrengthDescriptorId = default(int?); } } // ------------------------------------------------------------- @@ -70090,23 +69703,43 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData SourceLearningStandardReferenceData { get; set; } /// - /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. + /// Read-only property that allows the SourceLearningStandard discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ILocalBudget.LocalAccountDiscriminator + string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardDiscriminator { - get { return LocalAccountReferenceData?.Discriminator; } + get { return SourceLearningStandardReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the SourceLearningStandard resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ILocalBudget.LocalAccountResourceId + Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardResourceId { - get { return LocalAccountReferenceData?.Id; } + get { return SourceLearningStandardReferenceData?.Id; } + set { } + } + + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData TargetLearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the TargetLearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardDiscriminator + { + get { return TargetLearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the TargetLearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardResourceId + { + get { return TargetLearningStandardReferenceData?.Id; } set { } } @@ -70120,7 +69753,7 @@ string Entities.Common.EdFi.ILocalBudget.LocalAccountDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, + { "LearningStandardEquivalenceStrengthDescriptor", new LookupColumnDetails { PropertyName = "LearningStandardEquivalenceStrengthDescriptorId", LookupTypeName = "LearningStandardEquivalenceStrengthDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -70135,10 +69768,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("Namespace", Namespace); + keyValues.Add("SourceLearningStandardId", SourceLearningStandardId); + keyValues.Add("TargetLearningStandardId", TargetLearningStandardId); return keyValues; } @@ -70202,238 +69834,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalBudget)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardEquivalenceAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalBudget) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardEquivalenceAssociation) target, null); } } } -// Aggregate: LocalContractedStaff +// Aggregate: LearningStandardEquivalenceStrengthDescriptor -namespace EdFi.Ods.Entities.NHibernate.LocalContractedStaffAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LearningStandardEquivalenceStrengthDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.LearningStandardEquivalenceStrengthDescriptor table of the LearningStandardEquivalenceStrengthDescriptor aggregate in the ODS database. /// - public class LocalContractedStaffReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class LearningStandardEquivalenceStrengthDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AccountIdentifier { get; set; } - public virtual DateTime AsOfDate { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int FiscalYear { get; set; } - public virtual int StaffUSI { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + [DomainSignature] + public virtual int LearningStandardEquivalenceStrengthDescriptorId { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); - keyValues.Add("StaffUSI", StaffUSI); - - return keyValues; + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + + // ------------------------------------------------------------- - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + get { return CodeValue; } + set { CodeValue = value; } } - - public override int GetHashCode() + string IDescriptor.Description { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + get { return Description; } + set { Description = value; } } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.LocalContractedStaff table of the LocalContractedStaff aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class LocalContractedStaff : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILocalContractedStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public LocalContractedStaff() + DateTime? IDescriptor.EffectiveBeginDate { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual string AccountIdentifier { get; set; } - [DomainSignature] - public virtual DateTime AsOfDate + DateTime? IDescriptor.EffectiveEndDate { - get { return _asOfDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private DateTime _asOfDate; - - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } - [Display(Name="StaffUniqueId")][DomainSignature] - public virtual int StaffUSI + string IDescriptor.Namespace { - get - { - if (_staffUSI == default(int) && _staffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) - { - _staffUSI = usi; - } - } - - return _staffUSI; - } - set - { - _staffUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); - } + get { return Namespace; } + set { Namespace = value; } } - - private int _staffUSI; - private string _staffUniqueId; - - public virtual string StaffUniqueId + string IDescriptor.ShortDescription { - get - { - if (_staffUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) - { - _staffUniqueId = uniqueId; - } - } - - return _staffUniqueId; - } - set - { - if (_staffUniqueId != value) - _staffUSI = default(int); - - _staffUniqueId = value; - } + get { return ShortDescription; } + set { ShortDescription = value; } } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal Amount { get; set; } - public virtual int? FinancialCollectionDescriptorId - { - get - { - if (_financialCollectionDescriptorId == default(int?)) - _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); - - return _financialCollectionDescriptorId; - } - set - { - _financialCollectionDescriptorId = value; - _financialCollectionDescriptor = null; - } - } - - private int? _financialCollectionDescriptorId; - private string _financialCollectionDescriptor; - - public virtual string FinancialCollectionDescriptor - { - get - { - if (_financialCollectionDescriptor == null) - _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); - - return _financialCollectionDescriptor; - } - set - { - _financialCollectionDescriptor = value; - _financialCollectionDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -70444,80 +69920,11 @@ public virtual string FinancialCollectionDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } - - /// - /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILocalContractedStaff.LocalAccountDiscriminator - { - get { return LocalAccountReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalContractedStaff.LocalAccountResourceId - { - get { return LocalAccountReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } - - /// - /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILocalContractedStaff.StaffDiscriminator - { - get { return StaffReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalContractedStaff.StaffResourceId - { - get { return StaffReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -70528,7 +69935,6 @@ string Entities.Common.EdFi.ILocalContractedStaff.StaffDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -70543,11 +69949,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); - keyValues.Add("StaffUSI", StaffUSI); + keyValues.Add("LearningStandardEquivalenceStrengthDescriptorId", LearningStandardEquivalenceStrengthDescriptorId); return keyValues; } @@ -70611,37 +70013,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalContractedStaff)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalContractedStaff) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor) target, null); } } } -// Aggregate: LocaleDescriptor +// Aggregate: LearningStandardScopeDescriptor -namespace EdFi.Ods.Entities.NHibernate.LocaleDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LearningStandardScopeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocaleDescriptor table of the LocaleDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LearningStandardScopeDescriptor table of the LearningStandardScopeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocaleDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILocaleDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LearningStandardScopeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILearningStandardScopeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int LocaleDescriptorId + public virtual int LearningStandardScopeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -70726,7 +70128,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LocaleDescriptorId", LocaleDescriptorId); + keyValues.Add("LearningStandardScopeDescriptorId", LearningStandardScopeDescriptorId); return keyValues; } @@ -70790,49 +70192,40 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocaleDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILearningStandardScopeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocaleDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILearningStandardScopeDescriptor) target, null); } } } -// Aggregate: LocalEducationAgency +// Aggregate: LevelOfEducationDescriptor -namespace EdFi.Ods.Entities.NHibernate.LocalEducationAgencyAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LevelOfEducationDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalEducationAgency table of the LocalEducationAgency aggregate in the ODS database. + /// A class which represents the edfi.LevelOfEducationDescriptor table of the LevelOfEducationDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalEducationAgency : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.ILocalEducationAgency, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LevelOfEducationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILevelOfEducationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public LocalEducationAgency() - { - LocalEducationAgencyAccountabilities = new HashSet(); - LocalEducationAgencyFederalFunds = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long LocalEducationAgencyId + public virtual int LevelOfEducationDescriptorId { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } // ------------------------------------------------------------- @@ -70840,102 +70233,41 @@ public virtual long LocalEducationAgencyId // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor + string IDescriptor.CodeValue { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } + get { return CodeValue; } + set { CodeValue = value; } } - string IEducationOrganization.ShortNameOfInstitution + string IDescriptor.Description { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } + get { return Description; } + set { Description = value; } } - string IEducationOrganization.WebSite + DateTime? IDescriptor.EffectiveBeginDate { - get { return WebSite; } - set { WebSite = value; } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? CharterStatusDescriptorId + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_charterStatusDescriptorId == default(int?)) - _charterStatusDescriptorId = string.IsNullOrWhiteSpace(_charterStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CharterStatusDescriptor", _charterStatusDescriptor); - - return _charterStatusDescriptorId; - } - set - { - _charterStatusDescriptorId = value; - _charterStatusDescriptor = null; - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private int? _charterStatusDescriptorId; - private string _charterStatusDescriptor; - - public virtual string CharterStatusDescriptor + string IDescriptor.Namespace { - get - { - if (_charterStatusDescriptor == null) - _charterStatusDescriptor = _charterStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CharterStatusDescriptor", _charterStatusDescriptorId.Value); - - return _charterStatusDescriptor; - } - set - { - _charterStatusDescriptor = value; - _charterStatusDescriptorId = default(int?); - } + get { return Namespace; } + set { Namespace = value; } } - public virtual long? EducationServiceCenterId { get; set; } - public virtual int LocalEducationAgencyCategoryDescriptorId + string IDescriptor.ShortDescription { - get - { - if (_localEducationAgencyCategoryDescriptorId == default(int)) - _localEducationAgencyCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocalEducationAgencyCategoryDescriptor", _localEducationAgencyCategoryDescriptor); - - return _localEducationAgencyCategoryDescriptorId; - } - set - { - _localEducationAgencyCategoryDescriptorId = value; - _localEducationAgencyCategoryDescriptor = null; - } + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- - private int _localEducationAgencyCategoryDescriptorId; - private string _localEducationAgencyCategoryDescriptor; - - public virtual string LocalEducationAgencyCategoryDescriptor - { - get - { - if (_localEducationAgencyCategoryDescriptor == null) - _localEducationAgencyCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocalEducationAgencyCategoryDescriptor", _localEducationAgencyCategoryDescriptorId); - - return _localEducationAgencyCategoryDescriptor; - } - set - { - _localEducationAgencyCategoryDescriptor = value; - _localEducationAgencyCategoryDescriptorId = default(int); - } - } - public virtual long? ParentLocalEducationAgencyId { get; set; } - public virtual long? StateEducationAgencyId { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -70946,180 +70278,21 @@ public virtual string LocalEducationAgencyCategoryDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationServiceCenterReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationServiceCenter resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalEducationAgency.EducationServiceCenterResourceId - { - get { return EducationServiceCenterReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParentLocalEducationAgencyReferenceData { get; set; } - - /// - /// Read-only property that allows the ParentLocalEducationAgency resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalEducationAgency.ParentLocalEducationAgencyResourceId - { - get { return ParentLocalEducationAgencyReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData StateEducationAgencyReferenceData { get; set; } - - /// - /// Read-only property that allows the StateEducationAgency resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalEducationAgency.StateEducationAgencyResourceId - { - get { return StateEducationAgencyReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _localEducationAgencyAccountabilities; - private ICollection _localEducationAgencyAccountabilitiesCovariant; - public virtual ICollection LocalEducationAgencyAccountabilities - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _localEducationAgencyAccountabilities) - if (item.LocalEducationAgency == null) - item.LocalEducationAgency = this; - // ------------------------------------------------------------- - - return _localEducationAgencyAccountabilities; - } - set - { - _localEducationAgencyAccountabilities = value; - _localEducationAgencyAccountabilitiesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyAccountabilities - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _localEducationAgencyAccountabilities) - if (item.LocalEducationAgency == null) - item.LocalEducationAgency = this; - // ------------------------------------------------------------- - - return _localEducationAgencyAccountabilitiesCovariant; - } - set - { - LocalEducationAgencyAccountabilities = new HashSet(value.Cast()); - } - } - - - private ICollection _localEducationAgencyFederalFunds; - private ICollection _localEducationAgencyFederalFundsCovariant; - public virtual ICollection LocalEducationAgencyFederalFunds - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _localEducationAgencyFederalFunds) - if (item.LocalEducationAgency == null) - item.LocalEducationAgency = this; - // ------------------------------------------------------------- - - return _localEducationAgencyFederalFunds; - } - set - { - _localEducationAgencyFederalFunds = value; - _localEducationAgencyFederalFundsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyFederalFunds - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _localEducationAgencyFederalFunds) - if (item.LocalEducationAgency == null) - item.LocalEducationAgency = this; - // ------------------------------------------------------------- - - return _localEducationAgencyFederalFundsCovariant; - } - set - { - LocalEducationAgencyFederalFunds = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CharterStatusDescriptor", new LookupColumnDetails { PropertyName = "CharterStatusDescriptorId", LookupTypeName = "CharterStatusDescriptor"} }, - { "LocalEducationAgencyCategoryDescriptor", new LookupColumnDetails { PropertyName = "LocalEducationAgencyCategoryDescriptorId", LookupTypeName = "LocalEducationAgencyCategoryDescriptor"} }, - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -71134,7 +70307,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LocalEducationAgencyId", LocalEducationAgencyId); + keyValues.Add("LevelOfEducationDescriptorId", LevelOfEducationDescriptorId); return keyValues; } @@ -71198,130 +70371,84 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgency)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILevelOfEducationDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalEducationAgency) target, null); + this.MapTo((Entities.Common.EdFi.ILevelOfEducationDescriptor) target, null); } } +} +// Aggregate: LicenseStatusDescriptor + +namespace EdFi.Ods.Entities.NHibernate.LicenseStatusDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalEducationAgencyAccountability table of the LocalEducationAgency aggregate in the ODS database. + /// A class which represents the edfi.LicenseStatusDescriptor table of the LicenseStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalEducationAgencyAccountability : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILocalEducationAgencyAccountability, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LicenseStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILicenseStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public LocalEducationAgencyAccountability() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual LocalEducationAgency LocalEducationAgency { get; set; } - - Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyAccountability.LocalEducationAgency + [DomainSignature] + public virtual int LicenseStatusDescriptorId { - get { return LocalEducationAgency; } - set { LocalEducationAgency = (LocalEducationAgency) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual short SchoolYear { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? GunFreeSchoolsActReportingStatusDescriptorId + string IDescriptor.CodeValue { - get - { - if (_gunFreeSchoolsActReportingStatusDescriptorId == default(int?)) - _gunFreeSchoolsActReportingStatusDescriptorId = string.IsNullOrWhiteSpace(_gunFreeSchoolsActReportingStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GunFreeSchoolsActReportingStatusDescriptor", _gunFreeSchoolsActReportingStatusDescriptor); - - return _gunFreeSchoolsActReportingStatusDescriptorId; - } - set - { - _gunFreeSchoolsActReportingStatusDescriptorId = value; - _gunFreeSchoolsActReportingStatusDescriptor = null; - } + get { return CodeValue; } + set { CodeValue = value; } } - - private int? _gunFreeSchoolsActReportingStatusDescriptorId; - private string _gunFreeSchoolsActReportingStatusDescriptor; - - public virtual string GunFreeSchoolsActReportingStatusDescriptor + string IDescriptor.Description { - get - { - if (_gunFreeSchoolsActReportingStatusDescriptor == null) - _gunFreeSchoolsActReportingStatusDescriptor = _gunFreeSchoolsActReportingStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GunFreeSchoolsActReportingStatusDescriptor", _gunFreeSchoolsActReportingStatusDescriptorId.Value); - - return _gunFreeSchoolsActReportingStatusDescriptor; - } - set - { - _gunFreeSchoolsActReportingStatusDescriptor = value; - _gunFreeSchoolsActReportingStatusDescriptorId = default(int?); - } + get { return Description; } + set { Description = value; } } - public virtual int? SchoolChoiceImplementStatusDescriptorId + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_schoolChoiceImplementStatusDescriptorId == default(int?)) - _schoolChoiceImplementStatusDescriptorId = string.IsNullOrWhiteSpace(_schoolChoiceImplementStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolChoiceImplementStatusDescriptor", _schoolChoiceImplementStatusDescriptor); - - return _schoolChoiceImplementStatusDescriptorId; - } - set - { - _schoolChoiceImplementStatusDescriptorId = value; - _schoolChoiceImplementStatusDescriptor = null; - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - - private int? _schoolChoiceImplementStatusDescriptorId; - private string _schoolChoiceImplementStatusDescriptor; - - public virtual string SchoolChoiceImplementStatusDescriptor + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_schoolChoiceImplementStatusDescriptor == null) - _schoolChoiceImplementStatusDescriptor = _schoolChoiceImplementStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolChoiceImplementStatusDescriptor", _schoolChoiceImplementStatusDescriptorId.Value); - - return _schoolChoiceImplementStatusDescriptor; - } - set - { - _schoolChoiceImplementStatusDescriptor = value; - _schoolChoiceImplementStatusDescriptorId = default(int?); - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } // ------------------------------------------------------------- + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -71330,51 +70457,11 @@ public virtual string SchoolChoiceImplementStatusDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } - - /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalEducationAgencyAccountability.SchoolYearTypeResourceId - { - get { return SchoolYearTypeReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -71385,8 +70472,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GunFreeSchoolsActReportingStatusDescriptor", new LookupColumnDetails { PropertyName = "GunFreeSchoolsActReportingStatusDescriptorId", LookupTypeName = "GunFreeSchoolsActReportingStatusDescriptor"} }, - { "SchoolChoiceImplementStatusDescriptor", new LookupColumnDetails { PropertyName = "SchoolChoiceImplementStatusDescriptorId", LookupTypeName = "SchoolChoiceImplementStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -71397,11 +70482,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("LicenseStatusDescriptorId", LicenseStatusDescriptorId); return keyValues; } @@ -71465,72 +70550,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgencyAccountability)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILicenseStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalEducationAgencyAccountability) target, null); + this.MapTo((Entities.Common.EdFi.ILicenseStatusDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - LocalEducationAgency = (LocalEducationAgency) value; - } } +} +// Aggregate: LicenseTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.LicenseTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalEducationAgencyFederalFunds table of the LocalEducationAgency aggregate in the ODS database. + /// A class which represents the edfi.LicenseTypeDescriptor table of the LicenseTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalEducationAgencyFederalFunds : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ILocalEducationAgencyFederalFunds, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LicenseTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILicenseTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public LocalEducationAgencyFederalFunds() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual LocalEducationAgency LocalEducationAgency { get; set; } - - Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.LocalEducationAgency + [DomainSignature] + public virtual int LicenseTypeDescriptorId { - get { return LocalEducationAgency; } - set { LocalEducationAgency = (LocalEducationAgency) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual int FiscalYear { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? InnovativeDollarsSpent { get; set; } - public virtual decimal? InnovativeDollarsSpentStrategicPriorities { get; set; } - public virtual decimal? InnovativeProgramsFundsReceived { get; set; } - public virtual decimal? SchoolImprovementAllocation { get; set; } - public virtual decimal? SchoolImprovementReservedFundsPercentage { get; set; } - public virtual decimal? StateAssessmentAdministrationFunding { get; set; } - public virtual decimal? SupplementalEducationalServicesFundsSpent { get; set; } - public virtual decimal? SupplementalEducationalServicesPerPupilExpenditure { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -71541,35 +70636,6 @@ Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.Loc // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -71595,11 +70661,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("LicenseTypeDescriptorId", LicenseTypeDescriptorId); return keyValues; } @@ -71663,41 +70729,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILicenseTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds) target, null); + this.MapTo((Entities.Common.EdFi.ILicenseTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - LocalEducationAgency = (LocalEducationAgency) value; - } } } -// Aggregate: LocalEducationAgencyCategoryDescriptor +// Aggregate: LimitedEnglishProficiencyDescriptor -namespace EdFi.Ods.Entities.NHibernate.LocalEducationAgencyCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LimitedEnglishProficiencyDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalEducationAgencyCategoryDescriptor table of the LocalEducationAgencyCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LimitedEnglishProficiencyDescriptor table of the LimitedEnglishProficiencyDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalEducationAgencyCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LimitedEnglishProficiencyDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int LocalEducationAgencyCategoryDescriptorId + public virtual int LimitedEnglishProficiencyDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -71782,7 +70844,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LocalEducationAgencyCategoryDescriptorId", LocalEducationAgencyCategoryDescriptorId); + keyValues.Add("LimitedEnglishProficiencyDescriptorId", LimitedEnglishProficiencyDescriptorId); return keyValues; } @@ -71846,30 +70908,29 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor) target, null); } } } -// Aggregate: LocalEncumbrance +// Aggregate: LocalAccount -namespace EdFi.Ods.Entities.NHibernate.LocalEncumbranceAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalAccountAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class LocalEncumbranceReferenceData : IHasPrimaryKeyValues + public class LocalAccountReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- public virtual string AccountIdentifier { get; set; } - public virtual DateTime AsOfDate { get; set; } public virtual long EducationOrganizationId { get; set; } public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -71893,7 +70954,6 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("FiscalYear", FiscalYear); @@ -71946,19 +71006,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalEncumbrance table of the LocalEncumbrance aggregate in the ODS database. + /// A class which represents the edfi.LocalAccount table of the LocalAccount aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalEncumbrance : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILocalEncumbrance, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LocalAccount : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILocalAccount, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LocalEncumbrance() + public LocalAccount() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + LocalAccountReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -71968,16 +71029,6 @@ public LocalEncumbrance() // ------------------------------------------------------------- [DomainSignature] public virtual string AccountIdentifier { get; set; } - [DomainSignature] - public virtual DateTime AsOfDate - { - get { return _asOfDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _asOfDate; - [DomainSignature] public virtual long EducationOrganizationId { get; set; } [DomainSignature] @@ -71992,41 +71043,9 @@ public virtual DateTime AsOfDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal Amount { get; set; } - public virtual int? FinancialCollectionDescriptorId - { - get - { - if (_financialCollectionDescriptorId == default(int?)) - _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); - - return _financialCollectionDescriptorId; - } - set - { - _financialCollectionDescriptorId = value; - _financialCollectionDescriptor = null; - } - } - - private int? _financialCollectionDescriptorId; - private string _financialCollectionDescriptor; - - public virtual string FinancialCollectionDescriptor - { - get - { - if (_financialCollectionDescriptor == null) - _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); - - return _financialCollectionDescriptor; - } - set - { - _financialCollectionDescriptor = value; - _financialCollectionDescriptorId = default(int?); - } - } + public virtual string AccountName { get; set; } + public virtual long ChartOfAccountEducationOrganizationId { get; set; } + public virtual string ChartOfAccountIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -72071,37 +71090,103 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } + public virtual NHibernate.ChartOfAccountAggregate.EdFi.ChartOfAccountReferenceData ChartOfAccountReferenceData { get; set; } /// - /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. + /// Read-only property that allows the ChartOfAccount discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ILocalEncumbrance.LocalAccountDiscriminator + string Entities.Common.EdFi.ILocalAccount.ChartOfAccountDiscriminator { - get { return LocalAccountReferenceData?.Discriminator; } + get { return ChartOfAccountReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the ChartOfAccount resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ILocalEncumbrance.LocalAccountResourceId + Guid? Entities.Common.EdFi.ILocalAccount.ChartOfAccountResourceId { - get { return LocalAccountReferenceData?.Id; } + get { return ChartOfAccountReferenceData?.Id; } set { } } - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalAccount.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _localAccountReportingTags; + private ICollection _localAccountReportingTagsCovariant; + public virtual ICollection LocalAccountReportingTags + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _localAccountReportingTags) + if (item.LocalAccount == null) + item.LocalAccount = this; + // ------------------------------------------------------------- + + return _localAccountReportingTags; + } + set + { + _localAccountReportingTags = value; + _localAccountReportingTagsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILocalAccount.LocalAccountReportingTags + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _localAccountReportingTags) + if (item.LocalAccount == null) + item.LocalAccount = this; + // ------------------------------------------------------------- + + return _localAccountReportingTagsCovariant; + } + set + { + LocalAccountReportingTags = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -72117,7 +71202,6 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("AsOfDate", AsOfDate); keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("FiscalYear", FiscalYear); @@ -72183,24 +71267,249 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalEncumbrance)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalAccount)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalEncumbrance) target, null); + this.MapTo((Entities.Common.EdFi.ILocalAccount) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.LocalAccountReportingTag table of the LocalAccount aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class LocalAccountReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILocalAccountReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public LocalAccountReportingTag() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual LocalAccount LocalAccount { get; set; } + + Entities.Common.EdFi.ILocalAccount ILocalAccountReportingTag.LocalAccount + { + get { return LocalAccount; } + set { LocalAccount = (LocalAccount) value; } + } + + [DomainSignature] + public virtual int ReportingTagDescriptorId + { + get + { + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + + return _reportingTagDescriptorId; + } + set + { + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; + } + } + + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; + + public virtual string ReportingTagDescriptor + { + get + { + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + + return _reportingTagDescriptor; + } + set + { + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string TagValue { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (LocalAccount as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ILocalAccountReportingTag)target); } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ILocalAccountReportingTag) target, null); + } + + void IChildEntity.SetParent(object value) + { + LocalAccount = (LocalAccount) value; + } } } -// Aggregate: LocalPayroll +// Aggregate: LocalActual -namespace EdFi.Ods.Entities.NHibernate.LocalPayrollAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalActualAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class LocalPayrollReferenceData : IHasPrimaryKeyValues + public class LocalActualReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key @@ -72209,7 +71518,6 @@ public class LocalPayrollReferenceData : IHasPrimaryKeyValues public virtual DateTime AsOfDate { get; set; } public virtual long EducationOrganizationId { get; set; } public virtual int FiscalYear { get; set; } - public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// @@ -72234,7 +71542,6 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() keyValues.Add("AsOfDate", AsOfDate); keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("FiscalYear", FiscalYear); - keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -72285,19 +71592,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.LocalPayroll table of the LocalPayroll aggregate in the ODS database. + /// A class which represents the edfi.LocalActual table of the LocalActual aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class LocalPayroll : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ILocalPayroll, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LocalActual : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILocalActual, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public LocalPayroll() + public LocalActual() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -72321,55 +71628,6 @@ public virtual DateTime AsOfDate public virtual long EducationOrganizationId { get; set; } [DomainSignature] public virtual int FiscalYear { get; set; } - [Display(Name="StaffUniqueId")][DomainSignature] - public virtual int StaffUSI - { - get - { - if (_staffUSI == default(int) && _staffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) - { - _staffUSI = usi; - } - } - - return _staffUSI; - } - set - { - _staffUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); - } - } - - private int _staffUSI; - private string _staffUniqueId; - - public virtual string StaffUniqueId - { - get - { - if (_staffUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) - { - _staffUniqueId = uniqueId; - } - } - - return _staffUniqueId; - } - set - { - if (_staffUniqueId != value) - _staffUSI = default(int); - - _staffUniqueId = value; - } - } // ------------------------------------------------------------- // ============================================================= @@ -72464,7 +71722,7 @@ public IDictionary Extensions /// /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ILocalPayroll.LocalAccountDiscriminator + string Entities.Common.EdFi.ILocalActual.LocalAccountDiscriminator { get { return LocalAccountReferenceData?.Discriminator; } set { } @@ -72473,32 +71731,12 @@ string Entities.Common.EdFi.ILocalPayroll.LocalAccountDiscriminator /// /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ILocalPayroll.LocalAccountResourceId + Guid? Entities.Common.EdFi.ILocalActual.LocalAccountResourceId { get { return LocalAccountReferenceData?.Id; } set { } } - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } - - /// - /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ILocalPayroll.StaffDiscriminator - { - get { return StaffReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ILocalPayroll.StaffResourceId - { - get { return StaffReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -72528,7 +71766,6 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() keyValues.Add("AsOfDate", AsOfDate); keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("FiscalYear", FiscalYear); - keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -72592,30 +71829,32 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocalPayroll)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalActual)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocalPayroll) target, null); + this.MapTo((Entities.Common.EdFi.ILocalActual) target, null); } } } -// Aggregate: Location +// Aggregate: LocalBudget -namespace EdFi.Ods.Entities.NHibernate.LocationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalBudgetAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class LocationReferenceData : IHasPrimaryKeyValues + public class LocalBudgetReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string ClassroomIdentificationCode { get; set; } - public virtual long SchoolId { get; set; } + public virtual string AccountIdentifier { get; set; } + public virtual DateTime AsOfDate { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// @@ -72636,8 +71875,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassroomIdentificationCode", ClassroomIdentificationCode); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -72688,19 +71929,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Location table of the Location aggregate in the ODS database. + /// A class which represents the edfi.LocalBudget table of the LocalBudget aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Location : AggregateRootWithCompositeKey, IHasCascadableKeyValues, - Entities.Common.EdFi.ILocation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LocalBudget : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILocalBudget, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Location() + public LocalBudget() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -72709,9 +71950,21 @@ public Location() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string ClassroomIdentificationCode { get; set; } + public virtual string AccountIdentifier { get; set; } [DomainSignature] - public virtual long SchoolId { get; set; } + public virtual DateTime AsOfDate + { + get { return _asOfDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _asOfDate; + + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -72722,8 +71975,41 @@ public Location() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? MaximumNumberOfSeats { get; set; } - public virtual int? OptimalNumberOfSeats { get; set; } + public virtual decimal Amount { get; set; } + public virtual int? FinancialCollectionDescriptorId + { + get + { + if (_financialCollectionDescriptorId == default(int?)) + _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); + + return _financialCollectionDescriptorId; + } + set + { + _financialCollectionDescriptorId = value; + _financialCollectionDescriptor = null; + } + } + + private int? _financialCollectionDescriptorId; + private string _financialCollectionDescriptor; + + public virtual string FinancialCollectionDescriptor + { + get + { + if (_financialCollectionDescriptor == null) + _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); + + return _financialCollectionDescriptor; + } + set + { + _financialCollectionDescriptor = value; + _financialCollectionDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -72768,14 +72054,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ILocation.SchoolResourceId + string Entities.Common.EdFi.ILocalBudget.LocalAccountDiscriminator { - get { return SchoolReferenceData?.Id; } + get { return LocalAccountReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalBudget.LocalAccountResourceId + { + get { return LocalAccountReferenceData?.Id; } set { } } @@ -72789,6 +72084,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -72803,18 +72099,14 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassroomIdentificationCode", ClassroomIdentificationCode); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } - /// - /// Gets or sets the capturing the new key values that have - /// not been modified directly on the entity. - /// - OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } - #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -72874,113 +72166,45 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ILocation)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalBudget)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ILocation) target, null); + this.MapTo((Entities.Common.EdFi.ILocalBudget) target, null); } } } -// Aggregate: MagnetSpecialProgramEmphasisSchoolDescriptor +// Aggregate: LocalContractedStaff -namespace EdFi.Ods.Entities.NHibernate.MagnetSpecialProgramEmphasisSchoolDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalContractedStaffAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.MagnetSpecialProgramEmphasisSchoolDescriptor table of the MagnetSpecialProgramEmphasisSchoolDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class MagnetSpecialProgramEmphasisSchoolDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalContractedStaffReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int MagnetSpecialProgramEmphasisSchoolDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual string AccountIdentifier { get; set; } + public virtual DateTime AsOfDate { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual int FiscalYear { get; set; } + public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -72989,7 +72213,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("MagnetSpecialProgramEmphasisSchoolDescriptorId", MagnetSpecialProgramEmphasisSchoolDescriptorId); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -73010,18 +72238,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -73038,97 +72256,148 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor) target, null); - } - } -} -// Aggregate: MediumOfInstructionDescriptor -namespace EdFi.Ods.Entities.NHibernate.MediumOfInstructionDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.MediumOfInstructionDescriptor table of the MediumOfInstructionDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LocalContractedStaff table of the LocalContractedStaff aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class MediumOfInstructionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IMediumOfInstructionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalContractedStaff : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILocalContractedStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public LocalContractedStaff() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int MediumOfInstructionDescriptorId + public virtual string AccountIdentifier { get; set; } + [DomainSignature] + public virtual DateTime AsOfDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _asOfDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _asOfDate; + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } + [Display(Name="StaffUniqueId")][DomainSignature] + public virtual int StaffUSI + { + get + { + if (_staffUSI == default(int) && _staffUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) + { + _staffUSI = usi; + } + } + + return _staffUSI; + } + set + { + _staffUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); + } + } + + private int _staffUSI; + private string _staffUniqueId; + + public virtual string StaffUniqueId + { + get + { + if (_staffUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) + { + _staffUniqueId = uniqueId; + } + } + + return _staffUniqueId; + } + set + { + if (_staffUniqueId != value) + _staffUSI = default(int); + + _staffUniqueId = value; + } + } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal Amount { get; set; } + public virtual int? FinancialCollectionDescriptorId + { + get + { + if (_financialCollectionDescriptorId == default(int?)) + _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); + + return _financialCollectionDescriptorId; + } + set + { + _financialCollectionDescriptorId = value; + _financialCollectionDescriptor = null; + } + } + + private int? _financialCollectionDescriptorId; + private string _financialCollectionDescriptor; + + public virtual string FinancialCollectionDescriptor + { + get + { + if (_financialCollectionDescriptor == null) + _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); + + return _financialCollectionDescriptor; + } + set + { + _financialCollectionDescriptor = value; + _financialCollectionDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -73139,11 +72408,80 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } + + /// + /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILocalContractedStaff.LocalAccountDiscriminator + { + get { return LocalAccountReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalContractedStaff.LocalAccountResourceId + { + get { return LocalAccountReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } + + /// + /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILocalContractedStaff.StaffDiscriminator + { + get { return StaffReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalContractedStaff.StaffResourceId + { + get { return StaffReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -73154,6 +72492,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -73168,7 +72507,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("MediumOfInstructionDescriptorId", MediumOfInstructionDescriptorId); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -73232,37 +72575,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IMediumOfInstructionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalContractedStaff)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IMediumOfInstructionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILocalContractedStaff) target, null); } } } -// Aggregate: MethodCreditEarnedDescriptor +// Aggregate: LocaleDescriptor -namespace EdFi.Ods.Entities.NHibernate.MethodCreditEarnedDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocaleDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.MethodCreditEarnedDescriptor table of the MethodCreditEarnedDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LocaleDescriptor table of the LocaleDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class MethodCreditEarnedDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IMethodCreditEarnedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocaleDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILocaleDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int MethodCreditEarnedDescriptorId + public virtual int LocaleDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -73347,7 +72690,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("MethodCreditEarnedDescriptorId", MethodCreditEarnedDescriptorId); + keyValues.Add("LocaleDescriptorId", LocaleDescriptorId); return keyValues; } @@ -73411,40 +72754,49 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IMethodCreditEarnedDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocaleDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IMethodCreditEarnedDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILocaleDescriptor) target, null); } } } -// Aggregate: MigrantEducationProgramServiceDescriptor +// Aggregate: LocalEducationAgency -namespace EdFi.Ods.Entities.NHibernate.MigrantEducationProgramServiceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalEducationAgencyAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.MigrantEducationProgramServiceDescriptor table of the MigrantEducationProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LocalEducationAgency table of the LocalEducationAgency aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class MigrantEducationProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalEducationAgency : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.ILocalEducationAgency, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public LocalEducationAgency() + { + LocalEducationAgencyAccountabilities = new HashSet(); + LocalEducationAgencyFederalFunds = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int MigrantEducationProgramServiceDescriptorId + public virtual long LocalEducationAgencyId { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } } // ------------------------------------------------------------- @@ -73452,245 +72804,286 @@ public virtual int MigrantEducationProgramServiceDescriptorId // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + string IEducationOrganization.NameOfInstitution { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } } - DateTime? IDescriptor.EffectiveEndDate + string IEducationOrganization.OperationalStatusDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } } - string IDescriptor.Namespace + string IEducationOrganization.ShortNameOfInstitution { - get { return Namespace; } - set { Namespace = value; } + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } } - string IDescriptor.ShortDescription + string IEducationOrganization.WebSite { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return WebSite; } + set { WebSite = value; } } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + public virtual int? CharterStatusDescriptorId + { + get { - }; + if (_charterStatusDescriptorId == default(int?)) + _charterStatusDescriptorId = string.IsNullOrWhiteSpace(_charterStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CharterStatusDescriptor", _charterStatusDescriptor); - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _charterStatusDescriptorId; + } + set + { + _charterStatusDescriptorId = value; + _charterStatusDescriptor = null; + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("MigrantEducationProgramServiceDescriptorId", MigrantEducationProgramServiceDescriptorId); + private int? _charterStatusDescriptorId; + private string _charterStatusDescriptor; - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + public virtual string CharterStatusDescriptor { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (_charterStatusDescriptor == null) + _charterStatusDescriptor = _charterStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CharterStatusDescriptor", _charterStatusDescriptorId.Value); + + return _charterStatusDescriptor; + } + set + { + _charterStatusDescriptor = value; + _charterStatusDescriptorId = default(int?); } - - return true; } - - public override int GetHashCode() + public virtual long? EducationServiceCenterId { get; set; } + public virtual int LocalEducationAgencyCategoryDescriptorId { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + get + { + if (_localEducationAgencyCategoryDescriptorId == default(int)) + _localEducationAgencyCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocalEducationAgencyCategoryDescriptor", _localEducationAgencyCategoryDescriptor); - foreach (DictionaryEntry entry in keyValues) + return _localEducationAgencyCategoryDescriptorId; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + _localEducationAgencyCategoryDescriptorId = value; + _localEducationAgencyCategoryDescriptor = null; } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor)target); } - void IMappable.Map(object target) + private int _localEducationAgencyCategoryDescriptorId; + private string _localEducationAgencyCategoryDescriptor; + + public virtual string LocalEducationAgencyCategoryDescriptor { - this.MapTo((Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor) target, null); + get + { + if (_localEducationAgencyCategoryDescriptor == null) + _localEducationAgencyCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocalEducationAgencyCategoryDescriptor", _localEducationAgencyCategoryDescriptorId); + + return _localEducationAgencyCategoryDescriptor; + } + set + { + _localEducationAgencyCategoryDescriptor = value; + _localEducationAgencyCategoryDescriptorId = default(int); + } } + public virtual long? ParentLocalEducationAgencyId { get; set; } + public virtual long? StateEducationAgencyId { get; set; } + // ------------------------------------------------------------- - } -} -// Aggregate: ModelEntityDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ModelEntityDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.ModelEntityDescriptor table of the ModelEntityDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ModelEntityDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IModelEntityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Extensions // ------------------------------------------------------------- - [DomainSignature] - public virtual int ModelEntityDescriptorId + private IDictionary _extensions; + + public IDictionary Extensions { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } } - + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= - // Inherited Properties + // Reference Data // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationServiceCenterReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationServiceCenter resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalEducationAgency.EducationServiceCenterResourceId { - get { return Description; } - set { Description = value; } + get { return EducationServiceCenterReferenceData?.Id; } + set { } } - DateTime? IDescriptor.EffectiveBeginDate + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParentLocalEducationAgencyReferenceData { get; set; } + + /// + /// Read-only property that allows the ParentLocalEducationAgency resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalEducationAgency.ParentLocalEducationAgencyResourceId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return ParentLocalEducationAgencyReferenceData?.Id; } + set { } } - DateTime? IDescriptor.EffectiveEndDate + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData StateEducationAgencyReferenceData { get; set; } + + /// + /// Read-only property that allows the StateEducationAgency resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalEducationAgency.StateEducationAgencyResourceId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return StateEducationAgencyReferenceData?.Id; } + set { } } - string IDescriptor.Namespace + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _localEducationAgencyAccountabilities; + private ICollection _localEducationAgencyAccountabilitiesCovariant; + public virtual ICollection LocalEducationAgencyAccountabilities { - get { return Namespace; } - set { Namespace = value; } + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _localEducationAgencyAccountabilities) + if (item.LocalEducationAgency == null) + item.LocalEducationAgency = this; + // ------------------------------------------------------------- + + return _localEducationAgencyAccountabilities; + } + set + { + _localEducationAgencyAccountabilities = value; + _localEducationAgencyAccountabilitiesCovariant = new CovariantCollectionAdapter(value); + } } - string IDescriptor.ShortDescription + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyAccountabilities { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _localEducationAgencyAccountabilities) + if (item.LocalEducationAgency == null) + item.LocalEducationAgency = this; + // ------------------------------------------------------------- + + return _localEducationAgencyAccountabilitiesCovariant; + } + set + { + LocalEducationAgencyAccountabilities = new HashSet(value.Cast()); + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private ICollection _localEducationAgencyFederalFunds; + private ICollection _localEducationAgencyFederalFundsCovariant; + public virtual ICollection LocalEducationAgencyFederalFunds + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _localEducationAgencyFederalFunds) + if (item.LocalEducationAgency == null) + item.LocalEducationAgency = this; + // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _localEducationAgencyFederalFunds; + } + set + { + _localEducationAgencyFederalFunds = value; + _localEducationAgencyFederalFundsCovariant = new CovariantCollectionAdapter(value); + } + } - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyFederalFunds + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _localEducationAgencyFederalFunds) + if (item.LocalEducationAgency == null) + item.LocalEducationAgency = this; + // ------------------------------------------------------------- + + return _localEducationAgencyFederalFundsCovariant; + } + set + { + LocalEducationAgencyFederalFunds = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CharterStatusDescriptor", new LookupColumnDetails { PropertyName = "CharterStatusDescriptorId", LookupTypeName = "CharterStatusDescriptor"} }, + { "LocalEducationAgencyCategoryDescriptor", new LookupColumnDetails { PropertyName = "LocalEducationAgencyCategoryDescriptorId", LookupTypeName = "LocalEducationAgencyCategoryDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -73705,7 +73098,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ModelEntityDescriptorId", ModelEntityDescriptorId); + keyValues.Add("LocalEducationAgencyId", LocalEducationAgencyId); return keyValues; } @@ -73769,84 +73162,130 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IModelEntityDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgency)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IModelEntityDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILocalEducationAgency) target, null); } } -} -// Aggregate: MonitoredDescriptor - -namespace EdFi.Ods.Entities.NHibernate.MonitoredDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.MonitoredDescriptor table of the MonitoredDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LocalEducationAgencyAccountability table of the LocalEducationAgency aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class MonitoredDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IMonitoredDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalEducationAgencyAccountability : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILocalEducationAgencyAccountability, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public LocalEducationAgencyAccountability() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int MonitoredDescriptorId + [DomainSignature, JsonIgnore] + public virtual LocalEducationAgency LocalEducationAgency { get; set; } + + Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyAccountability.LocalEducationAgency { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return LocalEducationAgency; } + set { LocalEducationAgency = (LocalEducationAgency) value; } } - + + [DomainSignature] + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int? GunFreeSchoolsActReportingStatusDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_gunFreeSchoolsActReportingStatusDescriptorId == default(int?)) + _gunFreeSchoolsActReportingStatusDescriptorId = string.IsNullOrWhiteSpace(_gunFreeSchoolsActReportingStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GunFreeSchoolsActReportingStatusDescriptor", _gunFreeSchoolsActReportingStatusDescriptor); + + return _gunFreeSchoolsActReportingStatusDescriptorId; + } + set + { + _gunFreeSchoolsActReportingStatusDescriptorId = value; + _gunFreeSchoolsActReportingStatusDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int? _gunFreeSchoolsActReportingStatusDescriptorId; + private string _gunFreeSchoolsActReportingStatusDescriptor; + + public virtual string GunFreeSchoolsActReportingStatusDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_gunFreeSchoolsActReportingStatusDescriptor == null) + _gunFreeSchoolsActReportingStatusDescriptor = _gunFreeSchoolsActReportingStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GunFreeSchoolsActReportingStatusDescriptor", _gunFreeSchoolsActReportingStatusDescriptorId.Value); + + return _gunFreeSchoolsActReportingStatusDescriptor; + } + set + { + _gunFreeSchoolsActReportingStatusDescriptor = value; + _gunFreeSchoolsActReportingStatusDescriptorId = default(int?); + } } - string IDescriptor.Namespace + public virtual int? SchoolChoiceImplementStatusDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_schoolChoiceImplementStatusDescriptorId == default(int?)) + _schoolChoiceImplementStatusDescriptorId = string.IsNullOrWhiteSpace(_schoolChoiceImplementStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolChoiceImplementStatusDescriptor", _schoolChoiceImplementStatusDescriptor); + + return _schoolChoiceImplementStatusDescriptorId; + } + set + { + _schoolChoiceImplementStatusDescriptorId = value; + _schoolChoiceImplementStatusDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int? _schoolChoiceImplementStatusDescriptorId; + private string _schoolChoiceImplementStatusDescriptor; + + public virtual string SchoolChoiceImplementStatusDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_schoolChoiceImplementStatusDescriptor == null) + _schoolChoiceImplementStatusDescriptor = _schoolChoiceImplementStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolChoiceImplementStatusDescriptor", _schoolChoiceImplementStatusDescriptorId.Value); + + return _schoolChoiceImplementStatusDescriptor; + } + set + { + _schoolChoiceImplementStatusDescriptor = value; + _schoolChoiceImplementStatusDescriptorId = default(int?); + } } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -73855,11 +73294,51 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalEducationAgencyAccountability.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -73870,6 +73349,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GunFreeSchoolsActReportingStatusDescriptor", new LookupColumnDetails { PropertyName = "GunFreeSchoolsActReportingStatusDescriptorId", LookupTypeName = "GunFreeSchoolsActReportingStatusDescriptor"} }, + { "SchoolChoiceImplementStatusDescriptor", new LookupColumnDetails { PropertyName = "SchoolChoiceImplementStatusDescriptorId", LookupTypeName = "SchoolChoiceImplementStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -73880,11 +73361,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("MonitoredDescriptorId", MonitoredDescriptorId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -73948,82 +73429,72 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IMonitoredDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgencyAccountability)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IMonitoredDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILocalEducationAgencyAccountability) target, null); } + void IChildEntity.SetParent(object value) + { + LocalEducationAgency = (LocalEducationAgency) value; + } } -} -// Aggregate: NeglectedOrDelinquentProgramDescriptor - -namespace EdFi.Ods.Entities.NHibernate.NeglectedOrDelinquentProgramDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.NeglectedOrDelinquentProgramDescriptor table of the NeglectedOrDelinquentProgramDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LocalEducationAgencyFederalFunds table of the LocalEducationAgency aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class NeglectedOrDelinquentProgramDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalEducationAgencyFederalFunds : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ILocalEducationAgencyFederalFunds, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public LocalEducationAgencyFederalFunds() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int NeglectedOrDelinquentProgramDescriptorId + [DomainSignature, JsonIgnore] + public virtual LocalEducationAgency LocalEducationAgency { get; set; } + + Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.LocalEducationAgency { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return LocalEducationAgency; } + set { LocalEducationAgency = (LocalEducationAgency) value; } } - + + [DomainSignature] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? InnovativeDollarsSpent { get; set; } + public virtual decimal? InnovativeDollarsSpentStrategicPriorities { get; set; } + public virtual decimal? InnovativeProgramsFundsReceived { get; set; } + public virtual decimal? SchoolImprovementAllocation { get; set; } + public virtual decimal? SchoolImprovementReservedFundsPercentage { get; set; } + public virtual decimal? StateAssessmentAdministrationFunding { get; set; } + public virtual decimal? SupplementalEducationalServicesFundsSpent { get; set; } + public virtual decimal? SupplementalEducationalServicesPerPupilExpenditure { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -74034,6 +73505,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -74059,11 +73559,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("NeglectedOrDelinquentProgramDescriptorId", NeglectedOrDelinquentProgramDescriptorId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -74127,37 +73627,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds) target, null); } + void IChildEntity.SetParent(object value) + { + LocalEducationAgency = (LocalEducationAgency) value; + } } } -// Aggregate: NeglectedOrDelinquentProgramServiceDescriptor +// Aggregate: LocalEducationAgencyCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.NeglectedOrDelinquentProgramServiceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalEducationAgencyCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.NeglectedOrDelinquentProgramServiceDescriptor table of the NeglectedOrDelinquentProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LocalEducationAgencyCategoryDescriptor table of the LocalEducationAgencyCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class NeglectedOrDelinquentProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalEducationAgencyCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int NeglectedOrDelinquentProgramServiceDescriptorId + public virtual int LocalEducationAgencyCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -74242,7 +73746,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("NeglectedOrDelinquentProgramServiceDescriptorId", NeglectedOrDelinquentProgramServiceDescriptorId); + keyValues.Add("LocalEducationAgencyCategoryDescriptorId", LocalEducationAgencyCategoryDescriptorId); return keyValues; } @@ -74306,113 +73810,44 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor) target, null); } } } -// Aggregate: NetworkPurposeDescriptor +// Aggregate: LocalEncumbrance -namespace EdFi.Ods.Entities.NHibernate.NetworkPurposeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalEncumbranceAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.NetworkPurposeDescriptor table of the NetworkPurposeDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class NetworkPurposeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.INetworkPurposeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalEncumbranceReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int NetworkPurposeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual string AccountIdentifier { get; set; } + public virtual DateTime AsOfDate { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -74421,7 +73856,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("NetworkPurposeDescriptorId", NetworkPurposeDescriptorId); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -74442,18 +73880,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -74470,97 +73898,99 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.INetworkPurposeDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.INetworkPurposeDescriptor) target, null); - } - } -} -// Aggregate: NonMedicalImmunizationExemptionDescriptor -namespace EdFi.Ods.Entities.NHibernate.NonMedicalImmunizationExemptionDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.NonMedicalImmunizationExemptionDescriptor table of the NonMedicalImmunizationExemptionDescriptor aggregate in the ODS database. + /// A class which represents the edfi.LocalEncumbrance table of the LocalEncumbrance aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class NonMedicalImmunizationExemptionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class LocalEncumbrance : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILocalEncumbrance, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public LocalEncumbrance() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int NonMedicalImmunizationExemptionDescriptorId + public virtual string AccountIdentifier { get; set; } + [DomainSignature] + public virtual DateTime AsOfDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _asOfDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _asOfDate; + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal Amount { get; set; } + public virtual int? FinancialCollectionDescriptorId + { + get + { + if (_financialCollectionDescriptorId == default(int?)) + _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); + + return _financialCollectionDescriptorId; + } + set + { + _financialCollectionDescriptorId = value; + _financialCollectionDescriptor = null; + } + } + + private int? _financialCollectionDescriptorId; + private string _financialCollectionDescriptor; + + public virtual string FinancialCollectionDescriptor + { + get + { + if (_financialCollectionDescriptor == null) + _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); + + return _financialCollectionDescriptor; + } + set + { + _financialCollectionDescriptor = value; + _financialCollectionDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -74571,11 +74001,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } + + /// + /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILocalEncumbrance.LocalAccountDiscriminator + { + get { return LocalAccountReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalEncumbrance.LocalAccountResourceId + { + get { return LocalAccountReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -74586,6 +74065,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -74600,7 +74080,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("NonMedicalImmunizationExemptionDescriptorId", NonMedicalImmunizationExemptionDescriptorId); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -74664,30 +74147,33 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalEncumbrance)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ILocalEncumbrance) target, null); } } } -// Aggregate: ObjectDimension +// Aggregate: LocalPayroll -namespace EdFi.Ods.Entities.NHibernate.ObjectDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocalPayrollAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ObjectDimensionReferenceData : IHasPrimaryKeyValues + public class LocalPayrollReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string Code { get; set; } + public virtual string AccountIdentifier { get; set; } + public virtual DateTime AsOfDate { get; set; } + public virtual long EducationOrganizationId { get; set; } public virtual int FiscalYear { get; set; } + public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// @@ -74708,8 +74194,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -74760,20 +74249,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ObjectDimension table of the ObjectDimension aggregate in the ODS database. + /// A class which represents the edfi.LocalPayroll table of the LocalPayroll aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ObjectDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IObjectDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class LocalPayroll : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ILocalPayroll, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ObjectDimension() + public LocalPayroll() { - ObjectDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -74782,289 +74270,117 @@ public ObjectDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string Code { get; set; } + public virtual string AccountIdentifier { get; set; } [DomainSignature] - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CodeName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; + public virtual DateTime AsOfDate + { + get { return _asOfDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _asOfDate = new DateTime(value.Year, value.Month, value.Day); } + } - public IDictionary Extensions + private DateTime _asOfDate; + + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } + [Display(Name="StaffUniqueId")][DomainSignature] + public virtual int StaffUSI { - get => _extensions; - set + get { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + if (_staffUSI == default(int) && _staffUniqueId != null) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } + _staffUSI = usi; } } - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _objectDimensionReportingTags; - private ICollection _objectDimensionReportingTagsCovariant; - public virtual ICollection ObjectDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectDimensionReportingTags) - if (item.ObjectDimension == null) - item.ObjectDimension = this; - // ------------------------------------------------------------- - - return _objectDimensionReportingTags; - } - set - { - _objectDimensionReportingTags = value; - _objectDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectDimension.ObjectDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectDimensionReportingTags) - if (item.ObjectDimension == null) - item.ObjectDimension = this; - // ------------------------------------------------------------- - - return _objectDimensionReportingTagsCovariant; - } + return _staffUSI; + } set { - ObjectDimensionReportingTags = new HashSet(value.Cast()); + _staffUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); } } - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); - - return keyValues; - } + private int _staffUSI; + private string _staffUniqueId; - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + public virtual string StaffUniqueId { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) + if (_staffUniqueId == null) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) { - return false; + _staffUniqueId = uniqueId; } } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + return _staffUniqueId; } + set + { + if (_staffUniqueId != value) + _staffUSI = default(int); - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IObjectDimension)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IObjectDimension) target, null); - } - - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.ObjectDimensionReportingTag table of the ObjectDimension aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ObjectDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IObjectDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ObjectDimensionReportingTag() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + _staffUniqueId = value; + } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ObjectDimension ObjectDimension { get; set; } - - Entities.Common.EdFi.IObjectDimension IObjectDimensionReportingTag.ObjectDimension - { - get { return ObjectDimension; } - set { ObjectDimension = (ObjectDimension) value; } - } - [DomainSignature] - public virtual int ReportingTagDescriptorId + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual decimal Amount { get; set; } + public virtual int? FinancialCollectionDescriptorId { get { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + if (_financialCollectionDescriptorId == default(int?)) + _financialCollectionDescriptorId = string.IsNullOrWhiteSpace(_financialCollectionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("FinancialCollectionDescriptor", _financialCollectionDescriptor); - return _reportingTagDescriptorId; + return _financialCollectionDescriptorId; } set { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; + _financialCollectionDescriptorId = value; + _financialCollectionDescriptor = null; } } - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; + private int? _financialCollectionDescriptorId; + private string _financialCollectionDescriptor; - public virtual string ReportingTagDescriptor + public virtual string FinancialCollectionDescriptor { get { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + if (_financialCollectionDescriptor == null) + _financialCollectionDescriptor = _financialCollectionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("FinancialCollectionDescriptor", _financialCollectionDescriptorId.Value); - return _reportingTagDescriptor; + return _financialCollectionDescriptor; } set { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); + _financialCollectionDescriptor = value; + _financialCollectionDescriptorId = default(int?); } } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -75107,6 +74423,46 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } + + /// + /// Read-only property that allows the LocalAccount discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILocalPayroll.LocalAccountDiscriminator + { + get { return LocalAccountReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LocalAccount resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalPayroll.LocalAccountResourceId + { + get { return LocalAccountReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } + + /// + /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ILocalPayroll.StaffDiscriminator + { + get { return StaffReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ILocalPayroll.StaffResourceId + { + get { return StaffReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -75117,7 +74473,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + { "FinancialCollectionDescriptor", new LookupColumnDetails { PropertyName = "FinancialCollectionDescriptorId", LookupTypeName = "FinancialCollectionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -75128,11 +74484,15 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ObjectDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("AccountIdentifier", AccountIdentifier); + keyValues.Add("AsOfDate", AsOfDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -75196,35 +74556,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IObjectDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.ILocalPayroll)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IObjectDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.ILocalPayroll) target, null); } - void IChildEntity.SetParent(object value) - { - ObjectDimension = (ObjectDimension) value; - } } } -// Aggregate: ObjectiveAssessment +// Aggregate: Location -namespace EdFi.Ods.Entities.NHibernate.ObjectiveAssessmentAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.LocationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ObjectiveAssessmentReferenceData : IHasPrimaryKeyValues + public class LocationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AssessmentIdentifier { get; set; } - public virtual string IdentificationCode { get; set; } - public virtual string Namespace { get; set; } + public virtual string ClassroomIdentificationCode { get; set; } + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- /// @@ -75245,9 +74600,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("IdentificationCode", IdentificationCode); - keyValues.Add("Namespace", Namespace); + keyValues.Add("ClassroomIdentificationCode", ClassroomIdentificationCode); + keyValues.Add("SchoolId", SchoolId); return keyValues; } @@ -75298,23 +74652,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ObjectiveAssessment table of the ObjectiveAssessment aggregate in the ODS database. + /// A class which represents the edfi.Location table of the Location aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ObjectiveAssessment : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Location : AggregateRootWithCompositeKey, IHasCascadableKeyValues, + Entities.Common.EdFi.ILocation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ObjectiveAssessment() + public Location() { - ObjectiveAssessmentAssessmentItems = new HashSet(); - ObjectiveAssessmentLearningStandards = new HashSet(); - ObjectiveAssessmentPerformanceLevels = new HashSet(); - ObjectiveAssessmentScores = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -75323,11 +74673,9 @@ public ObjectiveAssessment() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string AssessmentIdentifier { get; set; } - [DomainSignature] - public virtual string IdentificationCode { get; set; } + public virtual string ClassroomIdentificationCode { get; set; } [DomainSignature] - public virtual string Namespace { get; set; } + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -75338,45 +74686,8 @@ public ObjectiveAssessment() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AcademicSubjectDescriptorId - { - get - { - if (_academicSubjectDescriptorId == default(int?)) - _academicSubjectDescriptorId = string.IsNullOrWhiteSpace(_academicSubjectDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } - } - - private int? _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor - { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = _academicSubjectDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId.Value); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int?); - } - } - public virtual string Description { get; set; } - public virtual decimal? MaxRawScore { get; set; } - public virtual string Nomenclature { get; set; } - public virtual string ParentIdentificationCode { get; set; } - public virtual decimal? PercentOfAssessment { get; set; } + public virtual int? MaximumNumberOfSeats { get; set; } + public virtual int? OptimalNumberOfSeats { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -75421,43 +74732,14 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } - - /// - /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IObjectiveAssessment.AssessmentDiscriminator - { - get { return AssessmentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IObjectiveAssessment.AssessmentResourceId - { - get { return AssessmentReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ParentObjectiveAssessmentReferenceData { get; set; } - - /// - /// Read-only property that allows the ParentObjectiveAssessment discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentDiscriminator - { - get { return ParentObjectiveAssessmentReferenceData?.Discriminator; } - set { } - } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the ParentObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentResourceId + Guid? Entities.Common.EdFi.ILocation.SchoolResourceId { - get { return ParentObjectiveAssessmentReferenceData?.Id; } + get { return SchoolReferenceData?.Id; } set { } } @@ -75466,200 +74748,197 @@ string Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentDiscri //============================================================= // Collections // ------------------------------------------------------------- + // ------------------------------------------------------------- - private ICollection _objectiveAssessmentAssessmentItems; - private ICollection _objectiveAssessmentAssessmentItemsCovariant; - public virtual ICollection ObjectiveAssessmentAssessmentItems - { - get + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentAssessmentItems) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- + }; - return _objectiveAssessmentAssessmentItems; - } - set - { - _objectiveAssessmentAssessmentItems = value; - _objectiveAssessmentAssessmentItemsCovariant = new CovariantCollectionAdapter(value); - } + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentAssessmentItems + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentAssessmentItems) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - return _objectiveAssessmentAssessmentItemsCovariant; - } - set - { - ObjectiveAssessmentAssessmentItems = new HashSet(value.Cast()); - } + // Add current key values + keyValues.Add("ClassroomIdentificationCode", ClassroomIdentificationCode); + keyValues.Add("SchoolId", SchoolId); + + return keyValues; } + /// + /// Gets or sets the capturing the new key values that have + /// not been modified directly on the entity. + /// + OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } - private ICollection _objectiveAssessmentLearningStandards; - private ICollection _objectiveAssessmentLearningStandardsCovariant; - public virtual ICollection ObjectiveAssessmentLearningStandards + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentLearningStandards) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _objectiveAssessmentLearningStandards; - } - set - { - _objectiveAssessmentLearningStandards = value; - _objectiveAssessmentLearningStandardsCovariant = new CovariantCollectionAdapter(value); - } - } + if (ReferenceEquals(this, compareTo)) + return true; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentLearningStandards - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentLearningStandards) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- + if (compareTo == null) + return false; - return _objectiveAssessmentLearningStandardsCovariant; - } - set + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - ObjectiveAssessmentLearningStandards = new HashSet(value.Cast()); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } - } + return true; + } - private ICollection _objectiveAssessmentPerformanceLevels; - private ICollection _objectiveAssessmentPerformanceLevelsCovariant; - public virtual ICollection ObjectiveAssessmentPerformanceLevels + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentPerformanceLevels) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _objectiveAssessmentPerformanceLevels; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - _objectiveAssessmentPerformanceLevels = value; - _objectiveAssessmentPerformanceLevelsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentPerformanceLevels + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentPerformanceLevels) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- + return this.SynchronizeTo((Entities.Common.EdFi.ILocation)target); + } - return _objectiveAssessmentPerformanceLevelsCovariant; - } - set - { - ObjectiveAssessmentPerformanceLevels = new HashSet(value.Cast()); - } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ILocation) target, null); } + } +} +// Aggregate: MagnetSpecialProgramEmphasisSchoolDescriptor - private ICollection _objectiveAssessmentScores; - private ICollection _objectiveAssessmentScoresCovariant; - public virtual ICollection ObjectiveAssessmentScores - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentScores) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- +namespace EdFi.Ods.Entities.NHibernate.MagnetSpecialProgramEmphasisSchoolDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 - return _objectiveAssessmentScores; - } - set - { - _objectiveAssessmentScores = value; - _objectiveAssessmentScoresCovariant = new CovariantCollectionAdapter(value); - } - } + /// + /// A class which represents the edfi.MagnetSpecialProgramEmphasisSchoolDescriptor table of the MagnetSpecialProgramEmphasisSchoolDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class MagnetSpecialProgramEmphasisSchoolDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentScores + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int MagnetSpecialProgramEmphasisSchoolDescriptorId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _objectiveAssessmentScores) - if (item.ObjectiveAssessment == null) - item.ObjectiveAssessment = this; - // ------------------------------------------------------------- + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- - return _objectiveAssessmentScoresCovariant; - } - set - { - ObjectiveAssessmentScores = new HashSet(value.Cast()); - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -75674,9 +74953,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("IdentificationCode", IdentificationCode); - keyValues.Add("Namespace", Namespace); + keyValues.Add("MagnetSpecialProgramEmphasisSchoolDescriptorId", MagnetSpecialProgramEmphasisSchoolDescriptorId); return keyValues; } @@ -75740,55 +75017,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessment)target); + return this.SynchronizeTo((Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IObjectiveAssessment) target, null); + this.MapTo((Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor) target, null); } } +} +// Aggregate: MediumOfInstructionDescriptor + +namespace EdFi.Ods.Entities.NHibernate.MediumOfInstructionDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ObjectiveAssessmentAssessmentItem table of the ObjectiveAssessment aggregate in the ODS database. + /// A class which represents the edfi.MediumOfInstructionDescriptor table of the MediumOfInstructionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentAssessmentItem : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class MediumOfInstructionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IMediumOfInstructionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ObjectiveAssessmentAssessmentItem() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } - - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.ObjectiveAssessment + [DomainSignature] + public virtual int MediumOfInstructionDescriptorId { - get { return ObjectiveAssessment; } - set { ObjectiveAssessment = (ObjectiveAssessment) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string AssessmentItemIdentificationCode { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -75804,60 +75103,11 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.Obj // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.AssessmentItemAggregate.EdFi.AssessmentItemReferenceData AssessmentItemReferenceData { get; set; } - - /// - /// Read-only property that allows the AssessmentItem discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemDiscriminator - { - get { return AssessmentItemReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the AssessmentItem resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemResourceId - { - get { return AssessmentItemReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -75878,11 +75128,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentItemIdentificationCode", AssessmentItemIdentificationCode); + keyValues.Add("MediumOfInstructionDescriptorId", MediumOfInstructionDescriptorId); return keyValues; } @@ -75946,59 +75196,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)target); + return this.SynchronizeTo((Entities.Common.EdFi.IMediumOfInstructionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem) target, null); + this.MapTo((Entities.Common.EdFi.IMediumOfInstructionDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ObjectiveAssessment = (ObjectiveAssessment) value; - } } +} +// Aggregate: MethodCreditEarnedDescriptor + +namespace EdFi.Ods.Entities.NHibernate.MethodCreditEarnedDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ObjectiveAssessmentLearningStandard table of the ObjectiveAssessment aggregate in the ODS database. + /// A class which represents the edfi.MethodCreditEarnedDescriptor table of the MethodCreditEarnedDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IObjectiveAssessmentLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class MethodCreditEarnedDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IMethodCreditEarnedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ObjectiveAssessmentLearningStandard() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } - - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.ObjectiveAssessment + [DomainSignature] + public virtual int MethodCreditEarnedDescriptorId { - get { return ObjectiveAssessment; } - set { ObjectiveAssessment = (ObjectiveAssessment) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string LearningStandardId { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -76014,60 +75282,11 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.O // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardResourceId - { - get { return LearningStandardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -76088,11 +75307,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("MethodCreditEarnedDescriptorId", MethodCreditEarnedDescriptorId); return keyValues; } @@ -76156,169 +75375,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IMethodCreditEarnedDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IMethodCreditEarnedDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ObjectiveAssessment = (ObjectiveAssessment) value; - } } +} +// Aggregate: MigrantEducationProgramServiceDescriptor + +namespace EdFi.Ods.Entities.NHibernate.MigrantEducationProgramServiceDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ObjectiveAssessmentPerformanceLevel table of the ObjectiveAssessment aggregate in the ODS database. + /// A class which represents the edfi.MigrantEducationProgramServiceDescriptor table of the MigrantEducationProgramServiceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class MigrantEducationProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public ObjectiveAssessmentPerformanceLevel() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int MigrantEducationProgramServiceDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } - - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentPerformanceLevel.ObjectiveAssessment + string IDescriptor.CodeValue { - get { return ObjectiveAssessment; } - set { ObjectiveAssessment = (ObjectiveAssessment) value; } + get { return CodeValue; } + set { CodeValue = value; } } - - [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId + string IDescriptor.Description { - get - { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - - return _assessmentReportingMethodDescriptorId; - } - set - { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; - - public virtual string AssessmentReportingMethodDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); - - return _assessmentReportingMethodDescriptor; - } - set - { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - [DomainSignature] - public virtual int PerformanceLevelDescriptorId + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_performanceLevelDescriptorId == default(int)) - _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); - - return _performanceLevelDescriptorId; - } - set - { - _performanceLevelDescriptorId = value; - _performanceLevelDescriptor = null; - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private int _performanceLevelDescriptorId; - private string _performanceLevelDescriptor; - - public virtual string PerformanceLevelDescriptor + string IDescriptor.Namespace { - get - { - if (_performanceLevelDescriptor == null) - _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); - - return _performanceLevelDescriptor; - } - set - { - _performanceLevelDescriptor = value; - _performanceLevelDescriptorId = default(int); - } + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } - public virtual string PerformanceLevelIndicatorName { get; set; } - public virtual int? ResultDatatypeTypeDescriptorId - { - get - { - if (_resultDatatypeTypeDescriptorId == default(int?)) - _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - - return _resultDatatypeTypeDescriptorId; - } - set - { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; - } - } - - private int? _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; - - public virtual string ResultDatatypeTypeDescriptor - { - get - { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); - - return _resultDatatypeTypeDescriptor; - } - set - { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -76329,35 +75461,6 @@ public virtual string ResultDatatypeTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -76373,9 +75476,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -76386,12 +75486,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); - keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); + keyValues.Add("MigrantEducationProgramServiceDescriptorId", MigrantEducationProgramServiceDescriptorId); return keyValues; } @@ -76455,133 +75554,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel) target, null); + this.MapTo((Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ObjectiveAssessment = (ObjectiveAssessment) value; - } } +} +// Aggregate: ModelEntityDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ModelEntityDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ObjectiveAssessmentScore table of the ObjectiveAssessment aggregate in the ODS database. + /// A class which represents the edfi.ModelEntityDescriptor table of the ModelEntityDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentScore : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IObjectiveAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ModelEntityDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IModelEntityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ObjectiveAssessmentScore() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } - - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentScore.ObjectiveAssessment - { - get { return ObjectiveAssessment; } - set { ObjectiveAssessment = (ObjectiveAssessment) value; } - } - [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId - { - get - { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - - return _assessmentReportingMethodDescriptorId; - } - set - { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; - } - } - - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; - - public virtual string AssessmentReportingMethodDescriptor + public virtual int ModelEntityDescriptorId { - get - { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); - - return _assessmentReportingMethodDescriptor; - } - set - { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } - public virtual int? ResultDatatypeTypeDescriptorId - { - get - { - if (_resultDatatypeTypeDescriptorId == default(int?)) - _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - - return _resultDatatypeTypeDescriptorId; - } - set - { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; - } - } - - private int? _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; - - public virtual string ResultDatatypeTypeDescriptor - { - get - { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); - - return _resultDatatypeTypeDescriptor; - } - set - { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -76592,35 +75640,6 @@ public virtual string ResultDatatypeTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -76636,8 +75655,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -76648,11 +75665,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("ModelEntityDescriptorId", ModelEntityDescriptorId); return keyValues; } @@ -76716,46 +75733,113 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentScore)target); + return this.SynchronizeTo((Entities.Common.EdFi.IModelEntityDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentScore) target, null); + this.MapTo((Entities.Common.EdFi.IModelEntityDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ObjectiveAssessment = (ObjectiveAssessment) value; - } } } -// Aggregate: OpenStaffPosition +// Aggregate: MonitoredDescriptor -namespace EdFi.Ods.Entities.NHibernate.OpenStaffPositionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.MonitoredDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.MonitoredDescriptor table of the MonitoredDescriptor aggregate in the ODS database. /// - public class OpenStaffPositionReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class MonitoredDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IMonitoredDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual string RequisitionNumber { get; set; } + [DomainSignature] + public virtual int MonitoredDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -76764,8 +75848,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("RequisitionNumber", RequisitionNumber); + keyValues.Add("MonitoredDescriptorId", MonitoredDescriptorId); return keyValues; } @@ -76786,8 +75869,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -76804,219 +75897,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IMonitoredDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IMonitoredDescriptor) target, null); + } + } +} +// Aggregate: NeglectedOrDelinquentProgramDescriptor +namespace EdFi.Ods.Entities.NHibernate.NeglectedOrDelinquentProgramDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.OpenStaffPosition table of the OpenStaffPosition aggregate in the ODS database. + /// A class which represents the edfi.NeglectedOrDelinquentProgramDescriptor table of the NeglectedOrDelinquentProgramDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class OpenStaffPosition : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IOpenStaffPosition, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class NeglectedOrDelinquentProgramDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public OpenStaffPosition() - { - OpenStaffPositionAcademicSubjects = new HashSet(); - OpenStaffPositionInstructionalGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string RequisitionNumber { get; set; } + public virtual int NeglectedOrDelinquentProgramDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime DatePosted - { - get { return _datePosted; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _datePosted = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _datePosted; - - public virtual DateTime? DatePostingRemoved - { - get { return _datePostingRemoved; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _datePostingRemoved = null; - } else - { - var given = (DateTime) value; - _datePostingRemoved = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _datePostingRemoved; - - public virtual int EmploymentStatusDescriptorId - { - get - { - if (_employmentStatusDescriptorId == default(int)) - _employmentStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EmploymentStatusDescriptor", _employmentStatusDescriptor); - - return _employmentStatusDescriptorId; - } - set - { - _employmentStatusDescriptorId = value; - _employmentStatusDescriptor = null; - } - } - - private int _employmentStatusDescriptorId; - private string _employmentStatusDescriptor; - - public virtual string EmploymentStatusDescriptor + string IDescriptor.CodeValue { - get - { - if (_employmentStatusDescriptor == null) - _employmentStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EmploymentStatusDescriptor", _employmentStatusDescriptorId); - - return _employmentStatusDescriptor; - } - set - { - _employmentStatusDescriptor = value; - _employmentStatusDescriptorId = default(int); - } + get { return CodeValue; } + set { CodeValue = value; } } - public virtual string PositionTitle { get; set; } - public virtual int? PostingResultDescriptorId + string IDescriptor.Description { - get - { - if (_postingResultDescriptorId == default(int?)) - _postingResultDescriptorId = string.IsNullOrWhiteSpace(_postingResultDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PostingResultDescriptor", _postingResultDescriptor); - - return _postingResultDescriptorId; - } - set - { - _postingResultDescriptorId = value; - _postingResultDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int? _postingResultDescriptorId; - private string _postingResultDescriptor; - - public virtual string PostingResultDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_postingResultDescriptor == null) - _postingResultDescriptor = _postingResultDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PostingResultDescriptor", _postingResultDescriptorId.Value); - - return _postingResultDescriptor; - } - set - { - _postingResultDescriptor = value; - _postingResultDescriptorId = default(int?); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - public virtual int? ProgramAssignmentDescriptorId + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_programAssignmentDescriptorId == default(int?)) - _programAssignmentDescriptorId = string.IsNullOrWhiteSpace(_programAssignmentDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramAssignmentDescriptor", _programAssignmentDescriptor); - - return _programAssignmentDescriptorId; - } - set - { - _programAssignmentDescriptorId = value; - _programAssignmentDescriptor = null; - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private int? _programAssignmentDescriptorId; - private string _programAssignmentDescriptor; - - public virtual string ProgramAssignmentDescriptor + string IDescriptor.Namespace { - get - { - if (_programAssignmentDescriptor == null) - _programAssignmentDescriptor = _programAssignmentDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramAssignmentDescriptor", _programAssignmentDescriptorId.Value); - - return _programAssignmentDescriptor; - } - set - { - _programAssignmentDescriptor = value; - _programAssignmentDescriptorId = default(int?); - } + get { return Namespace; } + set { Namespace = value; } } - public virtual int StaffClassificationDescriptorId + string IDescriptor.ShortDescription { - get - { - if (_staffClassificationDescriptorId == default(int)) - _staffClassificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StaffClassificationDescriptor", _staffClassificationDescriptor); - - return _staffClassificationDescriptorId; - } - set - { - _staffClassificationDescriptorId = value; - _staffClassificationDescriptor = null; - } + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- - private int _staffClassificationDescriptorId; - private string _staffClassificationDescriptor; - - public virtual string StaffClassificationDescriptor - { - get - { - if (_staffClassificationDescriptor == null) - _staffClassificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StaffClassificationDescriptor", _staffClassificationDescriptorId); - - return _staffClassificationDescriptor; - } - set - { - _staffClassificationDescriptor = value; - _staffClassificationDescriptorId = default(int); - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -77027,168 +75998,21 @@ public virtual string StaffClassificationDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _openStaffPositionAcademicSubjects; - private ICollection _openStaffPositionAcademicSubjectsCovariant; - public virtual ICollection OpenStaffPositionAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _openStaffPositionAcademicSubjects) - if (item.OpenStaffPosition == null) - item.OpenStaffPosition = this; - // ------------------------------------------------------------- - - return _openStaffPositionAcademicSubjects; - } - set - { - _openStaffPositionAcademicSubjects = value; - _openStaffPositionAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _openStaffPositionAcademicSubjects) - if (item.OpenStaffPosition == null) - item.OpenStaffPosition = this; - // ------------------------------------------------------------- - - return _openStaffPositionAcademicSubjectsCovariant; - } - set - { - OpenStaffPositionAcademicSubjects = new HashSet(value.Cast()); - } - } - - - private ICollection _openStaffPositionInstructionalGradeLevels; - private ICollection _openStaffPositionInstructionalGradeLevelsCovariant; - public virtual ICollection OpenStaffPositionInstructionalGradeLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _openStaffPositionInstructionalGradeLevels) - if (item.OpenStaffPosition == null) - item.OpenStaffPosition = this; - // ------------------------------------------------------------- - - return _openStaffPositionInstructionalGradeLevels; - } - set - { - _openStaffPositionInstructionalGradeLevels = value; - _openStaffPositionInstructionalGradeLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionInstructionalGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _openStaffPositionInstructionalGradeLevels) - if (item.OpenStaffPosition == null) - item.OpenStaffPosition = this; - // ------------------------------------------------------------- - - return _openStaffPositionInstructionalGradeLevelsCovariant; - } - set - { - OpenStaffPositionInstructionalGradeLevels = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EmploymentStatusDescriptor", new LookupColumnDetails { PropertyName = "EmploymentStatusDescriptorId", LookupTypeName = "EmploymentStatusDescriptor"} }, - { "PostingResultDescriptor", new LookupColumnDetails { PropertyName = "PostingResultDescriptorId", LookupTypeName = "PostingResultDescriptor"} }, - { "ProgramAssignmentDescriptor", new LookupColumnDetails { PropertyName = "ProgramAssignmentDescriptorId", LookupTypeName = "ProgramAssignmentDescriptor"} }, - { "StaffClassificationDescriptor", new LookupColumnDetails { PropertyName = "StaffClassificationDescriptorId", LookupTypeName = "StaffClassificationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -77203,8 +76027,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("RequisitionNumber", RequisitionNumber); + keyValues.Add("NeglectedOrDelinquentProgramDescriptorId", NeglectedOrDelinquentProgramDescriptorId); return keyValues; } @@ -77268,88 +76091,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IOpenStaffPosition)target); + return this.SynchronizeTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IOpenStaffPosition) target, null); + this.MapTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor) target, null); } } +} +// Aggregate: NeglectedOrDelinquentProgramServiceDescriptor + +namespace EdFi.Ods.Entities.NHibernate.NeglectedOrDelinquentProgramServiceDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.OpenStaffPositionAcademicSubject table of the OpenStaffPosition aggregate in the ODS database. + /// A class which represents the edfi.NeglectedOrDelinquentProgramServiceDescriptor table of the NeglectedOrDelinquentProgramServiceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class OpenStaffPositionAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IOpenStaffPositionAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class NeglectedOrDelinquentProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public OpenStaffPositionAcademicSubject() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual OpenStaffPosition OpenStaffPosition { get; set; } - - Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionAcademicSubject.OpenStaffPosition - { - get { return OpenStaffPosition; } - set { OpenStaffPosition = (OpenStaffPosition) value; } - } - [DomainSignature] - public virtual int AcademicSubjectDescriptorId - { - get - { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } - } - - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor + public virtual int NeglectedOrDelinquentProgramServiceDescriptorId { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -77365,35 +76177,6 @@ public virtual string AcademicSubjectDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -77409,7 +76192,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -77420,11 +76202,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("NeglectedOrDelinquentProgramServiceDescriptorId", NeglectedOrDelinquentProgramServiceDescriptorId); return keyValues; } @@ -77488,92 +76270,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - OpenStaffPosition = (OpenStaffPosition) value; - } } +} +// Aggregate: NetworkPurposeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.NetworkPurposeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.OpenStaffPositionInstructionalGradeLevel table of the OpenStaffPosition aggregate in the ODS database. + /// A class which represents the edfi.NetworkPurposeDescriptor table of the NetworkPurposeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class OpenStaffPositionInstructionalGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class NetworkPurposeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.INetworkPurposeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public OpenStaffPositionInstructionalGradeLevel() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int NetworkPurposeDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual OpenStaffPosition OpenStaffPosition { get; set; } - - Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionInstructionalGradeLevel.OpenStaffPosition + string IDescriptor.CodeValue { - get { return OpenStaffPosition; } - set { OpenStaffPosition = (OpenStaffPosition) value; } + get { return CodeValue; } + set { CodeValue = value; } } - - [DomainSignature] - public virtual int GradeLevelDescriptorId + string IDescriptor.Description { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -77589,35 +76356,6 @@ public virtual string GradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -77633,7 +76371,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -77644,11 +76381,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("NetworkPurposeDescriptorId", NetworkPurposeDescriptorId); return keyValues; } @@ -77712,41 +76449,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.INetworkPurposeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.INetworkPurposeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - OpenStaffPosition = (OpenStaffPosition) value; - } } } -// Aggregate: OperationalStatusDescriptor +// Aggregate: NonMedicalImmunizationExemptionDescriptor -namespace EdFi.Ods.Entities.NHibernate.OperationalStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.NonMedicalImmunizationExemptionDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.OperationalStatusDescriptor table of the OperationalStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.NonMedicalImmunizationExemptionDescriptor table of the NonMedicalImmunizationExemptionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class OperationalStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IOperationalStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class NonMedicalImmunizationExemptionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int OperationalStatusDescriptorId + public virtual int NonMedicalImmunizationExemptionDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -77831,7 +76564,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("OperationalStatusDescriptorId", OperationalStatusDescriptorId); + keyValues.Add("NonMedicalImmunizationExemptionDescriptorId", NonMedicalImmunizationExemptionDescriptorId); return keyValues; } @@ -77895,24 +76628,24 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IOperationalStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IOperationalStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor) target, null); } } } -// Aggregate: OperationalUnitDimension +// Aggregate: ObjectDimension -namespace EdFi.Ods.Entities.NHibernate.OperationalUnitDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ObjectDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class OperationalUnitDimensionReferenceData : IHasPrimaryKeyValues + public class ObjectDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key @@ -77991,20 +76724,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.OperationalUnitDimension table of the OperationalUnitDimension aggregate in the ODS database. + /// A class which represents the edfi.ObjectDimension table of the ObjectDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class OperationalUnitDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IOperationalUnitDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ObjectDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IObjectDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public OperationalUnitDimension() + public ObjectDimension() { - OperationalUnitDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ObjectDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -78077,9 +76810,9 @@ public IDictionary Extensions // Collections // ------------------------------------------------------------- - private ICollection _operationalUnitDimensionReportingTags; - private ICollection _operationalUnitDimensionReportingTagsCovariant; - public virtual ICollection OperationalUnitDimensionReportingTags + private ICollection _objectDimensionReportingTags; + private ICollection _objectDimensionReportingTagsCovariant; + public virtual ICollection ObjectDimensionReportingTags { get { @@ -78088,38 +76821,38 @@ public virtual ICollection(value); + _objectDimensionReportingTags = value; + _objectDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IOperationalUnitDimension.OperationalUnitDimensionReportingTags + ICollection Entities.Common.EdFi.IObjectDimension.ObjectDimensionReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _operationalUnitDimensionReportingTags) - if (item.OperationalUnitDimension == null) - item.OperationalUnitDimension = this; + foreach (var item in _objectDimensionReportingTags) + if (item.ObjectDimension == null) + item.ObjectDimension = this; // ------------------------------------------------------------- - return _operationalUnitDimensionReportingTagsCovariant; + return _objectDimensionReportingTagsCovariant; } set { - OperationalUnitDimensionReportingTags = new HashSet(value.Cast()); + ObjectDimensionReportingTags = new HashSet(value.Cast()); } } @@ -78207,12 +76940,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IOperationalUnitDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IObjectDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IOperationalUnitDimension) target, null); + this.MapTo((Entities.Common.EdFi.IObjectDimension) target, null); } } @@ -78220,19 +76953,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.OperationalUnitDimensionReportingTag table of the OperationalUnitDimension aggregate in the ODS database. + /// A class which represents the edfi.ObjectDimensionReportingTag table of the ObjectDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class OperationalUnitDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IOperationalUnitDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ObjectDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IObjectDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public OperationalUnitDimensionReportingTag() + public ObjectDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -78241,12 +76974,12 @@ public OperationalUnitDimensionReportingTag() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual OperationalUnitDimension OperationalUnitDimension { get; set; } + public virtual ObjectDimension ObjectDimension { get; set; } - Entities.Common.EdFi.IOperationalUnitDimension IOperationalUnitDimensionReportingTag.OperationalUnitDimension + Entities.Common.EdFi.IObjectDimension IObjectDimensionReportingTag.ObjectDimension { - get { return OperationalUnitDimension; } - set { OperationalUnitDimension = (OperationalUnitDimension) value; } + get { return ObjectDimension; } + set { ObjectDimension = (ObjectDimension) value; } } [DomainSignature] @@ -78360,7 +77093,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (OperationalUnitDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ObjectDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -78427,39 +77160,125 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IObjectDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IObjectDimensionReportingTag) target, null); } void IChildEntity.SetParent(object value) { - OperationalUnitDimension = (OperationalUnitDimension) value; + ObjectDimension = (ObjectDimension) value; } } } -// Aggregate: OrganizationDepartment +// Aggregate: ObjectiveAssessment -namespace EdFi.Ods.Entities.NHibernate.OrganizationDepartmentAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ObjectiveAssessmentAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class ObjectiveAssessmentReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string AssessmentIdentifier { get; set; } + public virtual string IdentificationCode { get; set; } + public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("Namespace", Namespace); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.OrganizationDepartment table of the OrganizationDepartment aggregate in the ODS database. + /// A class which represents the edfi.ObjectiveAssessment table of the ObjectiveAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class OrganizationDepartment : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.IOrganizationDepartment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ObjectiveAssessment : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public OrganizationDepartment() + public virtual void SuspendReferenceAssignmentCheck() { } + + public ObjectiveAssessment() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ObjectiveAssessmentAssessmentItems = new HashSet(); + ObjectiveAssessmentLearningStandards = new HashSet(); + ObjectiveAssessmentPerformanceLevels = new HashSet(); + ObjectiveAssessmentScores = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -78468,37 +77287,16 @@ public OrganizationDepartment() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long OrganizationDepartmentId - { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } - } - + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual string IdentificationCode { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor - { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } - } - string IEducationOrganization.ShortNameOfInstitution - { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } - } - string IEducationOrganization.WebSite - { - get { return WebSite; } - set { WebSite = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -78538,7 +77336,11 @@ public virtual string AcademicSubjectDescriptor _academicSubjectDescriptorId = default(int?); } } - public virtual long? ParentEducationOrganizationId { get; set; } + public virtual string Description { get; set; } + public virtual decimal? MaxRawScore { get; set; } + public virtual string Nomenclature { get; set; } + public virtual string ParentIdentificationCode { get; set; } + public virtual decimal? PercentOfAssessment { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -78583,23 +77385,43 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParentEducationOrganizationReferenceData { get; set; } + public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } /// - /// Read-only property that allows the ParentEducationOrganization discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationDiscriminator + string Entities.Common.EdFi.IObjectiveAssessment.AssessmentDiscriminator { - get { return ParentEducationOrganizationReferenceData?.Discriminator; } + get { return AssessmentReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ParentEducationOrganization resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationResourceId + Guid? Entities.Common.EdFi.IObjectiveAssessment.AssessmentResourceId { - get { return ParentEducationOrganizationReferenceData?.Id; } + get { return AssessmentReferenceData?.Id; } + set { } + } + + public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ParentObjectiveAssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the ParentObjectiveAssessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentDiscriminator + { + get { return ParentObjectiveAssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ParentObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentResourceId + { + get { return ParentObjectiveAssessmentReferenceData?.Id; } set { } } @@ -78608,192 +77430,200 @@ string Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationD //============================================================= // Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + private ICollection _objectiveAssessmentAssessmentItems; + private ICollection _objectiveAssessmentAssessmentItemsCovariant; + public virtual ICollection ObjectiveAssessmentAssessmentItems + { + get { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, - }; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentAssessmentItems) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _objectiveAssessmentAssessmentItems; + } + set + { + _objectiveAssessmentAssessmentItems = value; + _objectiveAssessmentAssessmentItemsCovariant = new CovariantCollectionAdapter(value); + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentAssessmentItems { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("OrganizationDepartmentId", OrganizationDepartmentId); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentAssessmentItems) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- - return keyValues; + return _objectiveAssessmentAssessmentItemsCovariant; + } + set + { + ObjectiveAssessmentAssessmentItems = new HashSet(value.Cast()); + } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + private ICollection _objectiveAssessmentLearningStandards; + private ICollection _objectiveAssessmentLearningStandardsCovariant; + public virtual ICollection ObjectiveAssessmentLearningStandards + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentLearningStandards) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- - foreach (DictionaryEntry entry in theseKeys) + return _objectiveAssessmentLearningStandards; + } + set { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + _objectiveAssessmentLearningStandards = value; + _objectiveAssessmentLearningStandardsCovariant = new CovariantCollectionAdapter(value); } - - return true; } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentLearningStandards { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentLearningStandards) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- - foreach (DictionaryEntry entry in keyValues) + return _objectiveAssessmentLearningStandardsCovariant; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + ObjectiveAssessmentLearningStandards = new HashSet(value.Cast()); } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IOrganizationDepartment)target); } - void IMappable.Map(object target) + + private ICollection _objectiveAssessmentPerformanceLevels; + private ICollection _objectiveAssessmentPerformanceLevelsCovariant; + public virtual ICollection ObjectiveAssessmentPerformanceLevels { - this.MapTo((Entities.Common.EdFi.IOrganizationDepartment) target, null); + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentPerformanceLevels) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- + + return _objectiveAssessmentPerformanceLevels; + } + set + { + _objectiveAssessmentPerformanceLevels = value; + _objectiveAssessmentPerformanceLevelsCovariant = new CovariantCollectionAdapter(value); + } } - } -} -// Aggregate: OtherNameTypeDescriptor + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentPerformanceLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentPerformanceLevels) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- -namespace EdFi.Ods.Entities.NHibernate.OtherNameTypeDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 + return _objectiveAssessmentPerformanceLevelsCovariant; + } + set + { + ObjectiveAssessmentPerformanceLevels = new HashSet(value.Cast()); + } + } - /// - /// A class which represents the edfi.OtherNameTypeDescriptor table of the OtherNameTypeDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class OtherNameTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IOtherNameTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int OtherNameTypeDescriptorId + private ICollection _objectiveAssessmentScores; + private ICollection _objectiveAssessmentScoresCovariant; + public virtual ICollection ObjectiveAssessmentScores { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentScores) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + return _objectiveAssessmentScores; + } + set + { + _objectiveAssessmentScores = value; + _objectiveAssessmentScoresCovariant = new CovariantCollectionAdapter(value); + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentScores + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _objectiveAssessmentScores) + if (item.ObjectiveAssessment == null) + item.ObjectiveAssessment = this; + // ------------------------------------------------------------- - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _objectiveAssessmentScoresCovariant; + } + set + { + ObjectiveAssessmentScores = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -78808,7 +77638,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("Namespace", Namespace); return keyValues; } @@ -78872,77 +77704,55 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IOtherNameTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IOtherNameTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IObjectiveAssessment) target, null); } } -} -// Aggregate: ParticipationDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ParticipationDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ParticipationDescriptor table of the ParticipationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ObjectiveAssessmentAssessmentItem table of the ObjectiveAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ParticipationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IParticipationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ObjectiveAssessmentAssessmentItem : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ObjectiveAssessmentAssessmentItem() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int ParticipationDescriptorId + [DomainSignature, JsonIgnore] + public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } + + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.ObjectiveAssessment { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return ObjectiveAssessment; } + set { ObjectiveAssessment = (ObjectiveAssessment) value; } } - + + [DomainSignature] + public virtual string AssessmentItemIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -78958,11 +77768,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.AssessmentItemAggregate.EdFi.AssessmentItemReferenceData AssessmentItemReferenceData { get; set; } + + /// + /// Read-only property that allows the AssessmentItem discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemDiscriminator + { + get { return AssessmentItemReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the AssessmentItem resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemResourceId + { + get { return AssessmentItemReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -78983,11 +77842,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ParticipationDescriptorId", ParticipationDescriptorId); + keyValues.Add("AssessmentItemIdentificationCode", AssessmentItemIdentificationCode); return keyValues; } @@ -79051,77 +77910,59 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IParticipationDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IParticipationDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem) target, null); } + void IChildEntity.SetParent(object value) + { + ObjectiveAssessment = (ObjectiveAssessment) value; + } } -} -// Aggregate: ParticipationStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ParticipationStatusDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ParticipationStatusDescriptor table of the ParticipationStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ObjectiveAssessmentLearningStandard table of the ObjectiveAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ParticipationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IParticipationStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ObjectiveAssessmentLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IObjectiveAssessmentLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ObjectiveAssessmentLearningStandard() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int ParticipationStatusDescriptorId + [DomainSignature, JsonIgnore] + public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } + + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.ObjectiveAssessment { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return ObjectiveAssessment; } + set { ObjectiveAssessment = (ObjectiveAssessment) value; } } - + + [DomainSignature] + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -79137,11 +77978,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardDiscriminator + { + get { return LearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardResourceId + { + get { return LearningStandardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -79162,11 +78052,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ParticipationStatusDescriptorId", ParticipationStatusDescriptorId); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -79230,82 +78120,169 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IParticipationStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IParticipationStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard) target, null); } + void IChildEntity.SetParent(object value) + { + ObjectiveAssessment = (ObjectiveAssessment) value; + } } -} -// Aggregate: PerformanceBaseConversionDescriptor - -namespace EdFi.Ods.Entities.NHibernate.PerformanceBaseConversionDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PerformanceBaseConversionDescriptor table of the PerformanceBaseConversionDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ObjectiveAssessmentPerformanceLevel table of the ObjectiveAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PerformanceBaseConversionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPerformanceBaseConversionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ObjectiveAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PerformanceBaseConversionDescriptorId + public ObjectiveAssessmentPerformanceLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description + [DomainSignature, JsonIgnore] + public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } + + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentPerformanceLevel.ObjectiveAssessment { - get { return Description; } - set { Description = value; } + get { return ObjectiveAssessment; } + set { ObjectiveAssessment = (ObjectiveAssessment) value; } } - DateTime? IDescriptor.EffectiveBeginDate + + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; + + public virtual string AssessmentReportingMethodDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } } - string IDescriptor.Namespace + [DomainSignature] + public virtual int PerformanceLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_performanceLevelDescriptorId == default(int)) + _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); + + return _performanceLevelDescriptorId; + } + set + { + _performanceLevelDescriptorId = value; + _performanceLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _performanceLevelDescriptorId; + private string _performanceLevelDescriptor; + + public virtual string PerformanceLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_performanceLevelDescriptor == null) + _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); + + return _performanceLevelDescriptor; + } + set + { + _performanceLevelDescriptor = value; + _performanceLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string MaximumScore { get; set; } + public virtual string MinimumScore { get; set; } + public virtual string PerformanceLevelIndicatorName { get; set; } + public virtual int? ResultDatatypeTypeDescriptorId + { + get + { + if (_resultDatatypeTypeDescriptorId == default(int?)) + _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + + return _resultDatatypeTypeDescriptorId; + } + set + { + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; + } + } + + private int? _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; + + public virtual string ResultDatatypeTypeDescriptor + { + get + { + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); + + return _resultDatatypeTypeDescriptor; + } + set + { + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -79316,6 +78293,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -79331,6 +78337,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -79341,11 +78350,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("PerformanceBaseConversionDescriptorId", PerformanceBaseConversionDescriptorId); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); return keyValues; } @@ -79409,82 +78419,133 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPerformanceBaseConversionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPerformanceBaseConversionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel) target, null); } + void IChildEntity.SetParent(object value) + { + ObjectiveAssessment = (ObjectiveAssessment) value; + } } -} -// Aggregate: PerformanceLevelDescriptor - -namespace EdFi.Ods.Entities.NHibernate.PerformanceLevelDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PerformanceLevelDescriptor table of the PerformanceLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ObjectiveAssessmentScore table of the ObjectiveAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PerformanceLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPerformanceLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ObjectiveAssessmentScore : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IObjectiveAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PerformanceLevelDescriptorId + public ObjectiveAssessmentScore() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } + + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentScore.ObjectiveAssessment { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return ObjectiveAssessment; } + set { ObjectiveAssessment = (ObjectiveAssessment) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; + + public virtual string AssessmentReportingMethodDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string MaximumScore { get; set; } + public virtual string MinimumScore { get; set; } + public virtual int? ResultDatatypeTypeDescriptorId + { + get + { + if (_resultDatatypeTypeDescriptorId == default(int?)) + _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + + return _resultDatatypeTypeDescriptorId; + } + set + { + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; + } + } + + private int? _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; + + public virtual string ResultDatatypeTypeDescriptor + { + get + { + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); + + return _resultDatatypeTypeDescriptor; + } + set + { + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -79495,6 +78556,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -79510,6 +78600,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -79520,11 +78612,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); return keyValues; } @@ -79588,30 +78680,34 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPerformanceLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IObjectiveAssessmentScore)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPerformanceLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IObjectiveAssessmentScore) target, null); } + void IChildEntity.SetParent(object value) + { + ObjectiveAssessment = (ObjectiveAssessment) value; + } } } -// Aggregate: Person +// Aggregate: OpenStaffPosition -namespace EdFi.Ods.Entities.NHibernate.PersonAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.OpenStaffPositionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class PersonReferenceData : IHasPrimaryKeyValues + public class OpenStaffPositionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string PersonId { get; set; } - public virtual int SourceSystemDescriptorId { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual string RequisitionNumber { get; set; } // ------------------------------------------------------------- /// @@ -79632,8 +78728,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PersonId", PersonId); - keyValues.Add("SourceSystemDescriptorId", SourceSystemDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("RequisitionNumber", RequisitionNumber); return keyValues; } @@ -79684,19 +78780,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Person table of the Person aggregate in the ODS database. + /// A class which represents the edfi.OpenStaffPosition table of the OpenStaffPosition aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Person : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IPerson, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class OpenStaffPosition : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IOpenStaffPosition, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Person() + public OpenStaffPosition() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + OpenStaffPositionAcademicSubjects = new HashSet(); + OpenStaffPositionInstructionalGradeLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -79705,52 +78803,184 @@ public Person() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string PersonId { get; set; } + public virtual long EducationOrganizationId { get; set; } [DomainSignature] - public virtual int SourceSystemDescriptorId - { - get - { - if (_sourceSystemDescriptorId == default(int)) - _sourceSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SourceSystemDescriptor", _sourceSystemDescriptor); + public virtual string RequisitionNumber { get; set; } + // ------------------------------------------------------------- - return _sourceSystemDescriptorId; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime DatePosted + { + get { return _datePosted; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _datePosted = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _datePosted; + + public virtual DateTime? DatePostingRemoved + { + get { return _datePostingRemoved; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _datePostingRemoved = null; + } else + { + var given = (DateTime) value; + _datePostingRemoved = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _datePostingRemoved; + + public virtual int EmploymentStatusDescriptorId + { + get + { + if (_employmentStatusDescriptorId == default(int)) + _employmentStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EmploymentStatusDescriptor", _employmentStatusDescriptor); + + return _employmentStatusDescriptorId; } set { - _sourceSystemDescriptorId = value; - _sourceSystemDescriptor = null; + _employmentStatusDescriptorId = value; + _employmentStatusDescriptor = null; } } - private int _sourceSystemDescriptorId; - private string _sourceSystemDescriptor; + private int _employmentStatusDescriptorId; + private string _employmentStatusDescriptor; - public virtual string SourceSystemDescriptor + public virtual string EmploymentStatusDescriptor { get { - if (_sourceSystemDescriptor == null) - _sourceSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SourceSystemDescriptor", _sourceSystemDescriptorId); + if (_employmentStatusDescriptor == null) + _employmentStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EmploymentStatusDescriptor", _employmentStatusDescriptorId); - return _sourceSystemDescriptor; + return _employmentStatusDescriptor; } set { - _sourceSystemDescriptor = value; - _sourceSystemDescriptorId = default(int); + _employmentStatusDescriptor = value; + _employmentStatusDescriptorId = default(int); } } - // ------------------------------------------------------------- + public virtual string PositionTitle { get; set; } + public virtual int? PostingResultDescriptorId + { + get + { + if (_postingResultDescriptorId == default(int?)) + _postingResultDescriptorId = string.IsNullOrWhiteSpace(_postingResultDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PostingResultDescriptor", _postingResultDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _postingResultDescriptorId; + } + set + { + _postingResultDescriptorId = value; + _postingResultDescriptor = null; + } + } - // ============================================================= - // Properties - // ------------------------------------------------------------- + private int? _postingResultDescriptorId; + private string _postingResultDescriptor; + + public virtual string PostingResultDescriptor + { + get + { + if (_postingResultDescriptor == null) + _postingResultDescriptor = _postingResultDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PostingResultDescriptor", _postingResultDescriptorId.Value); + + return _postingResultDescriptor; + } + set + { + _postingResultDescriptor = value; + _postingResultDescriptorId = default(int?); + } + } + public virtual int? ProgramAssignmentDescriptorId + { + get + { + if (_programAssignmentDescriptorId == default(int?)) + _programAssignmentDescriptorId = string.IsNullOrWhiteSpace(_programAssignmentDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramAssignmentDescriptor", _programAssignmentDescriptor); + + return _programAssignmentDescriptorId; + } + set + { + _programAssignmentDescriptorId = value; + _programAssignmentDescriptor = null; + } + } + + private int? _programAssignmentDescriptorId; + private string _programAssignmentDescriptor; + + public virtual string ProgramAssignmentDescriptor + { + get + { + if (_programAssignmentDescriptor == null) + _programAssignmentDescriptor = _programAssignmentDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramAssignmentDescriptor", _programAssignmentDescriptorId.Value); + + return _programAssignmentDescriptor; + } + set + { + _programAssignmentDescriptor = value; + _programAssignmentDescriptorId = default(int?); + } + } + public virtual int StaffClassificationDescriptorId + { + get + { + if (_staffClassificationDescriptorId == default(int)) + _staffClassificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StaffClassificationDescriptor", _staffClassificationDescriptor); + + return _staffClassificationDescriptorId; + } + set + { + _staffClassificationDescriptorId = value; + _staffClassificationDescriptor = null; + } + } + + private int _staffClassificationDescriptorId; + private string _staffClassificationDescriptor; + + public virtual string StaffClassificationDescriptor + { + get + { + if (_staffClassificationDescriptor == null) + _staffClassificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StaffClassificationDescriptor", _staffClassificationDescriptorId); + + return _staffClassificationDescriptor; + } + set + { + _staffClassificationDescriptor = value; + _staffClassificationDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -79795,197 +79025,134 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "SourceSystemDescriptor", new LookupColumnDetails { PropertyName = "SourceSystemDescriptorId", LookupTypeName = "SourceSystemDescriptor"} }, - }; + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationDiscriminator { - get { return _idPropertyByLookupProperty; } + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationResourceId { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("PersonId", PersonId); - keyValues.Add("SourceSystemDescriptorId", SourceSystemDescriptorId); - - return keyValues; + get { return EducationOrganizationReferenceData?.Id; } + set { } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; + // ------------------------------------------------------------- - if (compareTo == null) - return false; + //============================================================= + // Collections + // ------------------------------------------------------------- - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + private ICollection _openStaffPositionAcademicSubjects; + private ICollection _openStaffPositionAcademicSubjectsCovariant; + public virtual ICollection OpenStaffPositionAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _openStaffPositionAcademicSubjects) + if (item.OpenStaffPosition == null) + item.OpenStaffPosition = this; + // ------------------------------------------------------------- - foreach (DictionaryEntry entry in theseKeys) + return _openStaffPositionAcademicSubjects; + } + set { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + _openStaffPositionAcademicSubjects = value; + _openStaffPositionAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); } - - return true; } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionAcademicSubjects { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _openStaffPositionAcademicSubjects) + if (item.OpenStaffPosition == null) + item.OpenStaffPosition = this; + // ------------------------------------------------------------- - foreach (DictionaryEntry entry in keyValues) + return _openStaffPositionAcademicSubjectsCovariant; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + OpenStaffPositionAcademicSubjects = new HashSet(value.Cast()); } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IPerson)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IPerson) target, null); } - } -} -// Aggregate: PersonalInformationVerificationDescriptor - -namespace EdFi.Ods.Entities.NHibernate.PersonalInformationVerificationDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.PersonalInformationVerificationDescriptor table of the PersonalInformationVerificationDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class PersonalInformationVerificationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPersonalInformationVerificationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PersonalInformationVerificationDescriptorId + private ICollection _openStaffPositionInstructionalGradeLevels; + private ICollection _openStaffPositionInstructionalGradeLevelsCovariant; + public virtual ICollection OpenStaffPositionInstructionalGradeLevels { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _openStaffPositionInstructionalGradeLevels) + if (item.OpenStaffPosition == null) + item.OpenStaffPosition = this; + // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + return _openStaffPositionInstructionalGradeLevels; + } + set + { + _openStaffPositionInstructionalGradeLevels = value; + _openStaffPositionInstructionalGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionInstructionalGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _openStaffPositionInstructionalGradeLevels) + if (item.OpenStaffPosition == null) + item.OpenStaffPosition = this; + // ------------------------------------------------------------- - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _openStaffPositionInstructionalGradeLevelsCovariant; + } + set + { + OpenStaffPositionInstructionalGradeLevels = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "EmploymentStatusDescriptor", new LookupColumnDetails { PropertyName = "EmploymentStatusDescriptorId", LookupTypeName = "EmploymentStatusDescriptor"} }, + { "PostingResultDescriptor", new LookupColumnDetails { PropertyName = "PostingResultDescriptorId", LookupTypeName = "PostingResultDescriptor"} }, + { "ProgramAssignmentDescriptor", new LookupColumnDetails { PropertyName = "ProgramAssignmentDescriptorId", LookupTypeName = "ProgramAssignmentDescriptor"} }, + { "StaffClassificationDescriptor", new LookupColumnDetails { PropertyName = "StaffClassificationDescriptorId", LookupTypeName = "StaffClassificationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -80000,7 +79167,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("RequisitionNumber", RequisitionNumber); return keyValues; } @@ -80064,79 +79232,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPersonalInformationVerificationDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOpenStaffPosition)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPersonalInformationVerificationDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IOpenStaffPosition) target, null); } } -} -// Aggregate: PlatformTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.PlatformTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PlatformTypeDescriptor table of the PlatformTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.OpenStaffPositionAcademicSubject table of the OpenStaffPosition aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PlatformTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPlatformTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class OpenStaffPositionAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IOpenStaffPositionAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PlatformTypeDescriptorId + public OpenStaffPositionAcademicSubject() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual OpenStaffPosition OpenStaffPosition { get; set; } + + Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionAcademicSubject.OpenStaffPosition { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return OpenStaffPosition; } + set { OpenStaffPosition = (OpenStaffPosition) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int AcademicSubjectDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + public virtual string AcademicSubjectDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -80150,6 +79329,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -80165,6 +79373,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -80175,11 +79384,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("PlatformTypeDescriptorId", PlatformTypeDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -80243,79 +79452,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPlatformTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPlatformTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject) target, null); } + void IChildEntity.SetParent(object value) + { + OpenStaffPosition = (OpenStaffPosition) value; + } } -} -// Aggregate: PopulationServedDescriptor - -namespace EdFi.Ods.Entities.NHibernate.PopulationServedDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PopulationServedDescriptor table of the PopulationServedDescriptor aggregate in the ODS database. + /// A class which represents the edfi.OpenStaffPositionInstructionalGradeLevel table of the OpenStaffPosition aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PopulationServedDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPopulationServedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class OpenStaffPositionInstructionalGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PopulationServedDescriptorId + public OpenStaffPositionInstructionalGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual OpenStaffPosition OpenStaffPosition { get; set; } + + Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionInstructionalGradeLevel.OpenStaffPosition { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return OpenStaffPosition; } + set { OpenStaffPosition = (OpenStaffPosition) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -80329,6 +79553,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -80344,6 +79597,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -80354,11 +79608,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -80422,37 +79676,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPopulationServedDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPopulationServedDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + OpenStaffPosition = (OpenStaffPosition) value; + } } } -// Aggregate: PostingResultDescriptor +// Aggregate: OperationalStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.PostingResultDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.OperationalStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PostingResultDescriptor table of the PostingResultDescriptor aggregate in the ODS database. + /// A class which represents the edfi.OperationalStatusDescriptor table of the OperationalStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PostingResultDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPostingResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class OperationalStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IOperationalStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int PostingResultDescriptorId + public virtual int OperationalStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -80537,7 +79795,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PostingResultDescriptorId", PostingResultDescriptorId); + keyValues.Add("OperationalStatusDescriptorId", OperationalStatusDescriptorId); return keyValues; } @@ -80601,31 +79859,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPostingResultDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOperationalStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPostingResultDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IOperationalStatusDescriptor) target, null); } } } -// Aggregate: PostSecondaryEvent +// Aggregate: OperationalUnitDimension -namespace EdFi.Ods.Entities.NHibernate.PostSecondaryEventAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.OperationalUnitDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class PostSecondaryEventReferenceData : IHasPrimaryKeyValues + public class OperationalUnitDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual DateTime EventDate { get; set; } - public virtual int PostSecondaryEventCategoryDescriptorId { get; set; } - public virtual int StudentUSI { get; set; } + public virtual string Code { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// @@ -80646,9 +79903,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EventDate", EventDate); - keyValues.Add("PostSecondaryEventCategoryDescriptorId", PostSecondaryEventCategoryDescriptorId); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -80699,19 +79955,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PostSecondaryEvent table of the PostSecondaryEvent aggregate in the ODS database. + /// A class which represents the edfi.OperationalUnitDimension table of the OperationalUnitDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PostSecondaryEvent : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IPostSecondaryEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class OperationalUnitDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IOperationalUnitDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public PostSecondaryEvent() + public OperationalUnitDimension() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + OperationalUnitDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -80720,99 +79977,9 @@ public PostSecondaryEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual DateTime EventDate - { - get { return _eventDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _eventDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _eventDate; - + public virtual string Code { get; set; } [DomainSignature] - public virtual int PostSecondaryEventCategoryDescriptorId - { - get - { - if (_postSecondaryEventCategoryDescriptorId == default(int)) - _postSecondaryEventCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PostSecondaryEventCategoryDescriptor", _postSecondaryEventCategoryDescriptor); - - return _postSecondaryEventCategoryDescriptorId; - } - set - { - _postSecondaryEventCategoryDescriptorId = value; - _postSecondaryEventCategoryDescriptor = null; - } - } - - private int _postSecondaryEventCategoryDescriptorId; - private string _postSecondaryEventCategoryDescriptor; - - public virtual string PostSecondaryEventCategoryDescriptor - { - get - { - if (_postSecondaryEventCategoryDescriptor == null) - _postSecondaryEventCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PostSecondaryEventCategoryDescriptor", _postSecondaryEventCategoryDescriptorId); - - return _postSecondaryEventCategoryDescriptor; - } - set - { - _postSecondaryEventCategoryDescriptor = value; - _postSecondaryEventCategoryDescriptorId = default(int); - } - } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId - { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } - } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -80823,7 +79990,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- - public virtual long? PostSecondaryInstitutionId { get; set; } + public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -80868,48 +80035,63 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData PostSecondaryInstitutionReferenceData { get; set; } - - /// - /// Read-only property that allows the PostSecondaryInstitution resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IPostSecondaryEvent.PostSecondaryInstitutionResourceId - { - get { return PostSecondaryInstitutionReferenceData?.Id; } - set { } - } + // ------------------------------------------------------------- - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + //============================================================= + // Collections + // ------------------------------------------------------------- - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IPostSecondaryEvent.StudentDiscriminator + private ICollection _operationalUnitDimensionReportingTags; + private ICollection _operationalUnitDimensionReportingTagsCovariant; + public virtual ICollection OperationalUnitDimensionReportingTags { - get { return StudentReferenceData?.Discriminator; } - set { } + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _operationalUnitDimensionReportingTags) + if (item.OperationalUnitDimension == null) + item.OperationalUnitDimension = this; + // ------------------------------------------------------------- + + return _operationalUnitDimensionReportingTags; + } + set + { + _operationalUnitDimensionReportingTags = value; + _operationalUnitDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); + } } - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IPostSecondaryEvent.StudentResourceId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IOperationalUnitDimension.OperationalUnitDimensionReportingTags { - get { return StudentReferenceData?.Id; } - set { } - } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _operationalUnitDimensionReportingTags) + if (item.OperationalUnitDimension == null) + item.OperationalUnitDimension = this; + // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _operationalUnitDimensionReportingTagsCovariant; + } + set + { + OperationalUnitDimensionReportingTags = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "PostSecondaryEventCategoryDescriptor", new LookupColumnDetails { PropertyName = "PostSecondaryEventCategoryDescriptorId", LookupTypeName = "PostSecondaryEventCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -80924,9 +80106,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EventDate", EventDate); - keyValues.Add("PostSecondaryEventCategoryDescriptorId", PostSecondaryEventCategoryDescriptorId); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -80990,79 +80171,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryEvent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOperationalUnitDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPostSecondaryEvent) target, null); + this.MapTo((Entities.Common.EdFi.IOperationalUnitDimension) target, null); } } -} -// Aggregate: PostSecondaryEventCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.PostSecondaryEventCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PostSecondaryEventCategoryDescriptor table of the PostSecondaryEventCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.OperationalUnitDimensionReportingTag table of the OperationalUnitDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PostSecondaryEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class OperationalUnitDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IOperationalUnitDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PostSecondaryEventCategoryDescriptorId + public OperationalUnitDimensionReportingTag() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue + [DomainSignature, JsonIgnore] + public virtual OperationalUnitDimension OperationalUnitDimension { get; set; } + + Entities.Common.EdFi.IOperationalUnitDimension IOperationalUnitDimensionReportingTag.OperationalUnitDimension { - get { return CodeValue; } - set { CodeValue = value; } + get { return OperationalUnitDimension; } + set { OperationalUnitDimension = (OperationalUnitDimension) value; } } - string IDescriptor.Description + + [DomainSignature] + public virtual int ReportingTagDescriptorId { - get { return Description; } - set { Description = value; } + get + { + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + + return _reportingTagDescriptorId; + } + set + { + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; + } } - DateTime? IDescriptor.EffectiveBeginDate + + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; + + public virtual string ReportingTagDescriptor { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + + return _reportingTagDescriptor; + } + set + { + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -81076,6 +80268,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -81091,6 +80312,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -81101,11 +80323,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (OperationalUnitDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("PostSecondaryEventCategoryDescriptorId", PostSecondaryEventCategoryDescriptorId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -81169,36 +80391,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag) target, null); } + void IChildEntity.SetParent(object value) + { + OperationalUnitDimension = (OperationalUnitDimension) value; + } } } -// Aggregate: PostSecondaryInstitution +// Aggregate: OrganizationDepartment -namespace EdFi.Ods.Entities.NHibernate.PostSecondaryInstitutionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.OrganizationDepartmentAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PostSecondaryInstitution table of the PostSecondaryInstitution aggregate in the ODS database. + /// A class which represents the edfi.OrganizationDepartment table of the OrganizationDepartment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PostSecondaryInstitution : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.IPostSecondaryInstitution, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class OrganizationDepartment : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.IOrganizationDepartment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public PostSecondaryInstitution() + public OrganizationDepartment() { - PostSecondaryInstitutionMediumOfInstructions = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -81207,7 +80432,7 @@ public PostSecondaryInstitution() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long PostSecondaryInstitutionId + public virtual long OrganizationDepartmentId { get { return base.EducationOrganizationId; } set { base.EducationOrganizationId = value; } @@ -81243,74 +80468,41 @@ string IEducationOrganization.WebSite // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AdministrativeFundingControlDescriptorId - { - get - { - if (_administrativeFundingControlDescriptorId == default(int?)) - _administrativeFundingControlDescriptorId = string.IsNullOrWhiteSpace(_administrativeFundingControlDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptor); - - return _administrativeFundingControlDescriptorId; - } - set - { - _administrativeFundingControlDescriptorId = value; - _administrativeFundingControlDescriptor = null; - } - } - - private int? _administrativeFundingControlDescriptorId; - private string _administrativeFundingControlDescriptor; - - public virtual string AdministrativeFundingControlDescriptor - { - get - { - if (_administrativeFundingControlDescriptor == null) - _administrativeFundingControlDescriptor = _administrativeFundingControlDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptorId.Value); - - return _administrativeFundingControlDescriptor; - } - set - { - _administrativeFundingControlDescriptor = value; - _administrativeFundingControlDescriptorId = default(int?); - } - } - public virtual int? PostSecondaryInstitutionLevelDescriptorId + public virtual int? AcademicSubjectDescriptorId { get { - if (_postSecondaryInstitutionLevelDescriptorId == default(int?)) - _postSecondaryInstitutionLevelDescriptorId = string.IsNullOrWhiteSpace(_postSecondaryInstitutionLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PostSecondaryInstitutionLevelDescriptor", _postSecondaryInstitutionLevelDescriptor); + if (_academicSubjectDescriptorId == default(int?)) + _academicSubjectDescriptorId = string.IsNullOrWhiteSpace(_academicSubjectDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - return _postSecondaryInstitutionLevelDescriptorId; + return _academicSubjectDescriptorId; } set { - _postSecondaryInstitutionLevelDescriptorId = value; - _postSecondaryInstitutionLevelDescriptor = null; + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; } } - private int? _postSecondaryInstitutionLevelDescriptorId; - private string _postSecondaryInstitutionLevelDescriptor; + private int? _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; - public virtual string PostSecondaryInstitutionLevelDescriptor + public virtual string AcademicSubjectDescriptor { get { - if (_postSecondaryInstitutionLevelDescriptor == null) - _postSecondaryInstitutionLevelDescriptor = _postSecondaryInstitutionLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PostSecondaryInstitutionLevelDescriptor", _postSecondaryInstitutionLevelDescriptorId.Value); + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = _academicSubjectDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId.Value); - return _postSecondaryInstitutionLevelDescriptor; + return _academicSubjectDescriptor; } set { - _postSecondaryInstitutionLevelDescriptor = value; - _postSecondaryInstitutionLevelDescriptorId = default(int?); + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int?); } } + public virtual long? ParentEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -81355,66 +80547,38 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParentEducationOrganizationReferenceData { get; set; } - private ICollection _postSecondaryInstitutionMediumOfInstructions; - private ICollection _postSecondaryInstitutionMediumOfInstructionsCovariant; - public virtual ICollection PostSecondaryInstitutionMediumOfInstructions + /// + /// Read-only property that allows the ParentEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationDiscriminator { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _postSecondaryInstitutionMediumOfInstructions) - if (item.PostSecondaryInstitution == null) - item.PostSecondaryInstitution = this; - // ------------------------------------------------------------- - - return _postSecondaryInstitutionMediumOfInstructions; - } - set - { - _postSecondaryInstitutionMediumOfInstructions = value; - _postSecondaryInstitutionMediumOfInstructionsCovariant = new CovariantCollectionAdapter(value); - } + get { return ParentEducationOrganizationReferenceData?.Discriminator; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IPostSecondaryInstitution.PostSecondaryInstitutionMediumOfInstructions + /// + /// Read-only property that allows the ParentEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationResourceId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _postSecondaryInstitutionMediumOfInstructions) - if (item.PostSecondaryInstitution == null) - item.PostSecondaryInstitution = this; - // ------------------------------------------------------------- - - return _postSecondaryInstitutionMediumOfInstructionsCovariant; - } - set - { - PostSecondaryInstitutionMediumOfInstructions = new HashSet(value.Cast()); - } + get { return ParentEducationOrganizationReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AdministrativeFundingControlDescriptor", new LookupColumnDetails { PropertyName = "AdministrativeFundingControlDescriptorId", LookupTypeName = "AdministrativeFundingControlDescriptor"} }, + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, - { "PostSecondaryInstitutionLevelDescriptor", new LookupColumnDetails { PropertyName = "PostSecondaryInstitutionLevelDescriptorId", LookupTypeName = "PostSecondaryInstitutionLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -81429,7 +80593,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PostSecondaryInstitutionId", PostSecondaryInstitutionId); + keyValues.Add("OrganizationDepartmentId", OrganizationDepartmentId); return keyValues; } @@ -81493,88 +80657,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryInstitution)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOrganizationDepartment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPostSecondaryInstitution) target, null); + this.MapTo((Entities.Common.EdFi.IOrganizationDepartment) target, null); } } +} +// Aggregate: OtherNameTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.OtherNameTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PostSecondaryInstitutionMediumOfInstruction table of the PostSecondaryInstitution aggregate in the ODS database. + /// A class which represents the edfi.OtherNameTypeDescriptor table of the OtherNameTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionMediumOfInstruction : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class OtherNameTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IOtherNameTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public PostSecondaryInstitutionMediumOfInstruction() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual PostSecondaryInstitution PostSecondaryInstitution { get; set; } - - Entities.Common.EdFi.IPostSecondaryInstitution IPostSecondaryInstitutionMediumOfInstruction.PostSecondaryInstitution - { - get { return PostSecondaryInstitution; } - set { PostSecondaryInstitution = (PostSecondaryInstitution) value; } - } - [DomainSignature] - public virtual int MediumOfInstructionDescriptorId - { - get - { - if (_mediumOfInstructionDescriptorId == default(int)) - _mediumOfInstructionDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptor); - - return _mediumOfInstructionDescriptorId; - } - set - { - _mediumOfInstructionDescriptorId = value; - _mediumOfInstructionDescriptor = null; - } - } - - private int _mediumOfInstructionDescriptorId; - private string _mediumOfInstructionDescriptor; - - public virtual string MediumOfInstructionDescriptor + public virtual int OtherNameTypeDescriptorId { - get - { - if (_mediumOfInstructionDescriptor == null) - _mediumOfInstructionDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptorId); - - return _mediumOfInstructionDescriptor; - } - set - { - _mediumOfInstructionDescriptor = value; - _mediumOfInstructionDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -81590,35 +80743,6 @@ public virtual string MediumOfInstructionDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -81634,7 +80758,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "MediumOfInstructionDescriptor", new LookupColumnDetails { PropertyName = "MediumOfInstructionDescriptorId", LookupTypeName = "MediumOfInstructionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -81645,11 +80768,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (PostSecondaryInstitution as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("MediumOfInstructionDescriptorId", MediumOfInstructionDescriptorId); + keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); return keyValues; } @@ -81713,41 +80836,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)target); + return this.SynchronizeTo((Entities.Common.EdFi.IOtherNameTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction) target, null); + this.MapTo((Entities.Common.EdFi.IOtherNameTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - PostSecondaryInstitution = (PostSecondaryInstitution) value; - } } } -// Aggregate: PostSecondaryInstitutionLevelDescriptor +// Aggregate: ParticipationDescriptor -namespace EdFi.Ods.Entities.NHibernate.PostSecondaryInstitutionLevelDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ParticipationDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PostSecondaryInstitutionLevelDescriptor table of the PostSecondaryInstitutionLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ParticipationDescriptor table of the ParticipationDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ParticipationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IParticipationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int PostSecondaryInstitutionLevelDescriptorId + public virtual int ParticipationDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -81832,7 +80951,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PostSecondaryInstitutionLevelDescriptorId", PostSecondaryInstitutionLevelDescriptorId); + keyValues.Add("ParticipationDescriptorId", ParticipationDescriptorId); return keyValues; } @@ -81896,216 +81015,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor) target, null); - } - - } -} -// Aggregate: PrimaryLearningDeviceAccessDescriptor - -namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceAccessDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.PrimaryLearningDeviceAccessDescriptor table of the PrimaryLearningDeviceAccessDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceAccessDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PrimaryLearningDeviceAccessDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("PrimaryLearningDeviceAccessDescriptorId", PrimaryLearningDeviceAccessDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IParticipationDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IParticipationDescriptor) target, null); } } } -// Aggregate: PrimaryLearningDeviceAwayFromSchoolDescriptor +// Aggregate: ParticipationStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceAwayFromSchoolDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ParticipationStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PrimaryLearningDeviceAwayFromSchoolDescriptor table of the PrimaryLearningDeviceAwayFromSchoolDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ParticipationStatusDescriptor table of the ParticipationStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceAwayFromSchoolDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ParticipationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IParticipationStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int PrimaryLearningDeviceAwayFromSchoolDescriptorId + public virtual int ParticipationStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -82190,7 +81130,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PrimaryLearningDeviceAwayFromSchoolDescriptorId", PrimaryLearningDeviceAwayFromSchoolDescriptorId); + keyValues.Add("ParticipationStatusDescriptorId", ParticipationStatusDescriptorId); return keyValues; } @@ -82254,37 +81194,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IParticipationStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IParticipationStatusDescriptor) target, null); } } } -// Aggregate: PrimaryLearningDeviceProviderDescriptor +// Aggregate: PerformanceBaseConversionDescriptor -namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceProviderDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PerformanceBaseConversionDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PrimaryLearningDeviceProviderDescriptor table of the PrimaryLearningDeviceProviderDescriptor aggregate in the ODS database. + /// A class which represents the edfi.PerformanceBaseConversionDescriptor table of the PerformanceBaseConversionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceProviderDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class PerformanceBaseConversionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPerformanceBaseConversionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int PrimaryLearningDeviceProviderDescriptorId + public virtual int PerformanceBaseConversionDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -82369,7 +81309,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PrimaryLearningDeviceProviderDescriptorId", PrimaryLearningDeviceProviderDescriptorId); + keyValues.Add("PerformanceBaseConversionDescriptorId", PerformanceBaseConversionDescriptorId); return keyValues; } @@ -82433,37 +81373,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPerformanceBaseConversionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IPerformanceBaseConversionDescriptor) target, null); } } } -// Aggregate: ProficiencyDescriptor +// Aggregate: PerformanceLevelDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProficiencyDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PerformanceLevelDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProficiencyDescriptor table of the ProficiencyDescriptor aggregate in the ODS database. + /// A class which represents the edfi.PerformanceLevelDescriptor table of the PerformanceLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProficiencyDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProficiencyDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class PerformanceLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPerformanceLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ProficiencyDescriptorId + public virtual int PerformanceLevelDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -82548,7 +81488,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProficiencyDescriptorId", ProficiencyDescriptorId); + keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); return keyValues; } @@ -82612,31 +81552,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProficiencyDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPerformanceLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProficiencyDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IPerformanceLevelDescriptor) target, null); } } } -// Aggregate: Program +// Aggregate: Person -namespace EdFi.Ods.Entities.NHibernate.ProgramAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PersonAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ProgramReferenceData : IHasPrimaryKeyValues + public class PersonReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId { get; set; } + public virtual string PersonId { get; set; } + public virtual int SourceSystemDescriptorId { get; set; } // ------------------------------------------------------------- /// @@ -82657,9 +81596,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("PersonId", PersonId); + keyValues.Add("SourceSystemDescriptorId", SourceSystemDescriptorId); return keyValues; } @@ -82710,22 +81648,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Program table of the Program aggregate in the ODS database. + /// A class which represents the edfi.Person table of the Person aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Program : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Person : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IPerson, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Program() + public Person() { - ProgramCharacteristics = new HashSet(); - ProgramLearningStandards = new HashSet(); - ProgramSponsors = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -82734,42 +81669,40 @@ public Program() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramName { get; set; } + public virtual string PersonId { get; set; } [DomainSignature] - public virtual int ProgramTypeDescriptorId + public virtual int SourceSystemDescriptorId { get { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + if (_sourceSystemDescriptorId == default(int)) + _sourceSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SourceSystemDescriptor", _sourceSystemDescriptor); - return _programTypeDescriptorId; + return _sourceSystemDescriptorId; } set { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; + _sourceSystemDescriptorId = value; + _sourceSystemDescriptor = null; } } - private int _programTypeDescriptorId; - private string _programTypeDescriptor; + private int _sourceSystemDescriptorId; + private string _sourceSystemDescriptor; - public virtual string ProgramTypeDescriptor + public virtual string SourceSystemDescriptor { get { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + if (_sourceSystemDescriptor == null) + _sourceSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SourceSystemDescriptor", _sourceSystemDescriptorId); - return _programTypeDescriptor; + return _sourceSystemDescriptor; } set { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); + _sourceSystemDescriptor = value; + _sourceSystemDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -82782,7 +81715,6 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string ProgramId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82827,178 +81759,17 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IProgram.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IProgram.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _programCharacteristics; - private ICollection _programCharacteristicsCovariant; - public virtual ICollection ProgramCharacteristics - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programCharacteristics) - if (item.Program == null) - item.Program = this; - // ------------------------------------------------------------- - - return _programCharacteristics; - } - set - { - _programCharacteristics = value; - _programCharacteristicsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgram.ProgramCharacteristics - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programCharacteristics) - if (item.Program == null) - item.Program = this; - // ------------------------------------------------------------- - - return _programCharacteristicsCovariant; - } - set - { - ProgramCharacteristics = new HashSet(value.Cast()); - } - } - - - private ICollection _programLearningStandards; - private ICollection _programLearningStandardsCovariant; - public virtual ICollection ProgramLearningStandards - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programLearningStandards) - if (item.Program == null) - item.Program = this; - // ------------------------------------------------------------- - - return _programLearningStandards; - } - set - { - _programLearningStandards = value; - _programLearningStandardsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgram.ProgramLearningStandards - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programLearningStandards) - if (item.Program == null) - item.Program = this; - // ------------------------------------------------------------- - - return _programLearningStandardsCovariant; - } - set - { - ProgramLearningStandards = new HashSet(value.Cast()); - } - } - - - private ICollection _programSponsors; - private ICollection _programSponsorsCovariant; - public virtual ICollection ProgramSponsors - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programSponsors) - if (item.Program == null) - item.Program = this; - // ------------------------------------------------------------- - - return _programSponsors; - } - set - { - _programSponsors = value; - _programSponsorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgram.ProgramSponsors - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programSponsors) - if (item.Program == null) - item.Program = this; - // ------------------------------------------------------------- - - return _programSponsorsCovariant; - } - set - { - ProgramSponsors = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "SourceSystemDescriptor", new LookupColumnDetails { PropertyName = "SourceSystemDescriptorId", LookupTypeName = "SourceSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -83013,9 +81784,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("PersonId", PersonId); + keyValues.Add("SourceSystemDescriptorId", SourceSystemDescriptorId); return keyValues; } @@ -83079,280 +81849,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPerson)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgram) target, null); + this.MapTo((Entities.Common.EdFi.IPerson) target, null); } } +} +// Aggregate: PersonalInformationVerificationDescriptor + +namespace EdFi.Ods.Entities.NHibernate.PersonalInformationVerificationDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramCharacteristic table of the Program aggregate in the ODS database. + /// A class which represents the edfi.PersonalInformationVerificationDescriptor table of the PersonalInformationVerificationDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramCharacteristic : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProgramCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PersonalInformationVerificationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPersonalInformationVerificationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ProgramCharacteristic() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Program Program { get; set; } - - Entities.Common.EdFi.IProgram IProgramCharacteristic.Program - { - get { return Program; } - set { Program = (Program) value; } - } - [DomainSignature] - public virtual int ProgramCharacteristicDescriptorId - { - get - { - if (_programCharacteristicDescriptorId == default(int)) - _programCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramCharacteristicDescriptor", _programCharacteristicDescriptor); - - return _programCharacteristicDescriptorId; - } - set - { - _programCharacteristicDescriptorId = value; - _programCharacteristicDescriptor = null; - } - } - - private int _programCharacteristicDescriptorId; - private string _programCharacteristicDescriptor; - - public virtual string ProgramCharacteristicDescriptor + public virtual int PersonalInformationVerificationDescriptorId { - get - { - if (_programCharacteristicDescriptor == null) - _programCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramCharacteristicDescriptor", _programCharacteristicDescriptorId); - - return _programCharacteristicDescriptor; - } - set - { - _programCharacteristicDescriptor = value; - _programCharacteristicDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "ProgramCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "ProgramCharacteristicDescriptorId", LookupTypeName = "ProgramCharacteristicDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("ProgramCharacteristicDescriptorId", ProgramCharacteristicDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() + string IDescriptor.CodeValue { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); + get { return CodeValue; } + set { CodeValue = value; } } - #endregion - bool ISynchronizable.Synchronize(object target) + string IDescriptor.Description { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramCharacteristic)target); + get { return Description; } + set { Description = value; } } - - void IMappable.Map(object target) + DateTime? IDescriptor.EffectiveBeginDate { - this.MapTo((Entities.Common.EdFi.IProgramCharacteristic) target, null); + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - - void IChildEntity.SetParent(object value) + DateTime? IDescriptor.EffectiveEndDate { - Program = (Program) value; + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.ProgramLearningStandard table of the Program aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ProgramLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProgramLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ProgramLearningStandard() + string IDescriptor.Namespace { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return Namespace; } + set { Namespace = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Program Program { get; set; } - - Entities.Common.EdFi.IProgram IProgramLearningStandard.Program + string IDescriptor.ShortDescription { - get { return Program; } - set { Program = (Program) value; } + get { return ShortDescription; } + set { ShortDescription = value; } } - - [DomainSignature] - public virtual string LearningStandardId { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -83368,60 +81935,11 @@ Entities.Common.EdFi.IProgram IProgramLearningStandard.Program // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IProgramLearningStandard.LearningStandardResourceId - { - get { return LearningStandardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -83432,7 +81950,6 @@ string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardDiscriminat // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -83443,11 +81960,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); return keyValues; } @@ -83511,92 +82028,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPersonalInformationVerificationDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IPersonalInformationVerificationDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Program = (Program) value; - } } +} +// Aggregate: PlatformTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.PlatformTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramSponsor table of the Program aggregate in the ODS database. + /// A class which represents the edfi.PlatformTypeDescriptor table of the PlatformTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramSponsor : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProgramSponsor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PlatformTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPlatformTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ProgramSponsor() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Program Program { get; set; } - - Entities.Common.EdFi.IProgram IProgramSponsor.Program - { - get { return Program; } - set { Program = (Program) value; } - } - [DomainSignature] - public virtual int ProgramSponsorDescriptorId - { - get - { - if (_programSponsorDescriptorId == default(int)) - _programSponsorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramSponsorDescriptor", _programSponsorDescriptor); - - return _programSponsorDescriptorId; - } - set - { - _programSponsorDescriptorId = value; - _programSponsorDescriptor = null; - } - } - - private int _programSponsorDescriptorId; - private string _programSponsorDescriptor; - - public virtual string ProgramSponsorDescriptor + public virtual int PlatformTypeDescriptorId { - get - { - if (_programSponsorDescriptor == null) - _programSponsorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramSponsorDescriptor", _programSponsorDescriptorId); - - return _programSponsorDescriptor; - } - set - { - _programSponsorDescriptor = value; - _programSponsorDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -83612,35 +82114,6 @@ public virtual string ProgramSponsorDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -83656,8 +82129,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramSponsorDescriptor", new LookupColumnDetails { PropertyName = "ProgramSponsorDescriptorId", LookupTypeName = "ProgramSponsorDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -83668,11 +82139,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramSponsorDescriptorId", ProgramSponsorDescriptorId); + keyValues.Add("PlatformTypeDescriptorId", PlatformTypeDescriptorId); return keyValues; } @@ -83736,41 +82207,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramSponsor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPlatformTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramSponsor) target, null); + this.MapTo((Entities.Common.EdFi.IPlatformTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Program = (Program) value; - } } } -// Aggregate: ProgramAssignmentDescriptor +// Aggregate: PopulationServedDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProgramAssignmentDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PopulationServedDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramAssignmentDescriptor table of the ProgramAssignmentDescriptor aggregate in the ODS database. + /// A class which represents the edfi.PopulationServedDescriptor table of the PopulationServedDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramAssignmentDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgramAssignmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class PopulationServedDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPopulationServedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ProgramAssignmentDescriptorId + public virtual int PopulationServedDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -83855,7 +82322,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramAssignmentDescriptorId", ProgramAssignmentDescriptorId); + keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); return keyValues; } @@ -83919,37 +82386,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramAssignmentDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPopulationServedDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramAssignmentDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IPopulationServedDescriptor) target, null); } } } -// Aggregate: ProgramCharacteristicDescriptor +// Aggregate: PostingResultDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProgramCharacteristicDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PostingResultDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramCharacteristicDescriptor table of the ProgramCharacteristicDescriptor aggregate in the ODS database. + /// A class which represents the edfi.PostingResultDescriptor table of the PostingResultDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgramCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class PostingResultDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPostingResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ProgramCharacteristicDescriptorId + public virtual int PostingResultDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -84034,7 +82501,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramCharacteristicDescriptorId", ProgramCharacteristicDescriptorId); + keyValues.Add("PostingResultDescriptorId", PostingResultDescriptorId); return keyValues; } @@ -84098,30 +82565,31 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramCharacteristicDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPostingResultDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramCharacteristicDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IPostingResultDescriptor) target, null); } } } -// Aggregate: ProgramDimension +// Aggregate: PostSecondaryEvent -namespace EdFi.Ods.Entities.NHibernate.ProgramDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PostSecondaryEventAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ProgramDimensionReferenceData : IHasPrimaryKeyValues + public class PostSecondaryEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } + public virtual DateTime EventDate { get; set; } + public virtual int PostSecondaryEventCategoryDescriptorId { get; set; } + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// @@ -84142,8 +82610,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("EventDate", EventDate); + keyValues.Add("PostSecondaryEventCategoryDescriptorId", PostSecondaryEventCategoryDescriptorId); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -84194,20 +82663,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramDimension table of the ProgramDimension aggregate in the ODS database. + /// A class which represents the edfi.PostSecondaryEvent table of the PostSecondaryEvent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IProgramDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PostSecondaryEvent : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IPostSecondaryEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ProgramDimension() + public PostSecondaryEvent() { - ProgramDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -84216,9 +82684,99 @@ public ProgramDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string Code { get; set; } + public virtual DateTime EventDate + { + get { return _eventDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _eventDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _eventDate; + [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual int PostSecondaryEventCategoryDescriptorId + { + get + { + if (_postSecondaryEventCategoryDescriptorId == default(int)) + _postSecondaryEventCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PostSecondaryEventCategoryDescriptor", _postSecondaryEventCategoryDescriptor); + + return _postSecondaryEventCategoryDescriptorId; + } + set + { + _postSecondaryEventCategoryDescriptorId = value; + _postSecondaryEventCategoryDescriptor = null; + } + } + + private int _postSecondaryEventCategoryDescriptorId; + private string _postSecondaryEventCategoryDescriptor; + + public virtual string PostSecondaryEventCategoryDescriptor + { + get + { + if (_postSecondaryEventCategoryDescriptor == null) + _postSecondaryEventCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PostSecondaryEventCategoryDescriptor", _postSecondaryEventCategoryDescriptorId); + + return _postSecondaryEventCategoryDescriptor; + } + set + { + _postSecondaryEventCategoryDescriptor = value; + _postSecondaryEventCategoryDescriptorId = default(int); + } + } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI + { + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } + + private int _studentUSI; + private string _studentUniqueId; + + public virtual string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -84229,7 +82787,7 @@ public ProgramDimension() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CodeName { get; set; } + public virtual long? PostSecondaryInstitutionId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -84274,63 +82832,48 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData PostSecondaryInstitutionReferenceData { get; set; } - private ICollection _programDimensionReportingTags; - private ICollection _programDimensionReportingTagsCovariant; - public virtual ICollection ProgramDimensionReportingTags + /// + /// Read-only property that allows the PostSecondaryInstitution resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IPostSecondaryEvent.PostSecondaryInstitutionResourceId { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programDimensionReportingTags) - if (item.ProgramDimension == null) - item.ProgramDimension = this; - // ------------------------------------------------------------- - - return _programDimensionReportingTags; - } - set - { - _programDimensionReportingTags = value; - _programDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } + get { return PostSecondaryInstitutionReferenceData?.Id; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramDimension.ProgramDimensionReportingTags + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IPostSecondaryEvent.StudentDiscriminator { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programDimensionReportingTags) - if (item.ProgramDimension == null) - item.ProgramDimension = this; - // ------------------------------------------------------------- + get { return StudentReferenceData?.Discriminator; } + set { } + } - return _programDimensionReportingTagsCovariant; - } - set - { - ProgramDimensionReportingTags = new HashSet(value.Cast()); - } + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IPostSecondaryEvent.StudentResourceId + { + get { return StudentReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "PostSecondaryEventCategoryDescriptor", new LookupColumnDetails { PropertyName = "PostSecondaryEventCategoryDescriptorId", LookupTypeName = "PostSecondaryEventCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -84345,8 +82888,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("EventDate", EventDate); + keyValues.Add("PostSecondaryEventCategoryDescriptorId", PostSecondaryEventCategoryDescriptorId); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -84410,88 +82954,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryEvent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramDimension) target, null); + this.MapTo((Entities.Common.EdFi.IPostSecondaryEvent) target, null); } } +} +// Aggregate: PostSecondaryEventCategoryDescriptor + +namespace EdFi.Ods.Entities.NHibernate.PostSecondaryEventCategoryDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramDimensionReportingTag table of the ProgramDimension aggregate in the ODS database. + /// A class which represents the edfi.PostSecondaryEventCategoryDescriptor table of the PostSecondaryEventCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProgramDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PostSecondaryEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ProgramDimensionReportingTag() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ProgramDimension ProgramDimension { get; set; } - - Entities.Common.EdFi.IProgramDimension IProgramDimensionReportingTag.ProgramDimension - { - get { return ProgramDimension; } - set { ProgramDimension = (ProgramDimension) value; } - } - [DomainSignature] - public virtual int ReportingTagDescriptorId - { - get - { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - - return _reportingTagDescriptorId; - } - set - { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; - } - } - - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; - - public virtual string ReportingTagDescriptor + public virtual int PostSecondaryEventCategoryDescriptorId { - get - { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - - return _reportingTagDescriptor; - } - set - { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -84507,35 +83040,6 @@ public virtual string ReportingTagDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -84551,7 +83055,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -84562,11 +83065,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ProgramDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("PostSecondaryEventCategoryDescriptorId", PostSecondaryEventCategoryDescriptorId); return keyValues; } @@ -84630,128 +83133,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ProgramDimension = (ProgramDimension) value; - } } } -// Aggregate: ProgramEvaluation +// Aggregate: PostSecondaryInstitution -namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PostSecondaryInstitutionAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class ProgramEvaluationReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } - public virtual string ProgramEvaluationTitle { get; set; } - public virtual int ProgramEvaluationTypeDescriptorId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluation table of the ProgramEvaluation aggregate in the ODS database. + /// A class which represents the edfi.PostSecondaryInstitution table of the PostSecondaryInstitution aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IProgramEvaluation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PostSecondaryInstitution : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.IPostSecondaryInstitution, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ProgramEvaluation() + public PostSecondaryInstitution() { - ProgramEvaluationLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + PostSecondaryInstitutionMediumOfInstructions = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -84760,131 +83171,112 @@ public ProgramEvaluation() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long ProgramEducationOrganizationId { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationPeriodDescriptorId + public virtual long PostSecondaryInstitutionId { - get - { - if (_programEvaluationPeriodDescriptorId == default(int)) - _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); - - return _programEvaluationPeriodDescriptorId; - } - set - { - _programEvaluationPeriodDescriptorId = value; - _programEvaluationPeriodDescriptor = null; - } + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } } + + // ------------------------------------------------------------- - private int _programEvaluationPeriodDescriptorId; - private string _programEvaluationPeriodDescriptor; - - public virtual string ProgramEvaluationPeriodDescriptor + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IEducationOrganization.NameOfInstitution { - get - { - if (_programEvaluationPeriodDescriptor == null) - _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); - - return _programEvaluationPeriodDescriptor; - } - set - { - _programEvaluationPeriodDescriptor = value; - _programEvaluationPeriodDescriptorId = default(int); - } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } } - [DomainSignature] - public virtual string ProgramEvaluationTitle { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationTypeDescriptorId + string IEducationOrganization.OperationalStatusDescriptor + { + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } + } + string IEducationOrganization.ShortNameOfInstitution + { + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } + } + string IEducationOrganization.WebSite + { + get { return WebSite; } + set { WebSite = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int? AdministrativeFundingControlDescriptorId { get { - if (_programEvaluationTypeDescriptorId == default(int)) - _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); + if (_administrativeFundingControlDescriptorId == default(int?)) + _administrativeFundingControlDescriptorId = string.IsNullOrWhiteSpace(_administrativeFundingControlDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptor); - return _programEvaluationTypeDescriptorId; + return _administrativeFundingControlDescriptorId; } set { - _programEvaluationTypeDescriptorId = value; - _programEvaluationTypeDescriptor = null; + _administrativeFundingControlDescriptorId = value; + _administrativeFundingControlDescriptor = null; } } - private int _programEvaluationTypeDescriptorId; - private string _programEvaluationTypeDescriptor; + private int? _administrativeFundingControlDescriptorId; + private string _administrativeFundingControlDescriptor; - public virtual string ProgramEvaluationTypeDescriptor + public virtual string AdministrativeFundingControlDescriptor { get { - if (_programEvaluationTypeDescriptor == null) - _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); + if (_administrativeFundingControlDescriptor == null) + _administrativeFundingControlDescriptor = _administrativeFundingControlDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptorId.Value); - return _programEvaluationTypeDescriptor; + return _administrativeFundingControlDescriptor; } set { - _programEvaluationTypeDescriptor = value; - _programEvaluationTypeDescriptorId = default(int); + _administrativeFundingControlDescriptor = value; + _administrativeFundingControlDescriptorId = default(int?); } } - [DomainSignature] - public virtual string ProgramName { get; set; } - [DomainSignature] - public virtual int ProgramTypeDescriptorId + public virtual int? PostSecondaryInstitutionLevelDescriptorId { get { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + if (_postSecondaryInstitutionLevelDescriptorId == default(int?)) + _postSecondaryInstitutionLevelDescriptorId = string.IsNullOrWhiteSpace(_postSecondaryInstitutionLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PostSecondaryInstitutionLevelDescriptor", _postSecondaryInstitutionLevelDescriptor); - return _programTypeDescriptorId; + return _postSecondaryInstitutionLevelDescriptorId; } set { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; + _postSecondaryInstitutionLevelDescriptorId = value; + _postSecondaryInstitutionLevelDescriptor = null; } } - private int _programTypeDescriptorId; - private string _programTypeDescriptor; + private int? _postSecondaryInstitutionLevelDescriptorId; + private string _postSecondaryInstitutionLevelDescriptor; - public virtual string ProgramTypeDescriptor + public virtual string PostSecondaryInstitutionLevelDescriptor { get { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + if (_postSecondaryInstitutionLevelDescriptor == null) + _postSecondaryInstitutionLevelDescriptor = _postSecondaryInstitutionLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PostSecondaryInstitutionLevelDescriptor", _postSecondaryInstitutionLevelDescriptorId.Value); - return _programTypeDescriptor; + return _postSecondaryInstitutionLevelDescriptor; } set { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); + _postSecondaryInstitutionLevelDescriptor = value; + _postSecondaryInstitutionLevelDescriptorId = default(int?); } } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual decimal? EvaluationMaxNumericRating { get; set; } - public virtual decimal? EvaluationMinNumericRating { get; set; } - public virtual string ProgramEvaluationDescription { get; set; } - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -84927,35 +83319,15 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } - - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IProgramEvaluation.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IProgramEvaluation.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _programEvaluationLevels; - private ICollection _programEvaluationLevelsCovariant; - public virtual ICollection ProgramEvaluationLevels + private ICollection _postSecondaryInstitutionMediumOfInstructions; + private ICollection _postSecondaryInstitutionMediumOfInstructionsCovariant; + public virtual ICollection PostSecondaryInstitutionMediumOfInstructions { get { @@ -84964,38 +83336,38 @@ public virtual ICollection(value); + _postSecondaryInstitutionMediumOfInstructions = value; + _postSecondaryInstitutionMediumOfInstructionsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramEvaluation.ProgramEvaluationLevels + ICollection Entities.Common.EdFi.IPostSecondaryInstitution.PostSecondaryInstitutionMediumOfInstructions { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _programEvaluationLevels) - if (item.ProgramEvaluation == null) - item.ProgramEvaluation = this; + foreach (var item in _postSecondaryInstitutionMediumOfInstructions) + if (item.PostSecondaryInstitution == null) + item.PostSecondaryInstitution = this; // ------------------------------------------------------------- - return _programEvaluationLevelsCovariant; + return _postSecondaryInstitutionMediumOfInstructionsCovariant; } set { - ProgramEvaluationLevels = new HashSet(value.Cast()); + PostSecondaryInstitutionMediumOfInstructions = new HashSet(value.Cast()); } } @@ -85004,9 +83376,9 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, - { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "AdministrativeFundingControlDescriptor", new LookupColumnDetails { PropertyName = "AdministrativeFundingControlDescriptorId", LookupTypeName = "AdministrativeFundingControlDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + { "PostSecondaryInstitutionLevelDescriptor", new LookupColumnDetails { PropertyName = "PostSecondaryInstitutionLevelDescriptorId", LookupTypeName = "PostSecondaryInstitutionLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -85021,12 +83393,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("PostSecondaryInstitutionId", PostSecondaryInstitutionId); return keyValues; } @@ -85090,12 +83457,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryInstitution)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluation) target, null); + this.MapTo((Entities.Common.EdFi.IPostSecondaryInstitution) target, null); } } @@ -85103,19 +83470,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluationLevel table of the ProgramEvaluation aggregate in the ODS database. + /// A class which represents the edfi.PostSecondaryInstitutionMediumOfInstruction table of the PostSecondaryInstitution aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PostSecondaryInstitutionMediumOfInstruction : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ProgramEvaluationLevel() + public PostSecondaryInstitutionMediumOfInstruction() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -85124,47 +83491,47 @@ public ProgramEvaluationLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual ProgramEvaluation ProgramEvaluation { get; set; } + public virtual PostSecondaryInstitution PostSecondaryInstitution { get; set; } - Entities.Common.EdFi.IProgramEvaluation IProgramEvaluationLevel.ProgramEvaluation + Entities.Common.EdFi.IPostSecondaryInstitution IPostSecondaryInstitutionMediumOfInstruction.PostSecondaryInstitution { - get { return ProgramEvaluation; } - set { ProgramEvaluation = (ProgramEvaluation) value; } + get { return PostSecondaryInstitution; } + set { PostSecondaryInstitution = (PostSecondaryInstitution) value; } } [DomainSignature] - public virtual int RatingLevelDescriptorId + public virtual int MediumOfInstructionDescriptorId { get { - if (_ratingLevelDescriptorId == default(int)) - _ratingLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _ratingLevelDescriptor); + if (_mediumOfInstructionDescriptorId == default(int)) + _mediumOfInstructionDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptor); - return _ratingLevelDescriptorId; + return _mediumOfInstructionDescriptorId; } set { - _ratingLevelDescriptorId = value; - _ratingLevelDescriptor = null; + _mediumOfInstructionDescriptorId = value; + _mediumOfInstructionDescriptor = null; } } - private int _ratingLevelDescriptorId; - private string _ratingLevelDescriptor; + private int _mediumOfInstructionDescriptorId; + private string _mediumOfInstructionDescriptor; - public virtual string RatingLevelDescriptor + public virtual string MediumOfInstructionDescriptor { get { - if (_ratingLevelDescriptor == null) - _ratingLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _ratingLevelDescriptorId); + if (_mediumOfInstructionDescriptor == null) + _mediumOfInstructionDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptorId); - return _ratingLevelDescriptor; + return _mediumOfInstructionDescriptor; } set { - _ratingLevelDescriptor = value; - _ratingLevelDescriptorId = default(int); + _mediumOfInstructionDescriptor = value; + _mediumOfInstructionDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -85177,8 +83544,6 @@ public virtual string RatingLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? MaxNumericRating { get; set; } - public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85233,10 +83598,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, - { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "RatingLevelDescriptor", new LookupColumnDetails { PropertyName = "RatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, + { "MediumOfInstructionDescriptor", new LookupColumnDetails { PropertyName = "MediumOfInstructionDescriptorId", LookupTypeName = "MediumOfInstructionDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -85248,10 +83610,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProgramEvaluation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (PostSecondaryInstitution as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); + keyValues.Add("MediumOfInstructionDescriptorId", MediumOfInstructionDescriptorId); return keyValues; } @@ -85315,51 +83677,117 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluationLevel) target, null); + this.MapTo((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction) target, null); } void IChildEntity.SetParent(object value) { - ProgramEvaluation = (ProgramEvaluation) value; + PostSecondaryInstitution = (PostSecondaryInstitution) value; } } } -// Aggregate: ProgramEvaluationElement +// Aggregate: PostSecondaryInstitutionLevelDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationElementAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PostSecondaryInstitutionLevelDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.PostSecondaryInstitutionLevelDescriptor table of the PostSecondaryInstitutionLevelDescriptor aggregate in the ODS database. /// - public class ProgramEvaluationElementReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class PostSecondaryInstitutionLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual string ProgramEvaluationElementTitle { get; set; } - public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } - public virtual string ProgramEvaluationTitle { get; set; } - public virtual int ProgramEvaluationTypeDescriptorId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId { get; set; } + [DomainSignature] + public virtual int PostSecondaryInstitutionLevelDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -85368,13 +83796,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("PostSecondaryInstitutionLevelDescriptorId", PostSecondaryInstitutionLevelDescriptorId); return keyValues; } @@ -85395,8 +83817,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -85413,167 +83845,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor) target, null); + } + } +} +// Aggregate: PrimaryLearningDeviceAccessDescriptor +namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceAccessDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluationElement table of the ProgramEvaluationElement aggregate in the ODS database. + /// A class which represents the edfi.PrimaryLearningDeviceAccessDescriptor table of the PrimaryLearningDeviceAccessDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluationElement : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IProgramEvaluationElement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PrimaryLearningDeviceAccessDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ProgramEvaluationElement() - { - ProgramEvaluationElementProgramEvaluationLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long ProgramEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramEvaluationElementTitle { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationPeriodDescriptorId + public virtual int PrimaryLearningDeviceAccessDescriptorId { - get - { - if (_programEvaluationPeriodDescriptorId == default(int)) - _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); - - return _programEvaluationPeriodDescriptorId; - } - set - { - _programEvaluationPeriodDescriptorId = value; - _programEvaluationPeriodDescriptor = null; - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + + // ------------------------------------------------------------- - private int _programEvaluationPeriodDescriptorId; - private string _programEvaluationPeriodDescriptor; - - public virtual string ProgramEvaluationPeriodDescriptor + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue { - get - { - if (_programEvaluationPeriodDescriptor == null) - _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); - - return _programEvaluationPeriodDescriptor; - } - set - { - _programEvaluationPeriodDescriptor = value; - _programEvaluationPeriodDescriptorId = default(int); - } + get { return CodeValue; } + set { CodeValue = value; } } - [DomainSignature] - public virtual string ProgramEvaluationTitle { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationTypeDescriptorId + string IDescriptor.Description { - get - { - if (_programEvaluationTypeDescriptorId == default(int)) - _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); - - return _programEvaluationTypeDescriptorId; - } - set - { - _programEvaluationTypeDescriptorId = value; - _programEvaluationTypeDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _programEvaluationTypeDescriptorId; - private string _programEvaluationTypeDescriptor; - - public virtual string ProgramEvaluationTypeDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_programEvaluationTypeDescriptor == null) - _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); - - return _programEvaluationTypeDescriptor; - } - set - { - _programEvaluationTypeDescriptor = value; - _programEvaluationTypeDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - [DomainSignature] - public virtual string ProgramName { get; set; } - [DomainSignature] - public virtual int ProgramTypeDescriptorId + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - - return _programTypeDescriptorId; - } - set - { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - - private int _programTypeDescriptorId; - private string _programTypeDescriptor; - - public virtual string ProgramTypeDescriptor + string IDescriptor.Namespace { - get - { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - - return _programTypeDescriptor; - } - set - { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); - } + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? ElementMaxNumericRating { get; set; } - public virtual decimal? ElementMinNumericRating { get; set; } - public virtual int? ElementSortOrder { get; set; } - public virtual string ProgramEvaluationElementDescription { get; set; } - public virtual string ProgramEvaluationObjectiveTitle { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85584,140 +83946,21 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramEvaluationAggregate.EdFi.ProgramEvaluationReferenceData ProgramEvaluationReferenceData { get; set; } - - /// - /// Read-only property that allows the ProgramEvaluation discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationDiscriminator - { - get { return ProgramEvaluationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ProgramEvaluation resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationResourceId - { - get { return ProgramEvaluationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ProgramEvaluationObjectiveAggregate.EdFi.ProgramEvaluationObjectiveReferenceData ProgramEvaluationObjectiveReferenceData { get; set; } - - /// - /// Read-only property that allows the ProgramEvaluationObjective discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveDiscriminator - { - get { return ProgramEvaluationObjectiveReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ProgramEvaluationObjective resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveResourceId - { - get { return ProgramEvaluationObjectiveReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _programEvaluationElementProgramEvaluationLevels; - private ICollection _programEvaluationElementProgramEvaluationLevelsCovariant; - public virtual ICollection ProgramEvaluationElementProgramEvaluationLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programEvaluationElementProgramEvaluationLevels) - if (item.ProgramEvaluationElement == null) - item.ProgramEvaluationElement = this; - // ------------------------------------------------------------- - - return _programEvaluationElementProgramEvaluationLevels; - } - set - { - _programEvaluationElementProgramEvaluationLevels = value; - _programEvaluationElementProgramEvaluationLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationElementProgramEvaluationLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _programEvaluationElementProgramEvaluationLevels) - if (item.ProgramEvaluationElement == null) - item.ProgramEvaluationElement = this; - // ------------------------------------------------------------- - - return _programEvaluationElementProgramEvaluationLevelsCovariant; - } - set - { - ProgramEvaluationElementProgramEvaluationLevels = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, - { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -85732,13 +83975,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("PrimaryLearningDeviceAccessDescriptorId", PrimaryLearningDeviceAccessDescriptorId); return keyValues; } @@ -85802,95 +84039,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationElement)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluationElement) target, null); + this.MapTo((Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor) target, null); } } +} +// Aggregate: PrimaryLearningDeviceAwayFromSchoolDescriptor + +namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceAwayFromSchoolDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluationElementProgramEvaluationLevel table of the ProgramEvaluationElement aggregate in the ODS database. + /// A class which represents the edfi.PrimaryLearningDeviceAwayFromSchoolDescriptor table of the PrimaryLearningDeviceAwayFromSchoolDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluationElementProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class PrimaryLearningDeviceAwayFromSchoolDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ProgramEvaluationElementProgramEvaluationLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ProgramEvaluationElement ProgramEvaluationElement { get; set; } - - Entities.Common.EdFi.IProgramEvaluationElement IProgramEvaluationElementProgramEvaluationLevel.ProgramEvaluationElement - { - get { return ProgramEvaluationElement; } - set { ProgramEvaluationElement = (ProgramEvaluationElement) value; } - } - [DomainSignature] - public virtual int RatingLevelDescriptorId - { - get - { - if (_ratingLevelDescriptorId == default(int)) - _ratingLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _ratingLevelDescriptor); - - return _ratingLevelDescriptorId; - } - set - { - _ratingLevelDescriptorId = value; - _ratingLevelDescriptor = null; - } - } - - private int _ratingLevelDescriptorId; - private string _ratingLevelDescriptor; - - public virtual string RatingLevelDescriptor + public virtual int PrimaryLearningDeviceAwayFromSchoolDescriptorId { - get - { - if (_ratingLevelDescriptor == null) - _ratingLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _ratingLevelDescriptorId); - - return _ratingLevelDescriptor; - } - set - { - _ratingLevelDescriptor = value; - _ratingLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? MaxNumericRating { get; set; } - public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85901,35 +84125,6 @@ public virtual string RatingLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85945,10 +84140,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, - { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "RatingLevelDescriptor", new LookupColumnDetails { PropertyName = "RatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -85959,11 +84150,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ProgramEvaluationElement as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); + keyValues.Add("PrimaryLearningDeviceAwayFromSchoolDescriptorId", PrimaryLearningDeviceAwayFromSchoolDescriptorId); return keyValues; } @@ -86027,79 +84218,135 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel) target, null); + this.MapTo((Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ProgramEvaluationElement = (ProgramEvaluationElement) value; - } } } -// Aggregate: ProgramEvaluationObjective +// Aggregate: PrimaryLearningDeviceProviderDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationObjectiveAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceProviderDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.PrimaryLearningDeviceProviderDescriptor table of the PrimaryLearningDeviceProviderDescriptor aggregate in the ODS database. /// - public class ProgramEvaluationObjectiveReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class PrimaryLearningDeviceProviderDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual string ProgramEvaluationObjectiveTitle { get; set; } - public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } - public virtual string ProgramEvaluationTitle { get; set; } - public virtual int ProgramEvaluationTypeDescriptorId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId { get; set; } + [DomainSignature] + public virtual int PrimaryLearningDeviceProviderDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationObjectiveTitle", ProgramEvaluationObjectiveTitle); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); - - return keyValues; + get { return CodeValue; } + set { CodeValue = value; } } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + string IDescriptor.Description { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("PrimaryLearningDeviceProviderDescriptorId", PrimaryLearningDeviceProviderDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) return false; var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); @@ -86107,8 +84354,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -86125,115 +84382,323 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor) target, null); + } + } +} +// Aggregate: ProficiencyDescriptor +namespace EdFi.Ods.Entities.NHibernate.ProficiencyDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluationObjective table of the ProgramEvaluationObjective aggregate in the ODS database. + /// A class which represents the edfi.ProficiencyDescriptor table of the ProficiencyDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluationObjective : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IProgramEvaluationObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProficiencyDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProficiencyDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public ProgramEvaluationObjective() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int ProficiencyDescriptorId { - ProgramEvaluationObjectiveProgramEvaluationLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature] - public virtual long ProgramEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramEvaluationObjectiveTitle { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationPeriodDescriptorId + string IDescriptor.CodeValue { - get - { - if (_programEvaluationPeriodDescriptorId == default(int)) - _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - return _programEvaluationPeriodDescriptorId; - } - set + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - _programEvaluationPeriodDescriptorId = value; - _programEvaluationPeriodDescriptor = null; - } + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } } - private int _programEvaluationPeriodDescriptorId; - private string _programEvaluationPeriodDescriptor; + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - public virtual string ProgramEvaluationPeriodDescriptor + // Add current key values + keyValues.Add("ProficiencyDescriptorId", ProficiencyDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - if (_programEvaluationPeriodDescriptor == null) - _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); - - return _programEvaluationPeriodDescriptor; - } - set + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _programEvaluationPeriodDescriptor = value; - _programEvaluationPeriodDescriptorId = default(int); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - [DomainSignature] - public virtual string ProgramEvaluationTitle { get; set; } - [DomainSignature] - public virtual int ProgramEvaluationTypeDescriptorId + + public override int GetHashCode() { - get - { - if (_programEvaluationTypeDescriptorId == default(int)) - _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _programEvaluationTypeDescriptorId; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - _programEvaluationTypeDescriptorId = value; - _programEvaluationTypeDescriptor = null; + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IProficiencyDescriptor)target); } - private int _programEvaluationTypeDescriptorId; - private string _programEvaluationTypeDescriptor; + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IProficiencyDescriptor) target, null); + } - public virtual string ProgramEvaluationTypeDescriptor + } +} +// Aggregate: Program + +namespace EdFi.Ods.Entities.NHibernate.ProgramAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class ProgramReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual string ProgramName { get; set; } + public virtual int ProgramTypeDescriptorId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - if (_programEvaluationTypeDescriptor == null) - _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); - - return _programEvaluationTypeDescriptor; + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } - set + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - _programEvaluationTypeDescriptor = value; - _programEvaluationTypeDescriptorId = default(int); + hashCode.Add(entry.Value); } + + return hashCode.ToHashCode(); + } + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.Program table of the Program aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class Program : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public Program() + { + ProgramCharacteristics = new HashSet(); + ProgramLearningStandards = new HashSet(); + ProgramSponsors = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } [DomainSignature] public virtual string ProgramName { get; set; } [DomainSignature] @@ -86281,10 +84746,7 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? ObjectiveMaxNumericRating { get; set; } - public virtual decimal? ObjectiveMinNumericRating { get; set; } - public virtual int? ObjectiveSortOrder { get; set; } - public virtual string ProgramEvaluationObjectiveDescription { get; set; } + public virtual string ProgramId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -86329,23 +84791,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramEvaluationAggregate.EdFi.ProgramEvaluationReferenceData ProgramEvaluationReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the ProgramEvaluation discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscriminator + string Entities.Common.EdFi.IProgram.EducationOrganizationDiscriminator { - get { return ProgramEvaluationReferenceData?.Discriminator; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ProgramEvaluation resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationResourceId + Guid? Entities.Common.EdFi.IProgram.EducationOrganizationResourceId { - get { return ProgramEvaluationReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Id; } set { } } @@ -86355,9 +84817,9 @@ string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscrim // Collections // ------------------------------------------------------------- - private ICollection _programEvaluationObjectiveProgramEvaluationLevels; - private ICollection _programEvaluationObjectiveProgramEvaluationLevelsCovariant; - public virtual ICollection ProgramEvaluationObjectiveProgramEvaluationLevels + private ICollection _programCharacteristics; + private ICollection _programCharacteristicsCovariant; + public virtual ICollection ProgramCharacteristics { get { @@ -86366,38 +84828,132 @@ public virtual ICollection(value); + _programCharacteristics = value; + _programCharacteristicsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationObjectiveProgramEvaluationLevels + ICollection Entities.Common.EdFi.IProgram.ProgramCharacteristics { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _programEvaluationObjectiveProgramEvaluationLevels) - if (item.ProgramEvaluationObjective == null) - item.ProgramEvaluationObjective = this; + foreach (var item in _programCharacteristics) + if (item.Program == null) + item.Program = this; // ------------------------------------------------------------- - return _programEvaluationObjectiveProgramEvaluationLevelsCovariant; + return _programCharacteristicsCovariant; } set { - ProgramEvaluationObjectiveProgramEvaluationLevels = new HashSet(value.Cast()); + ProgramCharacteristics = new HashSet(value.Cast()); + } + } + + + private ICollection _programLearningStandards; + private ICollection _programLearningStandardsCovariant; + public virtual ICollection ProgramLearningStandards + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programLearningStandards) + if (item.Program == null) + item.Program = this; + // ------------------------------------------------------------- + + return _programLearningStandards; + } + set + { + _programLearningStandards = value; + _programLearningStandardsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgram.ProgramLearningStandards + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programLearningStandards) + if (item.Program == null) + item.Program = this; + // ------------------------------------------------------------- + + return _programLearningStandardsCovariant; + } + set + { + ProgramLearningStandards = new HashSet(value.Cast()); + } + } + + + private ICollection _programSponsors; + private ICollection _programSponsorsCovariant; + public virtual ICollection ProgramSponsors + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programSponsors) + if (item.Program == null) + item.Program = this; + // ------------------------------------------------------------- + + return _programSponsors; + } + set + { + _programSponsors = value; + _programSponsorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgram.ProgramSponsors + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programSponsors) + if (item.Program == null) + item.Program = this; + // ------------------------------------------------------------- + + return _programSponsorsCovariant; + } + set + { + ProgramSponsors = new HashSet(value.Cast()); } } @@ -86406,8 +84962,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, - { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; @@ -86423,11 +84977,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramEvaluationObjectiveTitle", ProgramEvaluationObjectiveTitle); - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); - keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("ProgramName", ProgramName); keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); @@ -86493,12 +85043,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationObjective)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluationObjective) target, null); + this.MapTo((Entities.Common.EdFi.IProgram) target, null); } } @@ -86506,19 +85056,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluationObjectiveProgramEvaluationLevel table of the ProgramEvaluationObjective aggregate in the ODS database. + /// A class which represents the edfi.ProgramCharacteristic table of the Program aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluationObjectiveProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProgramCharacteristic : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProgramCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ProgramEvaluationObjectiveProgramEvaluationLevel() + public ProgramCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -86527,47 +85077,47 @@ public ProgramEvaluationObjectiveProgramEvaluationLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual ProgramEvaluationObjective ProgramEvaluationObjective { get; set; } + public virtual Program Program { get; set; } - Entities.Common.EdFi.IProgramEvaluationObjective IProgramEvaluationObjectiveProgramEvaluationLevel.ProgramEvaluationObjective + Entities.Common.EdFi.IProgram IProgramCharacteristic.Program { - get { return ProgramEvaluationObjective; } - set { ProgramEvaluationObjective = (ProgramEvaluationObjective) value; } + get { return Program; } + set { Program = (Program) value; } } [DomainSignature] - public virtual int RatingLevelDescriptorId + public virtual int ProgramCharacteristicDescriptorId { get { - if (_ratingLevelDescriptorId == default(int)) - _ratingLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _ratingLevelDescriptor); + if (_programCharacteristicDescriptorId == default(int)) + _programCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramCharacteristicDescriptor", _programCharacteristicDescriptor); - return _ratingLevelDescriptorId; + return _programCharacteristicDescriptorId; } set { - _ratingLevelDescriptorId = value; - _ratingLevelDescriptor = null; + _programCharacteristicDescriptorId = value; + _programCharacteristicDescriptor = null; } } - private int _ratingLevelDescriptorId; - private string _ratingLevelDescriptor; + private int _programCharacteristicDescriptorId; + private string _programCharacteristicDescriptor; - public virtual string RatingLevelDescriptor + public virtual string ProgramCharacteristicDescriptor { get { - if (_ratingLevelDescriptor == null) - _ratingLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _ratingLevelDescriptorId); + if (_programCharacteristicDescriptor == null) + _programCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramCharacteristicDescriptor", _programCharacteristicDescriptorId); - return _ratingLevelDescriptor; + return _programCharacteristicDescriptor; } set { - _ratingLevelDescriptor = value; - _ratingLevelDescriptorId = default(int); + _programCharacteristicDescriptor = value; + _programCharacteristicDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -86580,8 +85130,6 @@ public virtual string RatingLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? MaxNumericRating { get; set; } - public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -86636,10 +85184,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, - { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "ProgramCharacteristicDescriptorId", LookupTypeName = "ProgramCharacteristicDescriptor"} }, { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "RatingLevelDescriptor", new LookupColumnDetails { PropertyName = "RatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -86651,10 +85197,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProgramEvaluationObjective as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); + keyValues.Add("ProgramCharacteristicDescriptorId", ProgramCharacteristicDescriptorId); return keyValues; } @@ -86718,81 +85264,59 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramCharacteristic)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel) target, null); + this.MapTo((Entities.Common.EdFi.IProgramCharacteristic) target, null); } void IChildEntity.SetParent(object value) { - ProgramEvaluationObjective = (ProgramEvaluationObjective) value; + Program = (Program) value; } } -} -// Aggregate: ProgramEvaluationPeriodDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationPeriodDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluationPeriodDescriptor table of the ProgramEvaluationPeriodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramLearningStandard table of the Program aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluationPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProgramLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ProgramLearningStandard() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int ProgramEvaluationPeriodDescriptorId + [DomainSignature, JsonIgnore] + public virtual Program Program { get; set; } + + Entities.Common.EdFi.IProgram IProgramLearningStandard.Program { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return Program; } + set { Program = (Program) value; } } - + + [DomainSignature] + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -86808,11 +85332,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardDiscriminator + { + get { return LearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IProgramLearningStandard.LearningStandardResourceId + { + get { return LearningStandardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -86823,6 +85396,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -86833,11 +85407,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -86901,79 +85475,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramLearningStandard) target, null); } + void IChildEntity.SetParent(object value) + { + Program = (Program) value; + } } -} -// Aggregate: ProgramEvaluationTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramEvaluationTypeDescriptor table of the ProgramEvaluationTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramSponsor table of the Program aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgramEvaluationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramSponsor : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProgramSponsor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ProgramEvaluationTypeDescriptorId + public ProgramSponsor() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Program Program { get; set; } + + Entities.Common.EdFi.IProgram IProgramSponsor.Program { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Program; } + set { Program = (Program) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int ProgramSponsorDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_programSponsorDescriptorId == default(int)) + _programSponsorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramSponsorDescriptor", _programSponsorDescriptor); + + return _programSponsorDescriptorId; + } + set + { + _programSponsorDescriptorId = value; + _programSponsorDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _programSponsorDescriptorId; + private string _programSponsorDescriptor; + + public virtual string ProgramSponsorDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_programSponsorDescriptor == null) + _programSponsorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramSponsorDescriptor", _programSponsorDescriptorId); + + return _programSponsorDescriptor; + } + set + { + _programSponsorDescriptor = value; + _programSponsorDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -86987,6 +85576,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87002,6 +85620,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramSponsorDescriptor", new LookupColumnDetails { PropertyName = "ProgramSponsorDescriptorId", LookupTypeName = "ProgramSponsorDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -87012,11 +85632,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramSponsorDescriptorId", ProgramSponsorDescriptorId); return keyValues; } @@ -87080,37 +85700,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramSponsor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramEvaluationTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramSponsor) target, null); } + void IChildEntity.SetParent(object value) + { + Program = (Program) value; + } } } -// Aggregate: ProgramSponsorDescriptor +// Aggregate: ProgramAssignmentDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProgramSponsorDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramAssignmentDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramSponsorDescriptor table of the ProgramSponsorDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramAssignmentDescriptor table of the ProgramAssignmentDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramSponsorDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgramSponsorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramAssignmentDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgramAssignmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ProgramSponsorDescriptorId + public virtual int ProgramAssignmentDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -87195,7 +85819,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramSponsorDescriptorId", ProgramSponsorDescriptorId); + keyValues.Add("ProgramAssignmentDescriptorId", ProgramAssignmentDescriptorId); return keyValues; } @@ -87259,37 +85883,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramSponsorDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramAssignmentDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramSponsorDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramAssignmentDescriptor) target, null); } } } -// Aggregate: ProgramTypeDescriptor +// Aggregate: ProgramCharacteristicDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProgramTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramCharacteristicDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgramTypeDescriptor table of the ProgramTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramCharacteristicDescriptor table of the ProgramCharacteristicDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgramTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgramTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgramCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ProgramTypeDescriptorId + public virtual int ProgramCharacteristicDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -87374,7 +85998,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("ProgramCharacteristicDescriptorId", ProgramCharacteristicDescriptorId); return keyValues; } @@ -87438,82 +86062,138 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgramTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramCharacteristicDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgramTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramCharacteristicDescriptor) target, null); } } } -// Aggregate: ProgressDescriptor +// Aggregate: ProgramDimension -namespace EdFi.Ods.Entities.NHibernate.ProgressDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramDimensionAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.ProgressDescriptor table of the ProgressDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ProgressDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgressDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramDimensionReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int ProgressDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + public virtual string Code { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); + + return keyValues; } - DateTime? IDescriptor.EffectiveEndDate + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() { - get { return Namespace; } - set { Namespace = value; } + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } - string IDescriptor.ShortDescription + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.ProgramDimension table of the ProgramDimension aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class ProgramDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IProgramDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ProgramDimension() { - get { return ShortDescription; } - set { ShortDescription = value; } + ProgramDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string Code { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87524,6 +86204,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87534,6 +86243,53 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _programDimensionReportingTags; + private ICollection _programDimensionReportingTagsCovariant; + public virtual ICollection ProgramDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programDimensionReportingTags) + if (item.ProgramDimension == null) + item.ProgramDimension = this; + // ------------------------------------------------------------- + + return _programDimensionReportingTags; + } + set + { + _programDimensionReportingTags = value; + _programDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgramDimension.ProgramDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programDimensionReportingTags) + if (item.ProgramDimension == null) + item.ProgramDimension = this; + // ------------------------------------------------------------- + + return _programDimensionReportingTagsCovariant; + } + set + { + ProgramDimensionReportingTags = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map @@ -87553,7 +86309,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProgressDescriptorId", ProgressDescriptorId); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -87617,79 +86374,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgressDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgressDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramDimension) target, null); } } -} -// Aggregate: ProgressLevelDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ProgressLevelDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProgressLevelDescriptor table of the ProgressLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramDimensionReportingTag table of the ProgramDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProgressLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProgressLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProgramDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ProgressLevelDescriptorId + public ProgramDimensionReportingTag() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual ProgramDimension ProgramDimension { get; set; } + + Entities.Common.EdFi.IProgramDimension IProgramDimensionReportingTag.ProgramDimension { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return ProgramDimension; } + set { ProgramDimension = (ProgramDimension) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int ReportingTagDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + + return _reportingTagDescriptorId; + } + set + { + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; + + public virtual string ReportingTagDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + + return _reportingTagDescriptor; + } + set + { + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -87703,6 +86471,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87718,6 +86515,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -87728,11 +86526,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ProgramDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ProgressLevelDescriptorId", ProgressLevelDescriptorId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -87796,30 +86594,38 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProgressLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProgressLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramDimensionReportingTag) target, null); } + void IChildEntity.SetParent(object value) + { + ProgramDimension = (ProgramDimension) value; + } } } -// Aggregate: ProjectDimension +// Aggregate: ProgramEvaluation -namespace EdFi.Ods.Entities.NHibernate.ProjectDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ProjectDimensionReferenceData : IHasPrimaryKeyValues + public class ProgramEvaluationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } + public virtual long ProgramEducationOrganizationId { get; set; } + public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + public virtual string ProgramEvaluationTitle { get; set; } + public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + public virtual string ProgramName { get; set; } + public virtual int ProgramTypeDescriptorId { get; set; } // ------------------------------------------------------------- /// @@ -87840,8 +86646,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -87892,20 +86702,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProjectDimension table of the ProjectDimension aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluation table of the ProgramEvaluation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProjectDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IProjectDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProgramEvaluation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IProgramEvaluation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ProjectDimension() + public ProgramEvaluation() { - ProjectDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ProgramEvaluationLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -87914,9 +86724,116 @@ public ProjectDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string Code { get; set; } + public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual int ProgramEvaluationPeriodDescriptorId + { + get + { + if (_programEvaluationPeriodDescriptorId == default(int)) + _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); + + return _programEvaluationPeriodDescriptorId; + } + set + { + _programEvaluationPeriodDescriptorId = value; + _programEvaluationPeriodDescriptor = null; + } + } + + private int _programEvaluationPeriodDescriptorId; + private string _programEvaluationPeriodDescriptor; + + public virtual string ProgramEvaluationPeriodDescriptor + { + get + { + if (_programEvaluationPeriodDescriptor == null) + _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); + + return _programEvaluationPeriodDescriptor; + } + set + { + _programEvaluationPeriodDescriptor = value; + _programEvaluationPeriodDescriptorId = default(int); + } + } + [DomainSignature] + public virtual string ProgramEvaluationTitle { get; set; } + [DomainSignature] + public virtual int ProgramEvaluationTypeDescriptorId + { + get + { + if (_programEvaluationTypeDescriptorId == default(int)) + _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); + + return _programEvaluationTypeDescriptorId; + } + set + { + _programEvaluationTypeDescriptorId = value; + _programEvaluationTypeDescriptor = null; + } + } + + private int _programEvaluationTypeDescriptorId; + private string _programEvaluationTypeDescriptor; + + public virtual string ProgramEvaluationTypeDescriptor + { + get + { + if (_programEvaluationTypeDescriptor == null) + _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); + + return _programEvaluationTypeDescriptor; + } + set + { + _programEvaluationTypeDescriptor = value; + _programEvaluationTypeDescriptorId = default(int); + } + } + [DomainSignature] + public virtual string ProgramName { get; set; } + [DomainSignature] + public virtual int ProgramTypeDescriptorId + { + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } + } + + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + public virtual string ProgramTypeDescriptor + { + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -87927,7 +86844,9 @@ public ProjectDimension() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CodeName { get; set; } + public virtual decimal? EvaluationMaxNumericRating { get; set; } + public virtual decimal? EvaluationMinNumericRating { get; set; } + public virtual string ProgramEvaluationDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87972,15 +86891,35 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IProgramEvaluation.ProgramDiscriminator + { + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IProgramEvaluation.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _projectDimensionReportingTags; - private ICollection _projectDimensionReportingTagsCovariant; - public virtual ICollection ProjectDimensionReportingTags + private ICollection _programEvaluationLevels; + private ICollection _programEvaluationLevelsCovariant; + public virtual ICollection ProgramEvaluationLevels { get { @@ -87989,38 +86928,38 @@ public virtual ICollection(value); + _programEvaluationLevels = value; + _programEvaluationLevelsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProjectDimension.ProjectDimensionReportingTags + ICollection Entities.Common.EdFi.IProgramEvaluation.ProgramEvaluationLevels { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _projectDimensionReportingTags) - if (item.ProjectDimension == null) - item.ProjectDimension = this; + foreach (var item in _programEvaluationLevels) + if (item.ProgramEvaluation == null) + item.ProgramEvaluation = this; // ------------------------------------------------------------- - return _projectDimensionReportingTagsCovariant; + return _programEvaluationLevelsCovariant; } set { - ProjectDimensionReportingTags = new HashSet(value.Cast()); + ProgramEvaluationLevels = new HashSet(value.Cast()); } } @@ -88029,6 +86968,9 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, + { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -88043,8 +86985,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -88108,12 +87054,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProjectDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProjectDimension) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluation) target, null); } } @@ -88121,19 +87067,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProjectDimensionReportingTag table of the ProjectDimension aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluationLevel table of the ProgramEvaluation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProjectDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IProjectDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ProjectDimensionReportingTag() + public ProgramEvaluationLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -88142,47 +87088,47 @@ public ProjectDimensionReportingTag() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual ProjectDimension ProjectDimension { get; set; } + public virtual ProgramEvaluation ProgramEvaluation { get; set; } - Entities.Common.EdFi.IProjectDimension IProjectDimensionReportingTag.ProjectDimension + Entities.Common.EdFi.IProgramEvaluation IProgramEvaluationLevel.ProgramEvaluation { - get { return ProjectDimension; } - set { ProjectDimension = (ProjectDimension) value; } + get { return ProgramEvaluation; } + set { ProgramEvaluation = (ProgramEvaluation) value; } } [DomainSignature] - public virtual int ReportingTagDescriptorId + public virtual int RatingLevelDescriptorId { get { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + if (_ratingLevelDescriptorId == default(int)) + _ratingLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _ratingLevelDescriptor); - return _reportingTagDescriptorId; + return _ratingLevelDescriptorId; } set { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; + _ratingLevelDescriptorId = value; + _ratingLevelDescriptor = null; } } - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; + private int _ratingLevelDescriptorId; + private string _ratingLevelDescriptor; - public virtual string ReportingTagDescriptor + public virtual string RatingLevelDescriptor { get { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + if (_ratingLevelDescriptor == null) + _ratingLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _ratingLevelDescriptorId); - return _reportingTagDescriptor; + return _ratingLevelDescriptor; } set { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); + _ratingLevelDescriptor = value; + _ratingLevelDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -88195,6 +87141,8 @@ public virtual string ReportingTagDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? MaxNumericRating { get; set; } + public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -88249,7 +87197,10 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, + { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "RatingLevelDescriptor", new LookupColumnDetails { PropertyName = "RatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -88261,10 +87212,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProjectDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ProgramEvaluation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); return keyValues; } @@ -88328,117 +87279,51 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProjectDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProjectDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluationLevel) target, null); } void IChildEntity.SetParent(object value) { - ProjectDimension = (ProjectDimension) value; + ProgramEvaluation = (ProgramEvaluation) value; } } } -// Aggregate: ProviderCategoryDescriptor +// Aggregate: ProgramEvaluationElement -namespace EdFi.Ods.Entities.NHibernate.ProviderCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationElementAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.ProviderCategoryDescriptor table of the ProviderCategoryDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ProviderCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProviderCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramEvaluationElementReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int ProviderCategoryDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual long ProgramEducationOrganizationId { get; set; } + public virtual string ProgramEvaluationElementTitle { get; set; } + public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + public virtual string ProgramEvaluationTitle { get; set; } + public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + public virtual string ProgramName { get; set; } + public virtual int ProgramTypeDescriptorId { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -88447,7 +87332,13 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProviderCategoryDescriptorId", ProviderCategoryDescriptorId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -88468,18 +87359,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -88496,97 +87377,167 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IProviderCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IProviderCategoryDescriptor) target, null); - } - } -} -// Aggregate: ProviderProfitabilityDescriptor -namespace EdFi.Ods.Entities.NHibernate.ProviderProfitabilityDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProviderProfitabilityDescriptor table of the ProviderProfitabilityDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluationElement table of the ProgramEvaluationElement aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProviderProfitabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProviderProfitabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramEvaluationElement : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IProgramEvaluationElement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ProviderProfitabilityDescriptorId + public ProgramEvaluationElement() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + ProgramEvaluationElementProgramEvaluationLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue + [DomainSignature] + public virtual long ProgramEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ProgramEvaluationElementTitle { get; set; } + [DomainSignature] + public virtual int ProgramEvaluationPeriodDescriptorId { - get { return CodeValue; } - set { CodeValue = value; } + get + { + if (_programEvaluationPeriodDescriptorId == default(int)) + _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); + + return _programEvaluationPeriodDescriptorId; + } + set + { + _programEvaluationPeriodDescriptorId = value; + _programEvaluationPeriodDescriptor = null; + } } - string IDescriptor.Description + + private int _programEvaluationPeriodDescriptorId; + private string _programEvaluationPeriodDescriptor; + + public virtual string ProgramEvaluationPeriodDescriptor { - get { return Description; } - set { Description = value; } + get + { + if (_programEvaluationPeriodDescriptor == null) + _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); + + return _programEvaluationPeriodDescriptor; + } + set + { + _programEvaluationPeriodDescriptor = value; + _programEvaluationPeriodDescriptorId = default(int); + } } - DateTime? IDescriptor.EffectiveBeginDate + [DomainSignature] + public virtual string ProgramEvaluationTitle { get; set; } + [DomainSignature] + public virtual int ProgramEvaluationTypeDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_programEvaluationTypeDescriptorId == default(int)) + _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); + + return _programEvaluationTypeDescriptorId; + } + set + { + _programEvaluationTypeDescriptorId = value; + _programEvaluationTypeDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _programEvaluationTypeDescriptorId; + private string _programEvaluationTypeDescriptor; + + public virtual string ProgramEvaluationTypeDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_programEvaluationTypeDescriptor == null) + _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); + + return _programEvaluationTypeDescriptor; + } + set + { + _programEvaluationTypeDescriptor = value; + _programEvaluationTypeDescriptorId = default(int); + } } - string IDescriptor.Namespace + [DomainSignature] + public virtual string ProgramName { get; set; } + [DomainSignature] + public virtual int ProgramTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + public virtual string ProgramTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? ElementMaxNumericRating { get; set; } + public virtual decimal? ElementMinNumericRating { get; set; } + public virtual int? ElementSortOrder { get; set; } + public virtual string ProgramEvaluationElementDescription { get; set; } + public virtual string ProgramEvaluationObjectiveTitle { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -88597,21 +87548,140 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramEvaluationAggregate.EdFi.ProgramEvaluationReferenceData ProgramEvaluationReferenceData { get; set; } + + /// + /// Read-only property that allows the ProgramEvaluation discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationDiscriminator + { + get { return ProgramEvaluationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProgramEvaluation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationResourceId + { + get { return ProgramEvaluationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.ProgramEvaluationObjectiveAggregate.EdFi.ProgramEvaluationObjectiveReferenceData ProgramEvaluationObjectiveReferenceData { get; set; } + + /// + /// Read-only property that allows the ProgramEvaluationObjective discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveDiscriminator + { + get { return ProgramEvaluationObjectiveReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProgramEvaluationObjective resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveResourceId + { + get { return ProgramEvaluationObjectiveReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _programEvaluationElementProgramEvaluationLevels; + private ICollection _programEvaluationElementProgramEvaluationLevelsCovariant; + public virtual ICollection ProgramEvaluationElementProgramEvaluationLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programEvaluationElementProgramEvaluationLevels) + if (item.ProgramEvaluationElement == null) + item.ProgramEvaluationElement = this; + // ------------------------------------------------------------- + + return _programEvaluationElementProgramEvaluationLevels; + } + set + { + _programEvaluationElementProgramEvaluationLevels = value; + _programEvaluationElementProgramEvaluationLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationElementProgramEvaluationLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programEvaluationElementProgramEvaluationLevels) + if (item.ProgramEvaluationElement == null) + item.ProgramEvaluationElement = this; + // ------------------------------------------------------------- + + return _programEvaluationElementProgramEvaluationLevelsCovariant; + } + set + { + ProgramEvaluationElementProgramEvaluationLevels = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, + { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -88626,7 +87696,13 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ProviderProfitabilityDescriptorId", ProviderProfitabilityDescriptorId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -88690,82 +87766,95 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProviderProfitabilityDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationElement)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProviderProfitabilityDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluationElement) target, null); } } -} -// Aggregate: ProviderStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ProviderStatusDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ProviderStatusDescriptor table of the ProviderStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluationElementProgramEvaluationLevel table of the ProgramEvaluationElement aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ProviderStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IProviderStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramEvaluationElementProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ProviderStatusDescriptorId + public ProgramEvaluationElementProgramEvaluationLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual ProgramEvaluationElement ProgramEvaluationElement { get; set; } + + Entities.Common.EdFi.IProgramEvaluationElement IProgramEvaluationElementProgramEvaluationLevel.ProgramEvaluationElement { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return ProgramEvaluationElement; } + set { ProgramEvaluationElement = (ProgramEvaluationElement) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int RatingLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_ratingLevelDescriptorId == default(int)) + _ratingLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _ratingLevelDescriptor); + + return _ratingLevelDescriptorId; + } + set + { + _ratingLevelDescriptorId = value; + _ratingLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _ratingLevelDescriptorId; + private string _ratingLevelDescriptor; + + public virtual string RatingLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_ratingLevelDescriptor == null) + _ratingLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _ratingLevelDescriptorId); + + return _ratingLevelDescriptor; + } + set + { + _ratingLevelDescriptor = value; + _ratingLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? MaxNumericRating { get; set; } + public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -88776,6 +87865,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -88791,6 +87909,10 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, + { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "RatingLevelDescriptor", new LookupColumnDetails { PropertyName = "RatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -88801,11 +87923,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ProgramEvaluationElement as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ProviderStatusDescriptorId", ProviderStatusDescriptorId); + keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); return keyValues; } @@ -88869,82 +87991,264 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IProviderStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IProviderStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel) target, null); } + void IChildEntity.SetParent(object value) + { + ProgramEvaluationElement = (ProgramEvaluationElement) value; + } } } -// Aggregate: PublicationStatusDescriptor +// Aggregate: ProgramEvaluationObjective -namespace EdFi.Ods.Entities.NHibernate.PublicationStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationObjectiveAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class ProgramEvaluationObjectiveReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long ProgramEducationOrganizationId { get; set; } + public virtual string ProgramEvaluationObjectiveTitle { get; set; } + public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + public virtual string ProgramEvaluationTitle { get; set; } + public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + public virtual string ProgramName { get; set; } + public virtual int ProgramTypeDescriptorId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationObjectiveTitle", ProgramEvaluationObjectiveTitle); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.PublicationStatusDescriptor table of the PublicationStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluationObjective table of the ProgramEvaluationObjective aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class PublicationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IPublicationStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramEvaluationObjective : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IProgramEvaluationObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int PublicationStatusDescriptorId + public ProgramEvaluationObjective() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + ProgramEvaluationObjectiveProgramEvaluationLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue + [DomainSignature] + public virtual long ProgramEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ProgramEvaluationObjectiveTitle { get; set; } + [DomainSignature] + public virtual int ProgramEvaluationPeriodDescriptorId { - get { return CodeValue; } - set { CodeValue = value; } + get + { + if (_programEvaluationPeriodDescriptorId == default(int)) + _programEvaluationPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptor); + + return _programEvaluationPeriodDescriptorId; + } + set + { + _programEvaluationPeriodDescriptorId = value; + _programEvaluationPeriodDescriptor = null; + } } - string IDescriptor.Description + + private int _programEvaluationPeriodDescriptorId; + private string _programEvaluationPeriodDescriptor; + + public virtual string ProgramEvaluationPeriodDescriptor { - get { return Description; } - set { Description = value; } + get + { + if (_programEvaluationPeriodDescriptor == null) + _programEvaluationPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationPeriodDescriptor", _programEvaluationPeriodDescriptorId); + + return _programEvaluationPeriodDescriptor; + } + set + { + _programEvaluationPeriodDescriptor = value; + _programEvaluationPeriodDescriptorId = default(int); + } } - DateTime? IDescriptor.EffectiveBeginDate + [DomainSignature] + public virtual string ProgramEvaluationTitle { get; set; } + [DomainSignature] + public virtual int ProgramEvaluationTypeDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_programEvaluationTypeDescriptorId == default(int)) + _programEvaluationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptor); + + return _programEvaluationTypeDescriptorId; + } + set + { + _programEvaluationTypeDescriptorId = value; + _programEvaluationTypeDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int _programEvaluationTypeDescriptorId; + private string _programEvaluationTypeDescriptor; + + public virtual string ProgramEvaluationTypeDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_programEvaluationTypeDescriptor == null) + _programEvaluationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramEvaluationTypeDescriptor", _programEvaluationTypeDescriptorId); + + return _programEvaluationTypeDescriptor; + } + set + { + _programEvaluationTypeDescriptor = value; + _programEvaluationTypeDescriptorId = default(int); + } } - string IDescriptor.Namespace + [DomainSignature] + public virtual string ProgramName { get; set; } + [DomainSignature] + public virtual int ProgramTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + public virtual string ProgramTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? ObjectiveMaxNumericRating { get; set; } + public virtual decimal? ObjectiveMinNumericRating { get; set; } + public virtual int? ObjectiveSortOrder { get; set; } + public virtual string ProgramEvaluationObjectiveDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -88955,21 +88259,120 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramEvaluationAggregate.EdFi.ProgramEvaluationReferenceData ProgramEvaluationReferenceData { get; set; } + + /// + /// Read-only property that allows the ProgramEvaluation discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscriminator + { + get { return ProgramEvaluationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProgramEvaluation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationResourceId + { + get { return ProgramEvaluationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _programEvaluationObjectiveProgramEvaluationLevels; + private ICollection _programEvaluationObjectiveProgramEvaluationLevelsCovariant; + public virtual ICollection ProgramEvaluationObjectiveProgramEvaluationLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programEvaluationObjectiveProgramEvaluationLevels) + if (item.ProgramEvaluationObjective == null) + item.ProgramEvaluationObjective = this; + // ------------------------------------------------------------- + + return _programEvaluationObjectiveProgramEvaluationLevels; + } + set + { + _programEvaluationObjectiveProgramEvaluationLevels = value; + _programEvaluationObjectiveProgramEvaluationLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationObjectiveProgramEvaluationLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _programEvaluationObjectiveProgramEvaluationLevels) + if (item.ProgramEvaluationObjective == null) + item.ProgramEvaluationObjective = this; + // ------------------------------------------------------------- + + return _programEvaluationObjectiveProgramEvaluationLevelsCovariant; + } + set + { + ProgramEvaluationObjectiveProgramEvaluationLevels = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, + { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -88984,7 +88387,13 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("PublicationStatusDescriptorId", PublicationStatusDescriptorId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramEvaluationObjectiveTitle", ProgramEvaluationObjectiveTitle); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); + keyValues.Add("ProgramEvaluationTitle", ProgramEvaluationTitle); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -89048,82 +88457,95 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IPublicationStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationObjective)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IPublicationStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluationObjective) target, null); } } -} -// Aggregate: QuestionFormDescriptor - -namespace EdFi.Ods.Entities.NHibernate.QuestionFormDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.QuestionFormDescriptor table of the QuestionFormDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluationObjectiveProgramEvaluationLevel table of the ProgramEvaluationObjective aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class QuestionFormDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IQuestionFormDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramEvaluationObjectiveProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int QuestionFormDescriptorId + public ProgramEvaluationObjectiveProgramEvaluationLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual ProgramEvaluationObjective ProgramEvaluationObjective { get; set; } + + Entities.Common.EdFi.IProgramEvaluationObjective IProgramEvaluationObjectiveProgramEvaluationLevel.ProgramEvaluationObjective { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return ProgramEvaluationObjective; } + set { ProgramEvaluationObjective = (ProgramEvaluationObjective) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int RatingLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_ratingLevelDescriptorId == default(int)) + _ratingLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RatingLevelDescriptor", _ratingLevelDescriptor); + + return _ratingLevelDescriptorId; + } + set + { + _ratingLevelDescriptorId = value; + _ratingLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _ratingLevelDescriptorId; + private string _ratingLevelDescriptor; + + public virtual string RatingLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_ratingLevelDescriptor == null) + _ratingLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RatingLevelDescriptor", _ratingLevelDescriptorId); + + return _ratingLevelDescriptor; + } + set + { + _ratingLevelDescriptor = value; + _ratingLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal? MaxNumericRating { get; set; } + public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -89134,6 +88556,35 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -89149,6 +88600,10 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramEvaluationPeriodDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationPeriodDescriptorId", LookupTypeName = "ProgramEvaluationPeriodDescriptor"} }, + { "ProgramEvaluationTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramEvaluationTypeDescriptorId", LookupTypeName = "ProgramEvaluationTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "RatingLevelDescriptor", new LookupColumnDetails { PropertyName = "RatingLevelDescriptorId", LookupTypeName = "RatingLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -89159,11 +88614,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ProgramEvaluationObjective as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("QuestionFormDescriptorId", QuestionFormDescriptorId); + keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); return keyValues; } @@ -89227,37 +88682,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IQuestionFormDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IQuestionFormDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel) target, null); } + void IChildEntity.SetParent(object value) + { + ProgramEvaluationObjective = (ProgramEvaluationObjective) value; + } } } -// Aggregate: RaceDescriptor +// Aggregate: ProgramEvaluationPeriodDescriptor -namespace EdFi.Ods.Entities.NHibernate.RaceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationPeriodDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RaceDescriptor table of the RaceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluationPeriodDescriptor table of the ProgramEvaluationPeriodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RaceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IRaceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramEvaluationPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int RaceDescriptorId + public virtual int ProgramEvaluationPeriodDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -89342,7 +88801,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RaceDescriptorId", RaceDescriptorId); + keyValues.Add("ProgramEvaluationPeriodDescriptorId", ProgramEvaluationPeriodDescriptorId); return keyValues; } @@ -89406,37 +88865,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRaceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRaceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor) target, null); } } } -// Aggregate: RatingLevelDescriptor +// Aggregate: ProgramEvaluationTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.RatingLevelDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RatingLevelDescriptor table of the RatingLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramEvaluationTypeDescriptor table of the ProgramEvaluationTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RatingLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IRatingLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgramEvaluationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int RatingLevelDescriptorId + public virtual int ProgramEvaluationTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -89521,7 +88980,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); + keyValues.Add("ProgramEvaluationTypeDescriptorId", ProgramEvaluationTypeDescriptorId); return keyValues; } @@ -89585,37 +89044,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRatingLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramEvaluationTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRatingLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramEvaluationTypeDescriptor) target, null); } } } -// Aggregate: ReasonExitedDescriptor +// Aggregate: ProgramSponsorDescriptor -namespace EdFi.Ods.Entities.NHibernate.ReasonExitedDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramSponsorDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReasonExitedDescriptor table of the ReasonExitedDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramSponsorDescriptor table of the ProgramSponsorDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReasonExitedDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IReasonExitedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramSponsorDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgramSponsorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ReasonExitedDescriptorId + public virtual int ProgramSponsorDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -89700,7 +89159,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReasonExitedDescriptorId", ReasonExitedDescriptorId); + keyValues.Add("ProgramSponsorDescriptorId", ProgramSponsorDescriptorId); return keyValues; } @@ -89764,37 +89223,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReasonExitedDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramSponsorDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReasonExitedDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramSponsorDescriptor) target, null); } } } -// Aggregate: ReasonNotTestedDescriptor +// Aggregate: ProgramTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.ReasonNotTestedDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgramTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReasonNotTestedDescriptor table of the ReasonNotTestedDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgramTypeDescriptor table of the ProgramTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReasonNotTestedDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IReasonNotTestedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgramTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgramTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ReasonNotTestedDescriptorId + public virtual int ProgramTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -89879,7 +89338,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReasonNotTestedDescriptorId", ReasonNotTestedDescriptorId); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -89943,37 +89402,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReasonNotTestedDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgramTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReasonNotTestedDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgramTypeDescriptor) target, null); } } } -// Aggregate: RecognitionTypeDescriptor +// Aggregate: ProgressDescriptor -namespace EdFi.Ods.Entities.NHibernate.RecognitionTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgressDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RecognitionTypeDescriptor table of the RecognitionTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgressDescriptor table of the ProgressDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RecognitionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IRecognitionTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgressDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgressDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int RecognitionTypeDescriptorId + public virtual int ProgressDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -90058,7 +89517,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RecognitionTypeDescriptorId", RecognitionTypeDescriptorId); + keyValues.Add("ProgressDescriptorId", ProgressDescriptorId); return keyValues; } @@ -90122,37 +89581,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRecognitionTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgressDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRecognitionTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgressDescriptor) target, null); } } } -// Aggregate: RelationDescriptor +// Aggregate: ProgressLevelDescriptor -namespace EdFi.Ods.Entities.NHibernate.RelationDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProgressLevelDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RelationDescriptor table of the RelationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProgressLevelDescriptor table of the ProgressLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RelationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IRelationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProgressLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProgressLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int RelationDescriptorId + public virtual int ProgressLevelDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -90237,186 +89696,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RelationDescriptorId", RelationDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IRelationDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IRelationDescriptor) target, null); - } - - } -} -// Aggregate: RepeatIdentifierDescriptor - -namespace EdFi.Ods.Entities.NHibernate.RepeatIdentifierDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.RepeatIdentifierDescriptor table of the RepeatIdentifierDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class RepeatIdentifierDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IRepeatIdentifierDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int RepeatIdentifierDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("RepeatIdentifierDescriptorId", RepeatIdentifierDescriptorId); + keyValues.Add("ProgressLevelDescriptorId", ProgressLevelDescriptorId); return keyValues; } @@ -90480,34 +89760,30 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRepeatIdentifierDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProgressLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRepeatIdentifierDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProgressLevelDescriptor) target, null); } } } -// Aggregate: ReportCard +// Aggregate: ProjectDimension -namespace EdFi.Ods.Entities.NHibernate.ReportCardAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProjectDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ReportCardReferenceData : IHasPrimaryKeyValues + public class ProjectDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual int GradingPeriodDescriptorId { get; set; } - public virtual string GradingPeriodName { get; set; } - public virtual long GradingPeriodSchoolId { get; set; } - public virtual short GradingPeriodSchoolYear { get; set; } - public virtual int StudentUSI { get; set; } + public virtual string Code { get; set; } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// @@ -90528,12 +89804,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); - keyValues.Add("GradingPeriodName", GradingPeriodName); - keyValues.Add("GradingPeriodSchoolId", GradingPeriodSchoolId); - keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -90584,22 +89856,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReportCard table of the ReportCard aggregate in the ODS database. + /// A class which represents the edfi.ProjectDimension table of the ProjectDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReportCard : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IReportCard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProjectDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IProjectDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ReportCard() + public ProjectDimension() { - ReportCardGrades = new HashSet(); - ReportCardGradePointAverages = new HashSet(); - ReportCardStudentCompetencyObjectives = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ProjectDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -90608,97 +89878,9 @@ public ReportCard() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual int GradingPeriodDescriptorId - { - get - { - if (_gradingPeriodDescriptorId == default(int)) - _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); - - return _gradingPeriodDescriptorId; - } - set - { - _gradingPeriodDescriptorId = value; - _gradingPeriodDescriptor = null; - } - } - - private int _gradingPeriodDescriptorId; - private string _gradingPeriodDescriptor; - - public virtual string GradingPeriodDescriptor - { - get - { - if (_gradingPeriodDescriptor == null) - _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); - - return _gradingPeriodDescriptor; - } - set - { - _gradingPeriodDescriptor = value; - _gradingPeriodDescriptorId = default(int); - } - } - [DomainSignature] - public virtual string GradingPeriodName { get; set; } - [DomainSignature] - public virtual long GradingPeriodSchoolId { get; set; } + public virtual string Code { get; set; } [DomainSignature] - public virtual short GradingPeriodSchoolYear { get; set; } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId - { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } - } + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -90709,9 +89891,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? NumberOfDaysAbsent { get; set; } - public virtual decimal? NumberOfDaysInAttendance { get; set; } - public virtual int? NumberOfDaysTardy { get; set; } + public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -90756,169 +89936,15 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IReportCard.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IReportCard.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } - - /// - /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IReportCard.GradingPeriodDiscriminator - { - get { return GradingPeriodReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IReportCard.GradingPeriodResourceId - { - get { return GradingPeriodReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } - - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IReportCard.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IReportCard.StudentResourceId - { - get { return StudentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _reportCardGrades; - private ICollection _reportCardGradesCovariant; - public virtual ICollection ReportCardGrades - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _reportCardGrades) - if (item.ReportCard == null) - item.ReportCard = this; - // ------------------------------------------------------------- - - return _reportCardGrades; - } - set - { - _reportCardGrades = value; - _reportCardGradesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IReportCard.ReportCardGrades - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _reportCardGrades) - if (item.ReportCard == null) - item.ReportCard = this; - // ------------------------------------------------------------- - - return _reportCardGradesCovariant; - } - set - { - ReportCardGrades = new HashSet(value.Cast()); - } - } - - - private ICollection _reportCardGradePointAverages; - private ICollection _reportCardGradePointAveragesCovariant; - public virtual ICollection ReportCardGradePointAverages - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _reportCardGradePointAverages) - if (item.ReportCard == null) - item.ReportCard = this; - // ------------------------------------------------------------- - - return _reportCardGradePointAverages; - } - set - { - _reportCardGradePointAverages = value; - _reportCardGradePointAveragesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IReportCard.ReportCardGradePointAverages - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _reportCardGradePointAverages) - if (item.ReportCard == null) - item.ReportCard = this; - // ------------------------------------------------------------- - - return _reportCardGradePointAveragesCovariant; - } - set - { - ReportCardGradePointAverages = new HashSet(value.Cast()); - } - } - - - private ICollection _reportCardStudentCompetencyObjectives; - private ICollection _reportCardStudentCompetencyObjectivesCovariant; - public virtual ICollection ReportCardStudentCompetencyObjectives + private ICollection _projectDimensionReportingTags; + private ICollection _projectDimensionReportingTagsCovariant; + public virtual ICollection ProjectDimensionReportingTags { get { @@ -90927,38 +89953,38 @@ public virtual ICollection(value); + _projectDimensionReportingTags = value; + _projectDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IReportCard.ReportCardStudentCompetencyObjectives + ICollection Entities.Common.EdFi.IProjectDimension.ProjectDimensionReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _reportCardStudentCompetencyObjectives) - if (item.ReportCard == null) - item.ReportCard = this; + foreach (var item in _projectDimensionReportingTags) + if (item.ProjectDimension == null) + item.ProjectDimension = this; // ------------------------------------------------------------- - return _reportCardStudentCompetencyObjectivesCovariant; + return _projectDimensionReportingTagsCovariant; } set { - ReportCardStudentCompetencyObjectives = new HashSet(value.Cast()); + ProjectDimensionReportingTags = new HashSet(value.Cast()); } } @@ -90967,7 +89993,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -90982,12 +90007,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); - keyValues.Add("GradingPeriodName", GradingPeriodName); - keyValues.Add("GradingPeriodSchoolId", GradingPeriodSchoolId); - keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -91051,12 +90072,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReportCard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProjectDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReportCard) target, null); + this.MapTo((Entities.Common.EdFi.IProjectDimension) target, null); } } @@ -91064,19 +90085,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReportCardGrade table of the ReportCard aggregate in the ODS database. + /// A class which represents the edfi.ProjectDimensionReportingTag table of the ProjectDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReportCardGrade : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IReportCardGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProjectDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IProjectDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ReportCardGrade() + public ProjectDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -91085,69 +90106,49 @@ public ReportCardGrade() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual ReportCard ReportCard { get; set; } - - Entities.Common.EdFi.IReportCard IReportCardGrade.ReportCard - { - get { return ReportCard; } - set { ReportCard = (ReportCard) value; } - } + public virtual ProjectDimension ProjectDimension { get; set; } - [DomainSignature] - public virtual DateTime BeginDate + Entities.Common.EdFi.IProjectDimension IProjectDimensionReportingTag.ProjectDimension { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get { return ProjectDimension; } + set { ProjectDimension = (ProjectDimension) value; } } - private DateTime _beginDate; - [DomainSignature] - public virtual int GradeTypeDescriptorId + public virtual int ReportingTagDescriptorId { get { - if (_gradeTypeDescriptorId == default(int)) - _gradeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeTypeDescriptor", _gradeTypeDescriptor); + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - return _gradeTypeDescriptorId; + return _reportingTagDescriptorId; } set { - _gradeTypeDescriptorId = value; - _gradeTypeDescriptor = null; + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; } } - private int _gradeTypeDescriptorId; - private string _gradeTypeDescriptor; + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; - public virtual string GradeTypeDescriptor + public virtual string ReportingTagDescriptor { get { - if (_gradeTypeDescriptor == null) - _gradeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeTypeDescriptor", _gradeTypeDescriptorId); + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - return _gradeTypeDescriptor; + return _reportingTagDescriptor; } set { - _gradeTypeDescriptor = value; - _gradeTypeDescriptorId = default(int); + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); } } - [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [DomainSignature] - public virtual string SectionIdentifier { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -91202,26 +90203,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.GradeAggregate.EdFi.GradeReferenceData GradeReferenceData { get; set; } - - /// - /// Read-only property that allows the Grade discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IReportCardGrade.GradeDiscriminator - { - get { return GradeReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Grade resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IReportCardGrade.GradeResourceId - { - get { return GradeReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -91232,8 +90213,7 @@ string Entities.Common.EdFi.IReportCardGrade.GradeDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeTypeDescriptor", new LookupColumnDetails { PropertyName = "GradeTypeDescriptorId", LookupTypeName = "GradeTypeDescriptor"} }, - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -91245,16 +90225,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ProjectDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -91318,100 +90292,86 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReportCardGrade)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProjectDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReportCardGrade) target, null); + this.MapTo((Entities.Common.EdFi.IProjectDimensionReportingTag) target, null); } void IChildEntity.SetParent(object value) { - ReportCard = (ReportCard) value; + ProjectDimension = (ProjectDimension) value; } } +} +// Aggregate: ProviderCategoryDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ProviderCategoryDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReportCardGradePointAverage table of the ReportCard aggregate in the ODS database. + /// A class which represents the edfi.ProviderCategoryDescriptor table of the ProviderCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReportCardGradePointAverage : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IReportCardGradePointAverage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProviderCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProviderCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ReportCardGradePointAverage() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ReportCard ReportCard { get; set; } - - Entities.Common.EdFi.IReportCard IReportCardGradePointAverage.ReportCard - { - get { return ReportCard; } - set { ReportCard = (ReportCard) value; } - } - [DomainSignature] - public virtual int GradePointAverageTypeDescriptorId - { - get - { - if (_gradePointAverageTypeDescriptorId == default(int)) - _gradePointAverageTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptor); - - return _gradePointAverageTypeDescriptorId; - } - set - { - _gradePointAverageTypeDescriptorId = value; - _gradePointAverageTypeDescriptor = null; - } - } - - private int _gradePointAverageTypeDescriptorId; - private string _gradePointAverageTypeDescriptor; - - public virtual string GradePointAverageTypeDescriptor + public virtual int ProviderCategoryDescriptorId { - get - { - if (_gradePointAverageTypeDescriptor == null) - _gradePointAverageTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptorId); - - return _gradePointAverageTypeDescriptor; - } - set - { - _gradePointAverageTypeDescriptor = value; - _gradePointAverageTypeDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal GradePointAverageValue { get; set; } - public virtual bool? IsCumulative { get; set; } - public virtual decimal? MaxGradePointAverageValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -91422,35 +90382,6 @@ public virtual string GradePointAverageTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -91466,8 +90397,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradePointAverageTypeDescriptor", new LookupColumnDetails { PropertyName = "GradePointAverageTypeDescriptorId", LookupTypeName = "GradePointAverageTypeDescriptor"} }, - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -91478,11 +90407,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); + keyValues.Add("ProviderCategoryDescriptorId", ProviderCategoryDescriptorId); return keyValues; } @@ -91546,96 +90475,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReportCardGradePointAverage)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProviderCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReportCardGradePointAverage) target, null); + this.MapTo((Entities.Common.EdFi.IProviderCategoryDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ReportCard = (ReportCard) value; - } } +} +// Aggregate: ProviderProfitabilityDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ProviderProfitabilityDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReportCardStudentCompetencyObjective table of the ReportCard aggregate in the ODS database. + /// A class which represents the edfi.ProviderProfitabilityDescriptor table of the ProviderProfitabilityDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReportCardStudentCompetencyObjective : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IReportCardStudentCompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ProviderProfitabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProviderProfitabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ReportCardStudentCompetencyObjective() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ReportCard ReportCard { get; set; } - - Entities.Common.EdFi.IReportCard IReportCardStudentCompetencyObjective.ReportCard - { - get { return ReportCard; } - set { ReportCard = (ReportCard) value; } - } - - [DomainSignature] - public virtual long ObjectiveEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string Objective { get; set; } [DomainSignature] - public virtual int ObjectiveGradeLevelDescriptorId - { - get - { - if (_objectiveGradeLevelDescriptorId == default(int)) - _objectiveGradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _objectiveGradeLevelDescriptor); - - return _objectiveGradeLevelDescriptorId; - } - set - { - _objectiveGradeLevelDescriptorId = value; - _objectiveGradeLevelDescriptor = null; - } - } - - private int _objectiveGradeLevelDescriptorId; - private string _objectiveGradeLevelDescriptor; - - public virtual string ObjectiveGradeLevelDescriptor + public virtual int ProviderProfitabilityDescriptorId { - get - { - if (_objectiveGradeLevelDescriptor == null) - _objectiveGradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _objectiveGradeLevelDescriptorId); - - return _objectiveGradeLevelDescriptor; - } - set - { - _objectiveGradeLevelDescriptor = value; - _objectiveGradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -91651,60 +90561,11 @@ public virtual string ObjectiveGradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.StudentCompetencyObjectiveAggregate.EdFi.StudentCompetencyObjectiveReferenceData StudentCompetencyObjectiveReferenceData { get; set; } - - /// - /// Read-only property that allows the StudentCompetencyObjective discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveDiscriminator - { - get { return StudentCompetencyObjectiveReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the StudentCompetencyObjective resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveResourceId - { - get { return StudentCompetencyObjectiveReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -91715,8 +90576,6 @@ string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompete // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, - { "ObjectiveGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "ObjectiveGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -91727,13 +90586,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Objective", Objective); - keyValues.Add("ObjectiveEducationOrganizationId", ObjectiveEducationOrganizationId); - keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); + keyValues.Add("ProviderProfitabilityDescriptorId", ProviderProfitabilityDescriptorId); return keyValues; } @@ -91797,41 +90654,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReportCardStudentCompetencyObjective)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProviderProfitabilityDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReportCardStudentCompetencyObjective) target, null); + this.MapTo((Entities.Common.EdFi.IProviderProfitabilityDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ReportCard = (ReportCard) value; - } } } -// Aggregate: ReporterDescriptionDescriptor +// Aggregate: ProviderStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.ReporterDescriptionDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ProviderStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReporterDescriptionDescriptor table of the ReporterDescriptionDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ProviderStatusDescriptor table of the ProviderStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReporterDescriptionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IReporterDescriptionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ProviderStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IProviderStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ReporterDescriptionDescriptorId + public virtual int ProviderStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -91916,7 +90769,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReporterDescriptionDescriptorId", ReporterDescriptionDescriptorId); + keyValues.Add("ProviderStatusDescriptorId", ProviderStatusDescriptorId); return keyValues; } @@ -91980,37 +90833,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReporterDescriptionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IProviderStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReporterDescriptionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IProviderStatusDescriptor) target, null); } } } -// Aggregate: ReportingTagDescriptor +// Aggregate: PublicationStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.ReportingTagDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.PublicationStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ReportingTagDescriptor table of the ReportingTagDescriptor aggregate in the ODS database. + /// A class which represents the edfi.PublicationStatusDescriptor table of the PublicationStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ReportingTagDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IReportingTagDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class PublicationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IPublicationStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ReportingTagDescriptorId + public virtual int PublicationStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -92095,7 +90948,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("PublicationStatusDescriptorId", PublicationStatusDescriptorId); return keyValues; } @@ -92159,37 +91012,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IReportingTagDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IPublicationStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IReportingTagDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IPublicationStatusDescriptor) target, null); } } } -// Aggregate: ResidencyStatusDescriptor +// Aggregate: QuestionFormDescriptor -namespace EdFi.Ods.Entities.NHibernate.ResidencyStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.QuestionFormDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ResidencyStatusDescriptor table of the ResidencyStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.QuestionFormDescriptor table of the QuestionFormDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ResidencyStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IResidencyStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class QuestionFormDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IQuestionFormDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ResidencyStatusDescriptorId + public virtual int QuestionFormDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -92274,7 +91127,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ResidencyStatusDescriptorId", ResidencyStatusDescriptorId); + keyValues.Add("QuestionFormDescriptorId", QuestionFormDescriptorId); return keyValues; } @@ -92338,37 +91191,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IResidencyStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IQuestionFormDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IResidencyStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IQuestionFormDescriptor) target, null); } } } -// Aggregate: ResponseIndicatorDescriptor +// Aggregate: RaceDescriptor -namespace EdFi.Ods.Entities.NHibernate.ResponseIndicatorDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.RaceDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ResponseIndicatorDescriptor table of the ResponseIndicatorDescriptor aggregate in the ODS database. + /// A class which represents the edfi.RaceDescriptor table of the RaceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ResponseIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IResponseIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class RaceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IRaceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ResponseIndicatorDescriptorId + public virtual int RaceDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -92453,7 +91306,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ResponseIndicatorDescriptorId", ResponseIndicatorDescriptorId); + keyValues.Add("RaceDescriptorId", RaceDescriptorId); return keyValues; } @@ -92517,37 +91370,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IResponseIndicatorDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRaceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IResponseIndicatorDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IRaceDescriptor) target, null); } } } -// Aggregate: ResponsibilityDescriptor +// Aggregate: RatingLevelDescriptor -namespace EdFi.Ods.Entities.NHibernate.ResponsibilityDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.RatingLevelDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ResponsibilityDescriptor table of the ResponsibilityDescriptor aggregate in the ODS database. + /// A class which represents the edfi.RatingLevelDescriptor table of the RatingLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ResponsibilityDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IResponsibilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class RatingLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IRatingLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ResponsibilityDescriptorId + public virtual int RatingLevelDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -92632,7 +91485,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ResponsibilityDescriptorId", ResponsibilityDescriptorId); + keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); return keyValues; } @@ -92696,233 +91549,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IResponsibilityDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRatingLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IResponsibilityDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IRatingLevelDescriptor) target, null); } } } -// Aggregate: RestraintEvent +// Aggregate: ReasonExitedDescriptor -namespace EdFi.Ods.Entities.NHibernate.RestraintEventAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ReasonExitedDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class RestraintEventReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string RestraintEventIdentifier { get; set; } - public virtual long SchoolId { get; set; } - public virtual int StudentUSI { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("RestraintEventIdentifier", RestraintEventIdentifier); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("StudentUSI", StudentUSI); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RestraintEvent table of the RestraintEvent aggregate in the ODS database. + /// A class which represents the edfi.ReasonExitedDescriptor table of the ReasonExitedDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RestraintEvent : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IRestraintEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ReasonExitedDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IReasonExitedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public RestraintEvent() - { - RestraintEventPrograms = new HashSet(); - RestraintEventReasons = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string RestraintEventIdentifier { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId + public virtual int ReasonExitedDescriptorId { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? EducationalEnvironmentDescriptorId + string IDescriptor.CodeValue { - get - { - if (_educationalEnvironmentDescriptorId == default(int?)) - _educationalEnvironmentDescriptorId = string.IsNullOrWhiteSpace(_educationalEnvironmentDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationalEnvironmentDescriptor", _educationalEnvironmentDescriptor); - - return _educationalEnvironmentDescriptorId; - } - set - { - _educationalEnvironmentDescriptorId = value; - _educationalEnvironmentDescriptor = null; - } + get { return CodeValue; } + set { CodeValue = value; } } - - private int? _educationalEnvironmentDescriptorId; - private string _educationalEnvironmentDescriptor; - - public virtual string EducationalEnvironmentDescriptor + string IDescriptor.Description { - get - { - if (_educationalEnvironmentDescriptor == null) - _educationalEnvironmentDescriptor = _educationalEnvironmentDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationalEnvironmentDescriptor", _educationalEnvironmentDescriptorId.Value); - - return _educationalEnvironmentDescriptor; - } - set - { - _educationalEnvironmentDescriptor = value; - _educationalEnvironmentDescriptorId = default(int?); - } + get { return Description; } + set { Description = value; } } - public virtual DateTime EventDate + DateTime? IDescriptor.EffectiveBeginDate { - get { return _eventDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _eventDate = new DateTime(value.Year, value.Month, value.Day); } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - private DateTime _eventDate; - - public virtual string IncidentIdentifier { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -92933,196 +91635,21 @@ public virtual DateTime EventDate // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } - - /// - /// Read-only property that allows the DisciplineIncident discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentDiscriminator - { - get { return DisciplineIncidentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the DisciplineIncident resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentResourceId - { - get { return DisciplineIncidentReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IRestraintEvent.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } - - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IRestraintEvent.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IRestraintEvent.StudentResourceId - { - get { return StudentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _restraintEventPrograms; - private ICollection _restraintEventProgramsCovariant; - public virtual ICollection RestraintEventPrograms - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _restraintEventPrograms) - if (item.RestraintEvent == null) - item.RestraintEvent = this; - // ------------------------------------------------------------- - - return _restraintEventPrograms; - } - set - { - _restraintEventPrograms = value; - _restraintEventProgramsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventPrograms - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _restraintEventPrograms) - if (item.RestraintEvent == null) - item.RestraintEvent = this; - // ------------------------------------------------------------- - - return _restraintEventProgramsCovariant; - } - set - { - RestraintEventPrograms = new HashSet(value.Cast()); - } - } - - - private ICollection _restraintEventReasons; - private ICollection _restraintEventReasonsCovariant; - public virtual ICollection RestraintEventReasons - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _restraintEventReasons) - if (item.RestraintEvent == null) - item.RestraintEvent = this; - // ------------------------------------------------------------- - - return _restraintEventReasons; - } - set - { - _restraintEventReasons = value; - _restraintEventReasonsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventReasons - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _restraintEventReasons) - if (item.RestraintEvent == null) - item.RestraintEvent = this; - // ------------------------------------------------------------- - - return _restraintEventReasonsCovariant; - } - set - { - RestraintEventReasons = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EducationalEnvironmentDescriptor", new LookupColumnDetails { PropertyName = "EducationalEnvironmentDescriptorId", LookupTypeName = "EducationalEnvironmentDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -93137,9 +91664,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RestraintEventIdentifier", RestraintEventIdentifier); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("ReasonExitedDescriptorId", ReasonExitedDescriptorId); return keyValues; } @@ -93203,92 +91728,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEvent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReasonExitedDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRestraintEvent) target, null); + this.MapTo((Entities.Common.EdFi.IReasonExitedDescriptor) target, null); } } +} +// Aggregate: ReasonNotTestedDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ReasonNotTestedDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RestraintEventProgram table of the RestraintEvent aggregate in the ODS database. + /// A class which represents the edfi.ReasonNotTestedDescriptor table of the ReasonNotTestedDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RestraintEventProgram : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IRestraintEventProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ReasonNotTestedDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IReasonNotTestedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public RestraintEventProgram() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual RestraintEvent RestraintEvent { get; set; } - - Entities.Common.EdFi.IRestraintEvent IRestraintEventProgram.RestraintEvent - { - get { return RestraintEvent; } - set { RestraintEvent = (RestraintEvent) value; } - } - - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramName { get; set; } [DomainSignature] - public virtual int ProgramTypeDescriptorId - { - get - { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - - return _programTypeDescriptorId; - } - set - { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; - } - } - - private int _programTypeDescriptorId; - private string _programTypeDescriptor; - - public virtual string ProgramTypeDescriptor + public virtual int ReasonNotTestedDescriptorId { - get - { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - - return _programTypeDescriptor; - } - set - { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -93304,60 +91814,11 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } - - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IRestraintEventProgram.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IRestraintEventProgram.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -93368,7 +91829,6 @@ string Entities.Common.EdFi.IRestraintEventProgram.ProgramDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -93379,13 +91839,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (RestraintEvent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("ReasonNotTestedDescriptorId", ReasonNotTestedDescriptorId); return keyValues; } @@ -93449,92 +91907,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEventProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReasonNotTestedDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRestraintEventProgram) target, null); + this.MapTo((Entities.Common.EdFi.IReasonNotTestedDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - RestraintEvent = (RestraintEvent) value; - } } +} +// Aggregate: RecognitionTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.RecognitionTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RestraintEventReason table of the RestraintEvent aggregate in the ODS database. + /// A class which represents the edfi.RecognitionTypeDescriptor table of the RecognitionTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RestraintEventReason : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IRestraintEventReason, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class RecognitionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IRecognitionTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public RestraintEventReason() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual RestraintEvent RestraintEvent { get; set; } - - Entities.Common.EdFi.IRestraintEvent IRestraintEventReason.RestraintEvent - { - get { return RestraintEvent; } - set { RestraintEvent = (RestraintEvent) value; } - } - [DomainSignature] - public virtual int RestraintEventReasonDescriptorId - { - get - { - if (_restraintEventReasonDescriptorId == default(int)) - _restraintEventReasonDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RestraintEventReasonDescriptor", _restraintEventReasonDescriptor); - - return _restraintEventReasonDescriptorId; - } - set - { - _restraintEventReasonDescriptorId = value; - _restraintEventReasonDescriptor = null; - } - } - - private int _restraintEventReasonDescriptorId; - private string _restraintEventReasonDescriptor; - - public virtual string RestraintEventReasonDescriptor + public virtual int RecognitionTypeDescriptorId { - get - { - if (_restraintEventReasonDescriptor == null) - _restraintEventReasonDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RestraintEventReasonDescriptor", _restraintEventReasonDescriptorId); - - return _restraintEventReasonDescriptor; - } - set - { - _restraintEventReasonDescriptor = value; - _restraintEventReasonDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -93550,35 +91993,6 @@ public virtual string RestraintEventReasonDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -93594,7 +92008,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "RestraintEventReasonDescriptor", new LookupColumnDetails { PropertyName = "RestraintEventReasonDescriptorId", LookupTypeName = "RestraintEventReasonDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -93605,11 +92018,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (RestraintEvent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RestraintEventReasonDescriptorId", RestraintEventReasonDescriptorId); + keyValues.Add("RecognitionTypeDescriptorId", RecognitionTypeDescriptorId); return keyValues; } @@ -93673,41 +92086,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEventReason)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRecognitionTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRestraintEventReason) target, null); + this.MapTo((Entities.Common.EdFi.IRecognitionTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - RestraintEvent = (RestraintEvent) value; - } } } -// Aggregate: RestraintEventReasonDescriptor +// Aggregate: RelationDescriptor -namespace EdFi.Ods.Entities.NHibernate.RestraintEventReasonDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.RelationDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.RestraintEventReasonDescriptor table of the RestraintEventReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.RelationDescriptor table of the RelationDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class RestraintEventReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IRestraintEventReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class RelationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IRelationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int RestraintEventReasonDescriptorId + public virtual int RelationDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -93792,7 +92201,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RestraintEventReasonDescriptorId", RestraintEventReasonDescriptorId); + keyValues.Add("RelationDescriptorId", RelationDescriptorId); return keyValues; } @@ -93856,37 +92265,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEventReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRelationDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IRestraintEventReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IRelationDescriptor) target, null); } } } -// Aggregate: ResultDatatypeTypeDescriptor +// Aggregate: RepeatIdentifierDescriptor -namespace EdFi.Ods.Entities.NHibernate.ResultDatatypeTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.RepeatIdentifierDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ResultDatatypeTypeDescriptor table of the ResultDatatypeTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.RepeatIdentifierDescriptor table of the RepeatIdentifierDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ResultDatatypeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IResultDatatypeTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class RepeatIdentifierDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IRepeatIdentifierDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ResultDatatypeTypeDescriptorId + public virtual int RepeatIdentifierDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -93971,7 +92380,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ResultDatatypeTypeDescriptorId", ResultDatatypeTypeDescriptorId); + keyValues.Add("RepeatIdentifierDescriptorId", RepeatIdentifierDescriptorId); return keyValues; } @@ -94035,113 +92444,46 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IResultDatatypeTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRepeatIdentifierDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IResultDatatypeTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IRepeatIdentifierDescriptor) target, null); } } } -// Aggregate: RetestIndicatorDescriptor +// Aggregate: ReportCard -namespace EdFi.Ods.Entities.NHibernate.RetestIndicatorDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ReportCardAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.RetestIndicatorDescriptor table of the RetestIndicatorDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class RetestIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IRetestIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ReportCardReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int RetestIndicatorDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual int GradingPeriodDescriptorId { get; set; } + public virtual string GradingPeriodName { get; set; } + public virtual long GradingPeriodSchoolId { get; set; } + public virtual short GradingPeriodSchoolYear { get; set; } + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -94150,7 +92492,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("RetestIndicatorDescriptorId", RetestIndicatorDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); + keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("GradingPeriodSchoolId", GradingPeriodSchoolId); + keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -94171,18 +92518,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -94199,52 +92536,34 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IRetestIndicatorDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IRetestIndicatorDescriptor) target, null); - } - } -} -// Aggregate: School -namespace EdFi.Ods.Entities.NHibernate.SchoolAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.School table of the School aggregate in the ODS database. + /// A class which represents the edfi.ReportCard table of the ReportCard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class School : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.ISchool, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ReportCard : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IReportCard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public School() + public virtual void SuspendReferenceAssignmentCheck() { } + + public ReportCard() { - SchoolCategories = new HashSet(); - SchoolGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ReportCardGrades = new HashSet(); + ReportCardGradePointAverages = new HashSet(); + ReportCardStudentCompetencyObjectives = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -94253,282 +92572,110 @@ public School() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long SchoolId - { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor - { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } - } - string IEducationOrganization.ShortNameOfInstitution - { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } - } - string IEducationOrganization.WebSite - { - get { return WebSite; } - set { WebSite = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? AdministrativeFundingControlDescriptorId + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int GradingPeriodDescriptorId { get { - if (_administrativeFundingControlDescriptorId == default(int?)) - _administrativeFundingControlDescriptorId = string.IsNullOrWhiteSpace(_administrativeFundingControlDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptor); + if (_gradingPeriodDescriptorId == default(int)) + _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); - return _administrativeFundingControlDescriptorId; + return _gradingPeriodDescriptorId; } set { - _administrativeFundingControlDescriptorId = value; - _administrativeFundingControlDescriptor = null; + _gradingPeriodDescriptorId = value; + _gradingPeriodDescriptor = null; } } - private int? _administrativeFundingControlDescriptorId; - private string _administrativeFundingControlDescriptor; + private int _gradingPeriodDescriptorId; + private string _gradingPeriodDescriptor; - public virtual string AdministrativeFundingControlDescriptor + public virtual string GradingPeriodDescriptor { get { - if (_administrativeFundingControlDescriptor == null) - _administrativeFundingControlDescriptor = _administrativeFundingControlDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptorId.Value); + if (_gradingPeriodDescriptor == null) + _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); - return _administrativeFundingControlDescriptor; + return _gradingPeriodDescriptor; } set { - _administrativeFundingControlDescriptor = value; - _administrativeFundingControlDescriptorId = default(int?); + _gradingPeriodDescriptor = value; + _gradingPeriodDescriptorId = default(int); } } - public virtual int? CharterApprovalAgencyTypeDescriptorId + [DomainSignature] + public virtual string GradingPeriodName { get; set; } + [DomainSignature] + public virtual long GradingPeriodSchoolId { get; set; } + [DomainSignature] + public virtual short GradingPeriodSchoolYear { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI { get { - if (_charterApprovalAgencyTypeDescriptorId == default(int?)) - _charterApprovalAgencyTypeDescriptorId = string.IsNullOrWhiteSpace(_charterApprovalAgencyTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CharterApprovalAgencyTypeDescriptor", _charterApprovalAgencyTypeDescriptor); + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - return _charterApprovalAgencyTypeDescriptorId; + return _studentUSI; } set { - _charterApprovalAgencyTypeDescriptorId = value; - _charterApprovalAgencyTypeDescriptor = null; + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); } } - private int? _charterApprovalAgencyTypeDescriptorId; - private string _charterApprovalAgencyTypeDescriptor; + private int _studentUSI; + private string _studentUniqueId; - public virtual string CharterApprovalAgencyTypeDescriptor + public virtual string StudentUniqueId { get { - if (_charterApprovalAgencyTypeDescriptor == null) - _charterApprovalAgencyTypeDescriptor = _charterApprovalAgencyTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CharterApprovalAgencyTypeDescriptor", _charterApprovalAgencyTypeDescriptorId.Value); - - return _charterApprovalAgencyTypeDescriptor; - } - set - { - _charterApprovalAgencyTypeDescriptor = value; - _charterApprovalAgencyTypeDescriptorId = default(int?); - } - } - public virtual short? CharterApprovalSchoolYear { get; set; } - public virtual int? CharterStatusDescriptorId - { - get - { - if (_charterStatusDescriptorId == default(int?)) - _charterStatusDescriptorId = string.IsNullOrWhiteSpace(_charterStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CharterStatusDescriptor", _charterStatusDescriptor); - - return _charterStatusDescriptorId; - } - set - { - _charterStatusDescriptorId = value; - _charterStatusDescriptor = null; - } - } - - private int? _charterStatusDescriptorId; - private string _charterStatusDescriptor; - - public virtual string CharterStatusDescriptor - { - get - { - if (_charterStatusDescriptor == null) - _charterStatusDescriptor = _charterStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CharterStatusDescriptor", _charterStatusDescriptorId.Value); - - return _charterStatusDescriptor; - } - set - { - _charterStatusDescriptor = value; - _charterStatusDescriptorId = default(int?); - } - } - public virtual int? InternetAccessDescriptorId - { - get - { - if (_internetAccessDescriptorId == default(int?)) - _internetAccessDescriptorId = string.IsNullOrWhiteSpace(_internetAccessDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InternetAccessDescriptor", _internetAccessDescriptor); - - return _internetAccessDescriptorId; - } - set - { - _internetAccessDescriptorId = value; - _internetAccessDescriptor = null; - } - } - - private int? _internetAccessDescriptorId; - private string _internetAccessDescriptor; - - public virtual string InternetAccessDescriptor - { - get - { - if (_internetAccessDescriptor == null) - _internetAccessDescriptor = _internetAccessDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InternetAccessDescriptor", _internetAccessDescriptorId.Value); - - return _internetAccessDescriptor; - } - set - { - _internetAccessDescriptor = value; - _internetAccessDescriptorId = default(int?); - } - } - public virtual long? LocalEducationAgencyId { get; set; } - public virtual int? MagnetSpecialProgramEmphasisSchoolDescriptorId - { - get - { - if (_magnetSpecialProgramEmphasisSchoolDescriptorId == default(int?)) - _magnetSpecialProgramEmphasisSchoolDescriptorId = string.IsNullOrWhiteSpace(_magnetSpecialProgramEmphasisSchoolDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MagnetSpecialProgramEmphasisSchoolDescriptor", _magnetSpecialProgramEmphasisSchoolDescriptor); - - return _magnetSpecialProgramEmphasisSchoolDescriptorId; - } - set - { - _magnetSpecialProgramEmphasisSchoolDescriptorId = value; - _magnetSpecialProgramEmphasisSchoolDescriptor = null; - } - } - - private int? _magnetSpecialProgramEmphasisSchoolDescriptorId; - private string _magnetSpecialProgramEmphasisSchoolDescriptor; - - public virtual string MagnetSpecialProgramEmphasisSchoolDescriptor - { - get - { - if (_magnetSpecialProgramEmphasisSchoolDescriptor == null) - _magnetSpecialProgramEmphasisSchoolDescriptor = _magnetSpecialProgramEmphasisSchoolDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MagnetSpecialProgramEmphasisSchoolDescriptor", _magnetSpecialProgramEmphasisSchoolDescriptorId.Value); - - return _magnetSpecialProgramEmphasisSchoolDescriptor; - } - set - { - _magnetSpecialProgramEmphasisSchoolDescriptor = value; - _magnetSpecialProgramEmphasisSchoolDescriptorId = default(int?); - } - } - public virtual int? SchoolTypeDescriptorId - { - get - { - if (_schoolTypeDescriptorId == default(int?)) - _schoolTypeDescriptorId = string.IsNullOrWhiteSpace(_schoolTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolTypeDescriptor", _schoolTypeDescriptor); - - return _schoolTypeDescriptorId; - } - set - { - _schoolTypeDescriptorId = value; - _schoolTypeDescriptor = null; - } - } - - private int? _schoolTypeDescriptorId; - private string _schoolTypeDescriptor; + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } - public virtual string SchoolTypeDescriptor - { - get - { - if (_schoolTypeDescriptor == null) - _schoolTypeDescriptor = _schoolTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolTypeDescriptor", _schoolTypeDescriptorId.Value); - - return _schoolTypeDescriptor; + return _studentUniqueId; } set { - _schoolTypeDescriptor = value; - _schoolTypeDescriptorId = default(int?); - } - } - public virtual int? TitleIPartASchoolDesignationDescriptorId - { - get - { - if (_titleIPartASchoolDesignationDescriptorId == default(int?)) - _titleIPartASchoolDesignationDescriptorId = string.IsNullOrWhiteSpace(_titleIPartASchoolDesignationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TitleIPartASchoolDesignationDescriptor", _titleIPartASchoolDesignationDescriptor); + if (_studentUniqueId != value) + _studentUSI = default(int); - return _titleIPartASchoolDesignationDescriptorId; - } - set - { - _titleIPartASchoolDesignationDescriptorId = value; - _titleIPartASchoolDesignationDescriptor = null; + _studentUniqueId = value; } } + // ------------------------------------------------------------- - private int? _titleIPartASchoolDesignationDescriptorId; - private string _titleIPartASchoolDesignationDescriptor; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public virtual string TitleIPartASchoolDesignationDescriptor - { - get - { - if (_titleIPartASchoolDesignationDescriptor == null) - _titleIPartASchoolDesignationDescriptor = _titleIPartASchoolDesignationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TitleIPartASchoolDesignationDescriptor", _titleIPartASchoolDesignationDescriptorId.Value); - - return _titleIPartASchoolDesignationDescriptor; - } - set - { - _titleIPartASchoolDesignationDescriptor = value; - _titleIPartASchoolDesignationDescriptorId = default(int?); - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual decimal? NumberOfDaysAbsent { get; set; } + public virtual decimal? NumberOfDaysInAttendance { get; set; } + public virtual int? NumberOfDaysTardy { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -94573,25 +92720,63 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData CharterApprovalSchoolYearTypeReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the CharterApprovalSchoolYearType resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISchool.CharterApprovalSchoolYearTypeResourceId + string Entities.Common.EdFi.IReportCard.EducationOrganizationDiscriminator { - get { return CharterApprovalSchoolYearTypeReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData LocalEducationAgencyReferenceData { get; set; } + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IReportCard.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// - /// Read-only property that allows the LocalEducationAgency resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISchool.LocalEducationAgencyResourceId + string Entities.Common.EdFi.IReportCard.GradingPeriodDiscriminator { - get { return LocalEducationAgencyReferenceData?.Id; } + get { return GradingPeriodReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IReportCard.GradingPeriodResourceId + { + get { return GradingPeriodReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IReportCard.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IReportCard.StudentResourceId + { + get { return StudentReferenceData?.Id; } set { } } @@ -94601,9 +92786,9 @@ public IDictionary Extensions // Collections // ------------------------------------------------------------- - private ICollection _schoolCategories; - private ICollection _schoolCategoriesCovariant; - public virtual ICollection SchoolCategories + private ICollection _reportCardGrades; + private ICollection _reportCardGradesCovariant; + public virtual ICollection ReportCardGrades { get { @@ -94612,45 +92797,45 @@ public virtual ICollection(value); + _reportCardGrades = value; + _reportCardGradesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISchool.SchoolCategories + ICollection Entities.Common.EdFi.IReportCard.ReportCardGrades { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _schoolCategories) - if (item.School == null) - item.School = this; + foreach (var item in _reportCardGrades) + if (item.ReportCard == null) + item.ReportCard = this; // ------------------------------------------------------------- - return _schoolCategoriesCovariant; + return _reportCardGradesCovariant; } set { - SchoolCategories = new HashSet(value.Cast()); + ReportCardGrades = new HashSet(value.Cast()); } } - private ICollection _schoolGradeLevels; - private ICollection _schoolGradeLevelsCovariant; - public virtual ICollection SchoolGradeLevels + private ICollection _reportCardGradePointAverages; + private ICollection _reportCardGradePointAveragesCovariant; + public virtual ICollection ReportCardGradePointAverages { get { @@ -94659,38 +92844,85 @@ public virtual ICollection(value); + _reportCardGradePointAverages = value; + _reportCardGradePointAveragesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISchool.SchoolGradeLevels + ICollection Entities.Common.EdFi.IReportCard.ReportCardGradePointAverages { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _schoolGradeLevels) - if (item.School == null) - item.School = this; + foreach (var item in _reportCardGradePointAverages) + if (item.ReportCard == null) + item.ReportCard = this; // ------------------------------------------------------------- - return _schoolGradeLevelsCovariant; + return _reportCardGradePointAveragesCovariant; } set { - SchoolGradeLevels = new HashSet(value.Cast()); + ReportCardGradePointAverages = new HashSet(value.Cast()); + } + } + + + private ICollection _reportCardStudentCompetencyObjectives; + private ICollection _reportCardStudentCompetencyObjectivesCovariant; + public virtual ICollection ReportCardStudentCompetencyObjectives + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _reportCardStudentCompetencyObjectives) + if (item.ReportCard == null) + item.ReportCard = this; + // ------------------------------------------------------------- + + return _reportCardStudentCompetencyObjectives; + } + set + { + _reportCardStudentCompetencyObjectives = value; + _reportCardStudentCompetencyObjectivesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IReportCard.ReportCardStudentCompetencyObjectives + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _reportCardStudentCompetencyObjectives) + if (item.ReportCard == null) + item.ReportCard = this; + // ------------------------------------------------------------- + + return _reportCardStudentCompetencyObjectivesCovariant; + } + set + { + ReportCardStudentCompetencyObjectives = new HashSet(value.Cast()); } } @@ -94699,14 +92931,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AdministrativeFundingControlDescriptor", new LookupColumnDetails { PropertyName = "AdministrativeFundingControlDescriptorId", LookupTypeName = "AdministrativeFundingControlDescriptor"} }, - { "CharterApprovalAgencyTypeDescriptor", new LookupColumnDetails { PropertyName = "CharterApprovalAgencyTypeDescriptorId", LookupTypeName = "CharterApprovalAgencyTypeDescriptor"} }, - { "CharterStatusDescriptor", new LookupColumnDetails { PropertyName = "CharterStatusDescriptorId", LookupTypeName = "CharterStatusDescriptor"} }, - { "InternetAccessDescriptor", new LookupColumnDetails { PropertyName = "InternetAccessDescriptorId", LookupTypeName = "InternetAccessDescriptor"} }, - { "MagnetSpecialProgramEmphasisSchoolDescriptor", new LookupColumnDetails { PropertyName = "MagnetSpecialProgramEmphasisSchoolDescriptorId", LookupTypeName = "MagnetSpecialProgramEmphasisSchoolDescriptor"} }, - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, - { "SchoolTypeDescriptor", new LookupColumnDetails { PropertyName = "SchoolTypeDescriptorId", LookupTypeName = "SchoolTypeDescriptor"} }, - { "TitleIPartASchoolDesignationDescriptor", new LookupColumnDetails { PropertyName = "TitleIPartASchoolDesignationDescriptorId", LookupTypeName = "TitleIPartASchoolDesignationDescriptor"} }, + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -94721,7 +92946,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); + keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("GradingPeriodSchoolId", GradingPeriodSchoolId); + keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -94785,12 +93015,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchool)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReportCard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchool) target, null); + this.MapTo((Entities.Common.EdFi.IReportCard) target, null); } } @@ -94798,19 +93028,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolCategory table of the School aggregate in the ODS database. + /// A class which represents the edfi.ReportCardGrade table of the ReportCard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolCategory : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISchoolCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ReportCardGrade : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IReportCardGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SchoolCategory() + public ReportCardGrade() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -94819,49 +93049,69 @@ public SchoolCategory() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual School School { get; set; } + public virtual ReportCard ReportCard { get; set; } - Entities.Common.EdFi.ISchool ISchoolCategory.School + Entities.Common.EdFi.IReportCard IReportCardGrade.ReportCard { - get { return School; } - set { School = (School) value; } + get { return ReportCard; } + set { ReportCard = (ReportCard) value; } } [DomainSignature] - public virtual int SchoolCategoryDescriptorId + public virtual DateTime BeginDate + { + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _beginDate; + + [DomainSignature] + public virtual int GradeTypeDescriptorId { get { - if (_schoolCategoryDescriptorId == default(int)) - _schoolCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolCategoryDescriptor", _schoolCategoryDescriptor); + if (_gradeTypeDescriptorId == default(int)) + _gradeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeTypeDescriptor", _gradeTypeDescriptor); - return _schoolCategoryDescriptorId; + return _gradeTypeDescriptorId; } set { - _schoolCategoryDescriptorId = value; - _schoolCategoryDescriptor = null; + _gradeTypeDescriptorId = value; + _gradeTypeDescriptor = null; } } - private int _schoolCategoryDescriptorId; - private string _schoolCategoryDescriptor; + private int _gradeTypeDescriptorId; + private string _gradeTypeDescriptor; - public virtual string SchoolCategoryDescriptor + public virtual string GradeTypeDescriptor { get { - if (_schoolCategoryDescriptor == null) - _schoolCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolCategoryDescriptor", _schoolCategoryDescriptorId); + if (_gradeTypeDescriptor == null) + _gradeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeTypeDescriptor", _gradeTypeDescriptorId); - return _schoolCategoryDescriptor; + return _gradeTypeDescriptor; } set { - _schoolCategoryDescriptor = value; - _schoolCategoryDescriptorId = default(int); + _gradeTypeDescriptor = value; + _gradeTypeDescriptorId = default(int); } } + [DomainSignature] + public virtual string LocalCourseCode { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } + [DomainSignature] + public virtual string SectionIdentifier { get; set; } + [DomainSignature] + public virtual string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -94916,6 +93166,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.GradeAggregate.EdFi.GradeReferenceData GradeReferenceData { get; set; } + + /// + /// Read-only property that allows the Grade discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IReportCardGrade.GradeDiscriminator + { + get { return GradeReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Grade resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IReportCardGrade.GradeResourceId + { + get { return GradeReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -94926,7 +93196,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "SchoolCategoryDescriptor", new LookupColumnDetails { PropertyName = "SchoolCategoryDescriptorId", LookupTypeName = "SchoolCategoryDescriptor"} }, + { "GradeTypeDescriptor", new LookupColumnDetails { PropertyName = "GradeTypeDescriptorId", LookupTypeName = "GradeTypeDescriptor"} }, + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -94938,10 +93209,16 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (School as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("SchoolCategoryDescriptorId", SchoolCategoryDescriptorId); + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("GradeTypeDescriptorId", GradeTypeDescriptorId); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); return keyValues; } @@ -95005,36 +93282,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolCategory)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReportCardGrade)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolCategory) target, null); + this.MapTo((Entities.Common.EdFi.IReportCardGrade) target, null); } void IChildEntity.SetParent(object value) { - School = (School) value; + ReportCard = (ReportCard) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolGradeLevel table of the School aggregate in the ODS database. + /// A class which represents the edfi.ReportCardGradePointAverage table of the ReportCard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISchoolGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ReportCardGradePointAverage : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IReportCardGradePointAverage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SchoolGradeLevel() + public ReportCardGradePointAverage() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -95043,47 +93320,47 @@ public SchoolGradeLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual School School { get; set; } + public virtual ReportCard ReportCard { get; set; } - Entities.Common.EdFi.ISchool ISchoolGradeLevel.School + Entities.Common.EdFi.IReportCard IReportCardGradePointAverage.ReportCard { - get { return School; } - set { School = (School) value; } + get { return ReportCard; } + set { ReportCard = (ReportCard) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId + public virtual int GradePointAverageTypeDescriptorId { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_gradePointAverageTypeDescriptorId == default(int)) + _gradePointAverageTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptor); - return _gradeLevelDescriptorId; + return _gradePointAverageTypeDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _gradePointAverageTypeDescriptorId = value; + _gradePointAverageTypeDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int _gradePointAverageTypeDescriptorId; + private string _gradePointAverageTypeDescriptor; - public virtual string GradeLevelDescriptor + public virtual string GradePointAverageTypeDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_gradePointAverageTypeDescriptor == null) + _gradePointAverageTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptorId); - return _gradeLevelDescriptor; + return _gradePointAverageTypeDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _gradePointAverageTypeDescriptor = value; + _gradePointAverageTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -95096,6 +93373,9 @@ public virtual string GradeLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual decimal GradePointAverageValue { get; set; } + public virtual bool? IsCumulative { get; set; } + public virtual decimal? MaxGradePointAverageValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95150,7 +93430,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "GradePointAverageTypeDescriptor", new LookupColumnDetails { PropertyName = "GradePointAverageTypeDescriptorId", LookupTypeName = "GradePointAverageTypeDescriptor"} }, + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -95162,10 +93443,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (School as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); return keyValues; } @@ -95229,83 +93510,98 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReportCardGradePointAverage)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IReportCardGradePointAverage) target, null); } void IChildEntity.SetParent(object value) { - School = (School) value; + ReportCard = (ReportCard) value; } } -} -// Aggregate: SchoolCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.SchoolCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolCategoryDescriptor table of the SchoolCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ReportCardStudentCompetencyObjective table of the ReportCard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISchoolCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ReportCardStudentCompetencyObjective : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IReportCardStudentCompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int SchoolCategoryDescriptorId + public ReportCardStudentCompetencyObjective() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual ReportCard ReportCard { get; set; } + + Entities.Common.EdFi.IReportCard IReportCardStudentCompetencyObjective.ReportCard { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return ReportCard; } + set { ReportCard = (ReportCard) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual long ObjectiveEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Objective { get; set; } + [DomainSignature] + public virtual int ObjectiveGradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_objectiveGradeLevelDescriptorId == default(int)) + _objectiveGradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _objectiveGradeLevelDescriptor); + + return _objectiveGradeLevelDescriptorId; + } + set + { + _objectiveGradeLevelDescriptorId = value; + _objectiveGradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _objectiveGradeLevelDescriptorId; + private string _objectiveGradeLevelDescriptor; + + public virtual string ObjectiveGradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_objectiveGradeLevelDescriptor == null) + _objectiveGradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _objectiveGradeLevelDescriptorId); + + return _objectiveGradeLevelDescriptor; + } + set + { + _objectiveGradeLevelDescriptor = value; + _objectiveGradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -95319,11 +93615,60 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.StudentCompetencyObjectiveAggregate.EdFi.StudentCompetencyObjectiveReferenceData StudentCompetencyObjectiveReferenceData { get; set; } + + /// + /// Read-only property that allows the StudentCompetencyObjective discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveDiscriminator + { + get { return StudentCompetencyObjectiveReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentCompetencyObjective resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveResourceId + { + get { return StudentCompetencyObjectiveReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -95334,6 +93679,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, + { "ObjectiveGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "ObjectiveGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -95344,11 +93691,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("SchoolCategoryDescriptorId", SchoolCategoryDescriptorId); + keyValues.Add("Objective", Objective); + keyValues.Add("ObjectiveEducationOrganizationId", ObjectiveEducationOrganizationId); + keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); return keyValues; } @@ -95412,37 +93761,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReportCardStudentCompetencyObjective)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IReportCardStudentCompetencyObjective) target, null); } + void IChildEntity.SetParent(object value) + { + ReportCard = (ReportCard) value; + } } } -// Aggregate: SchoolChoiceBasisDescriptor +// Aggregate: ReporterDescriptionDescriptor -namespace EdFi.Ods.Entities.NHibernate.SchoolChoiceBasisDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ReporterDescriptionDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolChoiceBasisDescriptor table of the SchoolChoiceBasisDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ReporterDescriptionDescriptor table of the ReporterDescriptionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolChoiceBasisDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISchoolChoiceBasisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ReporterDescriptionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IReporterDescriptionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SchoolChoiceBasisDescriptorId + public virtual int ReporterDescriptionDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -95527,7 +93880,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolChoiceBasisDescriptorId", SchoolChoiceBasisDescriptorId); + keyValues.Add("ReporterDescriptionDescriptorId", ReporterDescriptionDescriptorId); return keyValues; } @@ -95591,37 +93944,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolChoiceBasisDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReporterDescriptionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolChoiceBasisDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IReporterDescriptionDescriptor) target, null); } } } -// Aggregate: SchoolChoiceImplementStatusDescriptor +// Aggregate: ReportingTagDescriptor -namespace EdFi.Ods.Entities.NHibernate.SchoolChoiceImplementStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ReportingTagDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolChoiceImplementStatusDescriptor table of the SchoolChoiceImplementStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ReportingTagDescriptor table of the ReportingTagDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolChoiceImplementStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ReportingTagDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IReportingTagDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SchoolChoiceImplementStatusDescriptorId + public virtual int ReportingTagDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -95706,7 +94059,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolChoiceImplementStatusDescriptorId", SchoolChoiceImplementStatusDescriptorId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -95770,37 +94123,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IReportingTagDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IReportingTagDescriptor) target, null); } } } -// Aggregate: SchoolFoodServiceProgramServiceDescriptor +// Aggregate: ResidencyStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.SchoolFoodServiceProgramServiceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ResidencyStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolFoodServiceProgramServiceDescriptor table of the SchoolFoodServiceProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ResidencyStatusDescriptor table of the ResidencyStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolFoodServiceProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ResidencyStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IResidencyStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SchoolFoodServiceProgramServiceDescriptorId + public virtual int ResidencyStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -95885,7 +94238,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolFoodServiceProgramServiceDescriptorId", SchoolFoodServiceProgramServiceDescriptorId); + keyValues.Add("ResidencyStatusDescriptorId", ResidencyStatusDescriptorId); return keyValues; } @@ -95949,37 +94302,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IResidencyStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IResidencyStatusDescriptor) target, null); } } } -// Aggregate: SchoolTypeDescriptor +// Aggregate: ResponseIndicatorDescriptor -namespace EdFi.Ods.Entities.NHibernate.SchoolTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ResponseIndicatorDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolTypeDescriptor table of the SchoolTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ResponseIndicatorDescriptor table of the ResponseIndicatorDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISchoolTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class ResponseIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IResponseIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SchoolTypeDescriptorId + public virtual int ResponseIndicatorDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -96064,7 +94417,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolTypeDescriptorId", SchoolTypeDescriptorId); + keyValues.Add("ResponseIndicatorDescriptorId", ResponseIndicatorDescriptorId); return keyValues; } @@ -96128,128 +94481,82 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IResponseIndicatorDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IResponseIndicatorDescriptor) target, null); } } } -// Aggregate: SchoolYearType +// Aggregate: ResponsibilityDescriptor -namespace EdFi.Ods.Entities.NHibernate.SchoolYearTypeAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ResponsibilityDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class SchoolYearTypeReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual short SchoolYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("SchoolYear", SchoolYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SchoolYearType table of the SchoolYearType aggregate in the ODS database. + /// A class which represents the edfi.ResponsibilityDescriptor table of the ResponsibilityDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SchoolYearType : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ISchoolYearType, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ResponsibilityDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IResponsibilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public SchoolYearType() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual short SchoolYear { get; set; } + public virtual int ResponsibilityDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool CurrentSchoolYear { get; set; } - public virtual string SchoolYearDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -96260,35 +94567,6 @@ public SchoolYearType() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -96318,7 +94596,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("ResponsibilityDescriptorId", ResponsibilityDescriptorId); return keyValues; } @@ -96382,33 +94660,31 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISchoolYearType)target); + return this.SynchronizeTo((Entities.Common.EdFi.IResponsibilityDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISchoolYearType) target, null); + this.MapTo((Entities.Common.EdFi.IResponsibilityDescriptor) target, null); } } } -// Aggregate: Section +// Aggregate: RestraintEvent -namespace EdFi.Ods.Entities.NHibernate.SectionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.RestraintEventAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class SectionReferenceData : IHasPrimaryKeyValues + public class RestraintEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string LocalCourseCode { get; set; } + public virtual string RestraintEventIdentifier { get; set; } public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual string SectionIdentifier { get; set; } - public virtual string SessionName { get; set; } + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// @@ -96429,11 +94705,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("RestraintEventIdentifier", RestraintEventIdentifier); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -96484,24 +94758,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Section table of the Section aggregate in the ODS database. + /// A class which represents the edfi.RestraintEvent table of the RestraintEvent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Section : AggregateRootWithCompositeKey, IHasCascadableKeyValues, - Entities.Common.EdFi.ISection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class RestraintEvent : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IRestraintEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Section() + public RestraintEvent() { - SectionCharacteristics = new HashSet(); - SectionClassPeriods = new HashSet(); - SectionCourseLevelCharacteristics = new HashSet(); - SectionOfferedGradeLevels = new HashSet(); - SectionPrograms = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions
(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions
()); + RestraintEventPrograms = new HashSet(); + RestraintEventReasons = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -96510,61 +94781,68 @@ public Section() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string LocalCourseCode { get; set; } + public virtual string RestraintEventIdentifier { get; set; } [DomainSignature] public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [DomainSignature] - public virtual string SectionIdentifier { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual decimal? AvailableCreditConversion { get; set; } - public virtual decimal? AvailableCredits { get; set; } - public virtual int? AvailableCreditTypeDescriptorId + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI { get { - if (_availableCreditTypeDescriptorId == default(int?)) - _availableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_availableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _availableCreditTypeDescriptor); + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - return _availableCreditTypeDescriptorId; + return _studentUSI; } set { - _availableCreditTypeDescriptorId = value; - _availableCreditTypeDescriptor = null; + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); } } - private int? _availableCreditTypeDescriptorId; - private string _availableCreditTypeDescriptor; + private int _studentUSI; + private string _studentUniqueId; - public virtual string AvailableCreditTypeDescriptor + public virtual string StudentUniqueId { get { - if (_availableCreditTypeDescriptor == null) - _availableCreditTypeDescriptor = _availableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _availableCreditTypeDescriptorId.Value); - - return _availableCreditTypeDescriptor; + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; } set { - _availableCreditTypeDescriptor = value; - _availableCreditTypeDescriptorId = default(int?); + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; } } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- public virtual int? EducationalEnvironmentDescriptorId { get @@ -96599,147 +94877,16 @@ public virtual string EducationalEnvironmentDescriptor _educationalEnvironmentDescriptorId = default(int?); } } - public virtual int? InstructionLanguageDescriptorId - { - get - { - if (_instructionLanguageDescriptorId == default(int?)) - _instructionLanguageDescriptorId = string.IsNullOrWhiteSpace(_instructionLanguageDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _instructionLanguageDescriptor); - - return _instructionLanguageDescriptorId; - } - set - { - _instructionLanguageDescriptorId = value; - _instructionLanguageDescriptor = null; - } - } - - private int? _instructionLanguageDescriptorId; - private string _instructionLanguageDescriptor; - - public virtual string InstructionLanguageDescriptor - { - get - { - if (_instructionLanguageDescriptor == null) - _instructionLanguageDescriptor = _instructionLanguageDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _instructionLanguageDescriptorId.Value); - - return _instructionLanguageDescriptor; - } - set - { - _instructionLanguageDescriptor = value; - _instructionLanguageDescriptorId = default(int?); - } - } - public virtual string LocationClassroomIdentificationCode { get; set; } - public virtual long? LocationSchoolId { get; set; } - public virtual int? MediumOfInstructionDescriptorId - { - get - { - if (_mediumOfInstructionDescriptorId == default(int?)) - _mediumOfInstructionDescriptorId = string.IsNullOrWhiteSpace(_mediumOfInstructionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptor); - - return _mediumOfInstructionDescriptorId; - } - set - { - _mediumOfInstructionDescriptorId = value; - _mediumOfInstructionDescriptor = null; - } - } - - private int? _mediumOfInstructionDescriptorId; - private string _mediumOfInstructionDescriptor; - - public virtual string MediumOfInstructionDescriptor - { - get - { - if (_mediumOfInstructionDescriptor == null) - _mediumOfInstructionDescriptor = _mediumOfInstructionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptorId.Value); - - return _mediumOfInstructionDescriptor; - } - set - { - _mediumOfInstructionDescriptor = value; - _mediumOfInstructionDescriptorId = default(int?); - } - } - public virtual bool? OfficialAttendancePeriod { get; set; } - public virtual int? PopulationServedDescriptorId - { - get - { - if (_populationServedDescriptorId == default(int?)) - _populationServedDescriptorId = string.IsNullOrWhiteSpace(_populationServedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); - - return _populationServedDescriptorId; - } - set - { - _populationServedDescriptorId = value; - _populationServedDescriptor = null; - } - } - - private int? _populationServedDescriptorId; - private string _populationServedDescriptor; - - public virtual string PopulationServedDescriptor - { - get - { - if (_populationServedDescriptor == null) - _populationServedDescriptor = _populationServedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId.Value); - - return _populationServedDescriptor; - } - set - { - _populationServedDescriptor = value; - _populationServedDescriptorId = default(int?); - } - } - public virtual string SectionName { get; set; } - public virtual int? SectionTypeDescriptorId + public virtual DateTime EventDate { - get - { - if (_sectionTypeDescriptorId == default(int?)) - _sectionTypeDescriptorId = string.IsNullOrWhiteSpace(_sectionTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SectionTypeDescriptor", _sectionTypeDescriptor); - - return _sectionTypeDescriptorId; - } - set - { - _sectionTypeDescriptorId = value; - _sectionTypeDescriptor = null; - } + get { return _eventDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _eventDate = new DateTime(value.Year, value.Month, value.Day); } } - private int? _sectionTypeDescriptorId; - private string _sectionTypeDescriptor; - - public virtual string SectionTypeDescriptor - { - get - { - if (_sectionTypeDescriptor == null) - _sectionTypeDescriptor = _sectionTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SectionTypeDescriptor", _sectionTypeDescriptorId.Value); - - return _sectionTypeDescriptor; - } - set - { - _sectionTypeDescriptor = value; - _sectionTypeDescriptorId = default(int?); - } - } - public virtual int? SequenceOfCourse { get; set; } + private DateTime _eventDate; + + public virtual string IncidentIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -96784,54 +94931,54 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.CourseOfferingAggregate.EdFi.CourseOfferingReferenceData CourseOfferingReferenceData { get; set; } + public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } /// - /// Read-only property that allows the CourseOffering discriminator value to be mapped to the resource reference. + /// Read-only property that allows the DisciplineIncident discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ISection.CourseOfferingDiscriminator + string Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentDiscriminator { - get { return CourseOfferingReferenceData?.Discriminator; } + get { return DisciplineIncidentReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the CourseOffering resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the DisciplineIncident resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISection.CourseOfferingResourceId + Guid? Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentResourceId { - get { return CourseOfferingReferenceData?.Id; } + get { return DisciplineIncidentReferenceData?.Id; } set { } } - public virtual NHibernate.LocationAggregate.EdFi.LocationReferenceData LocationReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the Location discriminator value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ISection.LocationDiscriminator + Guid? Entities.Common.EdFi.IRestraintEvent.SchoolResourceId { - get { return LocationReferenceData?.Discriminator; } + get { return SchoolReferenceData?.Id; } set { } } + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + /// - /// Read-only property that allows the Location resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISection.LocationResourceId + string Entities.Common.EdFi.IRestraintEvent.StudentDiscriminator { - get { return LocationReferenceData?.Id; } + get { return StudentReferenceData?.Discriminator; } set { } } - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData LocationSchoolReferenceData { get; set; } - /// - /// Read-only property that allows the LocationSchool resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISection.LocationSchoolResourceId + Guid? Entities.Common.EdFi.IRestraintEvent.StudentResourceId { - get { return LocationSchoolReferenceData?.Id; } + get { return StudentReferenceData?.Id; } set { } } @@ -96841,150 +94988,9 @@ string Entities.Common.EdFi.ISection.LocationDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _sectionCharacteristics; - private ICollection _sectionCharacteristicsCovariant; - public virtual ICollection SectionCharacteristics - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sectionCharacteristics) - if (item.Section == null) - item.Section = this; - // ------------------------------------------------------------- - - return _sectionCharacteristics; - } - set - { - _sectionCharacteristics = value; - _sectionCharacteristicsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionCharacteristics - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sectionCharacteristics) - if (item.Section == null) - item.Section = this; - // ------------------------------------------------------------- - - return _sectionCharacteristicsCovariant; - } - set - { - SectionCharacteristics = new HashSet(value.Cast()); - } - } - - - private ICollection _sectionClassPeriods; - private ICollection _sectionClassPeriodsCovariant; - public virtual ICollection SectionClassPeriods - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sectionClassPeriods) - if (item.Section == null) - item.Section = this; - // ------------------------------------------------------------- - - return _sectionClassPeriods; - } - set - { - _sectionClassPeriods = value; - _sectionClassPeriodsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionClassPeriods - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sectionClassPeriods) - if (item.Section == null) - item.Section = this; - // ------------------------------------------------------------- - - return _sectionClassPeriodsCovariant; - } - set - { - SectionClassPeriods = new HashSet(value.Cast()); - } - } - - - private ICollection _sectionCourseLevelCharacteristics; - private ICollection _sectionCourseLevelCharacteristicsCovariant; - public virtual ICollection SectionCourseLevelCharacteristics - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sectionCourseLevelCharacteristics) - if (item.Section == null) - item.Section = this; - // ------------------------------------------------------------- - - return _sectionCourseLevelCharacteristics; - } - set - { - _sectionCourseLevelCharacteristics = value; - _sectionCourseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionCourseLevelCharacteristics - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sectionCourseLevelCharacteristics) - if (item.Section == null) - item.Section = this; - // ------------------------------------------------------------- - - return _sectionCourseLevelCharacteristicsCovariant; - } - set - { - SectionCourseLevelCharacteristics = new HashSet(value.Cast()); - } - } - - - private ICollection _sectionOfferedGradeLevels; - private ICollection _sectionOfferedGradeLevelsCovariant; - public virtual ICollection SectionOfferedGradeLevels + private ICollection _restraintEventPrograms; + private ICollection _restraintEventProgramsCovariant; + public virtual ICollection RestraintEventPrograms { get { @@ -96993,45 +94999,45 @@ public virtual ICollection(value); + _restraintEventPrograms = value; + _restraintEventProgramsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionOfferedGradeLevels + ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventPrograms { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _sectionOfferedGradeLevels) - if (item.Section == null) - item.Section = this; + foreach (var item in _restraintEventPrograms) + if (item.RestraintEvent == null) + item.RestraintEvent = this; // ------------------------------------------------------------- - return _sectionOfferedGradeLevelsCovariant; + return _restraintEventProgramsCovariant; } set { - SectionOfferedGradeLevels = new HashSet(value.Cast()); + RestraintEventPrograms = new HashSet(value.Cast()); } } - private ICollection _sectionPrograms; - private ICollection _sectionProgramsCovariant; - public virtual ICollection SectionPrograms + private ICollection _restraintEventReasons; + private ICollection _restraintEventReasonsCovariant; + public virtual ICollection RestraintEventReasons { get { @@ -97040,38 +95046,38 @@ public virtual ICollection(value); + _restraintEventReasons = value; + _restraintEventReasonsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionPrograms + ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventReasons { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _sectionPrograms) - if (item.Section == null) - item.Section = this; + foreach (var item in _restraintEventReasons) + if (item.RestraintEvent == null) + item.RestraintEvent = this; // ------------------------------------------------------------- - return _sectionProgramsCovariant; + return _restraintEventReasonsCovariant; } set { - SectionPrograms = new HashSet(value.Cast()); + RestraintEventReasons = new HashSet(value.Cast()); } } @@ -97080,12 +95086,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, { "EducationalEnvironmentDescriptor", new LookupColumnDetails { PropertyName = "EducationalEnvironmentDescriptorId", LookupTypeName = "EducationalEnvironmentDescriptor"} }, - { "InstructionLanguageDescriptor", new LookupColumnDetails { PropertyName = "InstructionLanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, - { "MediumOfInstructionDescriptor", new LookupColumnDetails { PropertyName = "MediumOfInstructionDescriptorId", LookupTypeName = "MediumOfInstructionDescriptor"} }, - { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, - { "SectionTypeDescriptor", new LookupColumnDetails { PropertyName = "SectionTypeDescriptorId", LookupTypeName = "SectionTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -97100,21 +95101,13 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("RestraintEventIdentifier", RestraintEventIdentifier); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } - /// - /// Gets or sets the capturing the new key values that have - /// not been modified directly on the entity. - /// - OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } - #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -97174,12 +95167,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISection)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEvent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISection) target, null); + this.MapTo((Entities.Common.EdFi.IRestraintEvent) target, null); } } @@ -97187,19 +95180,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionCharacteristic table of the Section aggregate in the ODS database. + /// A class which represents the edfi.RestraintEventProgram table of the RestraintEvent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionCharacteristic : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISectionCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class RestraintEventProgram : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IRestraintEventProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SectionCharacteristic() + public RestraintEventProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -97208,47 +95201,51 @@ public SectionCharacteristic() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Section Section { get; set; } + public virtual RestraintEvent RestraintEvent { get; set; } - Entities.Common.EdFi.ISection ISectionCharacteristic.Section + Entities.Common.EdFi.IRestraintEvent IRestraintEventProgram.RestraintEvent { - get { return Section; } - set { Section = (Section) value; } + get { return RestraintEvent; } + set { RestraintEvent = (RestraintEvent) value; } } [DomainSignature] - public virtual int SectionCharacteristicDescriptorId + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ProgramName { get; set; } + [DomainSignature] + public virtual int ProgramTypeDescriptorId { get { - if (_sectionCharacteristicDescriptorId == default(int)) - _sectionCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SectionCharacteristicDescriptor", _sectionCharacteristicDescriptor); + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - return _sectionCharacteristicDescriptorId; + return _programTypeDescriptorId; } set { - _sectionCharacteristicDescriptorId = value; - _sectionCharacteristicDescriptor = null; + _programTypeDescriptorId = value; + _programTypeDescriptor = null; } } - private int _sectionCharacteristicDescriptorId; - private string _sectionCharacteristicDescriptor; + private int _programTypeDescriptorId; + private string _programTypeDescriptor; - public virtual string SectionCharacteristicDescriptor + public virtual string ProgramTypeDescriptor { get { - if (_sectionCharacteristicDescriptor == null) - _sectionCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SectionCharacteristicDescriptor", _sectionCharacteristicDescriptorId); + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - return _sectionCharacteristicDescriptor; + return _programTypeDescriptor; } set { - _sectionCharacteristicDescriptor = value; - _sectionCharacteristicDescriptorId = default(int); + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -97305,6 +95302,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IRestraintEventProgram.ProgramDiscriminator + { + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IRestraintEventProgram.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -97315,7 +95332,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "SectionCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "SectionCharacteristicDescriptorId", LookupTypeName = "SectionCharacteristicDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -97327,10 +95344,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (RestraintEvent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("SectionCharacteristicDescriptorId", SectionCharacteristicDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -97394,36 +95413,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionCharacteristic)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEventProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionCharacteristic) target, null); + this.MapTo((Entities.Common.EdFi.IRestraintEventProgram) target, null); } void IChildEntity.SetParent(object value) { - Section = (Section) value; + RestraintEvent = (RestraintEvent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionClassPeriod table of the Section aggregate in the ODS database. + /// A class which represents the edfi.RestraintEventReason table of the RestraintEvent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionClassPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISectionClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class RestraintEventReason : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IRestraintEventReason, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SectionClassPeriod() + public RestraintEventReason() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -97432,16 +95451,49 @@ public SectionClassPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Section Section { get; set; } + public virtual RestraintEvent RestraintEvent { get; set; } - Entities.Common.EdFi.ISection ISectionClassPeriod.Section + Entities.Common.EdFi.IRestraintEvent IRestraintEventReason.RestraintEvent { - get { return Section; } - set { Section = (Section) value; } + get { return RestraintEvent; } + set { RestraintEvent = (RestraintEvent) value; } } [DomainSignature] - public virtual string ClassPeriodName { get; set; } + public virtual int RestraintEventReasonDescriptorId + { + get + { + if (_restraintEventReasonDescriptorId == default(int)) + _restraintEventReasonDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RestraintEventReasonDescriptor", _restraintEventReasonDescriptor); + + return _restraintEventReasonDescriptorId; + } + set + { + _restraintEventReasonDescriptorId = value; + _restraintEventReasonDescriptor = null; + } + } + + private int _restraintEventReasonDescriptorId; + private string _restraintEventReasonDescriptor; + + public virtual string RestraintEventReasonDescriptor + { + get + { + if (_restraintEventReasonDescriptor == null) + _restraintEventReasonDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RestraintEventReasonDescriptor", _restraintEventReasonDescriptorId); + + return _restraintEventReasonDescriptor; + } + set + { + _restraintEventReasonDescriptor = value; + _restraintEventReasonDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -97496,26 +95548,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } - - /// - /// Read-only property that allows the ClassPeriod discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodDiscriminator - { - get { return ClassPeriodReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ClassPeriod resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodResourceId - { - get { return ClassPeriodReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -97526,6 +95558,7 @@ string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "RestraintEventReasonDescriptor", new LookupColumnDetails { PropertyName = "RestraintEventReasonDescriptorId", LookupTypeName = "RestraintEventReasonDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -97537,10 +95570,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (RestraintEvent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ClassPeriodName", ClassPeriodName); + keyValues.Add("RestraintEventReasonDescriptorId", RestraintEventReasonDescriptorId); return keyValues; } @@ -97604,92 +95637,81 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionClassPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEventReason)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionClassPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IRestraintEventReason) target, null); } void IChildEntity.SetParent(object value) { - Section = (Section) value; + RestraintEvent = (RestraintEvent) value; } } +} +// Aggregate: RestraintEventReasonDescriptor + +namespace EdFi.Ods.Entities.NHibernate.RestraintEventReasonDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionCourseLevelCharacteristic table of the Section aggregate in the ODS database. + /// A class which represents the edfi.RestraintEventReasonDescriptor table of the RestraintEventReasonDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionCourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISectionCourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class RestraintEventReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IRestraintEventReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public SectionCourseLevelCharacteristic() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Section Section { get; set; } - - Entities.Common.EdFi.ISection ISectionCourseLevelCharacteristic.Section - { - get { return Section; } - set { Section = (Section) value; } - } - [DomainSignature] - public virtual int CourseLevelCharacteristicDescriptorId - { - get - { - if (_courseLevelCharacteristicDescriptorId == default(int)) - _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); - - return _courseLevelCharacteristicDescriptorId; - } - set - { - _courseLevelCharacteristicDescriptorId = value; - _courseLevelCharacteristicDescriptor = null; - } - } - - private int _courseLevelCharacteristicDescriptorId; - private string _courseLevelCharacteristicDescriptor; - - public virtual string CourseLevelCharacteristicDescriptor + public virtual int RestraintEventReasonDescriptorId { - get - { - if (_courseLevelCharacteristicDescriptor == null) - _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); - - return _courseLevelCharacteristicDescriptor; - } - set - { - _courseLevelCharacteristicDescriptor = value; - _courseLevelCharacteristicDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -97705,35 +95727,6 @@ public virtual string CourseLevelCharacteristicDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -97749,7 +95742,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -97760,11 +95752,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); + keyValues.Add("RestraintEventReasonDescriptorId", RestraintEventReasonDescriptorId); return keyValues; } @@ -97828,92 +95820,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionCourseLevelCharacteristic)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRestraintEventReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionCourseLevelCharacteristic) target, null); + this.MapTo((Entities.Common.EdFi.IRestraintEventReasonDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Section = (Section) value; - } } +} +// Aggregate: ResultDatatypeTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ResultDatatypeTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionOfferedGradeLevel table of the Section aggregate in the ODS database. + /// A class which represents the edfi.ResultDatatypeTypeDescriptor table of the ResultDatatypeTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISectionOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class ResultDatatypeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IResultDatatypeTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public SectionOfferedGradeLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Section Section { get; set; } - - Entities.Common.EdFi.ISection ISectionOfferedGradeLevel.Section - { - get { return Section; } - set { Section = (Section) value; } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + public virtual int ResultDatatypeTypeDescriptorId { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -97929,35 +95906,6 @@ public virtual string GradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -97973,7 +95921,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -97984,11 +95931,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("ResultDatatypeTypeDescriptorId", ResultDatatypeTypeDescriptorId); return keyValues; } @@ -98052,96 +95999,77 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionOfferedGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IResultDatatypeTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionOfferedGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IResultDatatypeTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Section = (Section) value; - } } +} +// Aggregate: RetestIndicatorDescriptor + +namespace EdFi.Ods.Entities.NHibernate.RetestIndicatorDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionProgram table of the Section aggregate in the ODS database. + /// A class which represents the edfi.RetestIndicatorDescriptor table of the RetestIndicatorDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionProgram : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISectionProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class RetestIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IRetestIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public SectionProgram() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Section Section { get; set; } - - Entities.Common.EdFi.ISection ISectionProgram.Section - { - get { return Section; } - set { Section = (Section) value; } - } - - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramName { get; set; } [DomainSignature] - public virtual int ProgramTypeDescriptorId - { - get - { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - - return _programTypeDescriptorId; - } - set - { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; - } - } - - private int _programTypeDescriptorId; - private string _programTypeDescriptor; - - public virtual string ProgramTypeDescriptor + public virtual int RetestIndicatorDescriptorId { - get - { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - - return _programTypeDescriptor; - } - set - { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -98157,60 +96085,11 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } - - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ISectionProgram.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ISectionProgram.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -98221,7 +96100,6 @@ string Entities.Common.EdFi.ISectionProgram.ProgramDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -98232,13 +96110,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("RetestIndicatorDescriptorId", RetestIndicatorDescriptorId); return keyValues; } @@ -98302,51 +96178,505 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.IRetestIndicatorDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionProgram) target, null); + this.MapTo((Entities.Common.EdFi.IRetestIndicatorDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Section = (Section) value; - } } } -// Aggregate: SectionAttendanceTakenEvent +// Aggregate: School -namespace EdFi.Ods.Entities.NHibernate.SectionAttendanceTakenEventAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SchoolAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.School table of the School aggregate in the ODS database. /// - public class SectionAttendanceTakenEventReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class School : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.ISchool, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public School() + { + SchoolCategories = new HashSet(); + SchoolGradeLevels = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CalendarCode { get; set; } - public virtual DateTime Date { get; set; } - public virtual string LocalCourseCode { get; set; } - public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual string SectionIdentifier { get; set; } - public virtual string SessionName { get; set; } + [DomainSignature] + public virtual long SchoolId + { + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IEducationOrganization.NameOfInstitution + { + get { return NameOfInstitution; } + set { NameOfInstitution = value; } + } + string IEducationOrganization.OperationalStatusDescriptor + { + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } + } + string IEducationOrganization.ShortNameOfInstitution + { + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } + } + string IEducationOrganization.WebSite + { + get { return WebSite; } + set { WebSite = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int? AdministrativeFundingControlDescriptorId + { + get + { + if (_administrativeFundingControlDescriptorId == default(int?)) + _administrativeFundingControlDescriptorId = string.IsNullOrWhiteSpace(_administrativeFundingControlDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptor); + + return _administrativeFundingControlDescriptorId; + } + set + { + _administrativeFundingControlDescriptorId = value; + _administrativeFundingControlDescriptor = null; + } + } + + private int? _administrativeFundingControlDescriptorId; + private string _administrativeFundingControlDescriptor; + + public virtual string AdministrativeFundingControlDescriptor + { + get + { + if (_administrativeFundingControlDescriptor == null) + _administrativeFundingControlDescriptor = _administrativeFundingControlDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdministrativeFundingControlDescriptor", _administrativeFundingControlDescriptorId.Value); + + return _administrativeFundingControlDescriptor; + } + set + { + _administrativeFundingControlDescriptor = value; + _administrativeFundingControlDescriptorId = default(int?); + } + } + public virtual int? CharterApprovalAgencyTypeDescriptorId + { + get + { + if (_charterApprovalAgencyTypeDescriptorId == default(int?)) + _charterApprovalAgencyTypeDescriptorId = string.IsNullOrWhiteSpace(_charterApprovalAgencyTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CharterApprovalAgencyTypeDescriptor", _charterApprovalAgencyTypeDescriptor); + + return _charterApprovalAgencyTypeDescriptorId; + } + set + { + _charterApprovalAgencyTypeDescriptorId = value; + _charterApprovalAgencyTypeDescriptor = null; + } + } + + private int? _charterApprovalAgencyTypeDescriptorId; + private string _charterApprovalAgencyTypeDescriptor; + + public virtual string CharterApprovalAgencyTypeDescriptor + { + get + { + if (_charterApprovalAgencyTypeDescriptor == null) + _charterApprovalAgencyTypeDescriptor = _charterApprovalAgencyTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CharterApprovalAgencyTypeDescriptor", _charterApprovalAgencyTypeDescriptorId.Value); + + return _charterApprovalAgencyTypeDescriptor; + } + set + { + _charterApprovalAgencyTypeDescriptor = value; + _charterApprovalAgencyTypeDescriptorId = default(int?); + } + } + public virtual short? CharterApprovalSchoolYear { get; set; } + public virtual int? CharterStatusDescriptorId + { + get + { + if (_charterStatusDescriptorId == default(int?)) + _charterStatusDescriptorId = string.IsNullOrWhiteSpace(_charterStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CharterStatusDescriptor", _charterStatusDescriptor); + + return _charterStatusDescriptorId; + } + set + { + _charterStatusDescriptorId = value; + _charterStatusDescriptor = null; + } + } + + private int? _charterStatusDescriptorId; + private string _charterStatusDescriptor; + + public virtual string CharterStatusDescriptor + { + get + { + if (_charterStatusDescriptor == null) + _charterStatusDescriptor = _charterStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CharterStatusDescriptor", _charterStatusDescriptorId.Value); + + return _charterStatusDescriptor; + } + set + { + _charterStatusDescriptor = value; + _charterStatusDescriptorId = default(int?); + } + } + public virtual int? InternetAccessDescriptorId + { + get + { + if (_internetAccessDescriptorId == default(int?)) + _internetAccessDescriptorId = string.IsNullOrWhiteSpace(_internetAccessDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InternetAccessDescriptor", _internetAccessDescriptor); + + return _internetAccessDescriptorId; + } + set + { + _internetAccessDescriptorId = value; + _internetAccessDescriptor = null; + } + } + + private int? _internetAccessDescriptorId; + private string _internetAccessDescriptor; + + public virtual string InternetAccessDescriptor + { + get + { + if (_internetAccessDescriptor == null) + _internetAccessDescriptor = _internetAccessDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InternetAccessDescriptor", _internetAccessDescriptorId.Value); + + return _internetAccessDescriptor; + } + set + { + _internetAccessDescriptor = value; + _internetAccessDescriptorId = default(int?); + } + } + public virtual long? LocalEducationAgencyId { get; set; } + public virtual int? MagnetSpecialProgramEmphasisSchoolDescriptorId + { + get + { + if (_magnetSpecialProgramEmphasisSchoolDescriptorId == default(int?)) + _magnetSpecialProgramEmphasisSchoolDescriptorId = string.IsNullOrWhiteSpace(_magnetSpecialProgramEmphasisSchoolDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MagnetSpecialProgramEmphasisSchoolDescriptor", _magnetSpecialProgramEmphasisSchoolDescriptor); + + return _magnetSpecialProgramEmphasisSchoolDescriptorId; + } + set + { + _magnetSpecialProgramEmphasisSchoolDescriptorId = value; + _magnetSpecialProgramEmphasisSchoolDescriptor = null; + } + } + + private int? _magnetSpecialProgramEmphasisSchoolDescriptorId; + private string _magnetSpecialProgramEmphasisSchoolDescriptor; + + public virtual string MagnetSpecialProgramEmphasisSchoolDescriptor + { + get + { + if (_magnetSpecialProgramEmphasisSchoolDescriptor == null) + _magnetSpecialProgramEmphasisSchoolDescriptor = _magnetSpecialProgramEmphasisSchoolDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MagnetSpecialProgramEmphasisSchoolDescriptor", _magnetSpecialProgramEmphasisSchoolDescriptorId.Value); + + return _magnetSpecialProgramEmphasisSchoolDescriptor; + } + set + { + _magnetSpecialProgramEmphasisSchoolDescriptor = value; + _magnetSpecialProgramEmphasisSchoolDescriptorId = default(int?); + } + } + public virtual int? SchoolTypeDescriptorId + { + get + { + if (_schoolTypeDescriptorId == default(int?)) + _schoolTypeDescriptorId = string.IsNullOrWhiteSpace(_schoolTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolTypeDescriptor", _schoolTypeDescriptor); + + return _schoolTypeDescriptorId; + } + set + { + _schoolTypeDescriptorId = value; + _schoolTypeDescriptor = null; + } + } + + private int? _schoolTypeDescriptorId; + private string _schoolTypeDescriptor; + + public virtual string SchoolTypeDescriptor + { + get + { + if (_schoolTypeDescriptor == null) + _schoolTypeDescriptor = _schoolTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolTypeDescriptor", _schoolTypeDescriptorId.Value); + + return _schoolTypeDescriptor; + } + set + { + _schoolTypeDescriptor = value; + _schoolTypeDescriptorId = default(int?); + } + } + public virtual int? TitleIPartASchoolDesignationDescriptorId + { + get + { + if (_titleIPartASchoolDesignationDescriptorId == default(int?)) + _titleIPartASchoolDesignationDescriptorId = string.IsNullOrWhiteSpace(_titleIPartASchoolDesignationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TitleIPartASchoolDesignationDescriptor", _titleIPartASchoolDesignationDescriptor); + + return _titleIPartASchoolDesignationDescriptorId; + } + set + { + _titleIPartASchoolDesignationDescriptorId = value; + _titleIPartASchoolDesignationDescriptor = null; + } + } + + private int? _titleIPartASchoolDesignationDescriptorId; + private string _titleIPartASchoolDesignationDescriptor; + + public virtual string TitleIPartASchoolDesignationDescriptor + { + get + { + if (_titleIPartASchoolDesignationDescriptor == null) + _titleIPartASchoolDesignationDescriptor = _titleIPartASchoolDesignationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TitleIPartASchoolDesignationDescriptor", _titleIPartASchoolDesignationDescriptorId.Value); + + return _titleIPartASchoolDesignationDescriptor; + } + set + { + _titleIPartASchoolDesignationDescriptor = value; + _titleIPartASchoolDesignationDescriptorId = default(int?); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData CharterApprovalSchoolYearTypeReferenceData { get; set; } /// - /// The id of the referenced entity (used as the resource identifier in the API). + /// Read-only property that allows the CharterApprovalSchoolYearType resource identifier value to be mapped to the resource reference. /// - public virtual Guid? Id { get; set; } + Guid? Entities.Common.EdFi.ISchool.CharterApprovalSchoolYearTypeResourceId + { + get { return CharterApprovalSchoolYearTypeReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData LocalEducationAgencyReferenceData { get; set; } /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. + /// Read-only property that allows the LocalEducationAgency resource identifier value to be mapped to the resource reference. /// - public virtual string Discriminator { get; set; } + Guid? Entities.Common.EdFi.ISchool.LocalEducationAgencyResourceId + { + get { return LocalEducationAgencyReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _schoolCategories; + private ICollection _schoolCategoriesCovariant; + public virtual ICollection SchoolCategories + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _schoolCategories) + if (item.School == null) + item.School = this; + // ------------------------------------------------------------- + + return _schoolCategories; + } + set + { + _schoolCategories = value; + _schoolCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISchool.SchoolCategories + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _schoolCategories) + if (item.School == null) + item.School = this; + // ------------------------------------------------------------- + + return _schoolCategoriesCovariant; + } + set + { + SchoolCategories = new HashSet(value.Cast()); + } + } + + + private ICollection _schoolGradeLevels; + private ICollection _schoolGradeLevelsCovariant; + public virtual ICollection SchoolGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _schoolGradeLevels) + if (item.School == null) + item.School = this; + // ------------------------------------------------------------- + + return _schoolGradeLevels; + } + set + { + _schoolGradeLevels = value; + _schoolGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISchool.SchoolGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _schoolGradeLevels) + if (item.School == null) + item.School = this; + // ------------------------------------------------------------- + + return _schoolGradeLevelsCovariant; + } + set + { + SchoolGradeLevels = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "AdministrativeFundingControlDescriptor", new LookupColumnDetails { PropertyName = "AdministrativeFundingControlDescriptorId", LookupTypeName = "AdministrativeFundingControlDescriptor"} }, + { "CharterApprovalAgencyTypeDescriptor", new LookupColumnDetails { PropertyName = "CharterApprovalAgencyTypeDescriptorId", LookupTypeName = "CharterApprovalAgencyTypeDescriptor"} }, + { "CharterStatusDescriptor", new LookupColumnDetails { PropertyName = "CharterStatusDescriptorId", LookupTypeName = "CharterStatusDescriptor"} }, + { "InternetAccessDescriptor", new LookupColumnDetails { PropertyName = "InternetAccessDescriptorId", LookupTypeName = "InternetAccessDescriptor"} }, + { "MagnetSpecialProgramEmphasisSchoolDescriptor", new LookupColumnDetails { PropertyName = "MagnetSpecialProgramEmphasisSchoolDescriptorId", LookupTypeName = "MagnetSpecialProgramEmphasisSchoolDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + { "SchoolTypeDescriptor", new LookupColumnDetails { PropertyName = "SchoolTypeDescriptorId", LookupTypeName = "SchoolTypeDescriptor"} }, + { "TitleIPartASchoolDesignationDescriptor", new LookupColumnDetails { PropertyName = "TitleIPartASchoolDesignationDescriptorId", LookupTypeName = "TitleIPartASchoolDesignationDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -98355,13 +96685,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("Date", Date); - keyValues.Add("LocalCourseCode", LocalCourseCode); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); return keyValues; } @@ -98382,8 +96706,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -98400,31 +96734,47 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion - } + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISchool)target); + } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISchool) target, null); + } + + } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionAttendanceTakenEvent table of the SectionAttendanceTakenEvent aggregate in the ODS database. + /// A class which represents the edfi.SchoolCategory table of the School aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionAttendanceTakenEvent : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ISectionAttendanceTakenEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class SchoolCategory : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISchoolCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SectionAttendanceTakenEvent() + public SchoolCategory() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -98432,101 +96782,62 @@ public SectionAttendanceTakenEvent() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual string CalendarCode { get; set; } - [DomainSignature] - public virtual DateTime Date - { - get { return _date; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _date = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _date; - - [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [DomainSignature] - public virtual string SectionIdentifier { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual School School { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime EventDate + Entities.Common.EdFi.ISchool ISchoolCategory.School { - get { return _eventDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _eventDate = new DateTime(value.Year, value.Month, value.Day); } + get { return School; } + set { School = (School) value; } } - private DateTime _eventDate; - - public virtual int? StaffUSI + [DomainSignature] + public virtual int SchoolCategoryDescriptorId { get { - if (_staffUSI == default(int?) && _staffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) - { - _staffUSI = usi; - } - } + if (_schoolCategoryDescriptorId == default(int)) + _schoolCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolCategoryDescriptor", _schoolCategoryDescriptor); - return _staffUSI; + return _schoolCategoryDescriptorId; } set { - _staffUSI = value; - - if (value != null) - { - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value.Value); - } + _schoolCategoryDescriptorId = value; + _schoolCategoryDescriptor = null; } } - private int? _staffUSI; - private string _staffUniqueId; + private int _schoolCategoryDescriptorId; + private string _schoolCategoryDescriptor; - public virtual string StaffUniqueId + public virtual string SchoolCategoryDescriptor { get { - if (_staffUniqueId == null && _staffUSI.HasValue) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_staffUSI.Value, out var uniqueId)) - { - _staffUniqueId = uniqueId; - } - } - - return _staffUniqueId; + if (_schoolCategoryDescriptor == null) + _schoolCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolCategoryDescriptor", _schoolCategoryDescriptorId); + + return _schoolCategoryDescriptor; } set { - if (_staffUniqueId != value) - _staffUSI = default(int?); - - _staffUniqueId = value; + _schoolCategoryDescriptor = value; + _schoolCategoryDescriptorId = default(int); } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -98569,66 +96880,230 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.CalendarDateAggregate.EdFi.CalendarDateReferenceData CalendarDateReferenceData { get; set; } + // ------------------------------------------------------------- - /// - /// Read-only property that allows the CalendarDate discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateDiscriminator + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "SchoolCategoryDescriptor", new LookupColumnDetails { PropertyName = "SchoolCategoryDescriptorId", LookupTypeName = "SchoolCategoryDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get { return CalendarDateReferenceData?.Discriminator; } - set { } + get { return _idPropertyByLookupProperty; } } - /// - /// Read-only property that allows the CalendarDate resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateResourceId + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get { return CalendarDateReferenceData?.Id; } - set { } + // Get parent key values + var keyValues = (School as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("SchoolCategoryDescriptorId", SchoolCategoryDescriptorId); + + return keyValues; } - public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; - /// - /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionDiscriminator + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() { - get { return SectionReferenceData?.Discriminator; } - set { } + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolCategory)target); } - /// - /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionResourceId + void IMappable.Map(object target) { - get { return SectionReferenceData?.Id; } - set { } + this.MapTo((Entities.Common.EdFi.ISchoolCategory) target, null); } - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } + void IChildEntity.SetParent(object value) + { + School = (School) value; + } + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 - /// - /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffDiscriminator + /// + /// A class which represents the edfi.SchoolGradeLevel table of the School aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SchoolGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISchoolGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public SchoolGradeLevel() { - get { return StaffReferenceData?.Discriminator; } - set { } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 - /// - /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffResourceId + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual School School { get; set; } + + Entities.Common.EdFi.ISchool ISchoolGradeLevel.School { - get { return StaffReferenceData?.Id; } - set { } + get { return School; } + set { School = (School) value; } + } + + [DomainSignature] + public virtual int GradeLevelDescriptorId + { + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } + } + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor + { + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } } + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- // ------------------------------------------------------------- //============================================================= @@ -98639,6 +97114,7 @@ string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -98649,17 +97125,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (School as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("Date", Date); - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -98723,37 +97193,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionAttendanceTakenEvent)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionAttendanceTakenEvent) target, null); + this.MapTo((Entities.Common.EdFi.ISchoolGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + School = (School) value; + } } } -// Aggregate: SectionCharacteristicDescriptor +// Aggregate: SchoolCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.SectionCharacteristicDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SchoolCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionCharacteristicDescriptor table of the SectionCharacteristicDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SchoolCategoryDescriptor table of the SchoolCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISectionCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SchoolCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISchoolCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SectionCharacteristicDescriptorId + public virtual int SchoolCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -98838,7 +97312,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SectionCharacteristicDescriptorId", SectionCharacteristicDescriptorId); + keyValues.Add("SchoolCategoryDescriptorId", SchoolCategoryDescriptorId); return keyValues; } @@ -98902,37 +97376,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionCharacteristicDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionCharacteristicDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISchoolCategoryDescriptor) target, null); } } } -// Aggregate: SectionTypeDescriptor +// Aggregate: SchoolChoiceBasisDescriptor -namespace EdFi.Ods.Entities.NHibernate.SectionTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SchoolChoiceBasisDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SectionTypeDescriptor table of the SectionTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SchoolChoiceBasisDescriptor table of the SchoolChoiceBasisDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SectionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISectionTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SchoolChoiceBasisDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISchoolChoiceBasisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SectionTypeDescriptorId + public virtual int SchoolChoiceBasisDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -99017,7 +97491,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SectionTypeDescriptorId", SectionTypeDescriptorId); + keyValues.Add("SchoolChoiceBasisDescriptorId", SchoolChoiceBasisDescriptorId); return keyValues; } @@ -99081,37 +97555,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISectionTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolChoiceBasisDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISectionTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISchoolChoiceBasisDescriptor) target, null); } } } -// Aggregate: SeparationDescriptor +// Aggregate: SchoolChoiceImplementStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.SeparationDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SchoolChoiceImplementStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SeparationDescriptor table of the SeparationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SchoolChoiceImplementStatusDescriptor table of the SchoolChoiceImplementStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SeparationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISeparationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SchoolChoiceImplementStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SeparationDescriptorId + public virtual int SchoolChoiceImplementStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -99196,7 +97670,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SeparationDescriptorId", SeparationDescriptorId); + keyValues.Add("SchoolChoiceImplementStatusDescriptorId", SchoolChoiceImplementStatusDescriptorId); return keyValues; } @@ -99260,37 +97734,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISeparationDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISeparationDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor) target, null); } } } -// Aggregate: SeparationReasonDescriptor +// Aggregate: SchoolFoodServiceProgramServiceDescriptor -namespace EdFi.Ods.Entities.NHibernate.SeparationReasonDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SchoolFoodServiceProgramServiceDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SeparationReasonDescriptor table of the SeparationReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SchoolFoodServiceProgramServiceDescriptor table of the SchoolFoodServiceProgramServiceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SeparationReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISeparationReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SchoolFoodServiceProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SeparationReasonDescriptorId + public virtual int SchoolFoodServiceProgramServiceDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -99375,7 +97849,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SeparationReasonDescriptorId", SeparationReasonDescriptorId); + keyValues.Add("SchoolFoodServiceProgramServiceDescriptorId", SchoolFoodServiceProgramServiceDescriptorId); return keyValues; } @@ -99439,37 +97913,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISeparationReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISeparationReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor) target, null); } } } -// Aggregate: ServiceDescriptor +// Aggregate: SchoolTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.ServiceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SchoolTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ServiceDescriptor table of the ServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SchoolTypeDescriptor table of the SchoolTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SchoolTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISchoolTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ServiceDescriptorId + public virtual int SchoolTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -99554,7 +98028,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ServiceDescriptorId", ServiceDescriptorId); + keyValues.Add("SchoolTypeDescriptorId", SchoolTypeDescriptorId); return keyValues; } @@ -99618,31 +98092,29 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISchoolTypeDescriptor) target, null); } } } -// Aggregate: Session +// Aggregate: SchoolYearType -namespace EdFi.Ods.Entities.NHibernate.SessionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SchoolYearTypeAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class SessionReferenceData : IHasPrimaryKeyValues + public class SchoolYearTypeReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long SchoolId { get; set; } public virtual short SchoolYear { get; set; } - public virtual string SessionName { get; set; } // ------------------------------------------------------------- /// @@ -99650,12 +98122,6 @@ public class SessionReferenceData : IHasPrimaryKeyValues /// public virtual Guid? Id { get; set; } - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { @@ -99663,9 +98129,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolId", SchoolId); keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SessionName", SessionName); return keyValues; } @@ -99716,21 +98180,19 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Session table of the Session aggregate in the ODS database. + /// A class which represents the edfi.SchoolYearType table of the SchoolYearType aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Session : AggregateRootWithCompositeKey, IHasCascadableKeyValues, - Entities.Common.EdFi.ISession, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class SchoolYearType : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ISchoolYearType, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Session() + public SchoolYearType() { - SessionAcademicWeeks = new HashSet(); - SessionGradingPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -99739,10 +98201,287 @@ public Session() // Primary Key // ------------------------------------------------------------- [DomainSignature] + public virtual short SchoolYear { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual bool CurrentSchoolYear { get; set; } + public virtual string SchoolYearDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SchoolYear", SchoolYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISchoolYearType)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISchoolYearType) target, null); + } + + } +} +// Aggregate: Section + +namespace EdFi.Ods.Entities.NHibernate.SectionAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class SectionReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string LocalCourseCode { get; set; } + public virtual long SchoolId { get; set; } + public virtual short SchoolYear { get; set; } + public virtual string SectionIdentifier { get; set; } + public virtual string SessionName { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.Section table of the Section aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class Section : AggregateRootWithCompositeKey, IHasCascadableKeyValues, + Entities.Common.EdFi.ISection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public Section() + { + SectionCharacteristics = new HashSet(); + SectionClassPeriods = new HashSet(); + SectionCourseLevelCharacteristics = new HashSet(); + SectionOfferedGradeLevels = new HashSet(); + SectionPrograms = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions
(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions
()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string LocalCourseCode { get; set; } + [DomainSignature] public virtual long SchoolId { get; set; } [DomainSignature] public virtual short SchoolYear { get; set; } [DomainSignature] + public virtual string SectionIdentifier { get; set; } + [DomainSignature] public virtual string SessionName { get; set; } // ------------------------------------------------------------- @@ -99754,59 +98493,217 @@ public Session() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime BeginDate + public virtual decimal? AvailableCreditConversion { get; set; } + public virtual decimal? AvailableCredits { get; set; } + public virtual int? AvailableCreditTypeDescriptorId { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_availableCreditTypeDescriptorId == default(int?)) + _availableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_availableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _availableCreditTypeDescriptor); + + return _availableCreditTypeDescriptorId; + } + set + { + _availableCreditTypeDescriptorId = value; + _availableCreditTypeDescriptor = null; + } } - private DateTime _beginDate; - - public virtual DateTime EndDate + private int? _availableCreditTypeDescriptorId; + private string _availableCreditTypeDescriptor; + + public virtual string AvailableCreditTypeDescriptor { - get { return _endDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _endDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_availableCreditTypeDescriptor == null) + _availableCreditTypeDescriptor = _availableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _availableCreditTypeDescriptorId.Value); + + return _availableCreditTypeDescriptor; + } + set + { + _availableCreditTypeDescriptor = value; + _availableCreditTypeDescriptorId = default(int?); + } + } + public virtual int? EducationalEnvironmentDescriptorId + { + get + { + if (_educationalEnvironmentDescriptorId == default(int?)) + _educationalEnvironmentDescriptorId = string.IsNullOrWhiteSpace(_educationalEnvironmentDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationalEnvironmentDescriptor", _educationalEnvironmentDescriptor); + + return _educationalEnvironmentDescriptorId; + } + set + { + _educationalEnvironmentDescriptorId = value; + _educationalEnvironmentDescriptor = null; + } } - private DateTime _endDate; - - public virtual int TermDescriptorId + private int? _educationalEnvironmentDescriptorId; + private string _educationalEnvironmentDescriptor; + + public virtual string EducationalEnvironmentDescriptor { get { - if (_termDescriptorId == default(int)) - _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); + if (_educationalEnvironmentDescriptor == null) + _educationalEnvironmentDescriptor = _educationalEnvironmentDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationalEnvironmentDescriptor", _educationalEnvironmentDescriptorId.Value); + + return _educationalEnvironmentDescriptor; + } + set + { + _educationalEnvironmentDescriptor = value; + _educationalEnvironmentDescriptorId = default(int?); + } + } + public virtual int? InstructionLanguageDescriptorId + { + get + { + if (_instructionLanguageDescriptorId == default(int?)) + _instructionLanguageDescriptorId = string.IsNullOrWhiteSpace(_instructionLanguageDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _instructionLanguageDescriptor); - return _termDescriptorId; + return _instructionLanguageDescriptorId; } set { - _termDescriptorId = value; - _termDescriptor = null; + _instructionLanguageDescriptorId = value; + _instructionLanguageDescriptor = null; } } - private int _termDescriptorId; - private string _termDescriptor; + private int? _instructionLanguageDescriptorId; + private string _instructionLanguageDescriptor; - public virtual string TermDescriptor + public virtual string InstructionLanguageDescriptor { get { - if (_termDescriptor == null) - _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); + if (_instructionLanguageDescriptor == null) + _instructionLanguageDescriptor = _instructionLanguageDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _instructionLanguageDescriptorId.Value); - return _termDescriptor; + return _instructionLanguageDescriptor; } set { - _termDescriptor = value; - _termDescriptorId = default(int); + _instructionLanguageDescriptor = value; + _instructionLanguageDescriptorId = default(int?); } } - public virtual int TotalInstructionalDays { get; set; } + public virtual string LocationClassroomIdentificationCode { get; set; } + public virtual long? LocationSchoolId { get; set; } + public virtual int? MediumOfInstructionDescriptorId + { + get + { + if (_mediumOfInstructionDescriptorId == default(int?)) + _mediumOfInstructionDescriptorId = string.IsNullOrWhiteSpace(_mediumOfInstructionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptor); + + return _mediumOfInstructionDescriptorId; + } + set + { + _mediumOfInstructionDescriptorId = value; + _mediumOfInstructionDescriptor = null; + } + } + + private int? _mediumOfInstructionDescriptorId; + private string _mediumOfInstructionDescriptor; + + public virtual string MediumOfInstructionDescriptor + { + get + { + if (_mediumOfInstructionDescriptor == null) + _mediumOfInstructionDescriptor = _mediumOfInstructionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MediumOfInstructionDescriptor", _mediumOfInstructionDescriptorId.Value); + + return _mediumOfInstructionDescriptor; + } + set + { + _mediumOfInstructionDescriptor = value; + _mediumOfInstructionDescriptorId = default(int?); + } + } + public virtual bool? OfficialAttendancePeriod { get; set; } + public virtual int? PopulationServedDescriptorId + { + get + { + if (_populationServedDescriptorId == default(int?)) + _populationServedDescriptorId = string.IsNullOrWhiteSpace(_populationServedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PopulationServedDescriptor", _populationServedDescriptor); + + return _populationServedDescriptorId; + } + set + { + _populationServedDescriptorId = value; + _populationServedDescriptor = null; + } + } + + private int? _populationServedDescriptorId; + private string _populationServedDescriptor; + + public virtual string PopulationServedDescriptor + { + get + { + if (_populationServedDescriptor == null) + _populationServedDescriptor = _populationServedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PopulationServedDescriptor", _populationServedDescriptorId.Value); + + return _populationServedDescriptor; + } + set + { + _populationServedDescriptor = value; + _populationServedDescriptorId = default(int?); + } + } + public virtual string SectionName { get; set; } + public virtual int? SectionTypeDescriptorId + { + get + { + if (_sectionTypeDescriptorId == default(int?)) + _sectionTypeDescriptorId = string.IsNullOrWhiteSpace(_sectionTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SectionTypeDescriptor", _sectionTypeDescriptor); + + return _sectionTypeDescriptorId; + } + set + { + _sectionTypeDescriptorId = value; + _sectionTypeDescriptor = null; + } + } + + private int? _sectionTypeDescriptorId; + private string _sectionTypeDescriptor; + + public virtual string SectionTypeDescriptor + { + get + { + if (_sectionTypeDescriptor == null) + _sectionTypeDescriptor = _sectionTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SectionTypeDescriptor", _sectionTypeDescriptorId.Value); + + return _sectionTypeDescriptor; + } + set + { + _sectionTypeDescriptor = value; + _sectionTypeDescriptorId = default(int?); + } + } + public virtual int? SequenceOfCourse { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -99851,25 +98748,54 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + public virtual NHibernate.CourseOfferingAggregate.EdFi.CourseOfferingReferenceData CourseOfferingReferenceData { get; set; } /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the CourseOffering discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISession.SchoolResourceId + string Entities.Common.EdFi.ISection.CourseOfferingDiscriminator { - get { return SchoolReferenceData?.Id; } + get { return CourseOfferingReferenceData?.Discriminator; } set { } } - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + /// + /// Read-only property that allows the CourseOffering resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISection.CourseOfferingResourceId + { + get { return CourseOfferingReferenceData?.Id; } + set { } + } + + public virtual NHibernate.LocationAggregate.EdFi.LocationReferenceData LocationReferenceData { get; set; } /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Location discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISession.SchoolYearTypeResourceId + string Entities.Common.EdFi.ISection.LocationDiscriminator { - get { return SchoolYearTypeReferenceData?.Id; } + get { return LocationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Location resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISection.LocationResourceId + { + get { return LocationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData LocationSchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the LocationSchool resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISection.LocationSchoolResourceId + { + get { return LocationSchoolReferenceData?.Id; } set { } } @@ -99879,9 +98805,9 @@ public IDictionary Extensions // Collections // ------------------------------------------------------------- - private ICollection _sessionAcademicWeeks; - private ICollection _sessionAcademicWeeksCovariant; - public virtual ICollection SessionAcademicWeeks + private ICollection _sectionCharacteristics; + private ICollection _sectionCharacteristicsCovariant; + public virtual ICollection SectionCharacteristics { get { @@ -99890,45 +98816,45 @@ public virtual ICollection(value); + _sectionCharacteristics = value; + _sectionCharacteristicsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISession.SessionAcademicWeeks + ICollection Entities.Common.EdFi.ISection.SectionCharacteristics { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _sessionAcademicWeeks) - if (item.Session == null) - item.Session = this; + foreach (var item in _sectionCharacteristics) + if (item.Section == null) + item.Section = this; // ------------------------------------------------------------- - return _sessionAcademicWeeksCovariant; + return _sectionCharacteristicsCovariant; } set { - SessionAcademicWeeks = new HashSet(value.Cast()); + SectionCharacteristics = new HashSet(value.Cast()); } } - private ICollection _sessionGradingPeriods; - private ICollection _sessionGradingPeriodsCovariant; - public virtual ICollection SessionGradingPeriods + private ICollection _sectionClassPeriods; + private ICollection _sectionClassPeriodsCovariant; + public virtual ICollection SectionClassPeriods { get { @@ -99937,38 +98863,179 @@ public virtual ICollection(value); + _sectionClassPeriods = value; + _sectionClassPeriodsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISession.SessionGradingPeriods + ICollection Entities.Common.EdFi.ISection.SectionClassPeriods { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _sessionGradingPeriods) - if (item.Session == null) - item.Session = this; + foreach (var item in _sectionClassPeriods) + if (item.Section == null) + item.Section = this; // ------------------------------------------------------------- - return _sessionGradingPeriodsCovariant; + return _sectionClassPeriodsCovariant; } set { - SessionGradingPeriods = new HashSet(value.Cast()); + SectionClassPeriods = new HashSet(value.Cast()); + } + } + + + private ICollection _sectionCourseLevelCharacteristics; + private ICollection _sectionCourseLevelCharacteristicsCovariant; + public virtual ICollection SectionCourseLevelCharacteristics + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sectionCourseLevelCharacteristics) + if (item.Section == null) + item.Section = this; + // ------------------------------------------------------------- + + return _sectionCourseLevelCharacteristics; + } + set + { + _sectionCourseLevelCharacteristics = value; + _sectionCourseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISection.SectionCourseLevelCharacteristics + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sectionCourseLevelCharacteristics) + if (item.Section == null) + item.Section = this; + // ------------------------------------------------------------- + + return _sectionCourseLevelCharacteristicsCovariant; + } + set + { + SectionCourseLevelCharacteristics = new HashSet(value.Cast()); + } + } + + + private ICollection _sectionOfferedGradeLevels; + private ICollection _sectionOfferedGradeLevelsCovariant; + public virtual ICollection SectionOfferedGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sectionOfferedGradeLevels) + if (item.Section == null) + item.Section = this; + // ------------------------------------------------------------- + + return _sectionOfferedGradeLevels; + } + set + { + _sectionOfferedGradeLevels = value; + _sectionOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISection.SectionOfferedGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sectionOfferedGradeLevels) + if (item.Section == null) + item.Section = this; + // ------------------------------------------------------------- + + return _sectionOfferedGradeLevelsCovariant; + } + set + { + SectionOfferedGradeLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _sectionPrograms; + private ICollection _sectionProgramsCovariant; + public virtual ICollection SectionPrograms + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sectionPrograms) + if (item.Section == null) + item.Section = this; + // ------------------------------------------------------------- + + return _sectionPrograms; + } + set + { + _sectionPrograms = value; + _sectionProgramsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISection.SectionPrograms + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sectionPrograms) + if (item.Section == null) + item.Section = this; + // ------------------------------------------------------------- + + return _sectionProgramsCovariant; + } + set + { + SectionPrograms = new HashSet(value.Cast()); } } @@ -99977,7 +99044,12 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "AvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "EducationalEnvironmentDescriptor", new LookupColumnDetails { PropertyName = "EducationalEnvironmentDescriptorId", LookupTypeName = "EducationalEnvironmentDescriptor"} }, + { "InstructionLanguageDescriptor", new LookupColumnDetails { PropertyName = "InstructionLanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, + { "MediumOfInstructionDescriptor", new LookupColumnDetails { PropertyName = "MediumOfInstructionDescriptorId", LookupTypeName = "MediumOfInstructionDescriptor"} }, + { "PopulationServedDescriptor", new LookupColumnDetails { PropertyName = "PopulationServedDescriptorId", LookupTypeName = "PopulationServedDescriptor"} }, + { "SectionTypeDescriptor", new LookupColumnDetails { PropertyName = "SectionTypeDescriptorId", LookupTypeName = "SectionTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -99992,8 +99064,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("LocalCourseCode", LocalCourseCode); keyValues.Add("SchoolId", SchoolId); keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); keyValues.Add("SessionName", SessionName); return keyValues; @@ -100064,12 +99138,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISession)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISection)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISession) target, null); + this.MapTo((Entities.Common.EdFi.ISection) target, null); } } @@ -100077,19 +99151,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SessionAcademicWeek table of the Session aggregate in the ODS database. + /// A class which represents the edfi.SectionCharacteristic table of the Section aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SessionAcademicWeek : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISessionAcademicWeek, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class SectionCharacteristic : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISectionCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SessionAcademicWeek() + public SectionCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -100098,16 +99172,49 @@ public SessionAcademicWeek() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Session Session { get; set; } + public virtual Section Section { get; set; } - Entities.Common.EdFi.ISession ISessionAcademicWeek.Session + Entities.Common.EdFi.ISection ISectionCharacteristic.Section { - get { return Session; } - set { Session = (Session) value; } + get { return Section; } + set { Section = (Section) value; } } [DomainSignature] - public virtual string WeekIdentifier { get; set; } + public virtual int SectionCharacteristicDescriptorId + { + get + { + if (_sectionCharacteristicDescriptorId == default(int)) + _sectionCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SectionCharacteristicDescriptor", _sectionCharacteristicDescriptor); + + return _sectionCharacteristicDescriptorId; + } + set + { + _sectionCharacteristicDescriptorId = value; + _sectionCharacteristicDescriptor = null; + } + } + + private int _sectionCharacteristicDescriptorId; + private string _sectionCharacteristicDescriptor; + + public virtual string SectionCharacteristicDescriptor + { + get + { + if (_sectionCharacteristicDescriptor == null) + _sectionCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SectionCharacteristicDescriptor", _sectionCharacteristicDescriptorId); + + return _sectionCharacteristicDescriptor; + } + set + { + _sectionCharacteristicDescriptor = value; + _sectionCharacteristicDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -100162,26 +99269,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.AcademicWeekAggregate.EdFi.AcademicWeekReferenceData AcademicWeekReferenceData { get; set; } - - /// - /// Read-only property that allows the AcademicWeek discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekDiscriminator - { - get { return AcademicWeekReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the AcademicWeek resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekResourceId - { - get { return AcademicWeekReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -100192,6 +99279,7 @@ string Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "SectionCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "SectionCharacteristicDescriptorId", LookupTypeName = "SectionCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -100203,10 +99291,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Session as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("WeekIdentifier", WeekIdentifier); + keyValues.Add("SectionCharacteristicDescriptorId", SectionCharacteristicDescriptorId); return keyValues; } @@ -100270,36 +99358,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISessionAcademicWeek)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISectionCharacteristic)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISessionAcademicWeek) target, null); + this.MapTo((Entities.Common.EdFi.ISectionCharacteristic) target, null); } void IChildEntity.SetParent(object value) { - Session = (Session) value; + Section = (Section) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SessionGradingPeriod table of the Session aggregate in the ODS database. + /// A class which represents the edfi.SectionClassPeriod table of the Section aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SessionGradingPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISessionGradingPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class SectionClassPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISectionClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SessionGradingPeriod() + public SectionClassPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -100308,51 +99396,16 @@ public SessionGradingPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Session Session { get; set; } - - Entities.Common.EdFi.ISession ISessionGradingPeriod.Session - { - get { return Session; } - set { Session = (Session) value; } - } + public virtual Section Section { get; set; } - [DomainSignature] - public virtual int GradingPeriodDescriptorId + Entities.Common.EdFi.ISection ISectionClassPeriod.Section { - get - { - if (_gradingPeriodDescriptorId == default(int)) - _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); - - return _gradingPeriodDescriptorId; - } - set - { - _gradingPeriodDescriptorId = value; - _gradingPeriodDescriptor = null; - } + get { return Section; } + set { Section = (Section) value; } } - private int _gradingPeriodDescriptorId; - private string _gradingPeriodDescriptor; - - public virtual string GradingPeriodDescriptor - { - get - { - if (_gradingPeriodDescriptor == null) - _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); - - return _gradingPeriodDescriptor; - } - set - { - _gradingPeriodDescriptor = value; - _gradingPeriodDescriptorId = default(int); - } - } [DomainSignature] - public virtual string GradingPeriodName { get; set; } + public virtual string ClassPeriodName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -100407,23 +99460,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } + public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } /// - /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. + /// Read-only property that allows the ClassPeriod discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDiscriminator + string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodDiscriminator { - get { return GradingPeriodReferenceData?.Discriminator; } + get { return ClassPeriodReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the ClassPeriod resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodResourceId + Guid? Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodResourceId { - get { return GradingPeriodReferenceData?.Id; } + get { return ClassPeriodReferenceData?.Id; } set { } } @@ -100437,7 +99490,6 @@ string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -100449,11 +99501,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Session as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); - keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("ClassPeriodName", ClassPeriodName); return keyValues; } @@ -100517,111 +99568,152 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISessionGradingPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISectionClassPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISessionGradingPeriod) target, null); + this.MapTo((Entities.Common.EdFi.ISectionClassPeriod) target, null); } void IChildEntity.SetParent(object value) { - Session = (Session) value; + Section = (Section) value; } } -} -// Aggregate: SexDescriptor - -namespace EdFi.Ods.Entities.NHibernate.SexDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SexDescriptor table of the SexDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SectionCourseLevelCharacteristic table of the Section aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SexDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISexDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SectionCourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISectionCourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int SexDescriptorId + public SectionCourseLevelCharacteristic() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, JsonIgnore] + public virtual Section Section { get; set; } + + Entities.Common.EdFi.ISection ISectionCourseLevelCharacteristic.Section { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Section; } + set { Section = (Section) value; } } - string IDescriptor.Namespace + + [DomainSignature] + public virtual int CourseLevelCharacteristicDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_courseLevelCharacteristicDescriptorId == default(int)) + _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); + + return _courseLevelCharacteristicDescriptorId; + } + set + { + _courseLevelCharacteristicDescriptorId = value; + _courseLevelCharacteristicDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _courseLevelCharacteristicDescriptorId; + private string _courseLevelCharacteristicDescriptor; + + public virtual string CourseLevelCharacteristicDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_courseLevelCharacteristicDescriptor == null) + _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); + + return _courseLevelCharacteristicDescriptor; + } + set + { + _courseLevelCharacteristicDescriptor = value; + _courseLevelCharacteristicDescriptorId = default(int); + } } // ------------------------------------------------------------- // ============================================================= - // Properties + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Extensions + // One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -100632,11 +99724,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("SexDescriptorId", SexDescriptorId); + keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); return keyValues; } @@ -100700,116 +99792,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISexDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISectionCourseLevelCharacteristic)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISexDescriptor) target, null); - } - - } -} -// Aggregate: SourceDimension - -namespace EdFi.Ods.Entities.NHibernate.SourceDimensionAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class SourceDimensionReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.ISectionCourseLevelCharacteristic) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + Section = (Section) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SourceDimension table of the SourceDimension aggregate in the ODS database. + /// A class which represents the edfi.SectionOfferedGradeLevel table of the Section aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SourceDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ISourceDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class SectionOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISectionOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SourceDimension() + public SectionOfferedGradeLevel() { - SourceDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -100817,10 +99829,50 @@ public SourceDimension() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Section Section { get; set; } + + Entities.Common.EdFi.ISection ISectionOfferedGradeLevel.Section + { + get { return Section; } + set { Section = (Section) value; } + } + [DomainSignature] - public virtual string Code { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } + public virtual int GradeLevelDescriptorId + { + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } + } + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + public virtual string GradeLevelDescriptor + { + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -100831,7 +99883,6 @@ public SourceDimension() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CodeName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -100881,58 +99932,12 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _sourceDimensionReportingTags; - private ICollection _sourceDimensionReportingTagsCovariant; - public virtual ICollection SourceDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sourceDimensionReportingTags) - if (item.SourceDimension == null) - item.SourceDimension = this; - // ------------------------------------------------------------- - - return _sourceDimensionReportingTags; - } - set - { - _sourceDimensionReportingTags = value; - _sourceDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISourceDimension.SourceDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _sourceDimensionReportingTags) - if (item.SourceDimension == null) - item.SourceDimension = this; - // ------------------------------------------------------------- - - return _sourceDimensionReportingTagsCovariant; - } - set - { - SourceDimensionReportingTags = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -100943,12 +99948,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -101012,32 +100016,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISourceDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISectionOfferedGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISourceDimension) target, null); + this.MapTo((Entities.Common.EdFi.ISectionOfferedGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + Section = (Section) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SourceDimensionReportingTag table of the SourceDimension aggregate in the ODS database. + /// A class which represents the edfi.SectionProgram table of the Section aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SourceDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ISourceDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class SectionProgram : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISectionProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public SourceDimensionReportingTag() + public SectionProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -101046,47 +100054,51 @@ public SourceDimensionReportingTag() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual SourceDimension SourceDimension { get; set; } + public virtual Section Section { get; set; } - Entities.Common.EdFi.ISourceDimension ISourceDimensionReportingTag.SourceDimension + Entities.Common.EdFi.ISection ISectionProgram.Section { - get { return SourceDimension; } - set { SourceDimension = (SourceDimension) value; } + get { return Section; } + set { Section = (Section) value; } } [DomainSignature] - public virtual int ReportingTagDescriptorId + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ProgramName { get; set; } + [DomainSignature] + public virtual int ProgramTypeDescriptorId { get { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - return _reportingTagDescriptorId; + return _programTypeDescriptorId; } set { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; + _programTypeDescriptorId = value; + _programTypeDescriptor = null; } } - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; + private int _programTypeDescriptorId; + private string _programTypeDescriptor; - public virtual string ReportingTagDescriptor + public virtual string ProgramTypeDescriptor { get { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - return _reportingTagDescriptor; + return _programTypeDescriptor; } set { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -101143,6 +100155,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ISectionProgram.ProgramDiscriminator + { + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISectionProgram.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -101153,7 +100185,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -101165,10 +100197,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (SourceDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -101232,41 +100266,41 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISourceDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISectionProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISourceDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.ISectionProgram) target, null); } void IChildEntity.SetParent(object value) { - SourceDimension = (SourceDimension) value; + Section = (Section) value; } } } -// Aggregate: SourceSystemDescriptor +// Aggregate: Section504DisabilityTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.SourceSystemDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.Section504DisabilityTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SourceSystemDescriptor table of the SourceSystemDescriptor aggregate in the ODS database. + /// A class which represents the edfi.Section504DisabilityTypeDescriptor table of the Section504DisabilityTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SourceSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISourceSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class Section504DisabilityTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISection504DisabilityTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SourceSystemDescriptorId + public virtual int Section504DisabilityTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -101351,7 +100385,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SourceSystemDescriptorId", SourceSystemDescriptorId); + keyValues.Add("Section504DisabilityTypeDescriptorId", Section504DisabilityTypeDescriptorId); return keyValues; } @@ -101415,37 +100449,454 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISourceSystemDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISection504DisabilityTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISourceSystemDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISection504DisabilityTypeDescriptor) target, null); } } } -// Aggregate: SpecialEducationExitReasonDescriptor +// Aggregate: SectionAttendanceTakenEvent -namespace EdFi.Ods.Entities.NHibernate.SpecialEducationExitReasonDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SectionAttendanceTakenEventAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + public class SectionAttendanceTakenEventReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string CalendarCode { get; set; } + public virtual DateTime Date { get; set; } + public virtual string LocalCourseCode { get; set; } + public virtual long SchoolId { get; set; } + public virtual short SchoolYear { get; set; } + public virtual string SectionIdentifier { get; set; } + public virtual string SessionName { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("Date", Date); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SpecialEducationExitReasonDescriptor table of the SpecialEducationExitReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SectionAttendanceTakenEvent table of the SectionAttendanceTakenEvent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SpecialEducationExitReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SectionAttendanceTakenEvent : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ISectionAttendanceTakenEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public SectionAttendanceTakenEvent() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SpecialEducationExitReasonDescriptorId + public virtual string CalendarCode { get; set; } + [DomainSignature] + public virtual DateTime Date + { + get { return _date; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _date = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _date; + + [DomainSignature] + public virtual string LocalCourseCode { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } + [DomainSignature] + public virtual string SectionIdentifier { get; set; } + [DomainSignature] + public virtual string SessionName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime EventDate + { + get { return _eventDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _eventDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _eventDate; + + public virtual int? StaffUSI + { + get + { + if (_staffUSI == default(int?) && _staffUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) + { + _staffUSI = usi; + } + } + + return _staffUSI; + } + set + { + _staffUSI = value; + + if (value != null) + { + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value.Value); + } + } + } + + private int? _staffUSI; + private string _staffUniqueId; + + public virtual string StaffUniqueId + { + get + { + if (_staffUniqueId == null && _staffUSI.HasValue) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_staffUSI.Value, out var uniqueId)) + { + _staffUniqueId = uniqueId; + } + } + + return _staffUniqueId; + } + set + { + if (_staffUniqueId != value) + _staffUSI = default(int?); + + _staffUniqueId = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + public virtual NHibernate.CalendarDateAggregate.EdFi.CalendarDateReferenceData CalendarDateReferenceData { get; set; } + + /// + /// Read-only property that allows the CalendarDate discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateDiscriminator + { + get { return CalendarDateReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the CalendarDate resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateResourceId + { + get { return CalendarDateReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } + + /// + /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionDiscriminator + { + get { return SectionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionResourceId + { + get { return SectionReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } + + /// + /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffDiscriminator + { + get { return StaffReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffResourceId + { + get { return StaffReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("Date", Date); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISectionAttendanceTakenEvent)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISectionAttendanceTakenEvent) target, null); + } + + } +} +// Aggregate: SectionCharacteristicDescriptor + +namespace EdFi.Ods.Entities.NHibernate.SectionCharacteristicDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SectionCharacteristicDescriptor table of the SectionCharacteristicDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SectionCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISectionCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int SectionCharacteristicDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -101530,7 +100981,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SpecialEducationExitReasonDescriptorId", SpecialEducationExitReasonDescriptorId); + keyValues.Add("SectionCharacteristicDescriptorId", SectionCharacteristicDescriptorId); return keyValues; } @@ -101594,37 +101045,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISectionCharacteristicDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISectionCharacteristicDescriptor) target, null); } } } -// Aggregate: SpecialEducationProgramServiceDescriptor +// Aggregate: SectionTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.SpecialEducationProgramServiceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SectionTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SpecialEducationProgramServiceDescriptor table of the SpecialEducationProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SectionTypeDescriptor table of the SectionTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SpecialEducationProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SectionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISectionTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SpecialEducationProgramServiceDescriptorId + public virtual int SectionTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -101709,7 +101160,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SpecialEducationProgramServiceDescriptorId", SpecialEducationProgramServiceDescriptorId); + keyValues.Add("SectionTypeDescriptorId", SectionTypeDescriptorId); return keyValues; } @@ -101773,37 +101224,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISectionTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISectionTypeDescriptor) target, null); } } } -// Aggregate: SpecialEducationSettingDescriptor +// Aggregate: SeparationDescriptor -namespace EdFi.Ods.Entities.NHibernate.SpecialEducationSettingDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SeparationDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.SpecialEducationSettingDescriptor table of the SpecialEducationSettingDescriptor aggregate in the ODS database. + /// A class which represents the edfi.SeparationDescriptor table of the SeparationDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class SpecialEducationSettingDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ISpecialEducationSettingDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + public class SeparationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISeparationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int SpecialEducationSettingDescriptorId + public virtual int SeparationDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -101888,7 +101339,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SpecialEducationSettingDescriptorId", SpecialEducationSettingDescriptorId); + keyValues.Add("SeparationDescriptorId", SeparationDescriptorId); return keyValues; } @@ -101952,29 +101403,389 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ISpecialEducationSettingDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ISeparationDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ISpecialEducationSettingDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ISeparationDescriptor) target, null); } } } -// Aggregate: Staff +// Aggregate: SeparationReasonDescriptor -namespace EdFi.Ods.Entities.NHibernate.StaffAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.SeparationReasonDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.SeparationReasonDescriptor table of the SeparationReasonDescriptor aggregate in the ODS database. /// - public class StaffReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SeparationReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISeparationReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int StaffUSI { get; set; } + [DomainSignature] + public virtual int SeparationReasonDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SeparationReasonDescriptorId", SeparationReasonDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISeparationReasonDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISeparationReasonDescriptor) target, null); + } + + } +} +// Aggregate: ServiceDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ServiceDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.ServiceDescriptor table of the ServiceDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class ServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int ServiceDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("ServiceDescriptorId", ServiceDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IServiceDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IServiceDescriptor) target, null); + } + + } +} +// Aggregate: Session + +namespace EdFi.Ods.Entities.NHibernate.SessionAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class SessionReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long SchoolId { get; set; } + public virtual short SchoolYear { get; set; } + public virtual string SessionName { get; set; } // ------------------------------------------------------------- /// @@ -101995,7 +101806,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("StaffUSI", StaffUSI); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SessionName", SessionName); return keyValues; } @@ -102046,34 +101859,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Staff table of the Staff aggregate in the ODS database. + /// A class which represents the edfi.Session table of the Session aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Staff : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class Session : AggregateRootWithCompositeKey, IHasCascadableKeyValues, + Entities.Common.EdFi.ISession, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Staff() + public Session() { - StaffAddresses = new HashSet(); - StaffAncestryEthnicOrigins = new HashSet(); - StaffCredentials = new HashSet(); - StaffElectronicMails = new HashSet(); - StaffIdentificationCodes = new HashSet(); - StaffIdentificationDocuments = new HashSet(); - StaffInternationalAddresses = new HashSet(); - StaffLanguages = new HashSet(); - StaffOtherNames = new HashSet(); - StaffPersonalIdentificationDocuments = new HashSet(); - StaffRaces = new HashSet(); - StaffRecognitions = new HashSet(); - StaffTelephones = new HashSet(); - StaffTribalAffiliations = new HashSet(); - StaffVisas = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + SessionAcademicWeeks = new HashSet(); + SessionGradingPeriods = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -102081,31 +101881,12 @@ public Staff() // ============================================================= // Primary Key // ------------------------------------------------------------- - [Display(Name="StaffUniqueId")][DomainSignature] - public virtual int StaffUSI - { - get - { - if (_staffUSI == default(int) && _staffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) - { - _staffUSI = usi; - } - } - - return _staffUSI; - } - set - { - _staffUSI = value; - } - } - - private int _staffUSI; - string IIdentifiablePerson.UniqueId { get { return StaffUniqueId; } } - + [DomainSignature] + public virtual long SchoolId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } + [DomainSignature] + public virtual string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -102116,94 +101897,2456 @@ public virtual int StaffUSI // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? BirthDate + public virtual DateTime BeginDate { - get { return _birthDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _birthDate = null; - } else - { - var given = (DateTime) value; - _birthDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } - private DateTime? _birthDate; + private DateTime _beginDate; - public virtual int? CitizenshipStatusDescriptorId + public virtual DateTime EndDate + { + get { return _endDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _endDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _endDate; + + public virtual int TermDescriptorId { get { - if (_citizenshipStatusDescriptorId == default(int?)) - _citizenshipStatusDescriptorId = string.IsNullOrWhiteSpace(_citizenshipStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CitizenshipStatusDescriptor", _citizenshipStatusDescriptor); + if (_termDescriptorId == default(int)) + _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); - return _citizenshipStatusDescriptorId; + return _termDescriptorId; } set { - _citizenshipStatusDescriptorId = value; - _citizenshipStatusDescriptor = null; + _termDescriptorId = value; + _termDescriptor = null; } } - private int? _citizenshipStatusDescriptorId; - private string _citizenshipStatusDescriptor; + private int _termDescriptorId; + private string _termDescriptor; - public virtual string CitizenshipStatusDescriptor + public virtual string TermDescriptor { get { - if (_citizenshipStatusDescriptor == null) - _citizenshipStatusDescriptor = _citizenshipStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CitizenshipStatusDescriptor", _citizenshipStatusDescriptorId.Value); + if (_termDescriptor == null) + _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); - return _citizenshipStatusDescriptor; + return _termDescriptor; } set { - _citizenshipStatusDescriptor = value; - _citizenshipStatusDescriptorId = default(int?); + _termDescriptor = value; + _termDescriptorId = default(int); } } - public virtual string FirstName { get; set; } - public virtual string GenderIdentity { get; set; } - public virtual string GenerationCodeSuffix { get; set; } - public virtual int? HighestCompletedLevelOfEducationDescriptorId - { - get - { - if (_highestCompletedLevelOfEducationDescriptorId == default(int?)) - _highestCompletedLevelOfEducationDescriptorId = string.IsNullOrWhiteSpace(_highestCompletedLevelOfEducationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptor); + public virtual int TotalInstructionalDays { get; set; } + // ------------------------------------------------------------- - return _highestCompletedLevelOfEducationDescriptorId; - } - set - { - _highestCompletedLevelOfEducationDescriptorId = value; - _highestCompletedLevelOfEducationDescriptor = null; - } - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - private int? _highestCompletedLevelOfEducationDescriptorId; - private string _highestCompletedLevelOfEducationDescriptor; + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; - public virtual string HighestCompletedLevelOfEducationDescriptor + public IDictionary Extensions { - get - { - if (_highestCompletedLevelOfEducationDescriptor == null) - _highestCompletedLevelOfEducationDescriptor = _highestCompletedLevelOfEducationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptorId.Value); - - return _highestCompletedLevelOfEducationDescriptor; - } + get => _extensions; set { - _highestCompletedLevelOfEducationDescriptor = value; - _highestCompletedLevelOfEducationDescriptorId = default(int?); + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISession.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISession.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _sessionAcademicWeeks; + private ICollection _sessionAcademicWeeksCovariant; + public virtual ICollection SessionAcademicWeeks + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sessionAcademicWeeks) + if (item.Session == null) + item.Session = this; + // ------------------------------------------------------------- + + return _sessionAcademicWeeks; + } + set + { + _sessionAcademicWeeks = value; + _sessionAcademicWeeksCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISession.SessionAcademicWeeks + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sessionAcademicWeeks) + if (item.Session == null) + item.Session = this; + // ------------------------------------------------------------- + + return _sessionAcademicWeeksCovariant; + } + set + { + SessionAcademicWeeks = new HashSet(value.Cast()); + } + } + + + private ICollection _sessionGradingPeriods; + private ICollection _sessionGradingPeriodsCovariant; + public virtual ICollection SessionGradingPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sessionGradingPeriods) + if (item.Session == null) + item.Session = this; + // ------------------------------------------------------------- + + return _sessionGradingPeriods; + } + set + { + _sessionGradingPeriods = value; + _sessionGradingPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISession.SessionGradingPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sessionGradingPeriods) + if (item.Session == null) + item.Session = this; + // ------------------------------------------------------------- + + return _sessionGradingPeriodsCovariant; + } + set + { + SessionGradingPeriods = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SessionName", SessionName); + + return keyValues; + } + + /// + /// Gets or sets the capturing the new key values that have + /// not been modified directly on the entity. + /// + OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISession)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISession) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SessionAcademicWeek table of the Session aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SessionAcademicWeek : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISessionAcademicWeek, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public SessionAcademicWeek() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Session Session { get; set; } + + Entities.Common.EdFi.ISession ISessionAcademicWeek.Session + { + get { return Session; } + set { Session = (Session) value; } + } + + [DomainSignature] + public virtual string WeekIdentifier { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + public virtual NHibernate.AcademicWeekAggregate.EdFi.AcademicWeekReferenceData AcademicWeekReferenceData { get; set; } + + /// + /// Read-only property that allows the AcademicWeek discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekDiscriminator + { + get { return AcademicWeekReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the AcademicWeek resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekResourceId + { + get { return AcademicWeekReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (Session as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("WeekIdentifier", WeekIdentifier); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISessionAcademicWeek)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISessionAcademicWeek) target, null); + } + + void IChildEntity.SetParent(object value) + { + Session = (Session) value; + } + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SessionGradingPeriod table of the Session aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SessionGradingPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISessionGradingPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public SessionGradingPeriod() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Session Session { get; set; } + + Entities.Common.EdFi.ISession ISessionGradingPeriod.Session + { + get { return Session; } + set { Session = (Session) value; } + } + + [DomainSignature] + public virtual int GradingPeriodDescriptorId + { + get + { + if (_gradingPeriodDescriptorId == default(int)) + _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); + + return _gradingPeriodDescriptorId; + } + set + { + _gradingPeriodDescriptorId = value; + _gradingPeriodDescriptor = null; + } + } + + private int _gradingPeriodDescriptorId; + private string _gradingPeriodDescriptor; + + public virtual string GradingPeriodDescriptor + { + get + { + if (_gradingPeriodDescriptor == null) + _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); + + return _gradingPeriodDescriptor; + } + set + { + _gradingPeriodDescriptor = value; + _gradingPeriodDescriptorId = default(int); + } + } + [DomainSignature] + public virtual string GradingPeriodName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } + + /// + /// Read-only property that allows the GradingPeriod discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDiscriminator + { + get { return GradingPeriodReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the GradingPeriod resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodResourceId + { + get { return GradingPeriodReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (Session as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); + keyValues.Add("GradingPeriodName", GradingPeriodName); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISessionGradingPeriod)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISessionGradingPeriod) target, null); + } + + void IChildEntity.SetParent(object value) + { + Session = (Session) value; + } + } +} +// Aggregate: SexDescriptor + +namespace EdFi.Ods.Entities.NHibernate.SexDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SexDescriptor table of the SexDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SexDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISexDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int SexDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SexDescriptorId", SexDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISexDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISexDescriptor) target, null); + } + + } +} +// Aggregate: SourceDimension + +namespace EdFi.Ods.Entities.NHibernate.SourceDimensionAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class SourceDimensionReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string Code { get; set; } + public virtual int FiscalYear { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SourceDimension table of the SourceDimension aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SourceDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ISourceDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public SourceDimension() + { + SourceDimensionReportingTags = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string Code { get; set; } + [DomainSignature] + public virtual int FiscalYear { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string CodeName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _sourceDimensionReportingTags; + private ICollection _sourceDimensionReportingTagsCovariant; + public virtual ICollection SourceDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sourceDimensionReportingTags) + if (item.SourceDimension == null) + item.SourceDimension = this; + // ------------------------------------------------------------- + + return _sourceDimensionReportingTags; + } + set + { + _sourceDimensionReportingTags = value; + _sourceDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISourceDimension.SourceDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _sourceDimensionReportingTags) + if (item.SourceDimension == null) + item.SourceDimension = this; + // ------------------------------------------------------------- + + return _sourceDimensionReportingTagsCovariant; + } + set + { + SourceDimensionReportingTags = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISourceDimension)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISourceDimension) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SourceDimensionReportingTag table of the SourceDimension aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SourceDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ISourceDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public SourceDimensionReportingTag() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual SourceDimension SourceDimension { get; set; } + + Entities.Common.EdFi.ISourceDimension ISourceDimensionReportingTag.SourceDimension + { + get { return SourceDimension; } + set { SourceDimension = (SourceDimension) value; } + } + + [DomainSignature] + public virtual int ReportingTagDescriptorId + { + get + { + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + + return _reportingTagDescriptorId; + } + set + { + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; + } + } + + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; + + public virtual string ReportingTagDescriptor + { + get + { + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + + return _reportingTagDescriptor; + } + set + { + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (SourceDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISourceDimensionReportingTag)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISourceDimensionReportingTag) target, null); + } + + void IChildEntity.SetParent(object value) + { + SourceDimension = (SourceDimension) value; + } + } +} +// Aggregate: SourceSystemDescriptor + +namespace EdFi.Ods.Entities.NHibernate.SourceSystemDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SourceSystemDescriptor table of the SourceSystemDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SourceSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISourceSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int SourceSystemDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SourceSystemDescriptorId", SourceSystemDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISourceSystemDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISourceSystemDescriptor) target, null); + } + + } +} +// Aggregate: SpecialEducationExitReasonDescriptor + +namespace EdFi.Ods.Entities.NHibernate.SpecialEducationExitReasonDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SpecialEducationExitReasonDescriptor table of the SpecialEducationExitReasonDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SpecialEducationExitReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int SpecialEducationExitReasonDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SpecialEducationExitReasonDescriptorId", SpecialEducationExitReasonDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor) target, null); + } + + } +} +// Aggregate: SpecialEducationProgramServiceDescriptor + +namespace EdFi.Ods.Entities.NHibernate.SpecialEducationProgramServiceDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SpecialEducationProgramServiceDescriptor table of the SpecialEducationProgramServiceDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SpecialEducationProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int SpecialEducationProgramServiceDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SpecialEducationProgramServiceDescriptorId", SpecialEducationProgramServiceDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor) target, null); + } + + } +} +// Aggregate: SpecialEducationSettingDescriptor + +namespace EdFi.Ods.Entities.NHibernate.SpecialEducationSettingDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.SpecialEducationSettingDescriptor table of the SpecialEducationSettingDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class SpecialEducationSettingDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ISpecialEducationSettingDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int SpecialEducationSettingDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SpecialEducationSettingDescriptorId", SpecialEducationSettingDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ISpecialEducationSettingDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ISpecialEducationSettingDescriptor) target, null); + } + + } +} +// Aggregate: Staff + +namespace EdFi.Ods.Entities.NHibernate.StaffAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class StaffReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual int StaffUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("StaffUSI", StaffUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.Staff table of the Staff aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class Staff : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public Staff() + { + StaffAddresses = new HashSet(); + StaffAncestryEthnicOrigins = new HashSet(); + StaffCredentials = new HashSet(); + StaffElectronicMails = new HashSet(); + StaffIdentificationCodes = new HashSet(); + StaffIdentificationDocuments = new HashSet(); + StaffInternationalAddresses = new HashSet(); + StaffLanguages = new HashSet(); + StaffOtherNames = new HashSet(); + StaffPersonalIdentificationDocuments = new HashSet(); + StaffRaces = new HashSet(); + StaffRecognitions = new HashSet(); + StaffTelephones = new HashSet(); + StaffTribalAffiliations = new HashSet(); + StaffVisas = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Display(Name="StaffUniqueId")][DomainSignature] + public virtual int StaffUSI + { + get + { + if (_staffUSI == default(int) && _staffUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) + { + _staffUSI = usi; + } + } + + return _staffUSI; + } + set + { + _staffUSI = value; + } + } + + private int _staffUSI; + string IIdentifiablePerson.UniqueId { get { return StaffUniqueId; } } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime? BirthDate + { + get { return _birthDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _birthDate = null; + } else + { + var given = (DateTime) value; + _birthDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _birthDate; + + public virtual int? CitizenshipStatusDescriptorId + { + get + { + if (_citizenshipStatusDescriptorId == default(int?)) + _citizenshipStatusDescriptorId = string.IsNullOrWhiteSpace(_citizenshipStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CitizenshipStatusDescriptor", _citizenshipStatusDescriptor); + + return _citizenshipStatusDescriptorId; + } + set + { + _citizenshipStatusDescriptorId = value; + _citizenshipStatusDescriptor = null; + } + } + + private int? _citizenshipStatusDescriptorId; + private string _citizenshipStatusDescriptor; + + public virtual string CitizenshipStatusDescriptor + { + get + { + if (_citizenshipStatusDescriptor == null) + _citizenshipStatusDescriptor = _citizenshipStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CitizenshipStatusDescriptor", _citizenshipStatusDescriptorId.Value); + + return _citizenshipStatusDescriptor; + } + set + { + _citizenshipStatusDescriptor = value; + _citizenshipStatusDescriptorId = default(int?); + } + } + public virtual string FirstName { get; set; } + public virtual string GenderIdentity { get; set; } + public virtual string GenerationCodeSuffix { get; set; } + public virtual int? HighestCompletedLevelOfEducationDescriptorId + { + get + { + if (_highestCompletedLevelOfEducationDescriptorId == default(int?)) + _highestCompletedLevelOfEducationDescriptorId = string.IsNullOrWhiteSpace(_highestCompletedLevelOfEducationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptor); + + return _highestCompletedLevelOfEducationDescriptorId; + } + set + { + _highestCompletedLevelOfEducationDescriptorId = value; + _highestCompletedLevelOfEducationDescriptor = null; + } + } + + private int? _highestCompletedLevelOfEducationDescriptorId; + private string _highestCompletedLevelOfEducationDescriptor; + + public virtual string HighestCompletedLevelOfEducationDescriptor + { + get + { + if (_highestCompletedLevelOfEducationDescriptor == null) + _highestCompletedLevelOfEducationDescriptor = _highestCompletedLevelOfEducationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptorId.Value); + + return _highestCompletedLevelOfEducationDescriptor; + } + set + { + _highestCompletedLevelOfEducationDescriptor = value; + _highestCompletedLevelOfEducationDescriptorId = default(int?); } } public virtual bool? HighlyQualifiedTeacher { get; set; } @@ -115660,11 +117803,554 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudent)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudent) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentIdentificationDocument table of the Student aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentIdentificationDocument : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public StudentIdentificationDocument() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Student Student { get; set; } + + Entities.Common.EdFi.IStudent IStudentIdentificationDocument.Student + { + get { return Student; } + set { Student = (Student) value; } + } + + [DomainSignature] + public virtual int IdentificationDocumentUseDescriptorId + { + get + { + if (_identificationDocumentUseDescriptorId == default(int)) + _identificationDocumentUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptor); + + return _identificationDocumentUseDescriptorId; + } + set + { + _identificationDocumentUseDescriptorId = value; + _identificationDocumentUseDescriptor = null; + } + } + + private int _identificationDocumentUseDescriptorId; + private string _identificationDocumentUseDescriptor; + + public virtual string IdentificationDocumentUseDescriptor + { + get + { + if (_identificationDocumentUseDescriptor == null) + _identificationDocumentUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptorId); + + return _identificationDocumentUseDescriptor; + } + set + { + _identificationDocumentUseDescriptor = value; + _identificationDocumentUseDescriptorId = default(int); + } + } + [DomainSignature] + public virtual int PersonalInformationVerificationDescriptorId + { + get + { + if (_personalInformationVerificationDescriptorId == default(int)) + _personalInformationVerificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptor); + + return _personalInformationVerificationDescriptorId; + } + set + { + _personalInformationVerificationDescriptorId = value; + _personalInformationVerificationDescriptor = null; + } + } + + private int _personalInformationVerificationDescriptorId; + private string _personalInformationVerificationDescriptor; + + public virtual string PersonalInformationVerificationDescriptor + { + get + { + if (_personalInformationVerificationDescriptor == null) + _personalInformationVerificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptorId); + + return _personalInformationVerificationDescriptor; + } + set + { + _personalInformationVerificationDescriptor = value; + _personalInformationVerificationDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime? DocumentExpirationDate + { + get { return _documentExpirationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _documentExpirationDate = null; + } else + { + var given = (DateTime) value; + _documentExpirationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _documentExpirationDate; + + public virtual string DocumentTitle { get; set; } + public virtual int? IssuerCountryDescriptorId + { + get + { + if (_issuerCountryDescriptorId == default(int?)) + _issuerCountryDescriptorId = string.IsNullOrWhiteSpace(_issuerCountryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _issuerCountryDescriptor); + + return _issuerCountryDescriptorId; + } + set + { + _issuerCountryDescriptorId = value; + _issuerCountryDescriptor = null; + } + } + + private int? _issuerCountryDescriptorId; + private string _issuerCountryDescriptor; + + public virtual string IssuerCountryDescriptor + { + get + { + if (_issuerCountryDescriptor == null) + _issuerCountryDescriptor = _issuerCountryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _issuerCountryDescriptorId.Value); + + return _issuerCountryDescriptor; + } + set + { + _issuerCountryDescriptor = value; + _issuerCountryDescriptorId = default(int?); + } + } + public virtual string IssuerDocumentIdentificationCode { get; set; } + public virtual string IssuerName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "IdentificationDocumentUseDescriptor", new LookupColumnDetails { PropertyName = "IdentificationDocumentUseDescriptorId", LookupTypeName = "IdentificationDocumentUseDescriptor"} }, + { "IssuerCountryDescriptor", new LookupColumnDetails { PropertyName = "IssuerCountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, + { "PersonalInformationVerificationDescriptor", new LookupColumnDetails { PropertyName = "PersonalInformationVerificationDescriptorId", LookupTypeName = "PersonalInformationVerificationDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); + keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentIdentificationDocument)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudentIdentificationDocument) target, null); + } + + void IChildEntity.SetParent(object value) + { + Student = (Student) value; + } + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentOtherName table of the Student aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentOtherName : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public StudentOtherName() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual Student Student { get; set; } + + Entities.Common.EdFi.IStudent IStudentOtherName.Student + { + get { return Student; } + set { Student = (Student) value; } + } + + [DomainSignature] + public virtual int OtherNameTypeDescriptorId + { + get + { + if (_otherNameTypeDescriptorId == default(int)) + _otherNameTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OtherNameTypeDescriptor", _otherNameTypeDescriptor); + + return _otherNameTypeDescriptorId; + } + set + { + _otherNameTypeDescriptorId = value; + _otherNameTypeDescriptor = null; + } + } + + private int _otherNameTypeDescriptorId; + private string _otherNameTypeDescriptor; + + public virtual string OtherNameTypeDescriptor + { + get + { + if (_otherNameTypeDescriptor == null) + _otherNameTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OtherNameTypeDescriptor", _otherNameTypeDescriptorId); + + return _otherNameTypeDescriptor; + } + set + { + _otherNameTypeDescriptor = value; + _otherNameTypeDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string FirstName { get; set; } + public virtual string GenerationCodeSuffix { get; set; } + public virtual string LastSurname { get; set; } + public virtual string MiddleName { get; set; } + public virtual string PersonalTitlePrefix { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "OtherNameTypeDescriptor", new LookupColumnDetails { PropertyName = "OtherNameTypeDescriptorId", LookupTypeName = "OtherNameTypeDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); return keyValues; } @@ -115728,32 +118414,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentOtherName)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudent) target, null); + this.MapTo((Entities.Common.EdFi.IStudentOtherName) target, null); } + void IChildEntity.SetParent(object value) + { + Student = (Student) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentIdentificationDocument table of the Student aggregate in the ODS database. + /// A class which represents the edfi.StudentPersonalIdentificationDocument table of the Student aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentIdentificationDocument : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentIdentificationDocument() + public StudentPersonalIdentificationDocument() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -115764,7 +118454,7 @@ public StudentIdentificationDocument() [DomainSignature, JsonIgnore] public virtual Student Student { get; set; } - Entities.Common.EdFi.IStudent IStudentIdentificationDocument.Student + Entities.Common.EdFi.IStudent IStudentPersonalIdentificationDocument.Student { get { return Student; } set { Student = (Student) value; } @@ -116042,12 +118732,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentIdentificationDocument)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentPersonalIdentificationDocument)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentIdentificationDocument) target, null); + this.MapTo((Entities.Common.EdFi.IStudentPersonalIdentificationDocument) target, null); } void IChildEntity.SetParent(object value) @@ -116059,19 +118749,19 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentOtherName table of the Student aggregate in the ODS database. + /// A class which represents the edfi.StudentVisa table of the Student aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentOtherName : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentVisa : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentVisa, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentOtherName() + public StudentVisa() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -116082,45 +118772,45 @@ public StudentOtherName() [DomainSignature, JsonIgnore] public virtual Student Student { get; set; } - Entities.Common.EdFi.IStudent IStudentOtherName.Student + Entities.Common.EdFi.IStudent IStudentVisa.Student { get { return Student; } set { Student = (Student) value; } } [DomainSignature] - public virtual int OtherNameTypeDescriptorId + public virtual int VisaDescriptorId { get { - if (_otherNameTypeDescriptorId == default(int)) - _otherNameTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OtherNameTypeDescriptor", _otherNameTypeDescriptor); + if (_visaDescriptorId == default(int)) + _visaDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("VisaDescriptor", _visaDescriptor); - return _otherNameTypeDescriptorId; + return _visaDescriptorId; } set { - _otherNameTypeDescriptorId = value; - _otherNameTypeDescriptor = null; + _visaDescriptorId = value; + _visaDescriptor = null; } } - private int _otherNameTypeDescriptorId; - private string _otherNameTypeDescriptor; + private int _visaDescriptorId; + private string _visaDescriptor; - public virtual string OtherNameTypeDescriptor + public virtual string VisaDescriptor { get { - if (_otherNameTypeDescriptor == null) - _otherNameTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OtherNameTypeDescriptor", _otherNameTypeDescriptorId); + if (_visaDescriptor == null) + _visaDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("VisaDescriptor", _visaDescriptorId); - return _otherNameTypeDescriptor; + return _visaDescriptor; } set { - _otherNameTypeDescriptor = value; - _otherNameTypeDescriptorId = default(int); + _visaDescriptor = value; + _visaDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -116133,11 +118823,6 @@ public virtual string OtherNameTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string FirstName { get; set; } - public virtual string GenerationCodeSuffix { get; set; } - public virtual string LastSurname { get; set; } - public virtual string MiddleName { get; set; } - public virtual string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116192,7 +118877,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OtherNameTypeDescriptor", new LookupColumnDetails { PropertyName = "OtherNameTypeDescriptorId", LookupTypeName = "OtherNameTypeDescriptor"} }, + { "VisaDescriptor", new LookupColumnDetails { PropertyName = "VisaDescriptorId", LookupTypeName = "VisaDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -116207,7 +118892,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); + keyValues.Add("VisaDescriptorId", VisaDescriptorId); return keyValues; } @@ -116271,12 +118956,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentOtherName)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentVisa)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentOtherName) target, null); + this.MapTo((Entities.Common.EdFi.IStudentVisa) target, null); } void IChildEntity.SetParent(object value) @@ -116284,23 +118969,894 @@ void IChildEntity.SetParent(object value) Student = (Student) value; } } +} +// Aggregate: StudentAcademicRecord + +namespace EdFi.Ods.Entities.NHibernate.StudentAcademicRecordAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class StudentAcademicRecordReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual long EducationOrganizationId { get; set; } + public virtual short SchoolYear { get; set; } + public virtual int StudentUSI { get; set; } + public virtual int TermDescriptorId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("TermDescriptorId", TermDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentPersonalIdentificationDocument table of the Student aggregate in the ODS database. + /// A class which represents the edfi.StudentAcademicRecord table of the StudentAcademicRecord aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAcademicRecord : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentAcademicRecord, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentPersonalIdentificationDocument() + public StudentAcademicRecord() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + StudentAcademicRecordClassRankingPersistentList = new HashSet(); + StudentAcademicRecordAcademicHonors = new HashSet(); + StudentAcademicRecordDiplomas = new HashSet(); + StudentAcademicRecordGradePointAverages = new HashSet(); + StudentAcademicRecordRecognitions = new HashSet(); + StudentAcademicRecordReportCards = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual short SchoolYear { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI + { + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } + + private int _studentUSI; + private string _studentUniqueId; + + public virtual string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } + [DomainSignature] + public virtual int TermDescriptorId + { + get + { + if (_termDescriptorId == default(int)) + _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); + + return _termDescriptorId; + } + set + { + _termDescriptorId = value; + _termDescriptor = null; + } + } + + private int _termDescriptorId; + private string _termDescriptor; + + public virtual string TermDescriptor + { + get + { + if (_termDescriptor == null) + _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); + + return _termDescriptor; + } + set + { + _termDescriptor = value; + _termDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual decimal? CumulativeAttemptedCreditConversion { get; set; } + public virtual decimal? CumulativeAttemptedCredits { get; set; } + public virtual int? CumulativeAttemptedCreditTypeDescriptorId + { + get + { + if (_cumulativeAttemptedCreditTypeDescriptorId == default(int?)) + _cumulativeAttemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_cumulativeAttemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _cumulativeAttemptedCreditTypeDescriptor); + + return _cumulativeAttemptedCreditTypeDescriptorId; + } + set + { + _cumulativeAttemptedCreditTypeDescriptorId = value; + _cumulativeAttemptedCreditTypeDescriptor = null; + } + } + + private int? _cumulativeAttemptedCreditTypeDescriptorId; + private string _cumulativeAttemptedCreditTypeDescriptor; + + public virtual string CumulativeAttemptedCreditTypeDescriptor + { + get + { + if (_cumulativeAttemptedCreditTypeDescriptor == null) + _cumulativeAttemptedCreditTypeDescriptor = _cumulativeAttemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _cumulativeAttemptedCreditTypeDescriptorId.Value); + + return _cumulativeAttemptedCreditTypeDescriptor; + } + set + { + _cumulativeAttemptedCreditTypeDescriptor = value; + _cumulativeAttemptedCreditTypeDescriptorId = default(int?); + } + } + public virtual decimal? CumulativeEarnedCreditConversion { get; set; } + public virtual decimal? CumulativeEarnedCredits { get; set; } + public virtual int? CumulativeEarnedCreditTypeDescriptorId + { + get + { + if (_cumulativeEarnedCreditTypeDescriptorId == default(int?)) + _cumulativeEarnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_cumulativeEarnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _cumulativeEarnedCreditTypeDescriptor); + + return _cumulativeEarnedCreditTypeDescriptorId; + } + set + { + _cumulativeEarnedCreditTypeDescriptorId = value; + _cumulativeEarnedCreditTypeDescriptor = null; + } + } + + private int? _cumulativeEarnedCreditTypeDescriptorId; + private string _cumulativeEarnedCreditTypeDescriptor; + + public virtual string CumulativeEarnedCreditTypeDescriptor + { + get + { + if (_cumulativeEarnedCreditTypeDescriptor == null) + _cumulativeEarnedCreditTypeDescriptor = _cumulativeEarnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _cumulativeEarnedCreditTypeDescriptorId.Value); + + return _cumulativeEarnedCreditTypeDescriptor; + } + set + { + _cumulativeEarnedCreditTypeDescriptor = value; + _cumulativeEarnedCreditTypeDescriptorId = default(int?); + } + } + public virtual DateTime? ProjectedGraduationDate + { + get { return _projectedGraduationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _projectedGraduationDate = null; + } else + { + var given = (DateTime) value; + _projectedGraduationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _projectedGraduationDate; + + public virtual decimal? SessionAttemptedCreditConversion { get; set; } + public virtual decimal? SessionAttemptedCredits { get; set; } + public virtual int? SessionAttemptedCreditTypeDescriptorId + { + get + { + if (_sessionAttemptedCreditTypeDescriptorId == default(int?)) + _sessionAttemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_sessionAttemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _sessionAttemptedCreditTypeDescriptor); + + return _sessionAttemptedCreditTypeDescriptorId; + } + set + { + _sessionAttemptedCreditTypeDescriptorId = value; + _sessionAttemptedCreditTypeDescriptor = null; + } + } + + private int? _sessionAttemptedCreditTypeDescriptorId; + private string _sessionAttemptedCreditTypeDescriptor; + + public virtual string SessionAttemptedCreditTypeDescriptor + { + get + { + if (_sessionAttemptedCreditTypeDescriptor == null) + _sessionAttemptedCreditTypeDescriptor = _sessionAttemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _sessionAttemptedCreditTypeDescriptorId.Value); + + return _sessionAttemptedCreditTypeDescriptor; + } + set + { + _sessionAttemptedCreditTypeDescriptor = value; + _sessionAttemptedCreditTypeDescriptorId = default(int?); + } + } + public virtual decimal? SessionEarnedCreditConversion { get; set; } + public virtual decimal? SessionEarnedCredits { get; set; } + public virtual int? SessionEarnedCreditTypeDescriptorId + { + get + { + if (_sessionEarnedCreditTypeDescriptorId == default(int?)) + _sessionEarnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_sessionEarnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _sessionEarnedCreditTypeDescriptor); + + return _sessionEarnedCreditTypeDescriptorId; + } + set + { + _sessionEarnedCreditTypeDescriptorId = value; + _sessionEarnedCreditTypeDescriptor = null; + } + } + + private int? _sessionEarnedCreditTypeDescriptorId; + private string _sessionEarnedCreditTypeDescriptor; + + public virtual string SessionEarnedCreditTypeDescriptor + { + get + { + if (_sessionEarnedCreditTypeDescriptor == null) + _sessionEarnedCreditTypeDescriptor = _sessionEarnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _sessionEarnedCreditTypeDescriptorId.Value); + + return _sessionEarnedCreditTypeDescriptor; + } + set + { + _sessionEarnedCreditTypeDescriptor = value; + _sessionEarnedCreditTypeDescriptorId = default(int?); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + public virtual Entities.NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordClassRanking StudentAcademicRecordClassRanking + { + get + { + // Return the item in the list, if one exists + if (StudentAcademicRecordClassRankingPersistentList.Any()) + return StudentAcademicRecordClassRankingPersistentList.First(); + + // No reference is present + return null; + } + set + { + // Delete the existing object + if (StudentAcademicRecordClassRankingPersistentList.Any()) + StudentAcademicRecordClassRankingPersistentList.Clear(); + + // If we're setting a value, add it to the list now + if (value != null) + { + // Set the back-reference to the parent + value.StudentAcademicRecord = this; + + StudentAcademicRecordClassRankingPersistentList.Add(value); + } + } + } + + Entities.Common.EdFi.IStudentAcademicRecordClassRanking Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordClassRanking + { + get { return StudentAcademicRecordClassRanking; } + set { StudentAcademicRecordClassRanking = (Entities.NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordClassRanking) value; } + } + + private ICollection _studentAcademicRecordClassRankingPersistentList; + + public virtual ICollection StudentAcademicRecordClassRankingPersistentList + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordClassRankingPersistentList) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordClassRankingPersistentList; + } + set + { + _studentAcademicRecordClassRankingPersistentList = value; + } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAcademicRecord.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAcademicRecord.StudentResourceId + { + get { return StudentReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _studentAcademicRecordAcademicHonors; + private ICollection _studentAcademicRecordAcademicHonorsCovariant; + public virtual ICollection StudentAcademicRecordAcademicHonors + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordAcademicHonors) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordAcademicHonors; + } + set + { + _studentAcademicRecordAcademicHonors = value; + _studentAcademicRecordAcademicHonorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordAcademicHonors + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordAcademicHonors) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordAcademicHonorsCovariant; + } + set + { + StudentAcademicRecordAcademicHonors = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAcademicRecordDiplomas; + private ICollection _studentAcademicRecordDiplomasCovariant; + public virtual ICollection StudentAcademicRecordDiplomas + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordDiplomas) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordDiplomas; + } + set + { + _studentAcademicRecordDiplomas = value; + _studentAcademicRecordDiplomasCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordDiplomas + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordDiplomas) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordDiplomasCovariant; + } + set + { + StudentAcademicRecordDiplomas = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAcademicRecordGradePointAverages; + private ICollection _studentAcademicRecordGradePointAveragesCovariant; + public virtual ICollection StudentAcademicRecordGradePointAverages + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordGradePointAverages) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordGradePointAverages; + } + set + { + _studentAcademicRecordGradePointAverages = value; + _studentAcademicRecordGradePointAveragesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordGradePointAverages + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordGradePointAverages) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordGradePointAveragesCovariant; + } + set + { + StudentAcademicRecordGradePointAverages = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAcademicRecordRecognitions; + private ICollection _studentAcademicRecordRecognitionsCovariant; + public virtual ICollection StudentAcademicRecordRecognitions + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordRecognitions) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordRecognitions; + } + set + { + _studentAcademicRecordRecognitions = value; + _studentAcademicRecordRecognitionsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordRecognitions + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordRecognitions) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordRecognitionsCovariant; + } + set + { + StudentAcademicRecordRecognitions = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAcademicRecordReportCards; + private ICollection _studentAcademicRecordReportCardsCovariant; + public virtual ICollection StudentAcademicRecordReportCards + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordReportCards) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordReportCards; + } + set + { + _studentAcademicRecordReportCards = value; + _studentAcademicRecordReportCardsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordReportCards + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAcademicRecordReportCards) + if (item.StudentAcademicRecord == null) + item.StudentAcademicRecord = this; + // ------------------------------------------------------------- + + return _studentAcademicRecordReportCardsCovariant; + } + set + { + StudentAcademicRecordReportCards = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "CumulativeAttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CumulativeAttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "CumulativeEarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CumulativeEarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "SessionAttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "SessionAttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "SessionEarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "SessionEarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("TermDescriptorId", TermDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecord)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudentAcademicRecord) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentAcademicRecordAcademicHonor table of the StudentAcademicRecord aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentAcademicRecordAcademicHonor : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public StudentAcademicRecordAcademicHonor() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -116309,150 +119865,141 @@ public StudentPersonalIdentificationDocument() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Student Student { get; set; } + public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } - Entities.Common.EdFi.IStudent IStudentPersonalIdentificationDocument.Student + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordAcademicHonor.StudentAcademicRecord { - get { return Student; } - set { Student = (Student) value; } + get { return StudentAcademicRecord; } + set { StudentAcademicRecord = (StudentAcademicRecord) value; } } [DomainSignature] - public virtual int IdentificationDocumentUseDescriptorId + public virtual int AcademicHonorCategoryDescriptorId { get { - if (_identificationDocumentUseDescriptorId == default(int)) - _identificationDocumentUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptor); + if (_academicHonorCategoryDescriptorId == default(int)) + _academicHonorCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicHonorCategoryDescriptor", _academicHonorCategoryDescriptor); - return _identificationDocumentUseDescriptorId; + return _academicHonorCategoryDescriptorId; } set { - _identificationDocumentUseDescriptorId = value; - _identificationDocumentUseDescriptor = null; + _academicHonorCategoryDescriptorId = value; + _academicHonorCategoryDescriptor = null; } } - private int _identificationDocumentUseDescriptorId; - private string _identificationDocumentUseDescriptor; + private int _academicHonorCategoryDescriptorId; + private string _academicHonorCategoryDescriptor; - public virtual string IdentificationDocumentUseDescriptor + public virtual string AcademicHonorCategoryDescriptor { get { - if (_identificationDocumentUseDescriptor == null) - _identificationDocumentUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptorId); + if (_academicHonorCategoryDescriptor == null) + _academicHonorCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicHonorCategoryDescriptor", _academicHonorCategoryDescriptorId); - return _identificationDocumentUseDescriptor; + return _academicHonorCategoryDescriptor; } set { - _identificationDocumentUseDescriptor = value; - _identificationDocumentUseDescriptorId = default(int); + _academicHonorCategoryDescriptor = value; + _academicHonorCategoryDescriptorId = default(int); } } [DomainSignature] - public virtual int PersonalInformationVerificationDescriptorId + public virtual string HonorDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int? AchievementCategoryDescriptorId { get { - if (_personalInformationVerificationDescriptorId == default(int)) - _personalInformationVerificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptor); + if (_achievementCategoryDescriptorId == default(int?)) + _achievementCategoryDescriptorId = string.IsNullOrWhiteSpace(_achievementCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AchievementCategoryDescriptor", _achievementCategoryDescriptor); - return _personalInformationVerificationDescriptorId; + return _achievementCategoryDescriptorId; } set { - _personalInformationVerificationDescriptorId = value; - _personalInformationVerificationDescriptor = null; + _achievementCategoryDescriptorId = value; + _achievementCategoryDescriptor = null; } } - private int _personalInformationVerificationDescriptorId; - private string _personalInformationVerificationDescriptor; + private int? _achievementCategoryDescriptorId; + private string _achievementCategoryDescriptor; - public virtual string PersonalInformationVerificationDescriptor + public virtual string AchievementCategoryDescriptor { get { - if (_personalInformationVerificationDescriptor == null) - _personalInformationVerificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptorId); + if (_achievementCategoryDescriptor == null) + _achievementCategoryDescriptor = _achievementCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AchievementCategoryDescriptor", _achievementCategoryDescriptorId.Value); - return _personalInformationVerificationDescriptor; + return _achievementCategoryDescriptor; } set { - _personalInformationVerificationDescriptor = value; - _personalInformationVerificationDescriptorId = default(int); + _achievementCategoryDescriptor = value; + _achievementCategoryDescriptorId = default(int?); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime? DocumentExpirationDate + public virtual string AchievementCategorySystem { get; set; } + public virtual string AchievementTitle { get; set; } + public virtual string Criteria { get; set; } + public virtual string CriteriaURL { get; set; } + public virtual string EvidenceStatement { get; set; } + public virtual DateTime? HonorAwardDate { - get { return _documentExpirationDate; } + get { return _honorAwardDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _documentExpirationDate = null; + _honorAwardDate = null; } else { var given = (DateTime) value; - _documentExpirationDate = new DateTime(given.Year, given.Month, given.Day); + _honorAwardDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _documentExpirationDate; + private DateTime? _honorAwardDate; - public virtual string DocumentTitle { get; set; } - public virtual int? IssuerCountryDescriptorId + public virtual DateTime? HonorAwardExpiresDate { - get - { - if (_issuerCountryDescriptorId == default(int?)) - _issuerCountryDescriptorId = string.IsNullOrWhiteSpace(_issuerCountryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _issuerCountryDescriptor); - - return _issuerCountryDescriptorId; - } - set - { - _issuerCountryDescriptorId = value; - _issuerCountryDescriptor = null; + get { return _honorAwardExpiresDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _honorAwardExpiresDate = null; + } else + { + var given = (DateTime) value; + _honorAwardExpiresDate = new DateTime(given.Year, given.Month, given.Day); + } } } - private int? _issuerCountryDescriptorId; - private string _issuerCountryDescriptor; - - public virtual string IssuerCountryDescriptor - { - get - { - if (_issuerCountryDescriptor == null) - _issuerCountryDescriptor = _issuerCountryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _issuerCountryDescriptorId.Value); - - return _issuerCountryDescriptor; - } - set - { - _issuerCountryDescriptor = value; - _issuerCountryDescriptorId = default(int?); - } - } - public virtual string IssuerDocumentIdentificationCode { get; set; } + private DateTime? _honorAwardExpiresDate; + + public virtual string ImageURL { get; set; } public virtual string IssuerName { get; set; } + public virtual string IssuerOriginURL { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116507,9 +120054,9 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IdentificationDocumentUseDescriptor", new LookupColumnDetails { PropertyName = "IdentificationDocumentUseDescriptorId", LookupTypeName = "IdentificationDocumentUseDescriptor"} }, - { "IssuerCountryDescriptor", new LookupColumnDetails { PropertyName = "IssuerCountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, - { "PersonalInformationVerificationDescriptor", new LookupColumnDetails { PropertyName = "PersonalInformationVerificationDescriptorId", LookupTypeName = "PersonalInformationVerificationDescriptor"} }, + { "AcademicHonorCategoryDescriptor", new LookupColumnDetails { PropertyName = "AcademicHonorCategoryDescriptorId", LookupTypeName = "AcademicHonorCategoryDescriptor"} }, + { "AchievementCategoryDescriptor", new LookupColumnDetails { PropertyName = "AchievementCategoryDescriptorId", LookupTypeName = "AchievementCategoryDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -116521,11 +120068,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); - keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); + keyValues.Add("AcademicHonorCategoryDescriptorId", AcademicHonorCategoryDescriptorId); + keyValues.Add("HonorDescription", HonorDescription); return keyValues; } @@ -116589,36 +120136,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentPersonalIdentificationDocument)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentPersonalIdentificationDocument) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor) target, null); } void IChildEntity.SetParent(object value) { - Student = (Student) value; + StudentAcademicRecord = (StudentAcademicRecord) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentVisa table of the Student aggregate in the ODS database. + /// A class which represents the edfi.StudentAcademicRecordClassRanking table of the StudentAcademicRecord aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentVisa : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentVisa, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAcademicRecordClassRanking : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAcademicRecordClassRanking, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentVisa() + public StudentAcademicRecordClassRanking() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -116627,49 +120174,14 @@ public StudentVisa() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual Student Student { get; set; } - - Entities.Common.EdFi.IStudent IStudentVisa.Student - { - get { return Student; } - set { Student = (Student) value; } - } + public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } - [DomainSignature] - public virtual int VisaDescriptorId + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordClassRanking.StudentAcademicRecord { - get - { - if (_visaDescriptorId == default(int)) - _visaDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("VisaDescriptor", _visaDescriptor); - - return _visaDescriptorId; - } - set - { - _visaDescriptorId = value; - _visaDescriptor = null; - } + get { return StudentAcademicRecord; } + set { StudentAcademicRecord = (StudentAcademicRecord) value; } } - private int _visaDescriptorId; - private string _visaDescriptor; - - public virtual string VisaDescriptor - { - get - { - if (_visaDescriptor == null) - _visaDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("VisaDescriptor", _visaDescriptorId); - - return _visaDescriptor; - } - set - { - _visaDescriptor = value; - _visaDescriptorId = default(int); - } - } // ------------------------------------------------------------- // ============================================================= @@ -116680,6 +120192,28 @@ public virtual string VisaDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual int ClassRank { get; set; } + public virtual DateTime? ClassRankingDate + { + get { return _classRankingDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _classRankingDate = null; + } else + { + var given = (DateTime) value; + _classRankingDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _classRankingDate; + + public virtual int? PercentageRanking { get; set; } + public virtual int TotalNumberInClass { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116734,7 +120268,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "VisaDescriptor", new LookupColumnDetails { PropertyName = "VisaDescriptorId", LookupTypeName = "VisaDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -116746,10 +120280,9 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("VisaDescriptorId", VisaDescriptorId); return keyValues; } @@ -116813,129 +120346,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentVisa)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordClassRanking)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentVisa) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordClassRanking) target, null); } void IChildEntity.SetParent(object value) { - Student = (Student) value; - } - } -} -// Aggregate: StudentAcademicRecord - -namespace EdFi.Ods.Entities.NHibernate.StudentAcademicRecordAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class StudentAcademicRecordReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual int StudentUSI { get; set; } - public virtual int TermDescriptorId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("StudentUSI", StudentUSI); - keyValues.Add("TermDescriptorId", TermDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + StudentAcademicRecord = (StudentAcademicRecord) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAcademicRecord table of the StudentAcademicRecord aggregate in the ODS database. + /// A class which represents the edfi.StudentAcademicRecordDiploma table of the StudentAcademicRecord aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAcademicRecord : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IStudentAcademicRecord, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAcademicRecordDiploma : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAcademicRecordDiploma, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAcademicRecord() + public StudentAcademicRecordDiploma() { - StudentAcademicRecordClassRankingPersistentList = new HashSet(); - StudentAcademicRecordAcademicHonors = new HashSet(); - StudentAcademicRecordDiplomas = new HashSet(); - StudentAcademicRecordGradePointAverages = new HashSet(); - StudentAcademicRecordRecognitions = new HashSet(); - StudentAcademicRecordReportCards = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -116943,92 +120383,58 @@ public StudentAcademicRecord() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } + [DomainSignature, JsonIgnore] + public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordDiploma.StudentAcademicRecord + { + get { return StudentAcademicRecord; } + set { StudentAcademicRecord = (StudentAcademicRecord) value; } } - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId + [DomainSignature] + public virtual DateTime DiplomaAwardDate { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } + get { return _diplomaAwardDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _diplomaAwardDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _diplomaAwardDate; + [DomainSignature] - public virtual int TermDescriptorId + public virtual int DiplomaTypeDescriptorId { get { - if (_termDescriptorId == default(int)) - _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); + if (_diplomaTypeDescriptorId == default(int)) + _diplomaTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiplomaTypeDescriptor", _diplomaTypeDescriptor); - return _termDescriptorId; + return _diplomaTypeDescriptorId; } set { - _termDescriptorId = value; - _termDescriptor = null; + _diplomaTypeDescriptorId = value; + _diplomaTypeDescriptor = null; } } - private int _termDescriptorId; - private string _termDescriptor; + private int _diplomaTypeDescriptorId; + private string _diplomaTypeDescriptor; - public virtual string TermDescriptor + public virtual string DiplomaTypeDescriptor { get { - if (_termDescriptor == null) - _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); + if (_diplomaTypeDescriptor == null) + _diplomaTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiplomaTypeDescriptor", _diplomaTypeDescriptorId); - return _termDescriptor; + return _diplomaTypeDescriptor; } set { - _termDescriptor = value; - _termDescriptorId = default(int); + _diplomaTypeDescriptor = value; + _diplomaTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -117041,232 +120447,108 @@ public virtual string TermDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? CumulativeAttemptedCreditConversion { get; set; } - public virtual decimal? CumulativeAttemptedCredits { get; set; } - public virtual int? CumulativeAttemptedCreditTypeDescriptorId - { - get - { - if (_cumulativeAttemptedCreditTypeDescriptorId == default(int?)) - _cumulativeAttemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_cumulativeAttemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _cumulativeAttemptedCreditTypeDescriptor); - - return _cumulativeAttemptedCreditTypeDescriptorId; - } - set - { - _cumulativeAttemptedCreditTypeDescriptorId = value; - _cumulativeAttemptedCreditTypeDescriptor = null; - } - } - - private int? _cumulativeAttemptedCreditTypeDescriptorId; - private string _cumulativeAttemptedCreditTypeDescriptor; - - public virtual string CumulativeAttemptedCreditTypeDescriptor - { - get - { - if (_cumulativeAttemptedCreditTypeDescriptor == null) - _cumulativeAttemptedCreditTypeDescriptor = _cumulativeAttemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _cumulativeAttemptedCreditTypeDescriptorId.Value); - - return _cumulativeAttemptedCreditTypeDescriptor; - } - set - { - _cumulativeAttemptedCreditTypeDescriptor = value; - _cumulativeAttemptedCreditTypeDescriptorId = default(int?); - } - } - public virtual decimal? CumulativeEarnedCreditConversion { get; set; } - public virtual decimal? CumulativeEarnedCredits { get; set; } - public virtual int? CumulativeEarnedCreditTypeDescriptorId + public virtual int? AchievementCategoryDescriptorId { get { - if (_cumulativeEarnedCreditTypeDescriptorId == default(int?)) - _cumulativeEarnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_cumulativeEarnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _cumulativeEarnedCreditTypeDescriptor); + if (_achievementCategoryDescriptorId == default(int?)) + _achievementCategoryDescriptorId = string.IsNullOrWhiteSpace(_achievementCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AchievementCategoryDescriptor", _achievementCategoryDescriptor); - return _cumulativeEarnedCreditTypeDescriptorId; + return _achievementCategoryDescriptorId; } set { - _cumulativeEarnedCreditTypeDescriptorId = value; - _cumulativeEarnedCreditTypeDescriptor = null; + _achievementCategoryDescriptorId = value; + _achievementCategoryDescriptor = null; } } - private int? _cumulativeEarnedCreditTypeDescriptorId; - private string _cumulativeEarnedCreditTypeDescriptor; + private int? _achievementCategoryDescriptorId; + private string _achievementCategoryDescriptor; - public virtual string CumulativeEarnedCreditTypeDescriptor + public virtual string AchievementCategoryDescriptor { get { - if (_cumulativeEarnedCreditTypeDescriptor == null) - _cumulativeEarnedCreditTypeDescriptor = _cumulativeEarnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _cumulativeEarnedCreditTypeDescriptorId.Value); + if (_achievementCategoryDescriptor == null) + _achievementCategoryDescriptor = _achievementCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AchievementCategoryDescriptor", _achievementCategoryDescriptorId.Value); - return _cumulativeEarnedCreditTypeDescriptor; + return _achievementCategoryDescriptor; } set { - _cumulativeEarnedCreditTypeDescriptor = value; - _cumulativeEarnedCreditTypeDescriptorId = default(int?); + _achievementCategoryDescriptor = value; + _achievementCategoryDescriptorId = default(int?); } } - public virtual DateTime? ProjectedGraduationDate + public virtual string AchievementCategorySystem { get; set; } + public virtual string AchievementTitle { get; set; } + public virtual string Criteria { get; set; } + public virtual string CriteriaURL { get; set; } + public virtual bool? CTECompleter { get; set; } + public virtual DateTime? DiplomaAwardExpiresDate { - get { return _projectedGraduationDate; } + get { return _diplomaAwardExpiresDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _projectedGraduationDate = null; + _diplomaAwardExpiresDate = null; } else { var given = (DateTime) value; - _projectedGraduationDate = new DateTime(given.Year, given.Month, given.Day); + _diplomaAwardExpiresDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _projectedGraduationDate; + private DateTime? _diplomaAwardExpiresDate; - public virtual decimal? SessionAttemptedCreditConversion { get; set; } - public virtual decimal? SessionAttemptedCredits { get; set; } - public virtual int? SessionAttemptedCreditTypeDescriptorId - { - get - { - if (_sessionAttemptedCreditTypeDescriptorId == default(int?)) - _sessionAttemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_sessionAttemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _sessionAttemptedCreditTypeDescriptor); - - return _sessionAttemptedCreditTypeDescriptorId; - } - set - { - _sessionAttemptedCreditTypeDescriptorId = value; - _sessionAttemptedCreditTypeDescriptor = null; - } - } - - private int? _sessionAttemptedCreditTypeDescriptorId; - private string _sessionAttemptedCreditTypeDescriptor; - - public virtual string SessionAttemptedCreditTypeDescriptor - { - get - { - if (_sessionAttemptedCreditTypeDescriptor == null) - _sessionAttemptedCreditTypeDescriptor = _sessionAttemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _sessionAttemptedCreditTypeDescriptorId.Value); - - return _sessionAttemptedCreditTypeDescriptor; - } - set - { - _sessionAttemptedCreditTypeDescriptor = value; - _sessionAttemptedCreditTypeDescriptorId = default(int?); - } - } - public virtual decimal? SessionEarnedCreditConversion { get; set; } - public virtual decimal? SessionEarnedCredits { get; set; } - public virtual int? SessionEarnedCreditTypeDescriptorId + public virtual string DiplomaDescription { get; set; } + public virtual int? DiplomaLevelDescriptorId { get { - if (_sessionEarnedCreditTypeDescriptorId == default(int?)) - _sessionEarnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_sessionEarnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _sessionEarnedCreditTypeDescriptor); + if (_diplomaLevelDescriptorId == default(int?)) + _diplomaLevelDescriptorId = string.IsNullOrWhiteSpace(_diplomaLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiplomaLevelDescriptor", _diplomaLevelDescriptor); - return _sessionEarnedCreditTypeDescriptorId; + return _diplomaLevelDescriptorId; } set { - _sessionEarnedCreditTypeDescriptorId = value; - _sessionEarnedCreditTypeDescriptor = null; + _diplomaLevelDescriptorId = value; + _diplomaLevelDescriptor = null; } } - private int? _sessionEarnedCreditTypeDescriptorId; - private string _sessionEarnedCreditTypeDescriptor; + private int? _diplomaLevelDescriptorId; + private string _diplomaLevelDescriptor; - public virtual string SessionEarnedCreditTypeDescriptor + public virtual string DiplomaLevelDescriptor { get { - if (_sessionEarnedCreditTypeDescriptor == null) - _sessionEarnedCreditTypeDescriptor = _sessionEarnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _sessionEarnedCreditTypeDescriptorId.Value); + if (_diplomaLevelDescriptor == null) + _diplomaLevelDescriptor = _diplomaLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiplomaLevelDescriptor", _diplomaLevelDescriptorId.Value); - return _sessionEarnedCreditTypeDescriptor; + return _diplomaLevelDescriptor; } set { - _sessionEarnedCreditTypeDescriptor = value; - _sessionEarnedCreditTypeDescriptorId = default(int?); + _diplomaLevelDescriptor = value; + _diplomaLevelDescriptorId = default(int?); } } + public virtual string EvidenceStatement { get; set; } + public virtual string ImageURL { get; set; } + public virtual string IssuerName { get; set; } + public virtual string IssuerOriginURL { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- - public virtual Entities.NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordClassRanking StudentAcademicRecordClassRanking - { - get - { - // Return the item in the list, if one exists - if (StudentAcademicRecordClassRankingPersistentList.Any()) - return StudentAcademicRecordClassRankingPersistentList.First(); - - // No reference is present - return null; - } - set - { - // Delete the existing object - if (StudentAcademicRecordClassRankingPersistentList.Any()) - StudentAcademicRecordClassRankingPersistentList.Clear(); - - // If we're setting a value, add it to the list now - if (value != null) - { - // Set the back-reference to the parent - value.StudentAcademicRecord = this; - - StudentAcademicRecordClassRankingPersistentList.Add(value); - } - } - } - - Entities.Common.EdFi.IStudentAcademicRecordClassRanking Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordClassRanking - { - get { return StudentAcademicRecordClassRanking; } - set { StudentAcademicRecordClassRanking = (Entities.NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordClassRanking) value; } - } - - private ICollection _studentAcademicRecordClassRankingPersistentList; - - public virtual ICollection StudentAcademicRecordClassRankingPersistentList - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordClassRankingPersistentList) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- - - return _studentAcademicRecordClassRankingPersistentList; - } - set - { - _studentAcademicRecordClassRankingPersistentList = value; - } - } - // ------------------------------------------------------------- // ============================================================= @@ -117306,306 +120588,248 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + // ------------------------------------------------------------- - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationResourceId + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "AchievementCategoryDescriptor", new LookupColumnDetails { PropertyName = "AchievementCategoryDescriptorId", LookupTypeName = "AchievementCategoryDescriptor"} }, + { "DiplomaLevelDescriptor", new LookupColumnDetails { PropertyName = "DiplomaLevelDescriptorId", LookupTypeName = "DiplomaLevelDescriptor"} }, + { "DiplomaTypeDescriptor", new LookupColumnDetails { PropertyName = "DiplomaTypeDescriptorId", LookupTypeName = "DiplomaTypeDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get { return EducationOrganizationReferenceData?.Id; } - set { } + get { return _idPropertyByLookupProperty; } } - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } - - /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAcademicRecord.SchoolYearTypeResourceId + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get { return SchoolYearTypeReferenceData?.Id; } - set { } - } + // Get parent key values + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + // Add current key values + keyValues.Add("DiplomaAwardDate", DiplomaAwardDate); + keyValues.Add("DiplomaTypeDescriptorId", DiplomaTypeDescriptorId); - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } + return keyValues; } - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAcademicRecord.StudentResourceId + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get { return StudentReferenceData?.Id; } - set { } - } + var compareTo = obj as IHasPrimaryKeyValues; - // ------------------------------------------------------------- + if (ReferenceEquals(this, compareTo)) + return true; - //============================================================= - // Collections - // ------------------------------------------------------------- + if (compareTo == null) + return false; - private ICollection _studentAcademicRecordAcademicHonors; - private ICollection _studentAcademicRecordAcademicHonorsCovariant; - public virtual ICollection StudentAcademicRecordAcademicHonors - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordAcademicHonors) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); - return _studentAcademicRecordAcademicHonors; - } - set + foreach (DictionaryEntry entry in theseKeys) { - _studentAcademicRecordAcademicHonors = value; - _studentAcademicRecordAcademicHonorsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordAcademicHonors + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordAcademicHonors) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- - - return _studentAcademicRecordAcademicHonorsCovariant; - } - set - { - StudentAcademicRecordAcademicHonors = new HashSet(value.Cast()); - } - } + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + if (keyValues.Count == 0) + return base.GetHashCode(); - private ICollection _studentAcademicRecordDiplomas; - private ICollection _studentAcademicRecordDiplomasCovariant; - public virtual ICollection StudentAcademicRecordDiplomas - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordDiplomas) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- + var hashCode = new HashCode(); - return _studentAcademicRecordDiplomas; - } - set + foreach (DictionaryEntry entry in keyValues) { - _studentAcademicRecordDiplomas = value; - _studentAcademicRecordDiplomasCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordDiploma)target); } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordDiplomas + void IMappable.Map(object target) { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordDiplomas) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- + this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordDiploma) target, null); + } - return _studentAcademicRecordDiplomasCovariant; - } - set - { - StudentAcademicRecordDiplomas = new HashSet(value.Cast()); - } + void IChildEntity.SetParent(object value) + { + StudentAcademicRecord = (StudentAcademicRecord) value; } + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// + /// A class which represents the edfi.StudentAcademicRecordGradePointAverage table of the StudentAcademicRecord aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentAcademicRecordGradePointAverage : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } - private ICollection _studentAcademicRecordGradePointAverages; - private ICollection _studentAcademicRecordGradePointAveragesCovariant; - public virtual ICollection StudentAcademicRecordGradePointAverages + public StudentAcademicRecordGradePointAverage() { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordGradePointAverages) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 - return _studentAcademicRecordGradePointAverages; - } - set - { - _studentAcademicRecordGradePointAverages = value; - _studentAcademicRecordGradePointAveragesCovariant = new CovariantCollectionAdapter(value); - } + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } + + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordGradePointAverage.StudentAcademicRecord + { + get { return StudentAcademicRecord; } + set { StudentAcademicRecord = (StudentAcademicRecord) value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordGradePointAverages + [DomainSignature] + public virtual int GradePointAverageTypeDescriptorId { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordGradePointAverages) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- + if (_gradePointAverageTypeDescriptorId == default(int)) + _gradePointAverageTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptor); - return _studentAcademicRecordGradePointAveragesCovariant; - } + return _gradePointAverageTypeDescriptorId; + } set { - StudentAcademicRecordGradePointAverages = new HashSet(value.Cast()); + _gradePointAverageTypeDescriptorId = value; + _gradePointAverageTypeDescriptor = null; } } + private int _gradePointAverageTypeDescriptorId; + private string _gradePointAverageTypeDescriptor; - private ICollection _studentAcademicRecordRecognitions; - private ICollection _studentAcademicRecordRecognitionsCovariant; - public virtual ICollection StudentAcademicRecordRecognitions + public virtual string GradePointAverageTypeDescriptor { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordRecognitions) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- - - return _studentAcademicRecordRecognitions; + if (_gradePointAverageTypeDescriptor == null) + _gradePointAverageTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptorId); + + return _gradePointAverageTypeDescriptor; } set { - _studentAcademicRecordRecognitions = value; - _studentAcademicRecordRecognitionsCovariant = new CovariantCollectionAdapter(value); + _gradePointAverageTypeDescriptor = value; + _gradePointAverageTypeDescriptorId = default(int); } } + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordRecognitions - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordRecognitions) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _studentAcademicRecordRecognitionsCovariant; - } - set - { - StudentAcademicRecordRecognitions = new HashSet(value.Cast()); - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual decimal GradePointAverageValue { get; set; } + public virtual bool? IsCumulative { get; set; } + public virtual decimal? MaxGradePointAverageValue { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; - private ICollection _studentAcademicRecordReportCards; - private ICollection _studentAcademicRecordReportCardsCovariant; - public virtual ICollection StudentAcademicRecordReportCards + public IDictionary Extensions { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordReportCards) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- - - return _studentAcademicRecordReportCards; - } + get => _extensions; set { - _studentAcademicRecordReportCards = value; - _studentAcademicRecordReportCardsCovariant = new CovariantCollectionAdapter(value); + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordReportCards - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAcademicRecordReportCards) - if (item.StudentAcademicRecord == null) - item.StudentAcademicRecord = this; - // ------------------------------------------------------------- + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- - return _studentAcademicRecordReportCardsCovariant; - } - set - { - StudentAcademicRecordReportCards = new HashSet(value.Cast()); - } - } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CumulativeAttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CumulativeAttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "CumulativeEarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "CumulativeEarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "SessionAttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "SessionAttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "SessionEarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "SessionEarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "GradePointAverageTypeDescriptor", new LookupColumnDetails { PropertyName = "GradePointAverageTypeDescriptorId", LookupTypeName = "GradePointAverageTypeDescriptor"} }, { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; @@ -117617,14 +120841,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("StudentUSI", StudentUSI); - keyValues.Add("TermDescriptorId", TermDescriptorId); + keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); return keyValues; } @@ -117688,32 +120909,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecord)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAcademicRecord) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage) target, null); + } + + void IChildEntity.SetParent(object value) + { + StudentAcademicRecord = (StudentAcademicRecord) value; } - } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAcademicRecordAcademicHonor table of the StudentAcademicRecord aggregate in the ODS database. + /// A class which represents the edfi.StudentAcademicRecordRecognition table of the StudentAcademicRecord aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordAcademicHonor : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAcademicRecordRecognition : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAcademicRecordRecognition, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAcademicRecordAcademicHonor() + public StudentAcademicRecordRecognition() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -117724,49 +120949,47 @@ public StudentAcademicRecordAcademicHonor() [DomainSignature, JsonIgnore] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordAcademicHonor.StudentAcademicRecord + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordRecognition.StudentAcademicRecord { get { return StudentAcademicRecord; } set { StudentAcademicRecord = (StudentAcademicRecord) value; } } [DomainSignature] - public virtual int AcademicHonorCategoryDescriptorId + public virtual int RecognitionTypeDescriptorId { get { - if (_academicHonorCategoryDescriptorId == default(int)) - _academicHonorCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicHonorCategoryDescriptor", _academicHonorCategoryDescriptor); + if (_recognitionTypeDescriptorId == default(int)) + _recognitionTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RecognitionTypeDescriptor", _recognitionTypeDescriptor); - return _academicHonorCategoryDescriptorId; + return _recognitionTypeDescriptorId; } set { - _academicHonorCategoryDescriptorId = value; - _academicHonorCategoryDescriptor = null; + _recognitionTypeDescriptorId = value; + _recognitionTypeDescriptor = null; } } - private int _academicHonorCategoryDescriptorId; - private string _academicHonorCategoryDescriptor; + private int _recognitionTypeDescriptorId; + private string _recognitionTypeDescriptor; - public virtual string AcademicHonorCategoryDescriptor + public virtual string RecognitionTypeDescriptor { get { - if (_academicHonorCategoryDescriptor == null) - _academicHonorCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicHonorCategoryDescriptor", _academicHonorCategoryDescriptorId); + if (_recognitionTypeDescriptor == null) + _recognitionTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RecognitionTypeDescriptor", _recognitionTypeDescriptorId); - return _academicHonorCategoryDescriptor; + return _recognitionTypeDescriptor; } set { - _academicHonorCategoryDescriptor = value; - _academicHonorCategoryDescriptorId = default(int); + _recognitionTypeDescriptor = value; + _recognitionTypeDescriptorId = default(int); } } - [DomainSignature] - public virtual string HonorDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117816,47 +121039,48 @@ public virtual string AchievementCategoryDescriptor public virtual string Criteria { get; set; } public virtual string CriteriaURL { get; set; } public virtual string EvidenceStatement { get; set; } - public virtual DateTime? HonorAwardDate + public virtual string ImageURL { get; set; } + public virtual string IssuerName { get; set; } + public virtual string IssuerOriginURL { get; set; } + public virtual DateTime? RecognitionAwardDate { - get { return _honorAwardDate; } + get { return _recognitionAwardDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _honorAwardDate = null; + _recognitionAwardDate = null; } else { var given = (DateTime) value; - _honorAwardDate = new DateTime(given.Year, given.Month, given.Day); + _recognitionAwardDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _honorAwardDate; + private DateTime? _recognitionAwardDate; - public virtual DateTime? HonorAwardExpiresDate + public virtual DateTime? RecognitionAwardExpiresDate { - get { return _honorAwardExpiresDate; } + get { return _recognitionAwardExpiresDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _honorAwardExpiresDate = null; + _recognitionAwardExpiresDate = null; } else { var given = (DateTime) value; - _honorAwardExpiresDate = new DateTime(given.Year, given.Month, given.Day); + _recognitionAwardExpiresDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _honorAwardExpiresDate; + private DateTime? _recognitionAwardExpiresDate; - public virtual string ImageURL { get; set; } - public virtual string IssuerName { get; set; } - public virtual string IssuerOriginURL { get; set; } + public virtual string RecognitionDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117911,8 +121135,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicHonorCategoryDescriptor", new LookupColumnDetails { PropertyName = "AcademicHonorCategoryDescriptorId", LookupTypeName = "AcademicHonorCategoryDescriptor"} }, { "AchievementCategoryDescriptor", new LookupColumnDetails { PropertyName = "AchievementCategoryDescriptorId", LookupTypeName = "AchievementCategoryDescriptor"} }, + { "RecognitionTypeDescriptor", new LookupColumnDetails { PropertyName = "RecognitionTypeDescriptorId", LookupTypeName = "RecognitionTypeDescriptor"} }, { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; @@ -117928,8 +121152,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AcademicHonorCategoryDescriptorId", AcademicHonorCategoryDescriptorId); - keyValues.Add("HonorDescription", HonorDescription); + keyValues.Add("RecognitionTypeDescriptorId", RecognitionTypeDescriptorId); return keyValues; } @@ -117993,12 +121216,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordRecognition)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordRecognition) target, null); } void IChildEntity.SetParent(object value) @@ -118010,19 +121233,19 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAcademicRecordClassRanking table of the StudentAcademicRecord aggregate in the ODS database. + /// A class which represents the edfi.StudentAcademicRecordReportCard table of the StudentAcademicRecord aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordClassRanking : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAcademicRecordClassRanking, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAcademicRecordReportCard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAcademicRecordReportCard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAcademicRecordClassRanking() + public StudentAcademicRecordReportCard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -118033,12 +121256,53 @@ public StudentAcademicRecordClassRanking() [DomainSignature, JsonIgnore] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordClassRanking.StudentAcademicRecord + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordReportCard.StudentAcademicRecord { get { return StudentAcademicRecord; } set { StudentAcademicRecord = (StudentAcademicRecord) value; } } + [DomainSignature] + public virtual int GradingPeriodDescriptorId + { + get + { + if (_gradingPeriodDescriptorId == default(int)) + _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); + + return _gradingPeriodDescriptorId; + } + set + { + _gradingPeriodDescriptorId = value; + _gradingPeriodDescriptor = null; + } + } + + private int _gradingPeriodDescriptorId; + private string _gradingPeriodDescriptor; + + public virtual string GradingPeriodDescriptor + { + get + { + if (_gradingPeriodDescriptor == null) + _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); + + return _gradingPeriodDescriptor; + } + set + { + _gradingPeriodDescriptor = value; + _gradingPeriodDescriptorId = default(int); + } + } + [DomainSignature] + public virtual string GradingPeriodName { get; set; } + [DomainSignature] + public virtual long GradingPeriodSchoolId { get; set; } + [DomainSignature] + public virtual short GradingPeriodSchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118049,28 +121313,6 @@ Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordClassRanking.S // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int ClassRank { get; set; } - public virtual DateTime? ClassRankingDate - { - get { return _classRankingDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _classRankingDate = null; - } else - { - var given = (DateTime) value; - _classRankingDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _classRankingDate; - - public virtual int? PercentageRanking { get; set; } - public virtual int TotalNumberInClass { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118115,6 +121357,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.ReportCardAggregate.EdFi.ReportCardReferenceData ReportCardReferenceData { get; set; } + + /// + /// Read-only property that allows the ReportCard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardDiscriminator + { + get { return ReportCardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ReportCard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardResourceId + { + get { return ReportCardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -118125,6 +121387,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; @@ -118140,6 +121403,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values + keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); + keyValues.Add("GradingPeriodName", GradingPeriodName); + keyValues.Add("GradingPeriodSchoolId", GradingPeriodSchoolId); + keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); return keyValues; } @@ -118203,12 +121470,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordClassRanking)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordReportCard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordClassRanking) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordReportCard) target, null); } void IChildEntity.SetParent(object value) @@ -118216,23 +121483,116 @@ void IChildEntity.SetParent(object value) StudentAcademicRecord = (StudentAcademicRecord) value; } } +} +// Aggregate: StudentAssessment + +namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class StudentAssessmentReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string AssessmentIdentifier { get; set; } + public virtual string Namespace { get; set; } + public virtual string StudentAssessmentIdentifier { get; set; } + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAcademicRecordDiploma table of the StudentAcademicRecord aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessment table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordDiploma : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAcademicRecordDiploma, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessment : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAcademicRecordDiploma() + public StudentAssessment() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + StudentAssessmentPeriodPersistentList = new HashSet(); + StudentAssessmentAccommodations = new HashSet(); + StudentAssessmentItems = new HashSet(); + StudentAssessmentPerformanceLevels = new HashSet(); + StudentAssessmentScoreResults = new HashSet(); + StudentAssessmentStudentObjectiveAssessments = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -118240,58 +121600,59 @@ public StudentAcademicRecordDiploma() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } - - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordDiploma.StudentAcademicRecord - { - get { return StudentAcademicRecord; } - set { StudentAcademicRecord = (StudentAcademicRecord) value; } - } - [DomainSignature] - public virtual DateTime DiplomaAwardDate - { - get { return _diplomaAwardDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _diplomaAwardDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _diplomaAwardDate; - + public virtual string AssessmentIdentifier { get; set; } [DomainSignature] - public virtual int DiplomaTypeDescriptorId + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual string StudentAssessmentIdentifier { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI { get { - if (_diplomaTypeDescriptorId == default(int)) - _diplomaTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiplomaTypeDescriptor", _diplomaTypeDescriptor); + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - return _diplomaTypeDescriptorId; + return _studentUSI; } set { - _diplomaTypeDescriptorId = value; - _diplomaTypeDescriptor = null; + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); } } - private int _diplomaTypeDescriptorId; - private string _diplomaTypeDescriptor; + private int _studentUSI; + private string _studentUniqueId; - public virtual string DiplomaTypeDescriptor + public virtual string StudentUniqueId { get { - if (_diplomaTypeDescriptor == null) - _diplomaTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiplomaTypeDescriptor", _diplomaTypeDescriptorId); - - return _diplomaTypeDescriptor; + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; } set { - _diplomaTypeDescriptor = value; - _diplomaTypeDescriptorId = default(int); + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; } } // ------------------------------------------------------------- @@ -118304,108 +121665,349 @@ public virtual string DiplomaTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AchievementCategoryDescriptorId + public virtual DateTime? AdministrationDate + { + get { return _administrationDate; } + set + { + // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. + // Note ToUniversal will work differently based on DateTime.Kind + // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime + // Utc - No conversion is performed. + // Local - The current DateTime object is converted to UTC. + // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. + if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) + _administrationDate = value?.ToUniversalTime(); + } + } + + private DateTime? _administrationDate; + + public virtual DateTime? AdministrationEndDate + { + get { return _administrationEndDate; } + set + { + // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. + // Note ToUniversal will work differently based on DateTime.Kind + // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime + // Utc - No conversion is performed. + // Local - The current DateTime object is converted to UTC. + // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. + if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) + _administrationEndDate = value?.ToUniversalTime(); + } + } + + private DateTime? _administrationEndDate; + + public virtual int? AdministrationEnvironmentDescriptorId { get { - if (_achievementCategoryDescriptorId == default(int?)) - _achievementCategoryDescriptorId = string.IsNullOrWhiteSpace(_achievementCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AchievementCategoryDescriptor", _achievementCategoryDescriptor); + if (_administrationEnvironmentDescriptorId == default(int?)) + _administrationEnvironmentDescriptorId = string.IsNullOrWhiteSpace(_administrationEnvironmentDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdministrationEnvironmentDescriptor", _administrationEnvironmentDescriptor); - return _achievementCategoryDescriptorId; + return _administrationEnvironmentDescriptorId; } set { - _achievementCategoryDescriptorId = value; - _achievementCategoryDescriptor = null; + _administrationEnvironmentDescriptorId = value; + _administrationEnvironmentDescriptor = null; } } - private int? _achievementCategoryDescriptorId; - private string _achievementCategoryDescriptor; + private int? _administrationEnvironmentDescriptorId; + private string _administrationEnvironmentDescriptor; - public virtual string AchievementCategoryDescriptor + public virtual string AdministrationEnvironmentDescriptor { get { - if (_achievementCategoryDescriptor == null) - _achievementCategoryDescriptor = _achievementCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AchievementCategoryDescriptor", _achievementCategoryDescriptorId.Value); + if (_administrationEnvironmentDescriptor == null) + _administrationEnvironmentDescriptor = _administrationEnvironmentDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdministrationEnvironmentDescriptor", _administrationEnvironmentDescriptorId.Value); - return _achievementCategoryDescriptor; + return _administrationEnvironmentDescriptor; } set { - _achievementCategoryDescriptor = value; - _achievementCategoryDescriptorId = default(int?); + _administrationEnvironmentDescriptor = value; + _administrationEnvironmentDescriptorId = default(int?); } } - public virtual string AchievementCategorySystem { get; set; } - public virtual string AchievementTitle { get; set; } - public virtual string Criteria { get; set; } - public virtual string CriteriaURL { get; set; } - public virtual bool? CTECompleter { get; set; } - public virtual DateTime? DiplomaAwardExpiresDate + public virtual int? AdministrationLanguageDescriptorId { - get { return _diplomaAwardExpiresDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _diplomaAwardExpiresDate = null; - } else - { - var given = (DateTime) value; - _diplomaAwardExpiresDate = new DateTime(given.Year, given.Month, given.Day); - } + get + { + if (_administrationLanguageDescriptorId == default(int?)) + _administrationLanguageDescriptorId = string.IsNullOrWhiteSpace(_administrationLanguageDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _administrationLanguageDescriptor); + + return _administrationLanguageDescriptorId; + } + set + { + _administrationLanguageDescriptorId = value; + _administrationLanguageDescriptor = null; } } - private DateTime? _diplomaAwardExpiresDate; - - public virtual string DiplomaDescription { get; set; } - public virtual int? DiplomaLevelDescriptorId + private int? _administrationLanguageDescriptorId; + private string _administrationLanguageDescriptor; + + public virtual string AdministrationLanguageDescriptor { get { - if (_diplomaLevelDescriptorId == default(int?)) - _diplomaLevelDescriptorId = string.IsNullOrWhiteSpace(_diplomaLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DiplomaLevelDescriptor", _diplomaLevelDescriptor); + if (_administrationLanguageDescriptor == null) + _administrationLanguageDescriptor = _administrationLanguageDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _administrationLanguageDescriptorId.Value); + + return _administrationLanguageDescriptor; + } + set + { + _administrationLanguageDescriptor = value; + _administrationLanguageDescriptorId = default(int?); + } + } + public virtual int? AssessedMinutes { get; set; } + public virtual int? EventCircumstanceDescriptorId + { + get + { + if (_eventCircumstanceDescriptorId == default(int?)) + _eventCircumstanceDescriptorId = string.IsNullOrWhiteSpace(_eventCircumstanceDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EventCircumstanceDescriptor", _eventCircumstanceDescriptor); - return _diplomaLevelDescriptorId; + return _eventCircumstanceDescriptorId; } set { - _diplomaLevelDescriptorId = value; - _diplomaLevelDescriptor = null; + _eventCircumstanceDescriptorId = value; + _eventCircumstanceDescriptor = null; } } - private int? _diplomaLevelDescriptorId; - private string _diplomaLevelDescriptor; + private int? _eventCircumstanceDescriptorId; + private string _eventCircumstanceDescriptor; - public virtual string DiplomaLevelDescriptor + public virtual string EventCircumstanceDescriptor { get { - if (_diplomaLevelDescriptor == null) - _diplomaLevelDescriptor = _diplomaLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DiplomaLevelDescriptor", _diplomaLevelDescriptorId.Value); + if (_eventCircumstanceDescriptor == null) + _eventCircumstanceDescriptor = _eventCircumstanceDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EventCircumstanceDescriptor", _eventCircumstanceDescriptorId.Value); - return _diplomaLevelDescriptor; + return _eventCircumstanceDescriptor; } set { - _diplomaLevelDescriptor = value; - _diplomaLevelDescriptorId = default(int?); + _eventCircumstanceDescriptor = value; + _eventCircumstanceDescriptorId = default(int?); + } + } + public virtual string EventDescription { get; set; } + public virtual int? PlatformTypeDescriptorId + { + get + { + if (_platformTypeDescriptorId == default(int?)) + _platformTypeDescriptorId = string.IsNullOrWhiteSpace(_platformTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PlatformTypeDescriptor", _platformTypeDescriptor); + + return _platformTypeDescriptorId; + } + set + { + _platformTypeDescriptorId = value; + _platformTypeDescriptor = null; + } + } + + private int? _platformTypeDescriptorId; + private string _platformTypeDescriptor; + + public virtual string PlatformTypeDescriptor + { + get + { + if (_platformTypeDescriptor == null) + _platformTypeDescriptor = _platformTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PlatformTypeDescriptor", _platformTypeDescriptorId.Value); + + return _platformTypeDescriptor; + } + set + { + _platformTypeDescriptor = value; + _platformTypeDescriptorId = default(int?); + } + } + public virtual int? ReasonNotTestedDescriptorId + { + get + { + if (_reasonNotTestedDescriptorId == default(int?)) + _reasonNotTestedDescriptorId = string.IsNullOrWhiteSpace(_reasonNotTestedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReasonNotTestedDescriptor", _reasonNotTestedDescriptor); + + return _reasonNotTestedDescriptorId; + } + set + { + _reasonNotTestedDescriptorId = value; + _reasonNotTestedDescriptor = null; + } + } + + private int? _reasonNotTestedDescriptorId; + private string _reasonNotTestedDescriptor; + + public virtual string ReasonNotTestedDescriptor + { + get + { + if (_reasonNotTestedDescriptor == null) + _reasonNotTestedDescriptor = _reasonNotTestedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReasonNotTestedDescriptor", _reasonNotTestedDescriptorId.Value); + + return _reasonNotTestedDescriptor; + } + set + { + _reasonNotTestedDescriptor = value; + _reasonNotTestedDescriptorId = default(int?); + } + } + public virtual long? ReportedSchoolId { get; set; } + public virtual string ReportedSchoolIdentifier { get; set; } + public virtual int? RetestIndicatorDescriptorId + { + get + { + if (_retestIndicatorDescriptorId == default(int?)) + _retestIndicatorDescriptorId = string.IsNullOrWhiteSpace(_retestIndicatorDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RetestIndicatorDescriptor", _retestIndicatorDescriptor); + + return _retestIndicatorDescriptorId; + } + set + { + _retestIndicatorDescriptorId = value; + _retestIndicatorDescriptor = null; + } + } + + private int? _retestIndicatorDescriptorId; + private string _retestIndicatorDescriptor; + + public virtual string RetestIndicatorDescriptor + { + get + { + if (_retestIndicatorDescriptor == null) + _retestIndicatorDescriptor = _retestIndicatorDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RetestIndicatorDescriptor", _retestIndicatorDescriptorId.Value); + + return _retestIndicatorDescriptor; + } + set + { + _retestIndicatorDescriptor = value; + _retestIndicatorDescriptorId = default(int?); + } + } + public virtual short? SchoolYear { get; set; } + public virtual string SerialNumber { get; set; } + public virtual int? WhenAssessedGradeLevelDescriptorId + { + get + { + if (_whenAssessedGradeLevelDescriptorId == default(int?)) + _whenAssessedGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenAssessedGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenAssessedGradeLevelDescriptor); + + return _whenAssessedGradeLevelDescriptorId; + } + set + { + _whenAssessedGradeLevelDescriptorId = value; + _whenAssessedGradeLevelDescriptor = null; + } + } + + private int? _whenAssessedGradeLevelDescriptorId; + private string _whenAssessedGradeLevelDescriptor; + + public virtual string WhenAssessedGradeLevelDescriptor + { + get + { + if (_whenAssessedGradeLevelDescriptor == null) + _whenAssessedGradeLevelDescriptor = _whenAssessedGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenAssessedGradeLevelDescriptorId.Value); + + return _whenAssessedGradeLevelDescriptor; + } + set + { + _whenAssessedGradeLevelDescriptor = value; + _whenAssessedGradeLevelDescriptorId = default(int?); } } - public virtual string EvidenceStatement { get; set; } - public virtual string ImageURL { get; set; } - public virtual string IssuerName { get; set; } - public virtual string IssuerOriginURL { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + public virtual Entities.NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentPeriod StudentAssessmentPeriod + { + get + { + // Return the item in the list, if one exists + if (StudentAssessmentPeriodPersistentList.Any()) + return StudentAssessmentPeriodPersistentList.First(); + + // No reference is present + return null; + } + set + { + // Delete the existing object + if (StudentAssessmentPeriodPersistentList.Any()) + StudentAssessmentPeriodPersistentList.Clear(); + + // If we're setting a value, add it to the list now + if (value != null) + { + // Set the back-reference to the parent + value.StudentAssessment = this; + + StudentAssessmentPeriodPersistentList.Add(value); + } + } + } + + Entities.Common.EdFi.IStudentAssessmentPeriod Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPeriod + { + get { return StudentAssessmentPeriod; } + set { StudentAssessmentPeriod = (Entities.NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentPeriod) value; } + } + + private ICollection _studentAssessmentPeriodPersistentList; + + public virtual ICollection StudentAssessmentPeriodPersistentList + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentPeriodPersistentList) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentPeriodPersistentList; + } + set + { + _studentAssessmentPeriodPersistentList = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -118445,20 +122047,320 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessment.AssessmentDiscriminator + { + get { return AssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessment.AssessmentResourceId + { + get { return AssessmentReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ReportedSchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the ReportedSchool resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessment.ReportedSchoolResourceId + { + get { return ReportedSchoolReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessment.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessment.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessment.StudentResourceId + { + get { return StudentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _studentAssessmentAccommodations; + private ICollection _studentAssessmentAccommodationsCovariant; + public virtual ICollection StudentAssessmentAccommodations + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentAccommodations) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentAccommodations; + } + set + { + _studentAssessmentAccommodations = value; + _studentAssessmentAccommodationsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentAccommodations + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentAccommodations) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentAccommodationsCovariant; + } + set + { + StudentAssessmentAccommodations = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAssessmentItems; + private ICollection _studentAssessmentItemsCovariant; + public virtual ICollection StudentAssessmentItems + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentItems) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentItems; + } + set + { + _studentAssessmentItems = value; + _studentAssessmentItemsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentItems + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentItems) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentItemsCovariant; + } + set + { + StudentAssessmentItems = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAssessmentPerformanceLevels; + private ICollection _studentAssessmentPerformanceLevelsCovariant; + public virtual ICollection StudentAssessmentPerformanceLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentPerformanceLevels) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentPerformanceLevels; + } + set + { + _studentAssessmentPerformanceLevels = value; + _studentAssessmentPerformanceLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPerformanceLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentPerformanceLevels) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentPerformanceLevelsCovariant; + } + set + { + StudentAssessmentPerformanceLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAssessmentScoreResults; + private ICollection _studentAssessmentScoreResultsCovariant; + public virtual ICollection StudentAssessmentScoreResults + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentScoreResults) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentScoreResults; + } + set + { + _studentAssessmentScoreResults = value; + _studentAssessmentScoreResultsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentScoreResults + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentScoreResults) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentScoreResultsCovariant; + } + set + { + StudentAssessmentScoreResults = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAssessmentStudentObjectiveAssessments; + private ICollection _studentAssessmentStudentObjectiveAssessmentsCovariant; + public virtual ICollection StudentAssessmentStudentObjectiveAssessments + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentStudentObjectiveAssessments) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentStudentObjectiveAssessments; + } + set + { + _studentAssessmentStudentObjectiveAssessments = value; + _studentAssessmentStudentObjectiveAssessmentsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentStudentObjectiveAssessments + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentStudentObjectiveAssessments) + if (item.StudentAssessment == null) + item.StudentAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentStudentObjectiveAssessmentsCovariant; + } + set + { + StudentAssessmentStudentObjectiveAssessments = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AchievementCategoryDescriptor", new LookupColumnDetails { PropertyName = "AchievementCategoryDescriptorId", LookupTypeName = "AchievementCategoryDescriptor"} }, - { "DiplomaLevelDescriptor", new LookupColumnDetails { PropertyName = "DiplomaLevelDescriptorId", LookupTypeName = "DiplomaLevelDescriptor"} }, - { "DiplomaTypeDescriptor", new LookupColumnDetails { PropertyName = "DiplomaTypeDescriptorId", LookupTypeName = "DiplomaTypeDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "AdministrationEnvironmentDescriptor", new LookupColumnDetails { PropertyName = "AdministrationEnvironmentDescriptorId", LookupTypeName = "AdministrationEnvironmentDescriptor"} }, + { "AdministrationLanguageDescriptor", new LookupColumnDetails { PropertyName = "AdministrationLanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, + { "EventCircumstanceDescriptor", new LookupColumnDetails { PropertyName = "EventCircumstanceDescriptorId", LookupTypeName = "EventCircumstanceDescriptor"} }, + { "PlatformTypeDescriptor", new LookupColumnDetails { PropertyName = "PlatformTypeDescriptorId", LookupTypeName = "PlatformTypeDescriptor"} }, + { "ReasonNotTestedDescriptor", new LookupColumnDetails { PropertyName = "ReasonNotTestedDescriptorId", LookupTypeName = "ReasonNotTestedDescriptor"} }, + { "RetestIndicatorDescriptor", new LookupColumnDetails { PropertyName = "RetestIndicatorDescriptorId", LookupTypeName = "RetestIndicatorDescriptor"} }, + { "WhenAssessedGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenAssessedGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -118469,12 +122371,14 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiplomaAwardDate", DiplomaAwardDate); - keyValues.Add("DiplomaTypeDescriptorId", DiplomaTypeDescriptorId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -118538,36 +122442,32 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordDiploma)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordDiploma) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessment) target, null); } - void IChildEntity.SetParent(object value) - { - StudentAcademicRecord = (StudentAcademicRecord) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAcademicRecordGradePointAverage table of the StudentAcademicRecord aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentAccommodation table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordGradePointAverage : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentAccommodation : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAcademicRecordGradePointAverage() + public StudentAssessmentAccommodation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -118576,47 +122476,47 @@ public StudentAcademicRecordGradePointAverage() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } + public virtual StudentAssessment StudentAssessment { get; set; } - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordGradePointAverage.StudentAcademicRecord + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentAccommodation.StudentAssessment { - get { return StudentAcademicRecord; } - set { StudentAcademicRecord = (StudentAcademicRecord) value; } + get { return StudentAssessment; } + set { StudentAssessment = (StudentAssessment) value; } } [DomainSignature] - public virtual int GradePointAverageTypeDescriptorId + public virtual int AccommodationDescriptorId { get { - if (_gradePointAverageTypeDescriptorId == default(int)) - _gradePointAverageTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptor); + if (_accommodationDescriptorId == default(int)) + _accommodationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccommodationDescriptor", _accommodationDescriptor); - return _gradePointAverageTypeDescriptorId; + return _accommodationDescriptorId; } set { - _gradePointAverageTypeDescriptorId = value; - _gradePointAverageTypeDescriptor = null; + _accommodationDescriptorId = value; + _accommodationDescriptor = null; } } - private int _gradePointAverageTypeDescriptorId; - private string _gradePointAverageTypeDescriptor; + private int _accommodationDescriptorId; + private string _accommodationDescriptor; - public virtual string GradePointAverageTypeDescriptor + public virtual string AccommodationDescriptor { get { - if (_gradePointAverageTypeDescriptor == null) - _gradePointAverageTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradePointAverageTypeDescriptor", _gradePointAverageTypeDescriptorId); + if (_accommodationDescriptor == null) + _accommodationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccommodationDescriptor", _accommodationDescriptorId); - return _gradePointAverageTypeDescriptor; + return _accommodationDescriptor; } set { - _gradePointAverageTypeDescriptor = value; - _gradePointAverageTypeDescriptorId = default(int); + _accommodationDescriptor = value; + _accommodationDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -118629,9 +122529,6 @@ public virtual string GradePointAverageTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal GradePointAverageValue { get; set; } - public virtual bool? IsCumulative { get; set; } - public virtual decimal? MaxGradePointAverageValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118686,8 +122583,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradePointAverageTypeDescriptor", new LookupColumnDetails { PropertyName = "GradePointAverageTypeDescriptorId", LookupTypeName = "GradePointAverageTypeDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "AccommodationDescriptor", new LookupColumnDetails { PropertyName = "AccommodationDescriptorId", LookupTypeName = "AccommodationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -118699,10 +122595,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); + keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); return keyValues; } @@ -118766,36 +122662,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentAccommodation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentAccommodation) target, null); } void IChildEntity.SetParent(object value) { - StudentAcademicRecord = (StudentAcademicRecord) value; + StudentAssessment = (StudentAssessment) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAcademicRecordRecognition table of the StudentAcademicRecord aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentItem table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordRecognition : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAcademicRecordRecognition, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentItem : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAcademicRecordRecognition() + public StudentAssessmentItem() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -118804,140 +122700,99 @@ public StudentAcademicRecordRecognition() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } + public virtual StudentAssessment StudentAssessment { get; set; } - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordRecognition.StudentAcademicRecord + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment { - get { return StudentAcademicRecord; } - set { StudentAcademicRecord = (StudentAcademicRecord) value; } + get { return StudentAssessment; } + set { StudentAssessment = (StudentAssessment) value; } } [DomainSignature] - public virtual int RecognitionTypeDescriptorId + public virtual string IdentificationCode { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual int AssessmentItemResultDescriptorId { get { - if (_recognitionTypeDescriptorId == default(int)) - _recognitionTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RecognitionTypeDescriptor", _recognitionTypeDescriptor); + if (_assessmentItemResultDescriptorId == default(int)) + _assessmentItemResultDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentItemResultDescriptor", _assessmentItemResultDescriptor); - return _recognitionTypeDescriptorId; + return _assessmentItemResultDescriptorId; } set { - _recognitionTypeDescriptorId = value; - _recognitionTypeDescriptor = null; + _assessmentItemResultDescriptorId = value; + _assessmentItemResultDescriptor = null; } } - private int _recognitionTypeDescriptorId; - private string _recognitionTypeDescriptor; + private int _assessmentItemResultDescriptorId; + private string _assessmentItemResultDescriptor; - public virtual string RecognitionTypeDescriptor + public virtual string AssessmentItemResultDescriptor { get { - if (_recognitionTypeDescriptor == null) - _recognitionTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RecognitionTypeDescriptor", _recognitionTypeDescriptorId); + if (_assessmentItemResultDescriptor == null) + _assessmentItemResultDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentItemResultDescriptor", _assessmentItemResultDescriptorId); - return _recognitionTypeDescriptor; + return _assessmentItemResultDescriptor; } set { - _recognitionTypeDescriptor = value; - _recognitionTypeDescriptorId = default(int); + _assessmentItemResultDescriptor = value; + _assessmentItemResultDescriptorId = default(int); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? AchievementCategoryDescriptorId + public virtual string AssessmentResponse { get; set; } + public virtual string DescriptiveFeedback { get; set; } + public virtual int? ItemNumber { get; set; } + public virtual decimal? RawScoreResult { get; set; } + public virtual int? ResponseIndicatorDescriptorId { get { - if (_achievementCategoryDescriptorId == default(int?)) - _achievementCategoryDescriptorId = string.IsNullOrWhiteSpace(_achievementCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AchievementCategoryDescriptor", _achievementCategoryDescriptor); + if (_responseIndicatorDescriptorId == default(int?)) + _responseIndicatorDescriptorId = string.IsNullOrWhiteSpace(_responseIndicatorDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResponseIndicatorDescriptor", _responseIndicatorDescriptor); - return _achievementCategoryDescriptorId; + return _responseIndicatorDescriptorId; } set { - _achievementCategoryDescriptorId = value; - _achievementCategoryDescriptor = null; + _responseIndicatorDescriptorId = value; + _responseIndicatorDescriptor = null; } } - private int? _achievementCategoryDescriptorId; - private string _achievementCategoryDescriptor; + private int? _responseIndicatorDescriptorId; + private string _responseIndicatorDescriptor; - public virtual string AchievementCategoryDescriptor + public virtual string ResponseIndicatorDescriptor { get { - if (_achievementCategoryDescriptor == null) - _achievementCategoryDescriptor = _achievementCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AchievementCategoryDescriptor", _achievementCategoryDescriptorId.Value); + if (_responseIndicatorDescriptor == null) + _responseIndicatorDescriptor = _responseIndicatorDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResponseIndicatorDescriptor", _responseIndicatorDescriptorId.Value); - return _achievementCategoryDescriptor; + return _responseIndicatorDescriptor; } set { - _achievementCategoryDescriptor = value; - _achievementCategoryDescriptorId = default(int?); - } - } - public virtual string AchievementCategorySystem { get; set; } - public virtual string AchievementTitle { get; set; } - public virtual string Criteria { get; set; } - public virtual string CriteriaURL { get; set; } - public virtual string EvidenceStatement { get; set; } - public virtual string ImageURL { get; set; } - public virtual string IssuerName { get; set; } - public virtual string IssuerOriginURL { get; set; } - public virtual DateTime? RecognitionAwardDate - { - get { return _recognitionAwardDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _recognitionAwardDate = null; - } else - { - var given = (DateTime) value; - _recognitionAwardDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _recognitionAwardDate; - - public virtual DateTime? RecognitionAwardExpiresDate - { - get { return _recognitionAwardExpiresDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _recognitionAwardExpiresDate = null; - } else - { - var given = (DateTime) value; - _recognitionAwardExpiresDate = new DateTime(given.Year, given.Month, given.Day); - } + _responseIndicatorDescriptor = value; + _responseIndicatorDescriptorId = default(int?); } } - - private DateTime? _recognitionAwardExpiresDate; - - public virtual string RecognitionDescription { get; set; } + public virtual string TimeAssessed { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118982,6 +122837,26 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.AssessmentItemAggregate.EdFi.AssessmentItemReferenceData AssessmentItemReferenceData { get; set; } + + /// + /// Read-only property that allows the AssessmentItem discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator + { + get { return AssessmentItemReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the AssessmentItem resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemResourceId + { + get { return AssessmentItemReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -118992,9 +122867,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AchievementCategoryDescriptor", new LookupColumnDetails { PropertyName = "AchievementCategoryDescriptorId", LookupTypeName = "AchievementCategoryDescriptor"} }, - { "RecognitionTypeDescriptor", new LookupColumnDetails { PropertyName = "RecognitionTypeDescriptorId", LookupTypeName = "RecognitionTypeDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "AssessmentItemResultDescriptor", new LookupColumnDetails { PropertyName = "AssessmentItemResultDescriptorId", LookupTypeName = "AssessmentItemResultDescriptor"} }, + { "ResponseIndicatorDescriptor", new LookupColumnDetails { PropertyName = "ResponseIndicatorDescriptorId", LookupTypeName = "ResponseIndicatorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -119006,10 +122880,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("RecognitionTypeDescriptorId", RecognitionTypeDescriptorId); + keyValues.Add("IdentificationCode", IdentificationCode); return keyValues; } @@ -119073,93 +122947,122 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordRecognition)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentItem)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordRecognition) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentItem) target, null); } void IChildEntity.SetParent(object value) { - StudentAcademicRecord = (StudentAcademicRecord) value; + StudentAssessment = (StudentAssessment) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAcademicRecordReportCard table of the StudentAcademicRecord aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordReportCard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAcademicRecordReportCard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAcademicRecordReportCard() + public StudentAssessmentPerformanceLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual StudentAssessment StudentAssessment { get; set; } + + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPerformanceLevel.StudentAssessment + { + get { return StudentAssessment; } + set { StudentAssessment = (StudentAssessment) value; } + } + + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId + { + get + { + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordReportCard.StudentAcademicRecord + public virtual string AssessmentReportingMethodDescriptor { - get { return StudentAcademicRecord; } - set { StudentAcademicRecord = (StudentAcademicRecord) value; } + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } } - [DomainSignature] - public virtual int GradingPeriodDescriptorId + public virtual int PerformanceLevelDescriptorId { get { - if (_gradingPeriodDescriptorId == default(int)) - _gradingPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradingPeriodDescriptor", _gradingPeriodDescriptor); + if (_performanceLevelDescriptorId == default(int)) + _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); - return _gradingPeriodDescriptorId; + return _performanceLevelDescriptorId; } set { - _gradingPeriodDescriptorId = value; - _gradingPeriodDescriptor = null; + _performanceLevelDescriptorId = value; + _performanceLevelDescriptor = null; } } - private int _gradingPeriodDescriptorId; - private string _gradingPeriodDescriptor; + private int _performanceLevelDescriptorId; + private string _performanceLevelDescriptor; - public virtual string GradingPeriodDescriptor + public virtual string PerformanceLevelDescriptor { get { - if (_gradingPeriodDescriptor == null) - _gradingPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradingPeriodDescriptor", _gradingPeriodDescriptorId); + if (_performanceLevelDescriptor == null) + _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); - return _gradingPeriodDescriptor; + return _performanceLevelDescriptor; } set { - _gradingPeriodDescriptor = value; - _gradingPeriodDescriptorId = default(int); + _performanceLevelDescriptor = value; + _performanceLevelDescriptorId = default(int); } } - [DomainSignature] - public virtual string GradingPeriodName { get; set; } - [DomainSignature] - public virtual long GradingPeriodSchoolId { get; set; } - [DomainSignature] - public virtual short GradingPeriodSchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -119170,6 +123073,7 @@ public virtual string GradingPeriodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + public virtual string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -119214,26 +123118,6 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ReportCardAggregate.EdFi.ReportCardReferenceData ReportCardReferenceData { get; set; } - - /// - /// Read-only property that allows the ReportCard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardDiscriminator - { - get { return ReportCardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ReportCard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardResourceId - { - get { return ReportCardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -119244,8 +123128,8 @@ string Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardDiscrimin // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradingPeriodDescriptor", new LookupColumnDetails { PropertyName = "GradingPeriodDescriptorId", LookupTypeName = "GradingPeriodDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -119257,13 +123141,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); - keyValues.Add("GradingPeriodName", GradingPeriodName); - keyValues.Add("GradingPeriodSchoolId", GradingPeriodSchoolId); - keyValues.Add("GradingPeriodSchoolYear", GradingPeriodSchoolYear); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); return keyValues; } @@ -119327,129 +123209,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAcademicRecordReportCard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAcademicRecordReportCard) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel) target, null); } void IChildEntity.SetParent(object value) { - StudentAcademicRecord = (StudentAcademicRecord) value; - } - } -} -// Aggregate: StudentAssessment - -namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class StudentAssessmentReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string AssessmentIdentifier { get; set; } - public virtual string Namespace { get; set; } - public virtual string StudentAssessmentIdentifier { get; set; } - public virtual int StudentUSI { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("Namespace", Namespace); - keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); - keyValues.Add("StudentUSI", StudentUSI); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + StudentAssessment = (StudentAssessment) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessment table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentPeriod table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessment : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IStudentAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessment() + public StudentAssessmentPeriod() { - StudentAssessmentPeriodPersistentList = new HashSet(); - StudentAssessmentAccommodations = new HashSet(); - StudentAssessmentItems = new HashSet(); - StudentAssessmentPerformanceLevels = new HashSet(); - StudentAssessmentScoreResults = new HashSet(); - StudentAssessmentStudentObjectiveAssessments = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -119457,61 +123246,15 @@ public StudentAssessment() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual string AssessmentIdentifier { get; set; } - [DomainSignature] - public virtual string Namespace { get; set; } - [DomainSignature] - public virtual string StudentAssessmentIdentifier { get; set; } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; + [DomainSignature, JsonIgnore] + public virtual StudentAssessment StudentAssessment { get; set; } - public virtual string StudentUniqueId + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPeriod.StudentAssessment { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } + get { return StudentAssessment; } + set { StudentAssessment = (StudentAssessment) value; } } + // ------------------------------------------------------------- // ============================================================= @@ -119522,349 +123265,83 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? AdministrationDate - { - get { return _administrationDate; } - set - { - // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. - // Note ToUniversal will work differently based on DateTime.Kind - // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime - // Utc - No conversion is performed. - // Local - The current DateTime object is converted to UTC. - // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. - if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) - _administrationDate = value?.ToUniversalTime(); - } - } - - private DateTime? _administrationDate; - - public virtual DateTime? AdministrationEndDate - { - get { return _administrationEndDate; } - set - { - // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. - // Note ToUniversal will work differently based on DateTime.Kind - // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime - // Utc - No conversion is performed. - // Local - The current DateTime object is converted to UTC. - // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. - if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) - _administrationEndDate = value?.ToUniversalTime(); - } - } - - private DateTime? _administrationEndDate; - - public virtual int? AdministrationEnvironmentDescriptorId - { - get - { - if (_administrationEnvironmentDescriptorId == default(int?)) - _administrationEnvironmentDescriptorId = string.IsNullOrWhiteSpace(_administrationEnvironmentDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdministrationEnvironmentDescriptor", _administrationEnvironmentDescriptor); - - return _administrationEnvironmentDescriptorId; - } - set - { - _administrationEnvironmentDescriptorId = value; - _administrationEnvironmentDescriptor = null; - } - } - - private int? _administrationEnvironmentDescriptorId; - private string _administrationEnvironmentDescriptor; - - public virtual string AdministrationEnvironmentDescriptor - { - get - { - if (_administrationEnvironmentDescriptor == null) - _administrationEnvironmentDescriptor = _administrationEnvironmentDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdministrationEnvironmentDescriptor", _administrationEnvironmentDescriptorId.Value); - - return _administrationEnvironmentDescriptor; - } - set - { - _administrationEnvironmentDescriptor = value; - _administrationEnvironmentDescriptorId = default(int?); - } - } - public virtual int? AdministrationLanguageDescriptorId - { - get - { - if (_administrationLanguageDescriptorId == default(int?)) - _administrationLanguageDescriptorId = string.IsNullOrWhiteSpace(_administrationLanguageDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _administrationLanguageDescriptor); - - return _administrationLanguageDescriptorId; - } - set - { - _administrationLanguageDescriptorId = value; - _administrationLanguageDescriptor = null; - } - } - - private int? _administrationLanguageDescriptorId; - private string _administrationLanguageDescriptor; - - public virtual string AdministrationLanguageDescriptor - { - get - { - if (_administrationLanguageDescriptor == null) - _administrationLanguageDescriptor = _administrationLanguageDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _administrationLanguageDescriptorId.Value); - - return _administrationLanguageDescriptor; - } - set - { - _administrationLanguageDescriptor = value; - _administrationLanguageDescriptorId = default(int?); - } - } - public virtual int? AssessedMinutes { get; set; } - public virtual int? EventCircumstanceDescriptorId - { - get - { - if (_eventCircumstanceDescriptorId == default(int?)) - _eventCircumstanceDescriptorId = string.IsNullOrWhiteSpace(_eventCircumstanceDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EventCircumstanceDescriptor", _eventCircumstanceDescriptor); - - return _eventCircumstanceDescriptorId; - } - set - { - _eventCircumstanceDescriptorId = value; - _eventCircumstanceDescriptor = null; - } - } - - private int? _eventCircumstanceDescriptorId; - private string _eventCircumstanceDescriptor; - - public virtual string EventCircumstanceDescriptor - { - get - { - if (_eventCircumstanceDescriptor == null) - _eventCircumstanceDescriptor = _eventCircumstanceDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EventCircumstanceDescriptor", _eventCircumstanceDescriptorId.Value); - - return _eventCircumstanceDescriptor; - } - set - { - _eventCircumstanceDescriptor = value; - _eventCircumstanceDescriptorId = default(int?); - } - } - public virtual string EventDescription { get; set; } - public virtual int? PlatformTypeDescriptorId - { - get - { - if (_platformTypeDescriptorId == default(int?)) - _platformTypeDescriptorId = string.IsNullOrWhiteSpace(_platformTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PlatformTypeDescriptor", _platformTypeDescriptor); - - return _platformTypeDescriptorId; - } - set - { - _platformTypeDescriptorId = value; - _platformTypeDescriptor = null; - } - } - - private int? _platformTypeDescriptorId; - private string _platformTypeDescriptor; - - public virtual string PlatformTypeDescriptor - { - get - { - if (_platformTypeDescriptor == null) - _platformTypeDescriptor = _platformTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PlatformTypeDescriptor", _platformTypeDescriptorId.Value); - - return _platformTypeDescriptor; - } - set - { - _platformTypeDescriptor = value; - _platformTypeDescriptorId = default(int?); - } - } - public virtual int? ReasonNotTestedDescriptorId + public virtual int AssessmentPeriodDescriptorId { get { - if (_reasonNotTestedDescriptorId == default(int?)) - _reasonNotTestedDescriptorId = string.IsNullOrWhiteSpace(_reasonNotTestedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReasonNotTestedDescriptor", _reasonNotTestedDescriptor); + if (_assessmentPeriodDescriptorId == default(int)) + _assessmentPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentPeriodDescriptor", _assessmentPeriodDescriptor); - return _reasonNotTestedDescriptorId; + return _assessmentPeriodDescriptorId; } set { - _reasonNotTestedDescriptorId = value; - _reasonNotTestedDescriptor = null; + _assessmentPeriodDescriptorId = value; + _assessmentPeriodDescriptor = null; } } - private int? _reasonNotTestedDescriptorId; - private string _reasonNotTestedDescriptor; + private int _assessmentPeriodDescriptorId; + private string _assessmentPeriodDescriptor; - public virtual string ReasonNotTestedDescriptor + public virtual string AssessmentPeriodDescriptor { get { - if (_reasonNotTestedDescriptor == null) - _reasonNotTestedDescriptor = _reasonNotTestedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReasonNotTestedDescriptor", _reasonNotTestedDescriptorId.Value); + if (_assessmentPeriodDescriptor == null) + _assessmentPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentPeriodDescriptor", _assessmentPeriodDescriptorId); - return _reasonNotTestedDescriptor; + return _assessmentPeriodDescriptor; } set { - _reasonNotTestedDescriptor = value; - _reasonNotTestedDescriptorId = default(int?); + _assessmentPeriodDescriptor = value; + _assessmentPeriodDescriptorId = default(int); } } - public virtual long? ReportedSchoolId { get; set; } - public virtual string ReportedSchoolIdentifier { get; set; } - public virtual int? RetestIndicatorDescriptorId + public virtual DateTime? BeginDate { - get - { - if (_retestIndicatorDescriptorId == default(int?)) - _retestIndicatorDescriptorId = string.IsNullOrWhiteSpace(_retestIndicatorDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("RetestIndicatorDescriptor", _retestIndicatorDescriptor); - - return _retestIndicatorDescriptorId; - } - set - { - _retestIndicatorDescriptorId = value; - _retestIndicatorDescriptor = null; + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } } } - private int? _retestIndicatorDescriptorId; - private string _retestIndicatorDescriptor; - - public virtual string RetestIndicatorDescriptor - { - get - { - if (_retestIndicatorDescriptor == null) - _retestIndicatorDescriptor = _retestIndicatorDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("RetestIndicatorDescriptor", _retestIndicatorDescriptorId.Value); - - return _retestIndicatorDescriptor; - } - set - { - _retestIndicatorDescriptor = value; - _retestIndicatorDescriptorId = default(int?); - } - } - public virtual short? SchoolYear { get; set; } - public virtual string SerialNumber { get; set; } - public virtual int? WhenAssessedGradeLevelDescriptorId + private DateTime? _beginDate; + + public virtual DateTime? EndDate { - get - { - if (_whenAssessedGradeLevelDescriptorId == default(int?)) - _whenAssessedGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenAssessedGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenAssessedGradeLevelDescriptor); - - return _whenAssessedGradeLevelDescriptorId; - } - set - { - _whenAssessedGradeLevelDescriptorId = value; - _whenAssessedGradeLevelDescriptor = null; + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } } } - private int? _whenAssessedGradeLevelDescriptorId; - private string _whenAssessedGradeLevelDescriptor; - - public virtual string WhenAssessedGradeLevelDescriptor - { - get - { - if (_whenAssessedGradeLevelDescriptor == null) - _whenAssessedGradeLevelDescriptor = _whenAssessedGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenAssessedGradeLevelDescriptorId.Value); - - return _whenAssessedGradeLevelDescriptor; - } - set - { - _whenAssessedGradeLevelDescriptor = value; - _whenAssessedGradeLevelDescriptorId = default(int?); - } - } + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- - public virtual Entities.NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentPeriod StudentAssessmentPeriod - { - get - { - // Return the item in the list, if one exists - if (StudentAssessmentPeriodPersistentList.Any()) - return StudentAssessmentPeriodPersistentList.First(); - - // No reference is present - return null; - } - set - { - // Delete the existing object - if (StudentAssessmentPeriodPersistentList.Any()) - StudentAssessmentPeriodPersistentList.Clear(); - - // If we're setting a value, add it to the list now - if (value != null) - { - // Set the back-reference to the parent - value.StudentAssessment = this; - - StudentAssessmentPeriodPersistentList.Add(value); - } - } - } - - Entities.Common.EdFi.IStudentAssessmentPeriod Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPeriod - { - get { return StudentAssessmentPeriod; } - set { StudentAssessmentPeriod = (Entities.NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentPeriod) value; } - } - - private ICollection _studentAssessmentPeriodPersistentList; - - public virtual ICollection StudentAssessmentPeriodPersistentList - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentPeriodPersistentList) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentPeriodPersistentList; - } - set - { - _studentAssessmentPeriodPersistentList = value; - } - } - // ------------------------------------------------------------- // ============================================================= @@ -119904,320 +123381,17 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } - - /// - /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IStudentAssessment.AssessmentDiscriminator - { - get { return AssessmentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAssessment.AssessmentResourceId - { - get { return AssessmentReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ReportedSchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the ReportedSchool resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAssessment.ReportedSchoolResourceId - { - get { return ReportedSchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } - - /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAssessment.SchoolYearTypeResourceId - { - get { return SchoolYearTypeReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } - - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IStudentAssessment.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAssessment.StudentResourceId - { - get { return StudentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _studentAssessmentAccommodations; - private ICollection _studentAssessmentAccommodationsCovariant; - public virtual ICollection StudentAssessmentAccommodations - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentAccommodations) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentAccommodations; - } - set - { - _studentAssessmentAccommodations = value; - _studentAssessmentAccommodationsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentAccommodations - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentAccommodations) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentAccommodationsCovariant; - } - set - { - StudentAssessmentAccommodations = new HashSet(value.Cast()); - } - } - - - private ICollection _studentAssessmentItems; - private ICollection _studentAssessmentItemsCovariant; - public virtual ICollection StudentAssessmentItems - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentItems) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentItems; - } - set - { - _studentAssessmentItems = value; - _studentAssessmentItemsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentItems - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentItems) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentItemsCovariant; - } - set - { - StudentAssessmentItems = new HashSet(value.Cast()); - } - } - - - private ICollection _studentAssessmentPerformanceLevels; - private ICollection _studentAssessmentPerformanceLevelsCovariant; - public virtual ICollection StudentAssessmentPerformanceLevels - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentPerformanceLevels) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentPerformanceLevels; - } - set - { - _studentAssessmentPerformanceLevels = value; - _studentAssessmentPerformanceLevelsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPerformanceLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentPerformanceLevels) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentPerformanceLevelsCovariant; - } - set - { - StudentAssessmentPerformanceLevels = new HashSet(value.Cast()); - } - } - - - private ICollection _studentAssessmentScoreResults; - private ICollection _studentAssessmentScoreResultsCovariant; - public virtual ICollection StudentAssessmentScoreResults - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentScoreResults) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentScoreResults; - } - set - { - _studentAssessmentScoreResults = value; - _studentAssessmentScoreResultsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentScoreResults - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentScoreResults) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentScoreResultsCovariant; - } - set - { - StudentAssessmentScoreResults = new HashSet(value.Cast()); - } - } - - - private ICollection _studentAssessmentStudentObjectiveAssessments; - private ICollection _studentAssessmentStudentObjectiveAssessmentsCovariant; - public virtual ICollection StudentAssessmentStudentObjectiveAssessments - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentStudentObjectiveAssessments) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentStudentObjectiveAssessments; - } - set - { - _studentAssessmentStudentObjectiveAssessments = value; - _studentAssessmentStudentObjectiveAssessmentsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentStudentObjectiveAssessments - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _studentAssessmentStudentObjectiveAssessments) - if (item.StudentAssessment == null) - item.StudentAssessment = this; - // ------------------------------------------------------------- - - return _studentAssessmentStudentObjectiveAssessmentsCovariant; - } - set - { - StudentAssessmentStudentObjectiveAssessments = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AdministrationEnvironmentDescriptor", new LookupColumnDetails { PropertyName = "AdministrationEnvironmentDescriptorId", LookupTypeName = "AdministrationEnvironmentDescriptor"} }, - { "AdministrationLanguageDescriptor", new LookupColumnDetails { PropertyName = "AdministrationLanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, - { "EventCircumstanceDescriptor", new LookupColumnDetails { PropertyName = "EventCircumstanceDescriptorId", LookupTypeName = "EventCircumstanceDescriptor"} }, - { "PlatformTypeDescriptor", new LookupColumnDetails { PropertyName = "PlatformTypeDescriptorId", LookupTypeName = "PlatformTypeDescriptor"} }, - { "ReasonNotTestedDescriptor", new LookupColumnDetails { PropertyName = "ReasonNotTestedDescriptorId", LookupTypeName = "ReasonNotTestedDescriptor"} }, - { "RetestIndicatorDescriptor", new LookupColumnDetails { PropertyName = "RetestIndicatorDescriptorId", LookupTypeName = "RetestIndicatorDescriptor"} }, - { "WhenAssessedGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenAssessedGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "AssessmentPeriodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentPeriodDescriptorId", LookupTypeName = "AssessmentPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -120228,14 +123402,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("Namespace", Namespace); - keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); - keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -120299,32 +123469,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessment)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessment) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentPeriod) target, null); } + void IChildEntity.SetParent(object value) + { + StudentAssessment = (StudentAssessment) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentAccommodation table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentAccommodation : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentScoreResult : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentScoreResult, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentAccommodation() + public StudentAssessmentScoreResult() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -120335,59 +123509,94 @@ public StudentAssessmentAccommodation() [DomainSignature, JsonIgnore] public virtual StudentAssessment StudentAssessment { get; set; } - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentAccommodation.StudentAssessment + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentScoreResult.StudentAssessment { get { return StudentAssessment; } set { StudentAssessment = (StudentAssessment) value; } } [DomainSignature] - public virtual int AccommodationDescriptorId + public virtual int AssessmentReportingMethodDescriptorId { get { - if (_accommodationDescriptorId == default(int)) - _accommodationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccommodationDescriptor", _accommodationDescriptor); + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - return _accommodationDescriptorId; + return _assessmentReportingMethodDescriptorId; } set { - _accommodationDescriptorId = value; - _accommodationDescriptor = null; + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; } } - private int _accommodationDescriptorId; - private string _accommodationDescriptor; + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; - public virtual string AccommodationDescriptor + public virtual string AssessmentReportingMethodDescriptor { get { - if (_accommodationDescriptor == null) - _accommodationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccommodationDescriptor", _accommodationDescriptorId); + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string Result { get; set; } + public virtual int ResultDatatypeTypeDescriptorId + { + get + { + if (_resultDatatypeTypeDescriptorId == default(int)) + _resultDatatypeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + + return _resultDatatypeTypeDescriptorId; + } + set + { + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; + } + } + + private int _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; + + public virtual string ResultDatatypeTypeDescriptor + { + get + { + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId); - return _accommodationDescriptor; + return _resultDatatypeTypeDescriptor; } set { - _accommodationDescriptor = value; - _accommodationDescriptorId = default(int); + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int); } } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -120440,7 +123649,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AccommodationDescriptor", new LookupColumnDetails { PropertyName = "AccommodationDescriptorId", LookupTypeName = "AccommodationDescriptor"} }, + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -120455,7 +123665,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); return keyValues; } @@ -120519,12 +123729,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentAccommodation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentScoreResult)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentAccommodation) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentScoreResult) target, null); } void IChildEntity.SetParent(object value) @@ -120536,19 +123746,21 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentItem table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessment table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentItem : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentStudentObjectiveAssessment : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentItem() + public StudentAssessmentStudentObjectiveAssessment() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new HashSet(); + StudentAssessmentStudentObjectiveAssessmentScoreResults = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -120559,7 +123771,7 @@ public StudentAssessmentItem() [DomainSignature, JsonIgnore] public virtual StudentAssessment StudentAssessment { get; set; } - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssessment.StudentAssessment { get { return StudentAssessment; } set { StudentAssessment = (StudentAssessment) value; } @@ -120577,79 +123789,43 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int AssessmentItemResultDescriptorId + public virtual DateTime? AdministrationDate { - get - { - if (_assessmentItemResultDescriptorId == default(int)) - _assessmentItemResultDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentItemResultDescriptor", _assessmentItemResultDescriptor); - - return _assessmentItemResultDescriptorId; - } + get { return _administrationDate; } set { - _assessmentItemResultDescriptorId = value; - _assessmentItemResultDescriptor = null; + // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. + // Note ToUniversal will work differently based on DateTime.Kind + // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime + // Utc - No conversion is performed. + // Local - The current DateTime object is converted to UTC. + // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. + if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) + _administrationDate = value?.ToUniversalTime(); } } - private int _assessmentItemResultDescriptorId; - private string _assessmentItemResultDescriptor; + private DateTime? _administrationDate; - public virtual string AssessmentItemResultDescriptor - { - get - { - if (_assessmentItemResultDescriptor == null) - _assessmentItemResultDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentItemResultDescriptor", _assessmentItemResultDescriptorId); - - return _assessmentItemResultDescriptor; - } - set - { - _assessmentItemResultDescriptor = value; - _assessmentItemResultDescriptorId = default(int); - } - } - public virtual string AssessmentResponse { get; set; } - public virtual string DescriptiveFeedback { get; set; } - public virtual int? ItemNumber { get; set; } - public virtual decimal? RawScoreResult { get; set; } - public virtual int? ResponseIndicatorDescriptorId + public virtual DateTime? AdministrationEndDate { - get - { - if (_responseIndicatorDescriptorId == default(int?)) - _responseIndicatorDescriptorId = string.IsNullOrWhiteSpace(_responseIndicatorDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResponseIndicatorDescriptor", _responseIndicatorDescriptor); - - return _responseIndicatorDescriptorId; - } + get { return _administrationEndDate; } set { - _responseIndicatorDescriptorId = value; - _responseIndicatorDescriptor = null; + // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. + // Note ToUniversal will work differently based on DateTime.Kind + // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime + // Utc - No conversion is performed. + // Local - The current DateTime object is converted to UTC. + // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. + if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) + _administrationEndDate = value?.ToUniversalTime(); } } - private int? _responseIndicatorDescriptorId; - private string _responseIndicatorDescriptor; + private DateTime? _administrationEndDate; - public virtual string ResponseIndicatorDescriptor - { - get - { - if (_responseIndicatorDescriptor == null) - _responseIndicatorDescriptor = _responseIndicatorDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResponseIndicatorDescriptor", _responseIndicatorDescriptorId.Value); - - return _responseIndicatorDescriptor; - } - set - { - _responseIndicatorDescriptor = value; - _responseIndicatorDescriptorId = default(int?); - } - } - public virtual string TimeAssessed { get; set; } + public virtual int? AssessedMinutes { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -120694,23 +123870,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.AssessmentItemAggregate.EdFi.AssessmentItemReferenceData AssessmentItemReferenceData { get; set; } + public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } /// - /// Read-only property that allows the AssessmentItem discriminator value to be mapped to the resource reference. + /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator + string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentDiscriminator { - get { return AssessmentItemReferenceData?.Discriminator; } + get { return ObjectiveAssessmentReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the AssessmentItem resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemResourceId + Guid? Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentResourceId { - get { return AssessmentItemReferenceData?.Id; } + get { return ObjectiveAssessmentReferenceData?.Id; } set { } } @@ -120719,13 +123895,105 @@ string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; + private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; + public virtual ICollection StudentAssessmentStudentObjectiveAssessmentPerformanceLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentStudentObjectiveAssessmentPerformanceLevels) + if (item.StudentAssessmentStudentObjectiveAssessment == null) + item.StudentAssessmentStudentObjectiveAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; + } + set + { + _studentAssessmentStudentObjectiveAssessmentPerformanceLevels = value; + _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentStudentObjectiveAssessmentPerformanceLevels) + if (item.StudentAssessmentStudentObjectiveAssessment == null) + item.StudentAssessmentStudentObjectiveAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; + } + set + { + StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResults; + private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; + public virtual ICollection StudentAssessmentStudentObjectiveAssessmentScoreResults + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentStudentObjectiveAssessmentScoreResults) + if (item.StudentAssessmentStudentObjectiveAssessment == null) + item.StudentAssessmentStudentObjectiveAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentStudentObjectiveAssessmentScoreResults; + } + set + { + _studentAssessmentStudentObjectiveAssessmentScoreResults = value; + _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentScoreResults + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentStudentObjectiveAssessmentScoreResults) + if (item.StudentAssessmentStudentObjectiveAssessment == null) + item.StudentAssessmentStudentObjectiveAssessment = this; + // ------------------------------------------------------------- + + return _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; + } + set + { + StudentAssessmentStudentObjectiveAssessmentScoreResults = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentItemResultDescriptor", new LookupColumnDetails { PropertyName = "AssessmentItemResultDescriptorId", LookupTypeName = "AssessmentItemResultDescriptor"} }, - { "ResponseIndicatorDescriptor", new LookupColumnDetails { PropertyName = "ResponseIndicatorDescriptorId", LookupTypeName = "ResponseIndicatorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -120804,12 +124072,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentItem)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentItem) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment) target, null); } void IChildEntity.SetParent(object value) @@ -120821,19 +124089,19 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentPerformanceLevel() + public StudentAssessmentStudentObjectiveAssessmentPerformanceLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -120842,12 +124110,12 @@ public StudentAssessmentPerformanceLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentAssessment StudentAssessment { get; set; } + public virtual StudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { get; set; } - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPerformanceLevel.StudentAssessment + Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel.StudentAssessmentStudentObjectiveAssessment { - get { return StudentAssessment; } - set { StudentAssessment = (StudentAssessment) value; } + get { return StudentAssessmentStudentObjectiveAssessment; } + set { StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; } } [DomainSignature] @@ -120998,7 +124266,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -121066,36 +124334,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel) target, null); } void IChildEntity.SetParent(object value) { - StudentAssessment = (StudentAssessment) value; + StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentPeriod table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentStudentObjectiveAssessmentScoreResult : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentPeriod() + public StudentAssessmentStudentObjectiveAssessmentScoreResult() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121104,14 +124372,49 @@ public StudentAssessmentPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentAssessment StudentAssessment { get; set; } + public virtual StudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { get; set; } - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPeriod.StudentAssessment + Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentScoreResult.StudentAssessmentStudentObjectiveAssessment { - get { return StudentAssessment; } - set { StudentAssessment = (StudentAssessment) value; } + get { return StudentAssessmentStudentObjectiveAssessment; } + set { StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; } } + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId + { + get + { + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } + } + + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; + + public virtual string AssessmentReportingMethodDescriptor + { + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -121122,78 +124425,41 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPeriod.StudentAssessme // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int AssessmentPeriodDescriptorId + public virtual string Result { get; set; } + public virtual int ResultDatatypeTypeDescriptorId { get { - if (_assessmentPeriodDescriptorId == default(int)) - _assessmentPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentPeriodDescriptor", _assessmentPeriodDescriptor); + if (_resultDatatypeTypeDescriptorId == default(int)) + _resultDatatypeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - return _assessmentPeriodDescriptorId; + return _resultDatatypeTypeDescriptorId; } set { - _assessmentPeriodDescriptorId = value; - _assessmentPeriodDescriptor = null; + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; } } - private int _assessmentPeriodDescriptorId; - private string _assessmentPeriodDescriptor; + private int _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; - public virtual string AssessmentPeriodDescriptor + public virtual string ResultDatatypeTypeDescriptor { get { - if (_assessmentPeriodDescriptor == null) - _assessmentPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentPeriodDescriptor", _assessmentPeriodDescriptorId); + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId); - return _assessmentPeriodDescriptor; + return _resultDatatypeTypeDescriptor; } set { - _assessmentPeriodDescriptor = value; - _assessmentPeriodDescriptorId = default(int); - } - } - public virtual DateTime? BeginDate - { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _beginDate; - - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int); } } - - private DateTime? _endDate; - // ------------------------------------------------------------- // ============================================================= @@ -121248,7 +124514,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentPeriodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentPeriodDescriptorId", LookupTypeName = "AssessmentPeriodDescriptor"} }, + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -121260,9 +124527,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); return keyValues; } @@ -121326,36 +124594,127 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult) target, null); } void IChildEntity.SetParent(object value) { - StudentAssessment = (StudentAssessment) value; + StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; + } + } +} +// Aggregate: StudentAssessmentEducationOrganizationAssociation + +namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentEducationOrganizationAssociationAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class StudentAssessmentEducationOrganizationAssociationReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string AssessmentIdentifier { get; set; } + public virtual int EducationOrganizationAssociationTypeDescriptorId { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual string Namespace { get; set; } + public virtual string StudentAssessmentIdentifier { get; set; } + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("EducationOrganizationAssociationTypeDescriptorId", EducationOrganizationAssociationTypeDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Namespace", Namespace); + keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentEducationOrganizationAssociation table of the StudentAssessmentEducationOrganizationAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentScoreResult : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentScoreResult, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentEducationOrganizationAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentScoreResult() + public StudentAssessmentEducationOrganizationAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121363,97 +124722,111 @@ public StudentAssessmentScoreResult() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual StudentAssessment StudentAssessment { get; set; } - - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentScoreResult.StudentAssessment - { - get { return StudentAssessment; } - set { StudentAssessment = (StudentAssessment) value; } - } - [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual int EducationOrganizationAssociationTypeDescriptorId { get { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + if (_educationOrganizationAssociationTypeDescriptorId == default(int)) + _educationOrganizationAssociationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationAssociationTypeDescriptor", _educationOrganizationAssociationTypeDescriptor); - return _assessmentReportingMethodDescriptorId; + return _educationOrganizationAssociationTypeDescriptorId; } set { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; + _educationOrganizationAssociationTypeDescriptorId = value; + _educationOrganizationAssociationTypeDescriptor = null; } } - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; + private int _educationOrganizationAssociationTypeDescriptorId; + private string _educationOrganizationAssociationTypeDescriptor; - public virtual string AssessmentReportingMethodDescriptor + public virtual string EducationOrganizationAssociationTypeDescriptor { get { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + if (_educationOrganizationAssociationTypeDescriptor == null) + _educationOrganizationAssociationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationAssociationTypeDescriptor", _educationOrganizationAssociationTypeDescriptorId); - return _assessmentReportingMethodDescriptor; + return _educationOrganizationAssociationTypeDescriptor; } set { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); + _educationOrganizationAssociationTypeDescriptor = value; + _educationOrganizationAssociationTypeDescriptorId = default(int); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string Result { get; set; } - public virtual int ResultDatatypeTypeDescriptorId + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual string StudentAssessmentIdentifier { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI { get { - if (_resultDatatypeTypeDescriptorId == default(int)) - _resultDatatypeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - return _resultDatatypeTypeDescriptorId; + return _studentUSI; } set { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); } } - private int _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; + private int _studentUSI; + private string _studentUniqueId; - public virtual string ResultDatatypeTypeDescriptor + public virtual string StudentUniqueId { get { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId); - - return _resultDatatypeTypeDescriptor; + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; } set { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int); + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual short? SchoolYear { get; set; } + // ------------------------------------------------------------- + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -121496,6 +124869,57 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentReferenceData StudentAssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the StudentAssessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentDiscriminator + { + get { return StudentAssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentAssessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentResourceId + { + get { return StudentAssessmentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -121506,8 +124930,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, + { "EducationOrganizationAssociationTypeDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationAssociationTypeDescriptorId", LookupTypeName = "EducationOrganizationAssociationTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -121518,11 +124941,16 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("EducationOrganizationAssociationTypeDescriptorId", EducationOrganizationAssociationTypeDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Namespace", Namespace); + keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -121586,38 +125014,125 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentScoreResult)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentScoreResult) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: StudentAssessmentRegistration + +namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentRegistrationAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class StudentAssessmentRegistrationReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual string AdministrationIdentifier { get; set; } + public virtual string AssessmentIdentifier { get; set; } + public virtual long AssigningEducationOrganizationId { get; set; } + public virtual long EducationOrganizationId { get; set; } + public virtual string Namespace { get; set; } + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - StudentAssessment = (StudentAssessment) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Namespace", Namespace); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessment table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistration table of the StudentAssessmentRegistration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessment : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentRegistration : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentAssessmentRegistration, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentStudentObjectiveAssessment() + public StudentAssessmentRegistration() { - StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new HashSet(); - StudentAssessmentStudentObjectiveAssessmentScoreResults = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + StudentAssessmentRegistrationAssessmentAccommodations = new HashSet(); + StudentAssessmentRegistrationAssessmentCustomizations = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121625,17 +125140,65 @@ public StudentAssessmentStudentObjectiveAssessment() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual StudentAssessment StudentAssessment { get; set; } - - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssessment.StudentAssessment + [DomainSignature] + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual long AssigningEducationOrganizationId { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI { - get { return StudentAssessment; } - set { StudentAssessment = (StudentAssessment) value; } + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } } - [DomainSignature] - public virtual string IdentificationCode { get; set; } + private int _studentUSI; + private string _studentUniqueId; + + public virtual string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -121646,43 +125209,86 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssess // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? AdministrationDate + public virtual int? AssessmentGradeLevelDescriptorId { - get { return _administrationDate; } + get + { + if (_assessmentGradeLevelDescriptorId == default(int?)) + _assessmentGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_assessmentGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _assessmentGradeLevelDescriptor); + + return _assessmentGradeLevelDescriptorId; + } set { - // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. - // Note ToUniversal will work differently based on DateTime.Kind - // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime - // Utc - No conversion is performed. - // Local - The current DateTime object is converted to UTC. - // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. - if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) - _administrationDate = value?.ToUniversalTime(); + _assessmentGradeLevelDescriptorId = value; + _assessmentGradeLevelDescriptor = null; } } - private DateTime? _administrationDate; + private int? _assessmentGradeLevelDescriptorId; + private string _assessmentGradeLevelDescriptor; - public virtual DateTime? AdministrationEndDate + public virtual string AssessmentGradeLevelDescriptor { - get { return _administrationEndDate; } + get + { + if (_assessmentGradeLevelDescriptor == null) + _assessmentGradeLevelDescriptor = _assessmentGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _assessmentGradeLevelDescriptorId.Value); + + return _assessmentGradeLevelDescriptor; + } set { - // This is only stored as a UTC DateTime in the DB and NHibernate will retrieve it back as the (UTC) DateTime.Kind. - // Note ToUniversal will work differently based on DateTime.Kind - // See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.touniversaltime?view=netframework-4.5#System_DateTime_ToUniversalTime - // Utc - No conversion is performed. - // Local - The current DateTime object is converted to UTC. - // Unspecified - The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local. - if (value.HasValue && value.Value != (DateTime)typeof(DateTime).GetDefaultValue()) - _administrationEndDate = value?.ToUniversalTime(); + _assessmentGradeLevelDescriptor = value; + _assessmentGradeLevelDescriptorId = default(int?); } } + public virtual DateTime EntryDate + { + get { return _entryDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _entryDate = new DateTime(value.Year, value.Month, value.Day); } + } - private DateTime? _administrationEndDate; + private DateTime _entryDate; + + public virtual int? PlatformTypeDescriptorId + { + get + { + if (_platformTypeDescriptorId == default(int?)) + _platformTypeDescriptorId = string.IsNullOrWhiteSpace(_platformTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PlatformTypeDescriptor", _platformTypeDescriptor); - public virtual int? AssessedMinutes { get; set; } + return _platformTypeDescriptorId; + } + set + { + _platformTypeDescriptorId = value; + _platformTypeDescriptor = null; + } + } + + private int? _platformTypeDescriptorId; + private string _platformTypeDescriptor; + + public virtual string PlatformTypeDescriptor + { + get + { + if (_platformTypeDescriptor == null) + _platformTypeDescriptor = _platformTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PlatformTypeDescriptor", _platformTypeDescriptorId.Value); + + return _platformTypeDescriptor; + } + set + { + _platformTypeDescriptor = value; + _platformTypeDescriptorId = default(int?); + } + } + public virtual long? ReportingEducationOrganizationId { get; set; } + public virtual long SchoolId { get; set; } + public virtual long? TestingEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -121727,23 +125333,123 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } + public virtual NHibernate.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationReferenceData AssessmentAdministrationReferenceData { get; set; } /// - /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentAdministration discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentDiscriminator + string Entities.Common.EdFi.IStudentAssessmentRegistration.AssessmentAdministrationDiscriminator { - get { return ObjectiveAssessmentReferenceData?.Discriminator; } + get { return AssessmentAdministrationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentAdministration resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentResourceId + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.AssessmentAdministrationResourceId { - get { return ObjectiveAssessmentReferenceData?.Id; } + get { return AssessmentAdministrationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ReportingEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the ReportingEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentRegistration.ReportingEducationOrganizationDiscriminator + { + get { return ReportingEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ReportingEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.ReportingEducationOrganizationResourceId + { + get { return ReportingEducationOrganizationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi.StudentEducationOrganizationAssessmentAccommodationReferenceData StudentEducationOrganizationAssessmentAccommodationReferenceData { get; set; } + + /// + /// Read-only property that allows the StudentEducationOrganizationAssessmentAccommodation discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssessmentAccommodationDiscriminator + { + get { return StudentEducationOrganizationAssessmentAccommodationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentEducationOrganizationAssessmentAccommodation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssessmentAccommodationResourceId + { + get { return StudentEducationOrganizationAssessmentAccommodationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentEducationOrganizationAssociationAggregate.EdFi.StudentEducationOrganizationAssociationReferenceData StudentEducationOrganizationAssociationReferenceData { get; set; } + + /// + /// Read-only property that allows the StudentEducationOrganizationAssociation discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssociationDiscriminator + { + get { return StudentEducationOrganizationAssociationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentEducationOrganizationAssociation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssociationResourceId + { + get { return StudentEducationOrganizationAssociationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentSchoolAssociationAggregate.EdFi.StudentSchoolAssociationReferenceData StudentSchoolAssociationReferenceData { get; set; } + + /// + /// Read-only property that allows the StudentSchoolAssociation discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentSchoolAssociationDiscriminator + { + get { return StudentSchoolAssociationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentSchoolAssociation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.StudentSchoolAssociationResourceId + { + get { return StudentSchoolAssociationReferenceData?.Id; } + set { } + } + + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData TestingEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the TestingEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentAssessmentRegistration.TestingEducationOrganizationDiscriminator + { + get { return TestingEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the TestingEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.TestingEducationOrganizationResourceId + { + get { return TestingEducationOrganizationReferenceData?.Id; } set { } } @@ -121753,9 +125459,9 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Objecti // Collections // ------------------------------------------------------------- - private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; - private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; - public virtual ICollection StudentAssessmentStudentObjectiveAssessmentPerformanceLevels + private ICollection _studentAssessmentRegistrationAssessmentAccommodations; + private ICollection _studentAssessmentRegistrationAssessmentAccommodationsCovariant; + public virtual ICollection StudentAssessmentRegistrationAssessmentAccommodations { get { @@ -121764,45 +125470,45 @@ public virtual ICollection(value); + _studentAssessmentRegistrationAssessmentAccommodations = value; + _studentAssessmentRegistrationAssessmentAccommodationsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels + ICollection Entities.Common.EdFi.IStudentAssessmentRegistration.StudentAssessmentRegistrationAssessmentAccommodations { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _studentAssessmentStudentObjectiveAssessmentPerformanceLevels) - if (item.StudentAssessmentStudentObjectiveAssessment == null) - item.StudentAssessmentStudentObjectiveAssessment = this; + foreach (var item in _studentAssessmentRegistrationAssessmentAccommodations) + if (item.StudentAssessmentRegistration == null) + item.StudentAssessmentRegistration = this; // ------------------------------------------------------------- - return _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; + return _studentAssessmentRegistrationAssessmentAccommodationsCovariant; } set { - StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new HashSet(value.Cast()); + StudentAssessmentRegistrationAssessmentAccommodations = new HashSet(value.Cast()); } } - private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResults; - private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; - public virtual ICollection StudentAssessmentStudentObjectiveAssessmentScoreResults + private ICollection _studentAssessmentRegistrationAssessmentCustomizations; + private ICollection _studentAssessmentRegistrationAssessmentCustomizationsCovariant; + public virtual ICollection StudentAssessmentRegistrationAssessmentCustomizations { get { @@ -121811,38 +125517,38 @@ public virtual ICollection(value); + _studentAssessmentRegistrationAssessmentCustomizations = value; + _studentAssessmentRegistrationAssessmentCustomizationsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentScoreResults + ICollection Entities.Common.EdFi.IStudentAssessmentRegistration.StudentAssessmentRegistrationAssessmentCustomizations { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _studentAssessmentStudentObjectiveAssessmentScoreResults) - if (item.StudentAssessmentStudentObjectiveAssessment == null) - item.StudentAssessmentStudentObjectiveAssessment = this; + foreach (var item in _studentAssessmentRegistrationAssessmentCustomizations) + if (item.StudentAssessmentRegistration == null) + item.StudentAssessmentRegistration = this; // ------------------------------------------------------------- - return _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; + return _studentAssessmentRegistrationAssessmentCustomizationsCovariant; } set { - StudentAssessmentStudentObjectiveAssessmentScoreResults = new HashSet(value.Cast()); + StudentAssessmentRegistrationAssessmentCustomizations = new HashSet(value.Cast()); } } @@ -121851,6 +125557,8 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "AssessmentGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "PlatformTypeDescriptor", new LookupColumnDetails { PropertyName = "PlatformTypeDescriptorId", LookupTypeName = "PlatformTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -121861,11 +125569,16 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Namespace", Namespace); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -121929,36 +125642,32 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentRegistration)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentRegistration) target, null); } - void IChildEntity.SetParent(object value) - { - StudentAssessment = (StudentAssessment) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistrationAssessmentAccommodation table of the StudentAssessmentRegistration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentRegistrationAssessmentAccommodation : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentStudentObjectiveAssessmentPerformanceLevel() + public StudentAssessmentRegistrationAssessmentAccommodation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121967,82 +125676,47 @@ public StudentAssessmentStudentObjectiveAssessmentPerformanceLevel() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { get; set; } + public virtual StudentAssessmentRegistration StudentAssessmentRegistration { get; set; } - Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel.StudentAssessmentStudentObjectiveAssessment + Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrationAssessmentAccommodation.StudentAssessmentRegistration { - get { return StudentAssessmentStudentObjectiveAssessment; } - set { StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; } + get { return StudentAssessmentRegistration; } + set { StudentAssessmentRegistration = (StudentAssessmentRegistration) value; } } [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId - { - get - { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - - return _assessmentReportingMethodDescriptorId; - } - set - { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; - } - } - - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; - - public virtual string AssessmentReportingMethodDescriptor - { - get - { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); - - return _assessmentReportingMethodDescriptor; - } - set - { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); - } - } - [DomainSignature] - public virtual int PerformanceLevelDescriptorId + public virtual int AccommodationDescriptorId { get { - if (_performanceLevelDescriptorId == default(int)) - _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); + if (_accommodationDescriptorId == default(int)) + _accommodationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccommodationDescriptor", _accommodationDescriptor); - return _performanceLevelDescriptorId; + return _accommodationDescriptorId; } set { - _performanceLevelDescriptorId = value; - _performanceLevelDescriptor = null; + _accommodationDescriptorId = value; + _accommodationDescriptor = null; } } - private int _performanceLevelDescriptorId; - private string _performanceLevelDescriptor; + private int _accommodationDescriptorId; + private string _accommodationDescriptor; - public virtual string PerformanceLevelDescriptor + public virtual string AccommodationDescriptor { get { - if (_performanceLevelDescriptor == null) - _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); + if (_accommodationDescriptor == null) + _accommodationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccommodationDescriptor", _accommodationDescriptorId); - return _performanceLevelDescriptor; + return _accommodationDescriptor; } set { - _performanceLevelDescriptor = value; - _performanceLevelDescriptorId = default(int); + _accommodationDescriptor = value; + _accommodationDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -122055,7 +125729,6 @@ public virtual string PerformanceLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -122110,8 +125783,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, + { "AccommodationDescriptor", new LookupColumnDetails { PropertyName = "AccommodationDescriptorId", LookupTypeName = "AccommodationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -122123,11 +125795,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentRegistration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); - keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); + keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); return keyValues; } @@ -122191,36 +125862,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation) target, null); } void IChildEntity.SetParent(object value) { - StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; + StudentAssessmentRegistration = (StudentAssessmentRegistration) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistrationAssessmentCustomization table of the StudentAssessmentRegistration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentScoreResult : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentRegistrationAssessmentCustomization : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentStudentObjectiveAssessmentScoreResult() + public StudentAssessmentRegistrationAssessmentCustomization() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -122229,49 +125900,16 @@ public StudentAssessmentStudentObjectiveAssessmentScoreResult() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { get; set; } + public virtual StudentAssessmentRegistration StudentAssessmentRegistration { get; set; } - Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentScoreResult.StudentAssessmentStudentObjectiveAssessment + Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrationAssessmentCustomization.StudentAssessmentRegistration { - get { return StudentAssessmentStudentObjectiveAssessment; } - set { StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; } + get { return StudentAssessmentRegistration; } + set { StudentAssessmentRegistration = (StudentAssessmentRegistration) value; } } [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId - { - get - { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - - return _assessmentReportingMethodDescriptorId; - } - set - { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; - } - } - - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; - - public virtual string AssessmentReportingMethodDescriptor - { - get - { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); - - return _assessmentReportingMethodDescriptor; - } - set - { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); - } - } + public virtual string CustomizationKey { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -122282,41 +125920,7 @@ public virtual string AssessmentReportingMethodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string Result { get; set; } - public virtual int ResultDatatypeTypeDescriptorId - { - get - { - if (_resultDatatypeTypeDescriptorId == default(int)) - _resultDatatypeTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - - return _resultDatatypeTypeDescriptorId; - } - set - { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; - } - } - - private int _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; - - public virtual string ResultDatatypeTypeDescriptor - { - get - { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId); - - return _resultDatatypeTypeDescriptor; - } - set - { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int); - } - } + public virtual string CustomizationValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -122371,8 +125975,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -122384,10 +125986,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentRegistration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("CustomizationKey", CustomizationKey); return keyValues; } @@ -122451,37 +126053,38 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization) target, null); } void IChildEntity.SetParent(object value) { - StudentAssessmentStudentObjectiveAssessment = (StudentAssessmentStudentObjectiveAssessment) value; + StudentAssessmentRegistration = (StudentAssessmentRegistration) value; } } } -// Aggregate: StudentAssessmentEducationOrganizationAssociation +// Aggregate: StudentAssessmentRegistrationBatteryPartAssociation -namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentEducationOrganizationAssociationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentRegistrationBatteryPartAssociationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class StudentAssessmentEducationOrganizationAssociationReferenceData : IHasPrimaryKeyValues + public class StudentAssessmentRegistrationBatteryPartAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + public virtual string AdministrationIdentifier { get; set; } + public virtual string AssessmentBatteryPartName { get; set; } public virtual string AssessmentIdentifier { get; set; } - public virtual int EducationOrganizationAssociationTypeDescriptorId { get; set; } + public virtual long AssigningEducationOrganizationId { get; set; } public virtual long EducationOrganizationId { get; set; } public virtual string Namespace { get; set; } - public virtual string StudentAssessmentIdentifier { get; set; } public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- @@ -122503,11 +126106,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("EducationOrganizationAssociationTypeDescriptorId", EducationOrganizationAssociationTypeDescriptorId); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("Namespace", Namespace); - keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); keyValues.Add("StudentUSI", StudentUSI); return keyValues; @@ -122559,19 +126163,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentAssessmentEducationOrganizationAssociation table of the StudentAssessmentEducationOrganizationAssociation aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistrationBatteryPartAssociation table of the StudentAssessmentRegistrationBatteryPartAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentAssessmentEducationOrganizationAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentAssessmentRegistrationBatteryPartAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentAssessmentEducationOrganizationAssociation() + public StudentAssessmentRegistrationBatteryPartAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + StudentAssessmentRegistrationBatteryPartAssociationAccommodations = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -122580,48 +126185,17 @@ public StudentAssessmentEducationOrganizationAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] + public virtual string AssessmentBatteryPartName { get; set; } + [DomainSignature] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] - public virtual int EducationOrganizationAssociationTypeDescriptorId - { - get - { - if (_educationOrganizationAssociationTypeDescriptorId == default(int)) - _educationOrganizationAssociationTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationAssociationTypeDescriptor", _educationOrganizationAssociationTypeDescriptor); - - return _educationOrganizationAssociationTypeDescriptorId; - } - set - { - _educationOrganizationAssociationTypeDescriptorId = value; - _educationOrganizationAssociationTypeDescriptor = null; - } - } - - private int _educationOrganizationAssociationTypeDescriptorId; - private string _educationOrganizationAssociationTypeDescriptor; - - public virtual string EducationOrganizationAssociationTypeDescriptor - { - get - { - if (_educationOrganizationAssociationTypeDescriptor == null) - _educationOrganizationAssociationTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationAssociationTypeDescriptor", _educationOrganizationAssociationTypeDescriptorId); - - return _educationOrganizationAssociationTypeDescriptor; - } - set - { - _educationOrganizationAssociationTypeDescriptor = value; - _educationOrganizationAssociationTypeDescriptorId = default(int); - } - } + public virtual long AssigningEducationOrganizationId { get; set; } [DomainSignature] public virtual long EducationOrganizationId { get; set; } [DomainSignature] public virtual string Namespace { get; set; } - [DomainSignature] - public virtual string StudentAssessmentIdentifier { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] public virtual int StudentUSI { @@ -122681,7 +126255,6 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- - public virtual short? SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -122726,54 +126299,43 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + public virtual NHibernate.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartReferenceData AssessmentBatteryPartReferenceData { get; set; } /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentBatteryPart discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AssessmentBatteryPartDiscriminator { - get { return EducationOrganizationReferenceData?.Discriminator; } + get { return AssessmentBatteryPartReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentBatteryPart resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AssessmentBatteryPartResourceId { - get { return EducationOrganizationReferenceData?.Id; } + get { return AssessmentBatteryPartReferenceData?.Id; } set { } } - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + public virtual NHibernate.StudentAssessmentRegistrationAggregate.EdFi.StudentAssessmentRegistrationReferenceData StudentAssessmentRegistrationReferenceData { get; set; } /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the StudentAssessmentRegistration discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.SchoolYearTypeResourceId + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.StudentAssessmentRegistrationDiscriminator { - get { return SchoolYearTypeReferenceData?.Id; } + get { return StudentAssessmentRegistrationReferenceData?.Discriminator; } set { } } - public virtual NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentReferenceData StudentAssessmentReferenceData { get; set; } - /// - /// Read-only property that allows the StudentAssessment discriminator value to be mapped to the resource reference. + /// Read-only property that allows the StudentAssessmentRegistration resource identifier value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentDiscriminator + Guid? Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.StudentAssessmentRegistrationResourceId { - get { return StudentAssessmentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the StudentAssessment resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentResourceId - { - get { return StudentAssessmentReferenceData?.Id; } + get { return StudentAssessmentRegistrationReferenceData?.Id; } set { } } @@ -122782,12 +126344,58 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.S //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _studentAssessmentRegistrationBatteryPartAssociationAccommodations; + private ICollection _studentAssessmentRegistrationBatteryPartAssociationAccommodationsCovariant; + public virtual ICollection StudentAssessmentRegistrationBatteryPartAssociationAccommodations + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentRegistrationBatteryPartAssociationAccommodations) + if (item.StudentAssessmentRegistrationBatteryPartAssociation == null) + item.StudentAssessmentRegistrationBatteryPartAssociation = this; + // ------------------------------------------------------------- + + return _studentAssessmentRegistrationBatteryPartAssociationAccommodations; + } + set + { + _studentAssessmentRegistrationBatteryPartAssociationAccommodations = value; + _studentAssessmentRegistrationBatteryPartAssociationAccommodationsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.StudentAssessmentRegistrationBatteryPartAssociationAccommodations + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentAssessmentRegistrationBatteryPartAssociationAccommodations) + if (item.StudentAssessmentRegistrationBatteryPartAssociation == null) + item.StudentAssessmentRegistrationBatteryPartAssociation = this; + // ------------------------------------------------------------- + + return _studentAssessmentRegistrationBatteryPartAssociationAccommodationsCovariant; + } + set + { + StudentAssessmentRegistrationBatteryPartAssociationAccommodations = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EducationOrganizationAssociationTypeDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationAssociationTypeDescriptorId", LookupTypeName = "EducationOrganizationAssociationTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -122802,11 +126410,12 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("EducationOrganizationAssociationTypeDescriptorId", EducationOrganizationAssociationTypeDescriptorId); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("Namespace", Namespace); - keyValues.Add("StudentAssessmentIdentifier", StudentAssessmentIdentifier); keyValues.Add("StudentUSI", StudentUSI); return keyValues; @@ -122871,14 +126480,238 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentAssessmentRegistrationBatteryPartAssociationAccommodation table of the StudentAssessmentRegistrationBatteryPartAssociation aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationAccommodation : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public StudentAssessmentRegistrationBatteryPartAssociationAccommodation() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual StudentAssessmentRegistrationBatteryPartAssociation StudentAssessmentRegistrationBatteryPartAssociation { get; set; } + + Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation IStudentAssessmentRegistrationBatteryPartAssociationAccommodation.StudentAssessmentRegistrationBatteryPartAssociation + { + get { return StudentAssessmentRegistrationBatteryPartAssociation; } + set { StudentAssessmentRegistrationBatteryPartAssociation = (StudentAssessmentRegistrationBatteryPartAssociation) value; } + } + + [DomainSignature] + public virtual int AccommodationDescriptorId + { + get + { + if (_accommodationDescriptorId == default(int)) + _accommodationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccommodationDescriptor", _accommodationDescriptor); + + return _accommodationDescriptorId; + } + set + { + _accommodationDescriptorId = value; + _accommodationDescriptor = null; + } + } + + private int _accommodationDescriptorId; + private string _accommodationDescriptor; + + public virtual string AccommodationDescriptor + { + get + { + if (_accommodationDescriptor == null) + _accommodationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccommodationDescriptor", _accommodationDescriptorId); + + return _accommodationDescriptor; + } + set + { + _accommodationDescriptor = value; + _accommodationDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } } + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "AccommodationDescriptor", new LookupColumnDetails { PropertyName = "AccommodationDescriptorId", LookupTypeName = "AccommodationDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (StudentAssessmentRegistrationBatteryPartAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation) target, null); + } + + void IChildEntity.SetParent(object value) + { + StudentAssessmentRegistrationBatteryPartAssociation = (StudentAssessmentRegistrationBatteryPartAssociation) value; + } } } // Aggregate: StudentCharacteristicDescriptor @@ -125623,12 +129456,720 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentCTEProgramAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentCTEProgramAssociation)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudentCTEProgramAssociation) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentCTEProgramAssociationCTEProgramService table of the StudentCTEProgramAssociation aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentCTEProgramAssociationCTEProgramService : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public StudentCTEProgramAssociationCTEProgramService() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual StudentCTEProgramAssociation StudentCTEProgramAssociation { get; set; } + + Entities.Common.EdFi.IStudentCTEProgramAssociation IStudentCTEProgramAssociationCTEProgramService.StudentCTEProgramAssociation + { + get { return StudentCTEProgramAssociation; } + set { StudentCTEProgramAssociation = (StudentCTEProgramAssociation) value; } + } + + [DomainSignature] + public virtual int CTEProgramServiceDescriptorId + { + get + { + if (_cteProgramServiceDescriptorId == default(int)) + _cteProgramServiceDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CTEProgramServiceDescriptor", _cteProgramServiceDescriptor); + + return _cteProgramServiceDescriptorId; + } + set + { + _cteProgramServiceDescriptorId = value; + _cteProgramServiceDescriptor = null; + } + } + + private int _cteProgramServiceDescriptorId; + private string _cteProgramServiceDescriptor; + + public virtual string CTEProgramServiceDescriptor + { + get + { + if (_cteProgramServiceDescriptor == null) + _cteProgramServiceDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CTEProgramServiceDescriptor", _cteProgramServiceDescriptorId); + + return _cteProgramServiceDescriptor; + } + set + { + _cteProgramServiceDescriptor = value; + _cteProgramServiceDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string CIPCode { get; set; } + public virtual bool? PrimaryIndicator { get; set; } + public virtual DateTime? ServiceBeginDate + { + get { return _serviceBeginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _serviceBeginDate = null; + } else + { + var given = (DateTime) value; + _serviceBeginDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _serviceBeginDate; + + public virtual DateTime? ServiceEndDate + { + get { return _serviceEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _serviceEndDate = null; + } else + { + var given = (DateTime) value; + _serviceEndDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _serviceEndDate; + + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "CTEProgramServiceDescriptor", new LookupColumnDetails { PropertyName = "CTEProgramServiceDescriptorId", LookupTypeName = "CTEProgramServiceDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (StudentCTEProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("CTEProgramServiceDescriptorId", CTEProgramServiceDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService) target, null); + } + + void IChildEntity.SetParent(object value) + { + StudentCTEProgramAssociation = (StudentCTEProgramAssociation) value; + } + } +} +// Aggregate: StudentDisciplineIncidentBehaviorAssociation + +namespace EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentBehaviorAssociationAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + public class StudentDisciplineIncidentBehaviorAssociationReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + public virtual int BehaviorDescriptorId { get; set; } + public virtual string IncidentIdentifier { get; set; } + public virtual long SchoolId { get; set; } + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociation table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentDisciplineIncidentBehaviorAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public StudentDisciplineIncidentBehaviorAssociation() + { + StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int BehaviorDescriptorId + { + get + { + if (_behaviorDescriptorId == default(int)) + _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); + + return _behaviorDescriptorId; + } + set + { + _behaviorDescriptorId = value; + _behaviorDescriptor = null; + } + } + + private int _behaviorDescriptorId; + private string _behaviorDescriptor; + + public virtual string BehaviorDescriptor + { + get + { + if (_behaviorDescriptor == null) + _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); + + return _behaviorDescriptor; + } + set + { + _behaviorDescriptor = value; + _behaviorDescriptorId = default(int); + } + } + [DomainSignature] + public virtual string IncidentIdentifier { get; set; } + [DomainSignature] + public virtual long SchoolId { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + public virtual int StudentUSI + { + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } + + private int _studentUSI; + private string _studentUniqueId; + + public virtual string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string BehaviorDetailedDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } + + /// + /// Read-only property that allows the DisciplineIncident discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.DisciplineIncidentDiscriminator + { + get { return DisciplineIncidentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the DisciplineIncident resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.DisciplineIncidentResourceId + { + get { return DisciplineIncidentReferenceData?.Id; } + set { } + } + + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentResourceId + { + get { return StudentReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; + private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; + public virtual ICollection StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes) + if (item.StudentDisciplineIncidentBehaviorAssociation == null) + item.StudentDisciplineIncidentBehaviorAssociation = this; + // ------------------------------------------------------------- + + return _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; + } + set + { + _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = value; + _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes) + if (item.StudentDisciplineIncidentBehaviorAssociation == null) + item.StudentDisciplineIncidentBehaviorAssociation = this; + // ------------------------------------------------------------- + + return _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; + } + set + { + StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentCTEProgramAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation) target, null); } } @@ -125636,19 +130177,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentCTEProgramAssociationCTEProgramService table of the StudentCTEProgramAssociation aggregate in the ODS database. + /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentCTEProgramAssociationCTEProgramService : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentCTEProgramAssociationCTEProgramService() + public StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -125657,47 +130198,47 @@ public StudentCTEProgramAssociationCTEProgramService() // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentCTEProgramAssociation StudentCTEProgramAssociation { get; set; } + public virtual StudentDisciplineIncidentBehaviorAssociation StudentDisciplineIncidentBehaviorAssociation { get; set; } - Entities.Common.EdFi.IStudentCTEProgramAssociation IStudentCTEProgramAssociationCTEProgramService.StudentCTEProgramAssociation + Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentBehaviorAssociation { - get { return StudentCTEProgramAssociation; } - set { StudentCTEProgramAssociation = (StudentCTEProgramAssociation) value; } + get { return StudentDisciplineIncidentBehaviorAssociation; } + set { StudentDisciplineIncidentBehaviorAssociation = (StudentDisciplineIncidentBehaviorAssociation) value; } } [DomainSignature] - public virtual int CTEProgramServiceDescriptorId + public virtual int DisciplineIncidentParticipationCodeDescriptorId { get { - if (_cteProgramServiceDescriptorId == default(int)) - _cteProgramServiceDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CTEProgramServiceDescriptor", _cteProgramServiceDescriptor); + if (_disciplineIncidentParticipationCodeDescriptorId == default(int)) + _disciplineIncidentParticipationCodeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptor); - return _cteProgramServiceDescriptorId; + return _disciplineIncidentParticipationCodeDescriptorId; } set { - _cteProgramServiceDescriptorId = value; - _cteProgramServiceDescriptor = null; + _disciplineIncidentParticipationCodeDescriptorId = value; + _disciplineIncidentParticipationCodeDescriptor = null; } } - private int _cteProgramServiceDescriptorId; - private string _cteProgramServiceDescriptor; + private int _disciplineIncidentParticipationCodeDescriptorId; + private string _disciplineIncidentParticipationCodeDescriptor; - public virtual string CTEProgramServiceDescriptor + public virtual string DisciplineIncidentParticipationCodeDescriptor { get { - if (_cteProgramServiceDescriptor == null) - _cteProgramServiceDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CTEProgramServiceDescriptor", _cteProgramServiceDescriptorId); + if (_disciplineIncidentParticipationCodeDescriptor == null) + _disciplineIncidentParticipationCodeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptorId); - return _cteProgramServiceDescriptor; + return _disciplineIncidentParticipationCodeDescriptor; } set { - _cteProgramServiceDescriptor = value; - _cteProgramServiceDescriptorId = default(int); + _disciplineIncidentParticipationCodeDescriptor = value; + _disciplineIncidentParticipationCodeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -125710,46 +130251,6 @@ public virtual string CTEProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CIPCode { get; set; } - public virtual bool? PrimaryIndicator { get; set; } - public virtual DateTime? ServiceBeginDate - { - get { return _serviceBeginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _serviceBeginDate = null; - } else - { - var given = (DateTime) value; - _serviceBeginDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _serviceBeginDate; - - public virtual DateTime? ServiceEndDate - { - get { return _serviceEndDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _serviceEndDate = null; - } else - { - var given = (DateTime) value; - _serviceEndDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _serviceEndDate; - // ------------------------------------------------------------- // ============================================================= @@ -125804,8 +130305,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CTEProgramServiceDescriptor", new LookupColumnDetails { PropertyName = "CTEProgramServiceDescriptorId", LookupTypeName = "CTEProgramServiceDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, + { "DisciplineIncidentParticipationCodeDescriptor", new LookupColumnDetails { PropertyName = "DisciplineIncidentParticipationCodeDescriptorId", LookupTypeName = "DisciplineIncidentParticipationCodeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -125817,10 +130318,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentCTEProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentDisciplineIncidentBehaviorAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("CTEProgramServiceDescriptorId", CTEProgramServiceDescriptorId); + keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); return keyValues; } @@ -125884,33 +130385,32 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService) target, null); + this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode) target, null); } void IChildEntity.SetParent(object value) { - StudentCTEProgramAssociation = (StudentCTEProgramAssociation) value; + StudentDisciplineIncidentBehaviorAssociation = (StudentDisciplineIncidentBehaviorAssociation) value; } } } -// Aggregate: StudentDisciplineIncidentBehaviorAssociation +// Aggregate: StudentDisciplineIncidentNonOffenderAssociation -namespace EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentBehaviorAssociationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentNonOffenderAssociationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class StudentDisciplineIncidentBehaviorAssociationReferenceData : IHasPrimaryKeyValues + public class StudentDisciplineIncidentNonOffenderAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int BehaviorDescriptorId { get; set; } public virtual string IncidentIdentifier { get; set; } public virtual long SchoolId { get; set; } public virtual int StudentUSI { get; set; } @@ -125934,7 +130434,6 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); keyValues.Add("IncidentIdentifier", IncidentIdentifier); keyValues.Add("SchoolId", SchoolId); keyValues.Add("StudentUSI", StudentUSI); @@ -125988,20 +130487,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociation table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS database. + /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociation table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentBehaviorAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentDisciplineIncidentNonOffenderAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentDisciplineIncidentBehaviorAssociation() + public StudentDisciplineIncidentNonOffenderAssociation() { - StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126010,41 +130509,6 @@ public StudentDisciplineIncidentBehaviorAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int BehaviorDescriptorId - { - get - { - if (_behaviorDescriptorId == default(int)) - _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); - - return _behaviorDescriptorId; - } - set - { - _behaviorDescriptorId = value; - _behaviorDescriptor = null; - } - } - - private int _behaviorDescriptorId; - private string _behaviorDescriptor; - - public virtual string BehaviorDescriptor - { - get - { - if (_behaviorDescriptor == null) - _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); - - return _behaviorDescriptor; - } - set - { - _behaviorDescriptor = value; - _behaviorDescriptorId = default(int); - } - } - [DomainSignature] public virtual string IncidentIdentifier { get; set; } [DomainSignature] public virtual long SchoolId { get; set; } @@ -126107,7 +130571,6 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -126157,7 +130620,7 @@ public IDictionary Extensions /// /// Read-only property that allows the DisciplineIncident discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.DisciplineIncidentDiscriminator + string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.DisciplineIncidentDiscriminator { get { return DisciplineIncidentReferenceData?.Discriminator; } set { } @@ -126166,7 +130629,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Discip /// /// Read-only property that allows the DisciplineIncident resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.DisciplineIncidentResourceId + Guid? Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.DisciplineIncidentResourceId { get { return DisciplineIncidentReferenceData?.Id; } set { } @@ -126177,7 +130640,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Discip /// /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentDiscriminator + string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentDiscriminator { get { return StudentReferenceData?.Discriminator; } set { } @@ -126186,7 +130649,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Studen /// /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentResourceId + Guid? Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentResourceId { get { return StudentReferenceData?.Id; } set { } @@ -126198,9 +130661,9 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Studen // Collections // ------------------------------------------------------------- - private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; - private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; - public virtual ICollection StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes + private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes; + private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; + public virtual ICollection StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes { get { @@ -126209,38 +130672,38 @@ public virtual ICollection(value); + _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = value; + _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes + ICollection Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes) - if (item.StudentDisciplineIncidentBehaviorAssociation == null) - item.StudentDisciplineIncidentBehaviorAssociation = this; + foreach (var item in _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes) + if (item.StudentDisciplineIncidentNonOffenderAssociation == null) + item.StudentDisciplineIncidentNonOffenderAssociation = this; // ------------------------------------------------------------- - return _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; + return _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; } set { - StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new HashSet(value.Cast()); + StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new HashSet(value.Cast()); } } @@ -126249,7 +130712,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -126264,7 +130726,6 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); keyValues.Add("IncidentIdentifier", IncidentIdentifier); keyValues.Add("SchoolId", SchoolId); keyValues.Add("StudentUSI", StudentUSI); @@ -126331,12 +130792,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation) target, null); } } @@ -126344,19 +130805,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS database. + /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode() + public StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126365,12 +130826,12 @@ public StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipati // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentDisciplineIncidentBehaviorAssociation StudentDisciplineIncidentBehaviorAssociation { get; set; } + public virtual StudentDisciplineIncidentNonOffenderAssociation StudentDisciplineIncidentNonOffenderAssociation { get; set; } - Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentBehaviorAssociation + Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentNonOffenderAssociation { - get { return StudentDisciplineIncidentBehaviorAssociation; } - set { StudentDisciplineIncidentBehaviorAssociation = (StudentDisciplineIncidentBehaviorAssociation) value; } + get { return StudentDisciplineIncidentNonOffenderAssociation; } + set { StudentDisciplineIncidentNonOffenderAssociation = (StudentDisciplineIncidentNonOffenderAssociation) value; } } [DomainSignature] @@ -126472,7 +130933,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, { "DisciplineIncidentParticipationCodeDescriptor", new LookupColumnDetails { PropertyName = "DisciplineIncidentParticipationCodeDescriptorId", LookupTypeName = "DisciplineIncidentParticipationCodeDescriptor"} }, }; @@ -126485,7 +130945,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentDisciplineIncidentBehaviorAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentDisciplineIncidentNonOffenderAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); @@ -126552,34 +131012,33 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode) target, null); + this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode) target, null); } void IChildEntity.SetParent(object value) { - StudentDisciplineIncidentBehaviorAssociation = (StudentDisciplineIncidentBehaviorAssociation) value; + StudentDisciplineIncidentNonOffenderAssociation = (StudentDisciplineIncidentNonOffenderAssociation) value; } } } -// Aggregate: StudentDisciplineIncidentNonOffenderAssociation +// Aggregate: StudentEducationOrganizationAssessmentAccommodation -namespace EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentNonOffenderAssociationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class StudentDisciplineIncidentNonOffenderAssociationReferenceData : IHasPrimaryKeyValues + public class StudentEducationOrganizationAssessmentAccommodationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string IncidentIdentifier { get; set; } - public virtual long SchoolId { get; set; } + public virtual long EducationOrganizationId { get; set; } public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- @@ -126601,8 +131060,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("StudentUSI", StudentUSI); return keyValues; @@ -126654,20 +131112,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociation table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS database. + /// A class which represents the edfi.StudentEducationOrganizationAssessmentAccommodation table of the StudentEducationOrganizationAssessmentAccommodation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentNonOffenderAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentEducationOrganizationAssessmentAccommodation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentDisciplineIncidentNonOffenderAssociation() + public StudentEducationOrganizationAssessmentAccommodation() { - StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations = new HashSet(); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126676,9 +131134,7 @@ public StudentDisciplineIncidentNonOffenderAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string IncidentIdentifier { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } + public virtual long EducationOrganizationId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] public virtual int StudentUSI { @@ -126782,23 +131238,23 @@ public IDictionary Extensions // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the DisciplineIncident discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.DisciplineIncidentDiscriminator + string Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.EducationOrganizationDiscriminator { - get { return DisciplineIncidentReferenceData?.Discriminator; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the DisciplineIncident resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.DisciplineIncidentResourceId + Guid? Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.EducationOrganizationResourceId { - get { return DisciplineIncidentReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Id; } set { } } @@ -126807,7 +131263,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Dis /// /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentDiscriminator + string Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.StudentDiscriminator { get { return StudentReferenceData?.Discriminator; } set { } @@ -126816,7 +131272,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Stu /// /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentResourceId + Guid? Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.StudentResourceId { get { return StudentReferenceData?.Id; } set { } @@ -126828,9 +131284,9 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Stu // Collections // ------------------------------------------------------------- - private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes; - private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; - public virtual ICollection StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes + private ICollection _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations; + private ICollection _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsCovariant; + public virtual ICollection StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { get { @@ -126839,38 +131295,38 @@ public virtual ICollection(value); + _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations = value; + _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes + ICollection Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes) - if (item.StudentDisciplineIncidentNonOffenderAssociation == null) - item.StudentDisciplineIncidentNonOffenderAssociation = this; + foreach (var item in _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations) + if (item.StudentEducationOrganizationAssessmentAccommodation == null) + item.StudentEducationOrganizationAssessmentAccommodation = this; // ------------------------------------------------------------- - return _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; + return _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsCovariant; } set { - StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new HashSet(value.Cast()); + StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations = new HashSet(value.Cast()); } } @@ -126893,8 +131349,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); keyValues.Add("StudentUSI", StudentUSI); return keyValues; @@ -126959,12 +131414,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation) target, null); } } @@ -126972,19 +131427,19 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS database. + /// A class which represents the edfi.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation table of the StudentEducationOrganizationAssessmentAccommodation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + public class StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode() + public StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126993,47 +131448,47 @@ public StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticip // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore] - public virtual StudentDisciplineIncidentNonOffenderAssociation StudentDisciplineIncidentNonOffenderAssociation { get; set; } + public virtual StudentEducationOrganizationAssessmentAccommodation StudentEducationOrganizationAssessmentAccommodation { get; set; } - Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentNonOffenderAssociation + Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation.StudentEducationOrganizationAssessmentAccommodation { - get { return StudentDisciplineIncidentNonOffenderAssociation; } - set { StudentDisciplineIncidentNonOffenderAssociation = (StudentDisciplineIncidentNonOffenderAssociation) value; } + get { return StudentEducationOrganizationAssessmentAccommodation; } + set { StudentEducationOrganizationAssessmentAccommodation = (StudentEducationOrganizationAssessmentAccommodation) value; } } [DomainSignature] - public virtual int DisciplineIncidentParticipationCodeDescriptorId + public virtual int AccommodationDescriptorId { get { - if (_disciplineIncidentParticipationCodeDescriptorId == default(int)) - _disciplineIncidentParticipationCodeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptor); + if (_accommodationDescriptorId == default(int)) + _accommodationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccommodationDescriptor", _accommodationDescriptor); - return _disciplineIncidentParticipationCodeDescriptorId; + return _accommodationDescriptorId; } set { - _disciplineIncidentParticipationCodeDescriptorId = value; - _disciplineIncidentParticipationCodeDescriptor = null; + _accommodationDescriptorId = value; + _accommodationDescriptor = null; } } - private int _disciplineIncidentParticipationCodeDescriptorId; - private string _disciplineIncidentParticipationCodeDescriptor; + private int _accommodationDescriptorId; + private string _accommodationDescriptor; - public virtual string DisciplineIncidentParticipationCodeDescriptor + public virtual string AccommodationDescriptor { get { - if (_disciplineIncidentParticipationCodeDescriptor == null) - _disciplineIncidentParticipationCodeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptorId); + if (_accommodationDescriptor == null) + _accommodationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccommodationDescriptor", _accommodationDescriptorId); - return _disciplineIncidentParticipationCodeDescriptor; + return _accommodationDescriptor; } set { - _disciplineIncidentParticipationCodeDescriptor = value; - _disciplineIncidentParticipationCodeDescriptorId = default(int); + _accommodationDescriptor = value; + _accommodationDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -127100,7 +131555,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DisciplineIncidentParticipationCodeDescriptor", new LookupColumnDetails { PropertyName = "DisciplineIncidentParticipationCodeDescriptorId", LookupTypeName = "DisciplineIncidentParticipationCodeDescriptor"} }, + { "AccommodationDescriptor", new LookupColumnDetails { PropertyName = "AccommodationDescriptorId", LookupTypeName = "AccommodationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -127112,10 +131567,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentDisciplineIncidentNonOffenderAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssessmentAccommodation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); // Add current key values - keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); + keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); return keyValues; } @@ -127179,17 +131634,17 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode) target, null); + this.MapTo((Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation) target, null); } void IChildEntity.SetParent(object value) { - StudentDisciplineIncidentNonOffenderAssociation = (StudentDisciplineIncidentNonOffenderAssociation) value; + StudentEducationOrganizationAssessmentAccommodation = (StudentEducationOrganizationAssessmentAccommodation) value; } } } @@ -144862,279 +149317,646 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService table of the StudentSchoolFoodServiceProgramAssociation aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore] + public virtual StudentSchoolFoodServiceProgramAssociation StudentSchoolFoodServiceProgramAssociation { get; set; } + + Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService.StudentSchoolFoodServiceProgramAssociation + { + get { return StudentSchoolFoodServiceProgramAssociation; } + set { StudentSchoolFoodServiceProgramAssociation = (StudentSchoolFoodServiceProgramAssociation) value; } + } + + [DomainSignature] + public virtual int SchoolFoodServiceProgramServiceDescriptorId + { + get + { + if (_schoolFoodServiceProgramServiceDescriptorId == default(int)) + _schoolFoodServiceProgramServiceDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolFoodServiceProgramServiceDescriptor", _schoolFoodServiceProgramServiceDescriptor); + + return _schoolFoodServiceProgramServiceDescriptorId; + } + set + { + _schoolFoodServiceProgramServiceDescriptorId = value; + _schoolFoodServiceProgramServiceDescriptor = null; + } + } + + private int _schoolFoodServiceProgramServiceDescriptorId; + private string _schoolFoodServiceProgramServiceDescriptor; + + public virtual string SchoolFoodServiceProgramServiceDescriptor + { + get + { + if (_schoolFoodServiceProgramServiceDescriptor == null) + _schoolFoodServiceProgramServiceDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolFoodServiceProgramServiceDescriptor", _schoolFoodServiceProgramServiceDescriptorId); + + return _schoolFoodServiceProgramServiceDescriptor; + } + set + { + _schoolFoodServiceProgramServiceDescriptor = value; + _schoolFoodServiceProgramServiceDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual bool? PrimaryIndicator { get; set; } + public virtual DateTime? ServiceBeginDate + { + get { return _serviceBeginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _serviceBeginDate = null; + } else + { + var given = (DateTime) value; + _serviceBeginDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _serviceBeginDate; + + public virtual DateTime? ServiceEndDate + { + get { return _serviceEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _serviceEndDate = null; + } else + { + var given = (DateTime) value; + _serviceEndDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _serviceEndDate; + + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "SchoolFoodServiceProgramServiceDescriptor", new LookupColumnDetails { PropertyName = "SchoolFoodServiceProgramServiceDescriptorId", LookupTypeName = "SchoolFoodServiceProgramServiceDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (StudentSchoolFoodServiceProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + // Add current key values + keyValues.Add("SchoolFoodServiceProgramServiceDescriptorId", SchoolFoodServiceProgramServiceDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService) target, null); + } + + void IChildEntity.SetParent(object value) + { + StudentSchoolFoodServiceProgramAssociation = (StudentSchoolFoodServiceProgramAssociation) value; + } + } +} +// Aggregate: StudentSection504ProgramAssociation + +namespace EdFi.Ods.Entities.NHibernate.StudentSection504ProgramAssociationAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.StudentSection504ProgramAssociation table of the StudentSection504ProgramAssociation aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, + Entities.Common.EdFi.IStudentSection504ProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public StudentSection504ProgramAssociation() + { + Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); + AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public override DateTime BeginDate { get; set; } + [DomainSignature] + public override long EducationOrganizationId { get; set; } + [DomainSignature] + public override long ProgramEducationOrganizationId { get; set; } + [DomainSignature] + public override string ProgramName { get; set; } + [DomainSignature] + public override int ProgramTypeDescriptorId + { + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } + } + + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + public override string ProgramTypeDescriptor + { + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } + } + [Display(Name="StudentUniqueId")][DomainSignature] + public override int StudentUSI + { + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } + + private int _studentUSI; + private string _studentUniqueId; + + public override string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + DateTime? IGeneralStudentProgramAssociation.EndDate + { + get { return EndDate; } + set { EndDate = value; } + } + string IGeneralStudentProgramAssociation.ReasonExitedDescriptor + { + get { return ReasonExitedDescriptor; } + set { ReasonExitedDescriptor = value; } + } + bool? IGeneralStudentProgramAssociation.ServedOutsideOfRegularSession + { + get { return ServedOutsideOfRegularSession; } + set { ServedOutsideOfRegularSession = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual bool? AccommodationPlan { get; set; } + public virtual int? Section504DisabilityTypeDescriptorId + { + get + { + if (_section504DisabilityTypeDescriptorId == default(int?)) + _section504DisabilityTypeDescriptorId = string.IsNullOrWhiteSpace(_section504DisabilityTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("Section504DisabilityTypeDescriptor", _section504DisabilityTypeDescriptor); + + return _section504DisabilityTypeDescriptorId; + } + set + { + _section504DisabilityTypeDescriptorId = value; + _section504DisabilityTypeDescriptor = null; + } + } + + private int? _section504DisabilityTypeDescriptorId; + private string _section504DisabilityTypeDescriptor; + + public virtual string Section504DisabilityTypeDescriptor + { + get + { + if (_section504DisabilityTypeDescriptor == null) + _section504DisabilityTypeDescriptor = _section504DisabilityTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("Section504DisabilityTypeDescriptor", _section504DisabilityTypeDescriptorId.Value); + + return _section504DisabilityTypeDescriptor; + } + set + { + _section504DisabilityTypeDescriptor = value; + _section504DisabilityTypeDescriptorId = default(int?); + } + } + public virtual bool Section504Eligibility { get; set; } + public virtual DateTime? Section504EligibilityDecisionDate + { + get { return _section504EligibilityDecisionDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _section504EligibilityDecisionDate = null; + } else + { + var given = (DateTime) value; + _section504EligibilityDecisionDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _section504EligibilityDecisionDate; + + public virtual DateTime? Section504MeetingDate + { + get { return _section504MeetingDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _section504MeetingDate = null; + } else + { + var given = (DateTime) value; + _section504MeetingDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _section504MeetingDate; + + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + public IDictionary Extensions + { + get => _extensions; + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + public IDictionary AggregateExtensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "ReasonExitedDescriptor", new LookupColumnDetails { PropertyName = "ReasonExitedDescriptorId", LookupTypeName = "ReasonExitedDescriptor"} }, + { "Section504DisabilityTypeDescriptor", new LookupColumnDetails { PropertyName = "Section504DisabilityTypeDescriptorId", LookupTypeName = "Section504DisabilityTypeDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IStudentSection504ProgramAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IStudentSection504ProgramAssociation) target, null); } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService table of the StudentSchoolFoodServiceProgramAssociation aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual StudentSchoolFoodServiceProgramAssociation StudentSchoolFoodServiceProgramAssociation { get; set; } - - Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService.StudentSchoolFoodServiceProgramAssociation - { - get { return StudentSchoolFoodServiceProgramAssociation; } - set { StudentSchoolFoodServiceProgramAssociation = (StudentSchoolFoodServiceProgramAssociation) value; } - } - - [DomainSignature] - public virtual int SchoolFoodServiceProgramServiceDescriptorId - { - get - { - if (_schoolFoodServiceProgramServiceDescriptorId == default(int)) - _schoolFoodServiceProgramServiceDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SchoolFoodServiceProgramServiceDescriptor", _schoolFoodServiceProgramServiceDescriptor); - - return _schoolFoodServiceProgramServiceDescriptorId; - } - set - { - _schoolFoodServiceProgramServiceDescriptorId = value; - _schoolFoodServiceProgramServiceDescriptor = null; - } - } - - private int _schoolFoodServiceProgramServiceDescriptorId; - private string _schoolFoodServiceProgramServiceDescriptor; - - public virtual string SchoolFoodServiceProgramServiceDescriptor - { - get - { - if (_schoolFoodServiceProgramServiceDescriptor == null) - _schoolFoodServiceProgramServiceDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SchoolFoodServiceProgramServiceDescriptor", _schoolFoodServiceProgramServiceDescriptorId); - - return _schoolFoodServiceProgramServiceDescriptor; - } - set - { - _schoolFoodServiceProgramServiceDescriptor = value; - _schoolFoodServiceProgramServiceDescriptorId = default(int); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual bool? PrimaryIndicator { get; set; } - public virtual DateTime? ServiceBeginDate - { - get { return _serviceBeginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _serviceBeginDate = null; - } else - { - var given = (DateTime) value; - _serviceBeginDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _serviceBeginDate; - - public virtual DateTime? ServiceEndDate - { - get { return _serviceEndDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _serviceEndDate = null; - } else - { - var given = (DateTime) value; - _serviceEndDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _serviceEndDate; - - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "SchoolFoodServiceProgramServiceDescriptor", new LookupColumnDetails { PropertyName = "SchoolFoodServiceProgramServiceDescriptorId", LookupTypeName = "SchoolFoodServiceProgramServiceDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (StudentSchoolFoodServiceProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("SchoolFoodServiceProgramServiceDescriptorId", SchoolFoodServiceProgramServiceDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService) target, null); - } - - void IChildEntity.SetParent(object value) - { - StudentSchoolFoodServiceProgramAssociation = (StudentSchoolFoodServiceProgramAssociation) value; - } - } } // Aggregate: StudentSectionAssociation @@ -148623,6 +153445,7 @@ public class StudentSpecialEducationProgramEligibilityAssociationReferenceData : // ------------------------------------------------------------- public virtual DateTime ConsentToEvaluationReceivedDate { get; set; } public virtual long EducationOrganizationId { get; set; } + public virtual long ProgramEducationOrganizationId { get; set; } public virtual string ProgramName { get; set; } public virtual int ProgramTypeDescriptorId { get; set; } public virtual int StudentUSI { get; set; } @@ -148648,6 +153471,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("ConsentToEvaluationReceivedDate", ConsentToEvaluationReceivedDate); keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); keyValues.Add("ProgramName", ProgramName); keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); keyValues.Add("StudentUSI", StudentUSI); @@ -148734,6 +153558,8 @@ public virtual DateTime ConsentToEvaluationReceivedDate [DomainSignature] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + public virtual long ProgramEducationOrganizationId { get; set; } + [DomainSignature] public virtual string ProgramName { get; set; } [DomainSignature] public virtual int ProgramTypeDescriptorId @@ -149237,6 +154063,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("ConsentToEvaluationReceivedDate", ConsentToEvaluationReceivedDate); keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); keyValues.Add("ProgramName", ProgramName); keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); keyValues.Add("StudentUSI", StudentUSI); diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_EntitiesForQueries.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_EntitiesForQueries.generated.approved.cs index c75339b423..49ef530e53 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_EntitiesForQueries.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_EntitiesForQueries.generated.approved.cs @@ -257,6 +257,15 @@ public class AccommodationDescriptorQ : QueryModels.DescriptorAggregate.EdFi.Des // External references for NHibernate mappings and HQL query usage #pragma warning disable 114 protected virtual ICollection StudentAssessmentAccommodations { get; set; } + #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrationAssessmentAccommodations { get; set; } + #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrationBatteryPartAssociationAccommodations { get; set; } + #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { get; set; } #pragma warning restore 114 // ------------------------------------------------------------- } @@ -719,6 +728,12 @@ public class AssessmentQ : AggregateRootWithCompositeKey // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage + #pragma warning disable 114 + protected virtual ICollection AssessmentAdministrations { get; set; } + #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection AssessmentBatteryParts { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection AssessmentItems { get; set; } #pragma warning restore 114 @@ -1291,6 +1306,255 @@ public class AssessmentSectionQ : EntityWithCompositeKey // ------------------------------------------------------------- } } +// Aggregate: AssessmentAdministration + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.AssessmentAdministrationAggregate.EdFi +{ + + /// + /// A class which represents the edfi.AssessmentAdministration table of the AssessmentAdministration aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationQ : AggregateRootWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual long AssigningEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + public virtual ICollection AssessmentAdministrationAssessmentAdminstrationPeriods { get; set; } + public virtual ICollection AssessmentAdministrationAssessmentBatteryParts { get; set; } + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + #pragma warning disable 114 + protected virtual ICollection AssesssmentAdministrationParticipations { get; set; } + #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentAggregate.EdFi.AssessmentQ Assessment { get; set; } + protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ AssigningEducationOrganization { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.AssessmentAdministrationAssessmentAdminstrationPeriod table of the AssessmentAdministration aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationAssessmentAdminstrationPeriodQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationQ AssessmentAdministration { get; set; } + [DomainSignature] + public virtual DateTime BeginDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime? EndDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.AssessmentAdministrationAssessmentBatteryPart table of the AssessmentAdministration aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationAssessmentBatteryPartQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationQ AssessmentAdministration { get; set; } + [DomainSignature] + public virtual string AssessmentBatteryPartName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartQ AssessmentBatteryPart { get; set; } + // ------------------------------------------------------------- + } +} +// Aggregate: AssessmentBatteryPart + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.AssessmentBatteryPartAggregate.EdFi +{ + + /// + /// A class which represents the edfi.AssessmentBatteryPart table of the AssessmentBatteryPart aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartQ : AggregateRootWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string AssessmentBatteryPartName { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + public virtual ICollection AssessmentBatteryPartObjectiveAssessments { get; set; } + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + #pragma warning disable 114 + protected virtual ICollection AssessmentAdministrationAssessmentBatteryParts { get; set; } + #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrationBatteryPartAssociations { get; set; } + #pragma warning restore 114 + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentAggregate.EdFi.AssessmentQ Assessment { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.AssessmentBatteryPartObjectiveAssessment table of the AssessmentBatteryPart aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartObjectiveAssessmentQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartQ AssessmentBatteryPart { get; set; } + [DomainSignature] + public virtual string IdentificationCode { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentQ ObjectiveAssessment { get; set; } + // ------------------------------------------------------------- + } +} // Aggregate: AssessmentCategoryDescriptor namespace EdFi.Ods.Entities.NHibernate.QueryModels.AssessmentCategoryDescriptorAggregate.EdFi @@ -1828,6 +2092,110 @@ public class AssessmentScoreRangeLearningStandardLearningStandardQ : EntityWithC // ------------------------------------------------------------- } } +// Aggregate: AssesssmentAdministrationParticipation + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.AssesssmentAdministrationParticipationAggregate.EdFi +{ + + /// + /// A class which represents the edfi.AssesssmentAdministrationParticipation table of the AssesssmentAdministrationParticipation aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationQ : AggregateRootWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual long AssigningEducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual long ParticipatingEducationOrganizationId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + public virtual ICollection AssesssmentAdministrationParticipationAdministrationPointOfContacts { get; set; } + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationQ AssessmentAdministration { get; set; } + protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ ParticipatingEducationOrganization { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.AssesssmentAdministrationParticipationAdministrationPointOfContact table of the AssesssmentAdministrationParticipation aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationAdministrationPointOfContactQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.AssesssmentAdministrationParticipationAggregate.EdFi.AssesssmentAdministrationParticipationQ AssesssmentAdministrationParticipation { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string ElectronicMailAddress { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string FirstName { get; set; } + public virtual string LastSurname { get; set; } + public virtual string LoginId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ EducationOrganization { get; set; } + // ------------------------------------------------------------- + } +} // Aggregate: AssignmentLateStatusDescriptor namespace EdFi.Ods.Entities.NHibernate.QueryModels.AssignmentLateStatusDescriptorAggregate.EdFi @@ -7688,12 +8056,21 @@ public abstract class EducationOrganizationQ : AggregateRootWithCompositeKey #pragma warning disable 114 protected virtual ICollection AccountabilityRatings { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection AssessmentAdministrations { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection AssessmentContentStandards { get; set; } #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection Assessments { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection AssesssmentAdministrationParticipationAdministrationPointOfContacts { get; set; } + #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection AssesssmentAdministrationParticipations { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection ChartOfAccounts { get; set; } #pragma warning restore 114 @@ -7754,6 +8131,9 @@ public abstract class EducationOrganizationQ : AggregateRootWithCompositeKey #pragma warning disable 114 protected virtual ICollection ReportCards { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection ReportingStudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection StaffEducationOrganizationAssignmentAssociations { get; set; } #pragma warning restore 114 @@ -7769,6 +8149,9 @@ public abstract class EducationOrganizationQ : AggregateRootWithCompositeKey #pragma warning disable 114 protected virtual ICollection StudentAssessmentEducationOrganizationAssociations { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentEducationOrganizationAssessmentAccommodations { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection StudentEducationOrganizationAssociations { get; set; } #pragma warning restore 114 @@ -7799,6 +8182,9 @@ public abstract class EducationOrganizationQ : AggregateRootWithCompositeKey #pragma warning disable 114 protected virtual ICollection SurveySectionResponseEducationOrganizationTargetAssociations { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection TestingStudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 // External references for NHibernate mappings and HQL query usage protected virtual NHibernate.QueryModels.OperationalStatusDescriptorAggregate.EdFi.OperationalStatusDescriptorQ OperationalStatusDescriptor { get; set; } @@ -9881,6 +10267,9 @@ public class GradeLevelDescriptorQ : QueryModels.DescriptorAggregate.EdFi.Descri #pragma warning disable 114 protected virtual ICollection StaffSchoolAssociationGradeLevels { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection StudentAssessments { get; set; } #pragma warning restore 114 @@ -14639,6 +15028,9 @@ public class ObjectiveAssessmentQ : AggregateRootWithCompositeKey // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage + #pragma warning disable 114 + protected virtual ICollection AssessmentBatteryPartObjectiveAssessments { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection AssessmentScoreRangeLearningStandards { get; set; } #pragma warning restore 114 @@ -15547,6 +15939,9 @@ public class PlatformTypeDescriptorQ : QueryModels.DescriptorAggregate.EdFi.Desc #pragma warning disable 114 protected virtual ICollection AssessmentPlatformTypes { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection StudentAssessments { get; set; } #pragma warning restore 114 @@ -19229,10 +19624,50 @@ public class SectionProgramQ : EntityWithCompositeKey // ------------------------------------------------------------- // ============================================================= - // Discriminator + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.ProgramAggregate.EdFi.ProgramQ Program { get; set; } + // ------------------------------------------------------------- + } +} +// Aggregate: Section504DisabilityTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.Section504DisabilityTypeDescriptorAggregate.EdFi +{ + + /// + /// A class which represents the edfi.Section504DisabilityTypeDescriptor table of the Section504DisabilityTypeDescriptor aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class Section504DisabilityTypeDescriptorQ : QueryModels.DescriptorAggregate.EdFi.DescriptorQ + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual int Section504DisabilityTypeDescriptorId { get; set; } // ------------------------------------------------------------- - - public virtual string Discriminator { get; set; } // ============================================================= // Properties @@ -19250,7 +19685,9 @@ public class SectionProgramQ : EntityWithCompositeKey // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage - protected virtual NHibernate.QueryModels.ProgramAggregate.EdFi.ProgramQ Program { get; set; } + #pragma warning disable 114 + protected virtual ICollection StudentSection504ProgramAssociations { get; set; } + #pragma warning restore 114 // ------------------------------------------------------------- } } @@ -22253,6 +22690,9 @@ public class StudentQ : AggregateRootWithCompositeKey #pragma warning disable 114 protected virtual ICollection StudentDisciplineIncidentNonOffenderAssociations { get; set; } #pragma warning restore 114 + #pragma warning disable 114 + protected virtual ICollection StudentEducationOrganizationAssessmentAccommodations { get; set; } + #pragma warning restore 114 #pragma warning disable 114 protected virtual ICollection StudentEducationOrganizationAssociations { get; set; } #pragma warning restore 114 @@ -23160,9 +23600,253 @@ public class StudentAssessmentPeriodQ : EntityWithCompositeKey // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int AssessmentPeriodDescriptorId { get; set; } - public virtual DateTime? BeginDate { get; set; } - public virtual DateTime? EndDate { get; set; } + public virtual int AssessmentPeriodDescriptorId { get; set; } + public virtual DateTime? BeginDate { get; set; } + public virtual DateTime? EndDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentPeriodDescriptorAggregate.EdFi.AssessmentPeriodDescriptorQ AssessmentPeriodDescriptor { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.StudentAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentAssessmentScoreResultQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentQ StudentAssessment { get; set; } + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string Result { get; set; } + public virtual int ResultDatatypeTypeDescriptorId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentReportingMethodDescriptorAggregate.EdFi.AssessmentReportingMethodDescriptorQ AssessmentReportingMethodDescriptor { get; set; } + protected virtual NHibernate.QueryModels.ResultDatatypeTypeDescriptorAggregate.EdFi.ResultDatatypeTypeDescriptorQ ResultDatatypeTypeDescriptor { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessment table of the StudentAssessment aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentAssessmentStudentObjectiveAssessmentQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentQ StudentAssessment { get; set; } + [DomainSignature] + public virtual string IdentificationCode { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual DateTime? AdministrationDate { get; set; } + public virtual DateTime? AdministrationEndDate { get; set; } + public virtual int? AssessedMinutes { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + public virtual ICollection StudentAssessmentStudentObjectiveAssessmentPerformanceLevels { get; set; } + public virtual ICollection StudentAssessmentStudentObjectiveAssessmentScoreResults { get; set; } + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentQ ObjectiveAssessment { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentStudentObjectiveAssessmentQ StudentAssessmentStudentObjectiveAssessment { get; set; } + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId { get; set; } + [DomainSignature] + public virtual int PerformanceLevelDescriptorId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string PerformanceLevelIndicatorName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentReportingMethodDescriptorAggregate.EdFi.AssessmentReportingMethodDescriptorQ AssessmentReportingMethodDescriptor { get; set; } + protected virtual NHibernate.QueryModels.PerformanceLevelDescriptorAggregate.EdFi.PerformanceLevelDescriptorQ PerformanceLevelDescriptor { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentAssessmentStudentObjectiveAssessmentScoreResultQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentStudentObjectiveAssessmentQ StudentAssessmentStudentObjectiveAssessment { get; set; } + [DomainSignature] + public virtual int AssessmentReportingMethodDescriptorId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual string Result { get; set; } + public virtual int ResultDatatypeTypeDescriptorId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentReportingMethodDescriptorAggregate.EdFi.AssessmentReportingMethodDescriptorQ AssessmentReportingMethodDescriptor { get; set; } + protected virtual NHibernate.QueryModels.ResultDatatypeTypeDescriptorAggregate.EdFi.ResultDatatypeTypeDescriptorQ ResultDatatypeTypeDescriptor { get; set; } + // ------------------------------------------------------------- + } +} +// Aggregate: StudentAssessmentEducationOrganizationAssociation + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentAssessmentEducationOrganizationAssociationAggregate.EdFi +{ + + /// + /// A class which represents the edfi.StudentAssessmentEducationOrganizationAssociation table of the StudentAssessmentEducationOrganizationAssociation aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentAssessmentEducationOrganizationAssociationQ : AggregateRootWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual int EducationOrganizationAssociationTypeDescriptorId { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual string StudentAssessmentIdentifier { get; set; } + [DomainSignature] + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual short? SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23176,25 +23860,41 @@ public class StudentAssessmentPeriodQ : EntityWithCompositeKey // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage - protected virtual NHibernate.QueryModels.AssessmentPeriodDescriptorAggregate.EdFi.AssessmentPeriodDescriptorQ AssessmentPeriodDescriptor { get; set; } + protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ EducationOrganization { get; set; } + protected virtual NHibernate.QueryModels.EducationOrganizationAssociationTypeDescriptorAggregate.EdFi.EducationOrganizationAssociationTypeDescriptorQ EducationOrganizationAssociationTypeDescriptor { get; set; } + protected virtual NHibernate.QueryModels.SchoolYearTypeAggregate.EdFi.SchoolYearTypeQ SchoolYearType { get; set; } + protected virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentQ StudentAssessment { get; set; } // ------------------------------------------------------------- } +} +// Aggregate: StudentAssessmentRegistration + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentAssessmentRegistrationAggregate.EdFi +{ /// - /// A class which represents the edfi.StudentAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistration table of the StudentAssessmentRegistration aggregate in the ODS database. /// [Serializable] [ExcludeFromCodeCoverage] - public class StudentAssessmentScoreResultQ : EntityWithCompositeKey + public class StudentAssessmentRegistrationQ : AggregateRootWithCompositeKey { // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore, IgnoreDataMember] - public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentQ StudentAssessment { get; set; } [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId { get; set; } + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual long AssigningEducationOrganizationId { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23206,13 +23906,19 @@ public class StudentAssessmentScoreResultQ : EntityWithCompositeKey // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string Result { get; set; } - public virtual int ResultDatatypeTypeDescriptorId { get; set; } + public virtual int? AssessmentGradeLevelDescriptorId { get; set; } + public virtual DateTime EntryDate { get; set; } + public virtual int? PlatformTypeDescriptorId { get; set; } + public virtual long? ReportingEducationOrganizationId { get; set; } + public virtual long SchoolId { get; set; } + public virtual long? TestingEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + public virtual ICollection StudentAssessmentRegistrationAssessmentAccommodations { get; set; } + public virtual ICollection StudentAssessmentRegistrationAssessmentCustomizations { get; set; } // ------------------------------------------------------------- @@ -23221,26 +23927,37 @@ public class StudentAssessmentScoreResultQ : EntityWithCompositeKey // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage - protected virtual NHibernate.QueryModels.AssessmentReportingMethodDescriptorAggregate.EdFi.AssessmentReportingMethodDescriptorQ AssessmentReportingMethodDescriptor { get; set; } - protected virtual NHibernate.QueryModels.ResultDatatypeTypeDescriptorAggregate.EdFi.ResultDatatypeTypeDescriptorQ ResultDatatypeTypeDescriptor { get; set; } + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrationBatteryPartAssociations { get; set; } + #pragma warning restore 114 + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationQ AssessmentAdministration { get; set; } + protected virtual NHibernate.QueryModels.GradeLevelDescriptorAggregate.EdFi.GradeLevelDescriptorQ AssessmentGradeLevelDescriptor { get; set; } + protected virtual NHibernate.QueryModels.PlatformTypeDescriptorAggregate.EdFi.PlatformTypeDescriptorQ PlatformTypeDescriptor { get; set; } + protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ ReportingEducationOrganization { get; set; } + protected virtual NHibernate.QueryModels.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi.StudentEducationOrganizationAssessmentAccommodationQ StudentEducationOrganizationAssessmentAccommodation { get; set; } + protected virtual NHibernate.QueryModels.StudentEducationOrganizationAssociationAggregate.EdFi.StudentEducationOrganizationAssociationQ StudentEducationOrganizationAssociation { get; set; } + protected virtual NHibernate.QueryModels.StudentSchoolAssociationAggregate.EdFi.StudentSchoolAssociationQ StudentSchoolAssociation { get; set; } + protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ TestingEducationOrganization { get; set; } // ------------------------------------------------------------- } /// - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessment table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistrationAssessmentAccommodation table of the StudentAssessmentRegistration aggregate in the ODS database. /// [Serializable] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentQ : EntityWithCompositeKey + public class StudentAssessmentRegistrationAssessmentAccommodationQ : EntityWithCompositeKey { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore, IgnoreDataMember] - public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentQ StudentAssessment { get; set; } + public virtual NHibernate.QueryModels.StudentAssessmentRegistrationAggregate.EdFi.StudentAssessmentRegistrationQ StudentAssessmentRegistration { get; set; } [DomainSignature] - public virtual string IdentificationCode { get; set; } + public virtual int AccommodationDescriptorId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23252,16 +23969,11 @@ public class StudentAssessmentStudentObjectiveAssessmentQ : EntityWithCompositeK // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? AdministrationDate { get; set; } - public virtual DateTime? AdministrationEndDate { get; set; } - public virtual int? AssessedMinutes { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - public virtual ICollection StudentAssessmentStudentObjectiveAssessmentPerformanceLevels { get; set; } - public virtual ICollection StudentAssessmentStudentObjectiveAssessmentScoreResults { get; set; } // ------------------------------------------------------------- @@ -23270,27 +23982,25 @@ public class StudentAssessmentStudentObjectiveAssessmentQ : EntityWithCompositeK // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage - protected virtual NHibernate.QueryModels.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentQ ObjectiveAssessment { get; set; } + protected virtual NHibernate.QueryModels.AccommodationDescriptorAggregate.EdFi.AccommodationDescriptorQ AccommodationDescriptor { get; set; } // ------------------------------------------------------------- } /// - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistrationAssessmentCustomization table of the StudentAssessmentRegistration aggregate in the ODS database. /// [Serializable] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelQ : EntityWithCompositeKey + public class StudentAssessmentRegistrationAssessmentCustomizationQ : EntityWithCompositeKey { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature, JsonIgnore, IgnoreDataMember] - public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentStudentObjectiveAssessmentQ StudentAssessmentStudentObjectiveAssessment { get; set; } + public virtual NHibernate.QueryModels.StudentAssessmentRegistrationAggregate.EdFi.StudentAssessmentRegistrationQ StudentAssessmentRegistration { get; set; } [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId { get; set; } - [DomainSignature] - public virtual int PerformanceLevelDescriptorId { get; set; } + public virtual string CustomizationKey { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23302,7 +24012,7 @@ public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelQ : Enti // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string PerformanceLevelIndicatorName { get; set; } + public virtual string CustomizationValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23314,28 +24024,39 @@ public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelQ : Enti // ============================================================= // External references for HQL Queries // ------------------------------------------------------------- - - // External references for NHibernate mappings and HQL query usage - protected virtual NHibernate.QueryModels.AssessmentReportingMethodDescriptorAggregate.EdFi.AssessmentReportingMethodDescriptorQ AssessmentReportingMethodDescriptor { get; set; } - protected virtual NHibernate.QueryModels.PerformanceLevelDescriptorAggregate.EdFi.PerformanceLevelDescriptorQ PerformanceLevelDescriptor { get; set; } // ------------------------------------------------------------- } +} +// Aggregate: StudentAssessmentRegistrationBatteryPartAssociation + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentAssessmentRegistrationBatteryPartAssociationAggregate.EdFi +{ /// - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentScoreResult table of the StudentAssessment aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistrationBatteryPartAssociation table of the StudentAssessmentRegistrationBatteryPartAssociation aggregate in the ODS database. /// [Serializable] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentScoreResultQ : EntityWithCompositeKey + public class StudentAssessmentRegistrationBatteryPartAssociationQ : AggregateRootWithCompositeKey { // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore, IgnoreDataMember] - public virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentStudentObjectiveAssessmentQ StudentAssessmentStudentObjectiveAssessment { get; set; } [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId { get; set; } + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] + public virtual string AssessmentBatteryPartName { get; set; } + [DomainSignature] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + public virtual long AssigningEducationOrganizationId { get; set; } + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual string Namespace { get; set; } + [DomainSignature] + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23347,13 +24068,12 @@ public class StudentAssessmentStudentObjectiveAssessmentScoreResultQ : EntityWit // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string Result { get; set; } - public virtual int ResultDatatypeTypeDescriptorId { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + public virtual ICollection StudentAssessmentRegistrationBatteryPartAssociationAccommodations { get; set; } // ------------------------------------------------------------- @@ -23362,39 +24082,26 @@ public class StudentAssessmentStudentObjectiveAssessmentScoreResultQ : EntityWit // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage - protected virtual NHibernate.QueryModels.AssessmentReportingMethodDescriptorAggregate.EdFi.AssessmentReportingMethodDescriptorQ AssessmentReportingMethodDescriptor { get; set; } - protected virtual NHibernate.QueryModels.ResultDatatypeTypeDescriptorAggregate.EdFi.ResultDatatypeTypeDescriptorQ ResultDatatypeTypeDescriptor { get; set; } + protected virtual NHibernate.QueryModels.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartQ AssessmentBatteryPart { get; set; } + protected virtual NHibernate.QueryModels.StudentAssessmentRegistrationAggregate.EdFi.StudentAssessmentRegistrationQ StudentAssessmentRegistration { get; set; } // ------------------------------------------------------------- } -} -// Aggregate: StudentAssessmentEducationOrganizationAssociation - -namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentAssessmentEducationOrganizationAssociationAggregate.EdFi -{ /// - /// A class which represents the edfi.StudentAssessmentEducationOrganizationAssociation table of the StudentAssessmentEducationOrganizationAssociation aggregate in the ODS database. + /// A class which represents the edfi.StudentAssessmentRegistrationBatteryPartAssociationAccommodation table of the StudentAssessmentRegistrationBatteryPartAssociation aggregate in the ODS database. /// [Serializable] [ExcludeFromCodeCoverage] - public class StudentAssessmentEducationOrganizationAssociationQ : AggregateRootWithCompositeKey + public class StudentAssessmentRegistrationBatteryPartAssociationAccommodationQ : EntityWithCompositeKey { // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.StudentAssessmentRegistrationBatteryPartAssociationAggregate.EdFi.StudentAssessmentRegistrationBatteryPartAssociationQ StudentAssessmentRegistrationBatteryPartAssociation { get; set; } [DomainSignature] - public virtual string AssessmentIdentifier { get; set; } - [DomainSignature] - public virtual int EducationOrganizationAssociationTypeDescriptorId { get; set; } - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string Namespace { get; set; } - [DomainSignature] - public virtual string StudentAssessmentIdentifier { get; set; } - [DomainSignature] - public virtual int StudentUSI { get; set; } + public virtual int AccommodationDescriptorId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23406,7 +24113,6 @@ public class StudentAssessmentEducationOrganizationAssociationQ : AggregateRootW // ============================================================= // Properties // ------------------------------------------------------------- - public virtual short? SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23420,10 +24126,7 @@ public class StudentAssessmentEducationOrganizationAssociationQ : AggregateRootW // ------------------------------------------------------------- // External references for NHibernate mappings and HQL query usage - protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ EducationOrganization { get; set; } - protected virtual NHibernate.QueryModels.EducationOrganizationAssociationTypeDescriptorAggregate.EdFi.EducationOrganizationAssociationTypeDescriptorQ EducationOrganizationAssociationTypeDescriptor { get; set; } - protected virtual NHibernate.QueryModels.SchoolYearTypeAggregate.EdFi.SchoolYearTypeQ SchoolYearType { get; set; } - protected virtual NHibernate.QueryModels.StudentAssessmentAggregate.EdFi.StudentAssessmentQ StudentAssessment { get; set; } + protected virtual NHibernate.QueryModels.AccommodationDescriptorAggregate.EdFi.AccommodationDescriptorQ AccommodationDescriptor { get; set; } // ------------------------------------------------------------- } } @@ -24102,6 +24805,104 @@ public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentPa // ------------------------------------------------------------- } } +// Aggregate: StudentEducationOrganizationAssessmentAccommodation + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi +{ + + /// + /// A class which represents the edfi.StudentEducationOrganizationAssessmentAccommodation table of the StudentEducationOrganizationAssessmentAccommodation aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationQ : AggregateRootWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + public virtual ICollection StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { get; set; } + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ EducationOrganization { get; set; } + protected virtual NHibernate.QueryModels.StudentAggregate.EdFi.StudentQ Student { get; set; } + // ------------------------------------------------------------- + } + + /// + /// A class which represents the edfi.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation table of the StudentEducationOrganizationAssessmentAccommodation aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationQ : EntityWithCompositeKey + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, JsonIgnore, IgnoreDataMember] + public virtual NHibernate.QueryModels.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi.StudentEducationOrganizationAssessmentAccommodationQ StudentEducationOrganizationAssessmentAccommodation { get; set; } + [DomainSignature] + public virtual int AccommodationDescriptorId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Discriminator + // ------------------------------------------------------------- + + public virtual string Discriminator { get; set; } + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.AccommodationDescriptorAggregate.EdFi.AccommodationDescriptorQ AccommodationDescriptor { get; set; } + // ------------------------------------------------------------- + } +} // Aggregate: StudentEducationOrganizationAssociation namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentEducationOrganizationAssociationAggregate.EdFi @@ -24173,6 +24974,11 @@ public class StudentEducationOrganizationAssociationQ : AggregateRootWithComposi // External references for HQL Queries // ------------------------------------------------------------- + // External references for NHibernate mappings and HQL query usage + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 + // External references for NHibernate mappings and HQL query usage protected virtual NHibernate.QueryModels.BarrierToInternetAccessInResidenceDescriptorAggregate.EdFi.BarrierToInternetAccessInResidenceDescriptorQ BarrierToInternetAccessInResidenceDescriptor { get; set; } protected virtual NHibernate.QueryModels.EducationOrganizationAggregate.EdFi.EducationOrganizationQ EducationOrganization { get; set; } @@ -26467,6 +27273,11 @@ public class StudentSchoolAssociationQ : AggregateRootWithCompositeKey // External references for HQL Queries // ------------------------------------------------------------- + // External references for NHibernate mappings and HQL query usage + #pragma warning disable 114 + protected virtual ICollection StudentAssessmentRegistrations { get; set; } + #pragma warning restore 114 + // External references for NHibernate mappings and HQL query usage protected virtual NHibernate.QueryModels.CalendarAggregate.EdFi.CalendarQ Calendar { get; set; } protected virtual NHibernate.QueryModels.SchoolYearTypeAggregate.EdFi.SchoolYearTypeQ ClassOfSchoolYearType { get; set; } @@ -26731,6 +27542,61 @@ public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramS // ------------------------------------------------------------- } } +// Aggregate: StudentSection504ProgramAssociation + +namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentSection504ProgramAssociationAggregate.EdFi +{ + + /// + /// A class which represents the edfi.StudentSection504ProgramAssociation table of the StudentSection504ProgramAssociation aggregate in the ODS database. + /// + [Serializable] + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationQ : QueryModels.GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociationQ + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + public override DateTime BeginDate { get; set; } + [DomainSignature] + public override long EducationOrganizationId { get; set; } + [DomainSignature] + public override long ProgramEducationOrganizationId { get; set; } + [DomainSignature] + public override string ProgramName { get; set; } + [DomainSignature] + public override int ProgramTypeDescriptorId { get; set; } + [DomainSignature] + public override int StudentUSI { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + public virtual bool? AccommodationPlan { get; set; } + public virtual int? Section504DisabilityTypeDescriptorId { get; set; } + public virtual bool Section504Eligibility { get; set; } + public virtual DateTime? Section504EligibilityDecisionDate { get; set; } + public virtual DateTime? Section504MeetingDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + + // ============================================================= + // External references for HQL Queries + // ------------------------------------------------------------- + + // External references for NHibernate mappings and HQL query usage + protected virtual NHibernate.QueryModels.Section504DisabilityTypeDescriptorAggregate.EdFi.Section504DisabilityTypeDescriptorQ Section504DisabilityTypeDescriptor { get; set; } + // ------------------------------------------------------------- + } +} // Aggregate: StudentSectionAssociation namespace EdFi.Ods.Entities.NHibernate.QueryModels.StudentSectionAssociationAggregate.EdFi @@ -27250,6 +28116,8 @@ public class StudentSpecialEducationProgramEligibilityAssociationQ : AggregateRo [DomainSignature] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + public virtual long ProgramEducationOrganizationId { get; set; } + [DomainSignature] public virtual string ProgramName { get; set; } [DomainSignature] public virtual int ProgramTypeDescriptorId { get; set; } diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Interfaces_EntityInterfaces.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Interfaces_EntityInterfaces.generated.approved.cs index 7f880ecbff..044bbcae19 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Interfaces_EntityInterfaces.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Interfaces_EntityInterfaces.generated.approved.cs @@ -1368,6 +1368,244 @@ public bool IsExtensionSupported(string name) } } + /// + /// Defines available properties and methods for the abstraction of the AssessmentAdministration model. + /// + public interface IAssessmentAdministration : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + string AdministrationIdentifier { get; set; } + + string AssessmentIdentifier { get; set; } + + long AssigningEducationOrganizationId { get; set; } + + string Namespace { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + ICollection AssessmentAdministrationAssessmentAdminstrationPeriods { get; set; } + ICollection AssessmentAdministrationAssessmentBatteryParts { get; set; } + + // Resource reference data + Guid? AssessmentResourceId { get; set; } + string AssessmentDiscriminator { get; set; } + Guid? AssigningEducationOrganizationResourceId { get; set; } + string AssigningEducationOrganizationDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class AssessmentAdministrationMappingContract : IMappingContract, IExtensionsMappingContract + { + public AssessmentAdministrationMappingContract( + bool isAssessmentAdministrationAssessmentAdminstrationPeriodsSupported, + bool isAssessmentAdministrationAssessmentBatteryPartsSupported, + bool isAssessmentReferenceSupported, + bool isAssigningEducationOrganizationReferenceSupported, + bool isAssessmentAdministrationAssessmentAdminstrationPeriodsItemCreatable, + Func isAssessmentAdministrationAssessmentAdminstrationPeriodIncluded, + bool isAssessmentAdministrationAssessmentBatteryPartsItemCreatable, + Func isAssessmentAdministrationAssessmentBatteryPartIncluded, + IReadOnlyList supportedExtensions + ) + { + IsAssessmentAdministrationAssessmentAdminstrationPeriodsSupported = isAssessmentAdministrationAssessmentAdminstrationPeriodsSupported; + IsAssessmentAdministrationAssessmentBatteryPartsSupported = isAssessmentAdministrationAssessmentBatteryPartsSupported; + IsAssessmentReferenceSupported = isAssessmentReferenceSupported; + IsAssigningEducationOrganizationReferenceSupported = isAssigningEducationOrganizationReferenceSupported; + IsAssessmentAdministrationAssessmentAdminstrationPeriodsItemCreatable = isAssessmentAdministrationAssessmentAdminstrationPeriodsItemCreatable; + IsAssessmentAdministrationAssessmentAdminstrationPeriodIncluded = isAssessmentAdministrationAssessmentAdminstrationPeriodIncluded; + IsAssessmentAdministrationAssessmentBatteryPartsItemCreatable = isAssessmentAdministrationAssessmentBatteryPartsItemCreatable; + IsAssessmentAdministrationAssessmentBatteryPartIncluded = isAssessmentAdministrationAssessmentBatteryPartIncluded; + SupportedExtensions = supportedExtensions; + } + + public bool IsAssessmentAdministrationAssessmentAdminstrationPeriodsSupported { get; } + public bool IsAssessmentAdministrationAssessmentBatteryPartsSupported { get; } + public bool IsAssessmentReferenceSupported { get; } + public bool IsAssigningEducationOrganizationReferenceSupported { get; } + public bool IsAssessmentAdministrationAssessmentAdminstrationPeriodsItemCreatable { get; } + public Func IsAssessmentAdministrationAssessmentAdminstrationPeriodIncluded { get; } + public bool IsAssessmentAdministrationAssessmentBatteryPartsItemCreatable { get; } + public Func IsAssessmentAdministrationAssessmentBatteryPartIncluded { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "AssessmentAdministrationAssessmentAdminstrationPeriods": + return IsAssessmentAdministrationAssessmentAdminstrationPeriodsSupported; + case "AssessmentAdministrationAssessmentBatteryParts": + return IsAssessmentAdministrationAssessmentBatteryPartsSupported; + case "AssessmentReference": + return IsAssessmentReferenceSupported; + case "AssigningEducationOrganizationReference": + return IsAssigningEducationOrganizationReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AdministrationIdentifier": + return true; + case "AssessmentIdentifier": + return true; + case "AssigningEducationOrganizationId": + return true; + case "Namespace": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) + { + switch (memberName) + { + case "AssessmentAdministrationAssessmentAdminstrationPeriods": + return IsAssessmentAdministrationAssessmentAdminstrationPeriodsItemCreatable; + case "AssessmentAdministrationAssessmentBatteryParts": + return IsAssessmentAdministrationAssessmentBatteryPartsItemCreatable; + default: + throw new Exception($"Unknown child item '{memberName}'."); + } + } + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the AssessmentAdministrationAssessmentAdminstrationPeriod model. + /// + public interface IAssessmentAdministrationAssessmentAdminstrationPeriod : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IAssessmentAdministration AssessmentAdministration { get; set; } + + DateTime BeginDate { get; set; } + + // Non-PK properties + DateTime? EndDate { get; set; } + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class AssessmentAdministrationAssessmentAdminstrationPeriodMappingContract : IMappingContract, IExtensionsMappingContract + { + public AssessmentAdministrationAssessmentAdminstrationPeriodMappingContract( + bool isEndDateSupported, + IReadOnlyList supportedExtensions + ) + { + IsEndDateSupported = isEndDateSupported; + SupportedExtensions = supportedExtensions; + } + + public bool IsEndDateSupported { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "EndDate": + return IsEndDateSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "BeginDate": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the AssessmentAdministrationAssessmentBatteryPart model. + /// + public interface IAssessmentAdministrationAssessmentBatteryPart : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IAssessmentAdministration AssessmentAdministration { get; set; } + + string AssessmentBatteryPartName { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + + // Resource reference data + Guid? AssessmentBatteryPartResourceId { get; set; } + string AssessmentBatteryPartDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class AssessmentAdministrationAssessmentBatteryPartMappingContract : IMappingContract, IExtensionsMappingContract + { + public AssessmentAdministrationAssessmentBatteryPartMappingContract( + bool isAssessmentBatteryPartReferenceSupported, + IReadOnlyList supportedExtensions + ) + { + IsAssessmentBatteryPartReferenceSupported = isAssessmentBatteryPartReferenceSupported; + SupportedExtensions = supportedExtensions; + } + + public bool IsAssessmentBatteryPartReferenceSupported { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "AssessmentBatteryPartReference": + return IsAssessmentBatteryPartReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AssessmentBatteryPartName": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + /// /// Defines available properties and methods for the abstraction of the AssessmentAssessedGradeLevel model. /// @@ -1423,6 +1661,158 @@ public bool IsExtensionSupported(string name) } } + /// + /// Defines available properties and methods for the abstraction of the AssessmentBatteryPart model. + /// + public interface IAssessmentBatteryPart : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + string AssessmentBatteryPartName { get; set; } + + string AssessmentIdentifier { get; set; } + + string Namespace { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + ICollection AssessmentBatteryPartObjectiveAssessments { get; set; } + + // Resource reference data + Guid? AssessmentResourceId { get; set; } + string AssessmentDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class AssessmentBatteryPartMappingContract : IMappingContract, IExtensionsMappingContract + { + public AssessmentBatteryPartMappingContract( + bool isAssessmentBatteryPartObjectiveAssessmentsSupported, + bool isAssessmentReferenceSupported, + bool isAssessmentBatteryPartObjectiveAssessmentsItemCreatable, + Func isAssessmentBatteryPartObjectiveAssessmentIncluded, + IReadOnlyList supportedExtensions + ) + { + IsAssessmentBatteryPartObjectiveAssessmentsSupported = isAssessmentBatteryPartObjectiveAssessmentsSupported; + IsAssessmentReferenceSupported = isAssessmentReferenceSupported; + IsAssessmentBatteryPartObjectiveAssessmentsItemCreatable = isAssessmentBatteryPartObjectiveAssessmentsItemCreatable; + IsAssessmentBatteryPartObjectiveAssessmentIncluded = isAssessmentBatteryPartObjectiveAssessmentIncluded; + SupportedExtensions = supportedExtensions; + } + + public bool IsAssessmentBatteryPartObjectiveAssessmentsSupported { get; } + public bool IsAssessmentReferenceSupported { get; } + public bool IsAssessmentBatteryPartObjectiveAssessmentsItemCreatable { get; } + public Func IsAssessmentBatteryPartObjectiveAssessmentIncluded { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "AssessmentBatteryPartObjectiveAssessments": + return IsAssessmentBatteryPartObjectiveAssessmentsSupported; + case "AssessmentReference": + return IsAssessmentReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AssessmentBatteryPartName": + return true; + case "AssessmentIdentifier": + return true; + case "Namespace": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) + { + switch (memberName) + { + case "AssessmentBatteryPartObjectiveAssessments": + return IsAssessmentBatteryPartObjectiveAssessmentsItemCreatable; + default: + throw new Exception($"Unknown child item '{memberName}'."); + } + } + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the AssessmentBatteryPartObjectiveAssessment model. + /// + public interface IAssessmentBatteryPartObjectiveAssessment : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IAssessmentBatteryPart AssessmentBatteryPart { get; set; } + + string IdentificationCode { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + + // Resource reference data + Guid? ObjectiveAssessmentResourceId { get; set; } + string ObjectiveAssessmentDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class AssessmentBatteryPartObjectiveAssessmentMappingContract : IMappingContract, IExtensionsMappingContract + { + public AssessmentBatteryPartObjectiveAssessmentMappingContract( + bool isObjectiveAssessmentReferenceSupported, + IReadOnlyList supportedExtensions + ) + { + IsObjectiveAssessmentReferenceSupported = isObjectiveAssessmentReferenceSupported; + SupportedExtensions = supportedExtensions; + } + + public bool IsObjectiveAssessmentReferenceSupported { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "ObjectiveAssessmentReference": + return IsObjectiveAssessmentReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "IdentificationCode": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + /// /// Defines available properties and methods for the abstraction of the AssessmentCategoryDescriptor model. /// @@ -3067,6 +3457,195 @@ public bool IsExtensionSupported(string name) } } + /// + /// Defines available properties and methods for the abstraction of the AssesssmentAdministrationParticipation model. + /// + public interface IAssesssmentAdministrationParticipation : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + string AdministrationIdentifier { get; set; } + + string AssessmentIdentifier { get; set; } + + long AssigningEducationOrganizationId { get; set; } + + string Namespace { get; set; } + + long ParticipatingEducationOrganizationId { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + ICollection AssesssmentAdministrationParticipationAdministrationPointOfContacts { get; set; } + + // Resource reference data + Guid? AssessmentAdministrationResourceId { get; set; } + string AssessmentAdministrationDiscriminator { get; set; } + Guid? ParticipatingEducationOrganizationResourceId { get; set; } + string ParticipatingEducationOrganizationDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class AssesssmentAdministrationParticipationMappingContract : IMappingContract, IExtensionsMappingContract + { + public AssesssmentAdministrationParticipationMappingContract( + bool isAssessmentAdministrationReferenceSupported, + bool isAssesssmentAdministrationParticipationAdministrationPointOfContactsSupported, + bool isParticipatingEducationOrganizationReferenceSupported, + bool isAssesssmentAdministrationParticipationAdministrationPointOfContactsItemCreatable, + Func isAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded, + IReadOnlyList supportedExtensions + ) + { + IsAssessmentAdministrationReferenceSupported = isAssessmentAdministrationReferenceSupported; + IsAssesssmentAdministrationParticipationAdministrationPointOfContactsSupported = isAssesssmentAdministrationParticipationAdministrationPointOfContactsSupported; + IsParticipatingEducationOrganizationReferenceSupported = isParticipatingEducationOrganizationReferenceSupported; + IsAssesssmentAdministrationParticipationAdministrationPointOfContactsItemCreatable = isAssesssmentAdministrationParticipationAdministrationPointOfContactsItemCreatable; + IsAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded = isAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded; + SupportedExtensions = supportedExtensions; + } + + public bool IsAssessmentAdministrationReferenceSupported { get; } + public bool IsAssesssmentAdministrationParticipationAdministrationPointOfContactsSupported { get; } + public bool IsParticipatingEducationOrganizationReferenceSupported { get; } + public bool IsAssesssmentAdministrationParticipationAdministrationPointOfContactsItemCreatable { get; } + public Func IsAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "AssessmentAdministrationReference": + return IsAssessmentAdministrationReferenceSupported; + case "AssesssmentAdministrationParticipationAdministrationPointOfContacts": + return IsAssesssmentAdministrationParticipationAdministrationPointOfContactsSupported; + case "ParticipatingEducationOrganizationReference": + return IsParticipatingEducationOrganizationReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AdministrationIdentifier": + return true; + case "AssessmentIdentifier": + return true; + case "AssigningEducationOrganizationId": + return true; + case "Namespace": + return true; + case "ParticipatingEducationOrganizationId": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) + { + switch (memberName) + { + case "AssesssmentAdministrationParticipationAdministrationPointOfContacts": + return IsAssesssmentAdministrationParticipationAdministrationPointOfContactsItemCreatable; + default: + throw new Exception($"Unknown child item '{memberName}'."); + } + } + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the AssesssmentAdministrationParticipationAdministrationPointOfContact model. + /// + public interface IAssesssmentAdministrationParticipationAdministrationPointOfContact : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IAssesssmentAdministrationParticipation AssesssmentAdministrationParticipation { get; set; } + + long EducationOrganizationId { get; set; } + + string ElectronicMailAddress { get; set; } + + // Non-PK properties + string FirstName { get; set; } + string LastSurname { get; set; } + string LoginId { get; set; } + + // One-to-one relationships + + // Lists + + // Resource reference data + Guid? EducationOrganizationResourceId { get; set; } + string EducationOrganizationDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class AssesssmentAdministrationParticipationAdministrationPointOfContactMappingContract : IMappingContract, IExtensionsMappingContract + { + public AssesssmentAdministrationParticipationAdministrationPointOfContactMappingContract( + bool isEducationOrganizationReferenceSupported, + bool isFirstNameSupported, + bool isLastSurnameSupported, + bool isLoginIdSupported, + IReadOnlyList supportedExtensions + ) + { + IsEducationOrganizationReferenceSupported = isEducationOrganizationReferenceSupported; + IsFirstNameSupported = isFirstNameSupported; + IsLastSurnameSupported = isLastSurnameSupported; + IsLoginIdSupported = isLoginIdSupported; + SupportedExtensions = supportedExtensions; + } + + public bool IsEducationOrganizationReferenceSupported { get; } + public bool IsFirstNameSupported { get; } + public bool IsLastSurnameSupported { get; } + public bool IsLoginIdSupported { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "EducationOrganizationReference": + return IsEducationOrganizationReferenceSupported; + case "FirstName": + return IsFirstNameSupported; + case "LastSurname": + return IsLastSurnameSupported; + case "LoginId": + return IsLoginIdSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "EducationOrganizationId": + return true; + case "ElectronicMailAddress": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + /// /// Defines available properties and methods for the abstraction of the AssignmentLateStatusDescriptor model. /// @@ -32844,179 +33423,13 @@ public bool IsExtensionSupported(string name) } /// - /// Defines available properties and methods for the abstraction of the SectionAttendanceTakenEvent model. + /// Defines available properties and methods for the abstraction of the Section504DisabilityTypeDescriptor model. /// - public interface ISectionAttendanceTakenEvent : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample - { - // Primary Key properties - - string CalendarCode { get; set; } - - DateTime Date { get; set; } - - string LocalCourseCode { get; set; } - - long SchoolId { get; set; } - - short SchoolYear { get; set; } - - string SectionIdentifier { get; set; } - - string SessionName { get; set; } - - // Non-PK properties - DateTime EventDate { get; set; } - string StaffUniqueId { get; set; } - - // One-to-one relationships - - // Lists - - // Resource reference data - Guid? CalendarDateResourceId { get; set; } - string CalendarDateDiscriminator { get; set; } - Guid? SectionResourceId { get; set; } - string SectionDiscriminator { get; set; } - Guid? StaffResourceId { get; set; } - string StaffDiscriminator { get; set; } - } - - /// - /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized - /// between entities/resources during API request processing. - /// - public class SectionAttendanceTakenEventMappingContract : IMappingContract, IExtensionsMappingContract - { - public SectionAttendanceTakenEventMappingContract( - bool isCalendarDateReferenceSupported, - bool isEventDateSupported, - bool isSectionReferenceSupported, - bool isStaffReferenceSupported, - bool isStaffUniqueIdSupported, - IReadOnlyList supportedExtensions - ) - { - IsCalendarDateReferenceSupported = isCalendarDateReferenceSupported; - IsEventDateSupported = isEventDateSupported; - IsSectionReferenceSupported = isSectionReferenceSupported; - IsStaffReferenceSupported = isStaffReferenceSupported; - IsStaffUniqueIdSupported = isStaffUniqueIdSupported; - SupportedExtensions = supportedExtensions; - } - - public bool IsCalendarDateReferenceSupported { get; } - public bool IsEventDateSupported { get; } - public bool IsSectionReferenceSupported { get; } - public bool IsStaffReferenceSupported { get; } - public bool IsStaffUniqueIdSupported { get; } - - bool IMappingContract.IsMemberSupported(string memberName) - { - switch (memberName) - { - case "CalendarDateReference": - return IsCalendarDateReferenceSupported; - case "EventDate": - return IsEventDateSupported; - case "SectionReference": - return IsSectionReferenceSupported; - case "StaffReference": - return IsStaffReferenceSupported; - case "StaffUniqueId": - return IsStaffUniqueIdSupported; - // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation - case "CalendarCode": - return true; - case "Date": - return true; - case "LocalCourseCode": - return true; - case "SchoolId": - return true; - case "SchoolYear": - return true; - case "SectionIdentifier": - return true; - case "SessionName": - return true; - default: - throw new Exception($"Unknown member '{memberName}'."); - } - } - - bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); - - public IReadOnlyList SupportedExtensions { get; } - - public bool IsExtensionSupported(string name) - { - return SupportedExtensions.Contains(name); - } - } - - /// - /// Defines available properties and methods for the abstraction of the SectionCharacteristic model. - /// - public interface ISectionCharacteristic : ISynchronizable, IMappable, IHasExtensions, IGetByExample - { - // Primary Key properties - ISection Section { get; set; } - - string SectionCharacteristicDescriptor { get; set; } - - // Non-PK properties - - // One-to-one relationships - - // Lists - - // Resource reference data - } - - /// - /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized - /// between entities/resources during API request processing. - /// - public class SectionCharacteristicMappingContract : IMappingContract, IExtensionsMappingContract - { - public SectionCharacteristicMappingContract( - IReadOnlyList supportedExtensions - ) - { - SupportedExtensions = supportedExtensions; - } - - - bool IMappingContract.IsMemberSupported(string memberName) - { - switch (memberName) - { - // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation - case "SectionCharacteristicDescriptor": - return true; - default: - throw new Exception($"Unknown member '{memberName}'."); - } - } - - bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); - - public IReadOnlyList SupportedExtensions { get; } - - public bool IsExtensionSupported(string name) - { - return SupportedExtensions.Contains(name); - } - } - - /// - /// Defines available properties and methods for the abstraction of the SectionCharacteristicDescriptor model. - /// - public interface ISectionCharacteristicDescriptor : EdFi.IDescriptor, ISynchronizable, IMappable, IHasIdentifier, IGetByExample + public interface ISection504DisabilityTypeDescriptor : EdFi.IDescriptor, ISynchronizable, IMappable, IHasIdentifier, IGetByExample { // Primary Key properties [AutoIncrement] - int SectionCharacteristicDescriptorId { get; set; } + int Section504DisabilityTypeDescriptorId { get; set; } // Non-PK properties @@ -33031,9 +33444,251 @@ public interface ISectionCharacteristicDescriptor : EdFi.IDescriptor, ISynchroni /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized /// between entities/resources during API request processing. /// - public class SectionCharacteristicDescriptorMappingContract : IMappingContract + public class Section504DisabilityTypeDescriptorMappingContract : IMappingContract { - public SectionCharacteristicDescriptorMappingContract( + public Section504DisabilityTypeDescriptorMappingContract( + bool isCodeValueSupported, + bool isDescriptionSupported, + bool isEffectiveBeginDateSupported, + bool isEffectiveEndDateSupported, + bool isNamespaceSupported, + bool isShortDescriptionSupported + ) + { + IsCodeValueSupported = isCodeValueSupported; + IsDescriptionSupported = isDescriptionSupported; + IsEffectiveBeginDateSupported = isEffectiveBeginDateSupported; + IsEffectiveEndDateSupported = isEffectiveEndDateSupported; + IsNamespaceSupported = isNamespaceSupported; + IsShortDescriptionSupported = isShortDescriptionSupported; + } + + public bool IsCodeValueSupported { get; } + public bool IsDescriptionSupported { get; } + public bool IsEffectiveBeginDateSupported { get; } + public bool IsEffectiveEndDateSupported { get; } + public bool IsNamespaceSupported { get; } + public bool IsShortDescriptionSupported { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "CodeValue": + return IsCodeValueSupported; + case "Description": + return IsDescriptionSupported; + case "EffectiveBeginDate": + return IsEffectiveBeginDateSupported; + case "EffectiveEndDate": + return IsEffectiveEndDateSupported; + case "Namespace": + return IsNamespaceSupported; + case "ShortDescription": + return IsShortDescriptionSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "Section504DisabilityTypeDescriptorId": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + } + + /// + /// Defines available properties and methods for the abstraction of the SectionAttendanceTakenEvent model. + /// + public interface ISectionAttendanceTakenEvent : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + string CalendarCode { get; set; } + + DateTime Date { get; set; } + + string LocalCourseCode { get; set; } + + long SchoolId { get; set; } + + short SchoolYear { get; set; } + + string SectionIdentifier { get; set; } + + string SessionName { get; set; } + + // Non-PK properties + DateTime EventDate { get; set; } + string StaffUniqueId { get; set; } + + // One-to-one relationships + + // Lists + + // Resource reference data + Guid? CalendarDateResourceId { get; set; } + string CalendarDateDiscriminator { get; set; } + Guid? SectionResourceId { get; set; } + string SectionDiscriminator { get; set; } + Guid? StaffResourceId { get; set; } + string StaffDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class SectionAttendanceTakenEventMappingContract : IMappingContract, IExtensionsMappingContract + { + public SectionAttendanceTakenEventMappingContract( + bool isCalendarDateReferenceSupported, + bool isEventDateSupported, + bool isSectionReferenceSupported, + bool isStaffReferenceSupported, + bool isStaffUniqueIdSupported, + IReadOnlyList supportedExtensions + ) + { + IsCalendarDateReferenceSupported = isCalendarDateReferenceSupported; + IsEventDateSupported = isEventDateSupported; + IsSectionReferenceSupported = isSectionReferenceSupported; + IsStaffReferenceSupported = isStaffReferenceSupported; + IsStaffUniqueIdSupported = isStaffUniqueIdSupported; + SupportedExtensions = supportedExtensions; + } + + public bool IsCalendarDateReferenceSupported { get; } + public bool IsEventDateSupported { get; } + public bool IsSectionReferenceSupported { get; } + public bool IsStaffReferenceSupported { get; } + public bool IsStaffUniqueIdSupported { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "CalendarDateReference": + return IsCalendarDateReferenceSupported; + case "EventDate": + return IsEventDateSupported; + case "SectionReference": + return IsSectionReferenceSupported; + case "StaffReference": + return IsStaffReferenceSupported; + case "StaffUniqueId": + return IsStaffUniqueIdSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "CalendarCode": + return true; + case "Date": + return true; + case "LocalCourseCode": + return true; + case "SchoolId": + return true; + case "SchoolYear": + return true; + case "SectionIdentifier": + return true; + case "SessionName": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the SectionCharacteristic model. + /// + public interface ISectionCharacteristic : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + ISection Section { get; set; } + + string SectionCharacteristicDescriptor { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class SectionCharacteristicMappingContract : IMappingContract, IExtensionsMappingContract + { + public SectionCharacteristicMappingContract( + IReadOnlyList supportedExtensions + ) + { + SupportedExtensions = supportedExtensions; + } + + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "SectionCharacteristicDescriptor": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the SectionCharacteristicDescriptor model. + /// + public interface ISectionCharacteristicDescriptor : EdFi.IDescriptor, ISynchronizable, IMappable, IHasIdentifier, IGetByExample + { + // Primary Key properties + [AutoIncrement] + int SectionCharacteristicDescriptorId { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class SectionCharacteristicDescriptorMappingContract : IMappingContract + { + public SectionCharacteristicDescriptorMappingContract( bool isCodeValueSupported, bool isDescriptionSupported, bool isEffectiveBeginDateSupported, @@ -40124,6 +40779,477 @@ public bool IsExtensionSupported(string name) } } + /// + /// Defines available properties and methods for the abstraction of the StudentAssessmentRegistration model. + /// + public interface IStudentAssessmentRegistration : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + string AdministrationIdentifier { get; set; } + + string AssessmentIdentifier { get; set; } + + long AssigningEducationOrganizationId { get; set; } + + long EducationOrganizationId { get; set; } + + string Namespace { get; set; } + + string StudentUniqueId { get; set; } + + // Non-PK properties + string AssessmentGradeLevelDescriptor { get; set; } + DateTime EntryDate { get; set; } + string PlatformTypeDescriptor { get; set; } + long? ReportingEducationOrganizationId { get; set; } + long SchoolId { get; set; } + long? TestingEducationOrganizationId { get; set; } + + // One-to-one relationships + + // Lists + ICollection StudentAssessmentRegistrationAssessmentAccommodations { get; set; } + ICollection StudentAssessmentRegistrationAssessmentCustomizations { get; set; } + + // Resource reference data + Guid? AssessmentAdministrationResourceId { get; set; } + string AssessmentAdministrationDiscriminator { get; set; } + Guid? ReportingEducationOrganizationResourceId { get; set; } + string ReportingEducationOrganizationDiscriminator { get; set; } + Guid? StudentEducationOrganizationAssessmentAccommodationResourceId { get; set; } + string StudentEducationOrganizationAssessmentAccommodationDiscriminator { get; set; } + Guid? StudentEducationOrganizationAssociationResourceId { get; set; } + string StudentEducationOrganizationAssociationDiscriminator { get; set; } + Guid? StudentSchoolAssociationResourceId { get; set; } + string StudentSchoolAssociationDiscriminator { get; set; } + Guid? TestingEducationOrganizationResourceId { get; set; } + string TestingEducationOrganizationDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentAssessmentRegistrationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentAssessmentRegistrationMappingContract( + bool isAssessmentAdministrationReferenceSupported, + bool isAssessmentGradeLevelDescriptorSupported, + bool isEntryDateSupported, + bool isPlatformTypeDescriptorSupported, + bool isReportingEducationOrganizationIdSupported, + bool isReportingEducationOrganizationReferenceSupported, + bool isSchoolIdSupported, + bool isStudentAssessmentRegistrationAssessmentAccommodationsSupported, + bool isStudentAssessmentRegistrationAssessmentCustomizationsSupported, + bool isStudentEducationOrganizationAssessmentAccommodationReferenceSupported, + bool isStudentEducationOrganizationAssociationReferenceSupported, + bool isStudentSchoolAssociationReferenceSupported, + bool isTestingEducationOrganizationIdSupported, + bool isTestingEducationOrganizationReferenceSupported, + bool isStudentAssessmentRegistrationAssessmentAccommodationsItemCreatable, + Func isStudentAssessmentRegistrationAssessmentAccommodationIncluded, + bool isStudentAssessmentRegistrationAssessmentCustomizationsItemCreatable, + Func isStudentAssessmentRegistrationAssessmentCustomizationIncluded, + IReadOnlyList supportedExtensions + ) + { + IsAssessmentAdministrationReferenceSupported = isAssessmentAdministrationReferenceSupported; + IsAssessmentGradeLevelDescriptorSupported = isAssessmentGradeLevelDescriptorSupported; + IsEntryDateSupported = isEntryDateSupported; + IsPlatformTypeDescriptorSupported = isPlatformTypeDescriptorSupported; + IsReportingEducationOrganizationIdSupported = isReportingEducationOrganizationIdSupported; + IsReportingEducationOrganizationReferenceSupported = isReportingEducationOrganizationReferenceSupported; + IsSchoolIdSupported = isSchoolIdSupported; + IsStudentAssessmentRegistrationAssessmentAccommodationsSupported = isStudentAssessmentRegistrationAssessmentAccommodationsSupported; + IsStudentAssessmentRegistrationAssessmentCustomizationsSupported = isStudentAssessmentRegistrationAssessmentCustomizationsSupported; + IsStudentEducationOrganizationAssessmentAccommodationReferenceSupported = isStudentEducationOrganizationAssessmentAccommodationReferenceSupported; + IsStudentEducationOrganizationAssociationReferenceSupported = isStudentEducationOrganizationAssociationReferenceSupported; + IsStudentSchoolAssociationReferenceSupported = isStudentSchoolAssociationReferenceSupported; + IsTestingEducationOrganizationIdSupported = isTestingEducationOrganizationIdSupported; + IsTestingEducationOrganizationReferenceSupported = isTestingEducationOrganizationReferenceSupported; + IsStudentAssessmentRegistrationAssessmentAccommodationsItemCreatable = isStudentAssessmentRegistrationAssessmentAccommodationsItemCreatable; + IsStudentAssessmentRegistrationAssessmentAccommodationIncluded = isStudentAssessmentRegistrationAssessmentAccommodationIncluded; + IsStudentAssessmentRegistrationAssessmentCustomizationsItemCreatable = isStudentAssessmentRegistrationAssessmentCustomizationsItemCreatable; + IsStudentAssessmentRegistrationAssessmentCustomizationIncluded = isStudentAssessmentRegistrationAssessmentCustomizationIncluded; + SupportedExtensions = supportedExtensions; + } + + public bool IsAssessmentAdministrationReferenceSupported { get; } + public bool IsAssessmentGradeLevelDescriptorSupported { get; } + public bool IsEntryDateSupported { get; } + public bool IsPlatformTypeDescriptorSupported { get; } + public bool IsReportingEducationOrganizationIdSupported { get; } + public bool IsReportingEducationOrganizationReferenceSupported { get; } + public bool IsSchoolIdSupported { get; } + public bool IsStudentAssessmentRegistrationAssessmentAccommodationsSupported { get; } + public bool IsStudentAssessmentRegistrationAssessmentCustomizationsSupported { get; } + public bool IsStudentEducationOrganizationAssessmentAccommodationReferenceSupported { get; } + public bool IsStudentEducationOrganizationAssociationReferenceSupported { get; } + public bool IsStudentSchoolAssociationReferenceSupported { get; } + public bool IsTestingEducationOrganizationIdSupported { get; } + public bool IsTestingEducationOrganizationReferenceSupported { get; } + public bool IsStudentAssessmentRegistrationAssessmentAccommodationsItemCreatable { get; } + public Func IsStudentAssessmentRegistrationAssessmentAccommodationIncluded { get; } + public bool IsStudentAssessmentRegistrationAssessmentCustomizationsItemCreatable { get; } + public Func IsStudentAssessmentRegistrationAssessmentCustomizationIncluded { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "AssessmentAdministrationReference": + return IsAssessmentAdministrationReferenceSupported; + case "AssessmentGradeLevelDescriptor": + return IsAssessmentGradeLevelDescriptorSupported; + case "EntryDate": + return IsEntryDateSupported; + case "PlatformTypeDescriptor": + return IsPlatformTypeDescriptorSupported; + case "ReportingEducationOrganizationId": + return IsReportingEducationOrganizationIdSupported; + case "ReportingEducationOrganizationReference": + return IsReportingEducationOrganizationReferenceSupported; + case "SchoolId": + return IsSchoolIdSupported; + case "StudentAssessmentRegistrationAssessmentAccommodations": + return IsStudentAssessmentRegistrationAssessmentAccommodationsSupported; + case "StudentAssessmentRegistrationAssessmentCustomizations": + return IsStudentAssessmentRegistrationAssessmentCustomizationsSupported; + case "StudentEducationOrganizationAssessmentAccommodationReference": + return IsStudentEducationOrganizationAssessmentAccommodationReferenceSupported; + case "StudentEducationOrganizationAssociationReference": + return IsStudentEducationOrganizationAssociationReferenceSupported; + case "StudentSchoolAssociationReference": + return IsStudentSchoolAssociationReferenceSupported; + case "TestingEducationOrganizationId": + return IsTestingEducationOrganizationIdSupported; + case "TestingEducationOrganizationReference": + return IsTestingEducationOrganizationReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AdministrationIdentifier": + return true; + case "AssessmentIdentifier": + return true; + case "AssigningEducationOrganizationId": + return true; + case "EducationOrganizationId": + return true; + case "Namespace": + return true; + case "StudentUniqueId": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) + { + switch (memberName) + { + case "StudentAssessmentRegistrationAssessmentAccommodations": + return IsStudentAssessmentRegistrationAssessmentAccommodationsItemCreatable; + case "StudentAssessmentRegistrationAssessmentCustomizations": + return IsStudentAssessmentRegistrationAssessmentCustomizationsItemCreatable; + default: + throw new Exception($"Unknown child item '{memberName}'."); + } + } + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the StudentAssessmentRegistrationAssessmentAccommodation model. + /// + public interface IStudentAssessmentRegistrationAssessmentAccommodation : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IStudentAssessmentRegistration StudentAssessmentRegistration { get; set; } + + string AccommodationDescriptor { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentAssessmentRegistrationAssessmentAccommodationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentAssessmentRegistrationAssessmentAccommodationMappingContract( + IReadOnlyList supportedExtensions + ) + { + SupportedExtensions = supportedExtensions; + } + + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AccommodationDescriptor": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the StudentAssessmentRegistrationAssessmentCustomization model. + /// + public interface IStudentAssessmentRegistrationAssessmentCustomization : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IStudentAssessmentRegistration StudentAssessmentRegistration { get; set; } + + string CustomizationKey { get; set; } + + // Non-PK properties + string CustomizationValue { get; set; } + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentAssessmentRegistrationAssessmentCustomizationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentAssessmentRegistrationAssessmentCustomizationMappingContract( + bool isCustomizationValueSupported, + IReadOnlyList supportedExtensions + ) + { + IsCustomizationValueSupported = isCustomizationValueSupported; + SupportedExtensions = supportedExtensions; + } + + public bool IsCustomizationValueSupported { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "CustomizationValue": + return IsCustomizationValueSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "CustomizationKey": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the StudentAssessmentRegistrationBatteryPartAssociation model. + /// + public interface IStudentAssessmentRegistrationBatteryPartAssociation : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + string AdministrationIdentifier { get; set; } + + string AssessmentBatteryPartName { get; set; } + + string AssessmentIdentifier { get; set; } + + long AssigningEducationOrganizationId { get; set; } + + long EducationOrganizationId { get; set; } + + string Namespace { get; set; } + + string StudentUniqueId { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + ICollection StudentAssessmentRegistrationBatteryPartAssociationAccommodations { get; set; } + + // Resource reference data + Guid? AssessmentBatteryPartResourceId { get; set; } + string AssessmentBatteryPartDiscriminator { get; set; } + Guid? StudentAssessmentRegistrationResourceId { get; set; } + string StudentAssessmentRegistrationDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentAssessmentRegistrationBatteryPartAssociationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentAssessmentRegistrationBatteryPartAssociationMappingContract( + bool isAssessmentBatteryPartReferenceSupported, + bool isStudentAssessmentRegistrationBatteryPartAssociationAccommodationsSupported, + bool isStudentAssessmentRegistrationReferenceSupported, + bool isStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItemCreatable, + Func isStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded, + IReadOnlyList supportedExtensions + ) + { + IsAssessmentBatteryPartReferenceSupported = isAssessmentBatteryPartReferenceSupported; + IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsSupported = isStudentAssessmentRegistrationBatteryPartAssociationAccommodationsSupported; + IsStudentAssessmentRegistrationReferenceSupported = isStudentAssessmentRegistrationReferenceSupported; + IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItemCreatable = isStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItemCreatable; + IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded = isStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded; + SupportedExtensions = supportedExtensions; + } + + public bool IsAssessmentBatteryPartReferenceSupported { get; } + public bool IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsSupported { get; } + public bool IsStudentAssessmentRegistrationReferenceSupported { get; } + public bool IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItemCreatable { get; } + public Func IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "AssessmentBatteryPartReference": + return IsAssessmentBatteryPartReferenceSupported; + case "StudentAssessmentRegistrationBatteryPartAssociationAccommodations": + return IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsSupported; + case "StudentAssessmentRegistrationReference": + return IsStudentAssessmentRegistrationReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AdministrationIdentifier": + return true; + case "AssessmentBatteryPartName": + return true; + case "AssessmentIdentifier": + return true; + case "AssigningEducationOrganizationId": + return true; + case "EducationOrganizationId": + return true; + case "Namespace": + return true; + case "StudentUniqueId": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) + { + switch (memberName) + { + case "StudentAssessmentRegistrationBatteryPartAssociationAccommodations": + return IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItemCreatable; + default: + throw new Exception($"Unknown child item '{memberName}'."); + } + } + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the StudentAssessmentRegistrationBatteryPartAssociationAccommodation model. + /// + public interface IStudentAssessmentRegistrationBatteryPartAssociationAccommodation : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IStudentAssessmentRegistrationBatteryPartAssociation StudentAssessmentRegistrationBatteryPartAssociation { get; set; } + + string AccommodationDescriptor { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentAssessmentRegistrationBatteryPartAssociationAccommodationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentAssessmentRegistrationBatteryPartAssociationAccommodationMappingContract( + IReadOnlyList supportedExtensions + ) + { + SupportedExtensions = supportedExtensions; + } + + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AccommodationDescriptor": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + /// /// Defines available properties and methods for the abstraction of the StudentAssessmentScoreResult model. /// @@ -41660,6 +42786,154 @@ public bool IsExtensionSupported(string name) } } + /// + /// Defines available properties and methods for the abstraction of the StudentEducationOrganizationAssessmentAccommodation model. + /// + public interface IStudentEducationOrganizationAssessmentAccommodation : ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + long EducationOrganizationId { get; set; } + + string StudentUniqueId { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + ICollection StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { get; set; } + + // Resource reference data + Guid? EducationOrganizationResourceId { get; set; } + string EducationOrganizationDiscriminator { get; set; } + Guid? StudentResourceId { get; set; } + string StudentDiscriminator { get; set; } + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentEducationOrganizationAssessmentAccommodationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentEducationOrganizationAssessmentAccommodationMappingContract( + bool isEducationOrganizationReferenceSupported, + bool isStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsSupported, + bool isStudentReferenceSupported, + bool isStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItemCreatable, + Func isStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationIncluded, + IReadOnlyList supportedExtensions + ) + { + IsEducationOrganizationReferenceSupported = isEducationOrganizationReferenceSupported; + IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsSupported = isStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsSupported; + IsStudentReferenceSupported = isStudentReferenceSupported; + IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItemCreatable = isStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItemCreatable; + IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationIncluded = isStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationIncluded; + SupportedExtensions = supportedExtensions; + } + + public bool IsEducationOrganizationReferenceSupported { get; } + public bool IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsSupported { get; } + public bool IsStudentReferenceSupported { get; } + public bool IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItemCreatable { get; } + public Func IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationIncluded { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "EducationOrganizationReference": + return IsEducationOrganizationReferenceSupported; + case "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations": + return IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsSupported; + case "StudentReference": + return IsStudentReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "EducationOrganizationId": + return true; + case "StudentUniqueId": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) + { + switch (memberName) + { + case "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations": + return IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItemCreatable; + default: + throw new Exception($"Unknown child item '{memberName}'."); + } + } + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + + /// + /// Defines available properties and methods for the abstraction of the StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation model. + /// + public interface IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation : ISynchronizable, IMappable, IHasExtensions, IGetByExample + { + // Primary Key properties + IStudentEducationOrganizationAssessmentAccommodation StudentEducationOrganizationAssessmentAccommodation { get; set; } + + string AccommodationDescriptor { get; set; } + + // Non-PK properties + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationMappingContract( + IReadOnlyList supportedExtensions + ) + { + SupportedExtensions = supportedExtensions; + } + + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "AccommodationDescriptor": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) => throw new Exception($"Unknown child item member '{memberName}'."); + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + /// /// Defines available properties and methods for the abstraction of the StudentEducationOrganizationAssociation model. /// @@ -47170,6 +48444,148 @@ public bool IsExtensionSupported(string name) } } + /// + /// Defines available properties and methods for the abstraction of the StudentSection504ProgramAssociation model. + /// + public interface IStudentSection504ProgramAssociation : EdFi.IGeneralStudentProgramAssociation, ISynchronizable, IMappable, IHasExtensions, IHasIdentifier, IGetByExample + { + // Primary Key properties + + // Non-PK properties + bool? AccommodationPlan { get; set; } + string Section504DisabilityTypeDescriptor { get; set; } + bool Section504Eligibility { get; set; } + DateTime? Section504EligibilityDecisionDate { get; set; } + DateTime? Section504MeetingDate { get; set; } + + // One-to-one relationships + + // Lists + + // Resource reference data + } + + /// + /// Defines a mapping contract appropriate for a particular context when data is either being mapped or synchronized + /// between entities/resources during API request processing. + /// + public class StudentSection504ProgramAssociationMappingContract : IMappingContract, IExtensionsMappingContract + { + public StudentSection504ProgramAssociationMappingContract( + bool isAccommodationPlanSupported, + bool isEducationOrganizationReferenceSupported, + bool isEndDateSupported, + bool isGeneralStudentProgramAssociationProgramParticipationStatusesSupported, + bool isProgramReferenceSupported, + bool isReasonExitedDescriptorSupported, + bool isSection504DisabilityTypeDescriptorSupported, + bool isSection504EligibilitySupported, + bool isSection504EligibilityDecisionDateSupported, + bool isSection504MeetingDateSupported, + bool isServedOutsideOfRegularSessionSupported, + bool isStudentReferenceSupported, + bool isGeneralStudentProgramAssociationProgramParticipationStatusesItemCreatable, + Func isGeneralStudentProgramAssociationProgramParticipationStatusIncluded, + IReadOnlyList supportedExtensions + ) + { + IsAccommodationPlanSupported = isAccommodationPlanSupported; + IsEducationOrganizationReferenceSupported = isEducationOrganizationReferenceSupported; + IsEndDateSupported = isEndDateSupported; + IsGeneralStudentProgramAssociationProgramParticipationStatusesSupported = isGeneralStudentProgramAssociationProgramParticipationStatusesSupported; + IsProgramReferenceSupported = isProgramReferenceSupported; + IsReasonExitedDescriptorSupported = isReasonExitedDescriptorSupported; + IsSection504DisabilityTypeDescriptorSupported = isSection504DisabilityTypeDescriptorSupported; + IsSection504EligibilitySupported = isSection504EligibilitySupported; + IsSection504EligibilityDecisionDateSupported = isSection504EligibilityDecisionDateSupported; + IsSection504MeetingDateSupported = isSection504MeetingDateSupported; + IsServedOutsideOfRegularSessionSupported = isServedOutsideOfRegularSessionSupported; + IsStudentReferenceSupported = isStudentReferenceSupported; + IsGeneralStudentProgramAssociationProgramParticipationStatusesItemCreatable = isGeneralStudentProgramAssociationProgramParticipationStatusesItemCreatable; + IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded = isGeneralStudentProgramAssociationProgramParticipationStatusIncluded; + SupportedExtensions = supportedExtensions; + } + + public bool IsAccommodationPlanSupported { get; } + public bool IsEducationOrganizationReferenceSupported { get; } + public bool IsEndDateSupported { get; } + public bool IsGeneralStudentProgramAssociationProgramParticipationStatusesSupported { get; } + public bool IsProgramReferenceSupported { get; } + public bool IsReasonExitedDescriptorSupported { get; } + public bool IsSection504DisabilityTypeDescriptorSupported { get; } + public bool IsSection504EligibilitySupported { get; } + public bool IsSection504EligibilityDecisionDateSupported { get; } + public bool IsSection504MeetingDateSupported { get; } + public bool IsServedOutsideOfRegularSessionSupported { get; } + public bool IsStudentReferenceSupported { get; } + public bool IsGeneralStudentProgramAssociationProgramParticipationStatusesItemCreatable { get; } + public Func IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded { get; } + + bool IMappingContract.IsMemberSupported(string memberName) + { + switch (memberName) + { + case "AccommodationPlan": + return IsAccommodationPlanSupported; + case "EducationOrganizationReference": + return IsEducationOrganizationReferenceSupported; + case "EndDate": + return IsEndDateSupported; + case "GeneralStudentProgramAssociationProgramParticipationStatuses": + return IsGeneralStudentProgramAssociationProgramParticipationStatusesSupported; + case "ProgramReference": + return IsProgramReferenceSupported; + case "ReasonExitedDescriptor": + return IsReasonExitedDescriptorSupported; + case "Section504DisabilityTypeDescriptor": + return IsSection504DisabilityTypeDescriptorSupported; + case "Section504Eligibility": + return IsSection504EligibilitySupported; + case "Section504EligibilityDecisionDate": + return IsSection504EligibilityDecisionDateSupported; + case "Section504MeetingDate": + return IsSection504MeetingDateSupported; + case "ServedOutsideOfRegularSession": + return IsServedOutsideOfRegularSessionSupported; + case "StudentReference": + return IsStudentReferenceSupported; + // Additional inspection support for identifying properties (which are implicitly supported by Profiles) for use during validation + case "BeginDate": + return true; + case "EducationOrganizationId": + return true; + case "ProgramEducationOrganizationId": + return true; + case "ProgramName": + return true; + case "ProgramTypeDescriptor": + return true; + case "StudentUniqueId": + return true; + default: + throw new Exception($"Unknown member '{memberName}'."); + } + } + + bool IMappingContract.IsItemCreatable(string memberName) + { + switch (memberName) + { + case "GeneralStudentProgramAssociationProgramParticipationStatuses": + return IsGeneralStudentProgramAssociationProgramParticipationStatusesItemCreatable; + default: + throw new Exception($"Unknown child item '{memberName}'."); + } + } + + public IReadOnlyList SupportedExtensions { get; } + + public bool IsExtensionSupported(string name) + { + return SupportedExtensions.Contains(name); + } + } + /// /// Defines available properties and methods for the abstraction of the StudentSectionAssociation model. /// @@ -48220,6 +49636,8 @@ public interface IStudentSpecialEducationProgramEligibilityAssociation : ISynchr long EducationOrganizationId { get; set; } + long ProgramEducationOrganizationId { get; set; } + string ProgramName { get; set; } string ProgramTypeDescriptor { get; set; } @@ -48369,6 +49787,8 @@ bool IMappingContract.IsMemberSupported(string memberName) return true; case "EducationOrganizationId": return true; + case "ProgramEducationOrganizationId": + return true; case "ProgramName": return true; case "ProgramTypeDescriptor": diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Mappers_EntityMapper.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Mappers_EntityMapper.generated.approved.cs index e1709c671f..51efd56a3d 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Mappers_EntityMapper.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Mappers_EntityMapper.generated.approved.cs @@ -3453,6 +3453,496 @@ public static void MapTo(this IAssessmentSection source, IAssessmentSection targ + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + +} +// Aggregate: AssessmentAdministration + +namespace EdFi.Ods.Entities.Common.EdFi //.AssessmentAdministrationAggregate +{ + [ExcludeFromCodeCoverage] + public static class AssessmentAdministrationMapper + { + private static readonly FullName _fullName_edfi_AssessmentAdministration = new FullName("edfi", "AssessmentAdministration"); + + public static bool SynchronizeTo(this IAssessmentAdministration source, IAssessmentAdministration target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (AssessmentAdministrationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentAdministration); + + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + + // Detect primary key changes + if ( + (!keyStringComparer.Equals(target.AdministrationIdentifier, source.AdministrationIdentifier)) + || (!keyStringComparer.Equals(target.AssessmentIdentifier, source.AssessmentIdentifier)) + || (target.AssigningEducationOrganizationId != source.AssigningEducationOrganizationId) + || (!keyStringComparer.Equals(target.Namespace, source.Namespace))) + { + // Disallow PK column updates on AssessmentAdministration + throw new KeyChangeNotSupportedException("AssessmentAdministration"); + } + + + // Copy non-PK properties + + + // Sync lists + if (mappingContract?.IsAssessmentAdministrationAssessmentAdminstrationPeriodsSupported ?? true) + { + isModified |= + source.AssessmentAdministrationAssessmentAdminstrationPeriods.SynchronizeCollectionTo( + target.AssessmentAdministrationAssessmentAdminstrationPeriods, + onChildAdded: child => + { + child.AssessmentAdministration = target; + }, + itemCreatable: mappingContract?.IsAssessmentAdministrationAssessmentAdminstrationPeriodsItemCreatable ?? true, + includeItem: item => mappingContract?.IsAssessmentAdministrationAssessmentAdminstrationPeriodIncluded?.Invoke(item) ?? true); + } + + if (mappingContract?.IsAssessmentAdministrationAssessmentBatteryPartsSupported ?? true) + { + isModified |= + source.AssessmentAdministrationAssessmentBatteryParts.SynchronizeCollectionTo( + target.AssessmentAdministrationAssessmentBatteryParts, + onChildAdded: child => + { + child.AssessmentAdministration = target; + }, + itemCreatable: mappingContract?.IsAssessmentAdministrationAssessmentBatteryPartsItemCreatable ?? true, + includeItem: item => mappingContract?.IsAssessmentAdministrationAssessmentBatteryPartIncluded?.Invoke(item) ?? true); + } + + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IAssessmentAdministration source, IAssessmentAdministration target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (AssessmentAdministrationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentAdministration); + + // Copy resource Id + target.Id = source.Id; + + // Copy contextual primary key values + target.AdministrationIdentifier = source.AdministrationIdentifier; + target.AssessmentIdentifier = source.AssessmentIdentifier; + target.AssigningEducationOrganizationId = source.AssigningEducationOrganizationId; + target.Namespace = source.Namespace; + + // Copy non-PK properties + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.AssessmentResourceId = source.AssessmentResourceId; + target.AssessmentDiscriminator = source.AssessmentDiscriminator; + target.AssigningEducationOrganizationResourceId = source.AssigningEducationOrganizationResourceId; + target.AssigningEducationOrganizationDiscriminator = source.AssigningEducationOrganizationDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + if (mappingContract?.IsAssessmentAdministrationAssessmentAdminstrationPeriodsSupported != false) + { + source.AssessmentAdministrationAssessmentAdminstrationPeriods.MapCollectionTo(target.AssessmentAdministrationAssessmentAdminstrationPeriods, mappingContract?.IsAssessmentAdministrationAssessmentAdminstrationPeriodsItemCreatable ?? true, target, mappingContract?.IsAssessmentAdministrationAssessmentAdminstrationPeriodIncluded); + } + + if (mappingContract?.IsAssessmentAdministrationAssessmentBatteryPartsSupported != false) + { + source.AssessmentAdministrationAssessmentBatteryParts.MapCollectionTo(target.AssessmentAdministrationAssessmentBatteryParts, mappingContract?.IsAssessmentAdministrationAssessmentBatteryPartsItemCreatable ?? true, target, mappingContract?.IsAssessmentAdministrationAssessmentBatteryPartIncluded); + } + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class AssessmentAdministrationAssessmentAdminstrationPeriodMapper + { + private static readonly FullName _fullName_edfi_AssessmentAdministrationAssessmentAdminstrationPeriod = new FullName("edfi", "AssessmentAdministrationAssessmentAdminstrationPeriod"); + + public static bool SynchronizeTo(this IAssessmentAdministrationAssessmentAdminstrationPeriod source, IAssessmentAdministrationAssessmentAdminstrationPeriod target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (AssessmentAdministrationAssessmentAdminstrationPeriodMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentAdministrationAssessmentAdminstrationPeriod); + + + // Copy non-PK properties + + if ((mappingContract?.IsEndDateSupported != false) + && target.EndDate != source.EndDate) + { + target.EndDate = source.EndDate; + isModified = true; + } + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IAssessmentAdministrationAssessmentAdminstrationPeriod source, IAssessmentAdministrationAssessmentAdminstrationPeriod target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (AssessmentAdministrationAssessmentAdminstrationPeriodMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentAdministrationAssessmentAdminstrationPeriod); + + // Copy contextual primary key values + target.BeginDate = source.BeginDate; + + // Copy non-PK properties + + if (mappingContract?.IsEndDateSupported != false) + target.EndDate = source.EndDate; + + // Copy Aggregate Reference Data + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class AssessmentAdministrationAssessmentBatteryPartMapper + { + private static readonly FullName _fullName_edfi_AssessmentAdministrationAssessmentBatteryPart = new FullName("edfi", "AssessmentAdministrationAssessmentBatteryPart"); + + public static bool SynchronizeTo(this IAssessmentAdministrationAssessmentBatteryPart source, IAssessmentAdministrationAssessmentBatteryPart target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (AssessmentAdministrationAssessmentBatteryPartMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentAdministrationAssessmentBatteryPart); + + + // Copy non-PK properties + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IAssessmentAdministrationAssessmentBatteryPart source, IAssessmentAdministrationAssessmentBatteryPart target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (AssessmentAdministrationAssessmentBatteryPartMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentAdministrationAssessmentBatteryPart); + + // Copy contextual primary key values + target.AssessmentBatteryPartName = source.AssessmentBatteryPartName; + + // Copy non-PK properties + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.AssessmentBatteryPartResourceId = source.AssessmentBatteryPartResourceId; + target.AssessmentBatteryPartDiscriminator = source.AssessmentBatteryPartDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + +} +// Aggregate: AssessmentBatteryPart + +namespace EdFi.Ods.Entities.Common.EdFi //.AssessmentBatteryPartAggregate +{ + [ExcludeFromCodeCoverage] + public static class AssessmentBatteryPartMapper + { + private static readonly FullName _fullName_edfi_AssessmentBatteryPart = new FullName("edfi", "AssessmentBatteryPart"); + + public static bool SynchronizeTo(this IAssessmentBatteryPart source, IAssessmentBatteryPart target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (AssessmentBatteryPartMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentBatteryPart); + + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + + // Detect primary key changes + if ( + (!keyStringComparer.Equals(target.AssessmentBatteryPartName, source.AssessmentBatteryPartName)) + || (!keyStringComparer.Equals(target.AssessmentIdentifier, source.AssessmentIdentifier)) + || (!keyStringComparer.Equals(target.Namespace, source.Namespace))) + { + // Disallow PK column updates on AssessmentBatteryPart + throw new KeyChangeNotSupportedException("AssessmentBatteryPart"); + } + + + // Copy non-PK properties + + + // Sync lists + if (mappingContract?.IsAssessmentBatteryPartObjectiveAssessmentsSupported ?? true) + { + isModified |= + source.AssessmentBatteryPartObjectiveAssessments.SynchronizeCollectionTo( + target.AssessmentBatteryPartObjectiveAssessments, + onChildAdded: child => + { + child.AssessmentBatteryPart = target; + }, + itemCreatable: mappingContract?.IsAssessmentBatteryPartObjectiveAssessmentsItemCreatable ?? true, + includeItem: item => mappingContract?.IsAssessmentBatteryPartObjectiveAssessmentIncluded?.Invoke(item) ?? true); + } + + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IAssessmentBatteryPart source, IAssessmentBatteryPart target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (AssessmentBatteryPartMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentBatteryPart); + + // Copy resource Id + target.Id = source.Id; + + // Copy contextual primary key values + target.AssessmentBatteryPartName = source.AssessmentBatteryPartName; + target.AssessmentIdentifier = source.AssessmentIdentifier; + target.Namespace = source.Namespace; + + // Copy non-PK properties + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.AssessmentResourceId = source.AssessmentResourceId; + target.AssessmentDiscriminator = source.AssessmentDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + if (mappingContract?.IsAssessmentBatteryPartObjectiveAssessmentsSupported != false) + { + source.AssessmentBatteryPartObjectiveAssessments.MapCollectionTo(target.AssessmentBatteryPartObjectiveAssessments, mappingContract?.IsAssessmentBatteryPartObjectiveAssessmentsItemCreatable ?? true, target, mappingContract?.IsAssessmentBatteryPartObjectiveAssessmentIncluded); + } + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class AssessmentBatteryPartObjectiveAssessmentMapper + { + private static readonly FullName _fullName_edfi_AssessmentBatteryPartObjectiveAssessment = new FullName("edfi", "AssessmentBatteryPartObjectiveAssessment"); + + public static bool SynchronizeTo(this IAssessmentBatteryPartObjectiveAssessment source, IAssessmentBatteryPartObjectiveAssessment target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (AssessmentBatteryPartObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentBatteryPartObjectiveAssessment); + + + // Copy non-PK properties + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IAssessmentBatteryPartObjectiveAssessment source, IAssessmentBatteryPartObjectiveAssessment target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (AssessmentBatteryPartObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentBatteryPartObjectiveAssessment); + + // Copy contextual primary key values + target.IdentificationCode = source.IdentificationCode; + + // Copy non-PK properties + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.ObjectiveAssessmentResourceId = source.ObjectiveAssessmentResourceId; + target.ObjectiveAssessmentDiscriminator = source.ObjectiveAssessmentDiscriminator; + } + + + // ---------------------------------- // Map One-to-one relationships // ---------------------------------- @@ -4963,6 +5453,237 @@ public static void MapTo(this IAssessmentScoreRangeLearningStandardLearningStand + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + +} +// Aggregate: AssesssmentAdministrationParticipation + +namespace EdFi.Ods.Entities.Common.EdFi //.AssesssmentAdministrationParticipationAggregate +{ + [ExcludeFromCodeCoverage] + public static class AssesssmentAdministrationParticipationMapper + { + private static readonly FullName _fullName_edfi_AssesssmentAdministrationParticipation = new FullName("edfi", "AssesssmentAdministrationParticipation"); + + public static bool SynchronizeTo(this IAssesssmentAdministrationParticipation source, IAssesssmentAdministrationParticipation target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (AssesssmentAdministrationParticipationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssesssmentAdministrationParticipation); + + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + + // Detect primary key changes + if ( + (!keyStringComparer.Equals(target.AdministrationIdentifier, source.AdministrationIdentifier)) + || (!keyStringComparer.Equals(target.AssessmentIdentifier, source.AssessmentIdentifier)) + || (target.AssigningEducationOrganizationId != source.AssigningEducationOrganizationId) + || (!keyStringComparer.Equals(target.Namespace, source.Namespace)) + || (target.ParticipatingEducationOrganizationId != source.ParticipatingEducationOrganizationId)) + { + // Disallow PK column updates on AssesssmentAdministrationParticipation + throw new KeyChangeNotSupportedException("AssesssmentAdministrationParticipation"); + } + + + // Copy non-PK properties + + + // Sync lists + if (mappingContract?.IsAssesssmentAdministrationParticipationAdministrationPointOfContactsSupported ?? true) + { + isModified |= + source.AssesssmentAdministrationParticipationAdministrationPointOfContacts.SynchronizeCollectionTo( + target.AssesssmentAdministrationParticipationAdministrationPointOfContacts, + onChildAdded: child => + { + child.AssesssmentAdministrationParticipation = target; + }, + itemCreatable: mappingContract?.IsAssesssmentAdministrationParticipationAdministrationPointOfContactsItemCreatable ?? true, + includeItem: item => mappingContract?.IsAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded?.Invoke(item) ?? true); + } + + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IAssesssmentAdministrationParticipation source, IAssesssmentAdministrationParticipation target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (AssesssmentAdministrationParticipationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssesssmentAdministrationParticipation); + + // Copy resource Id + target.Id = source.Id; + + // Copy contextual primary key values + target.AdministrationIdentifier = source.AdministrationIdentifier; + target.AssessmentIdentifier = source.AssessmentIdentifier; + target.AssigningEducationOrganizationId = source.AssigningEducationOrganizationId; + target.Namespace = source.Namespace; + target.ParticipatingEducationOrganizationId = source.ParticipatingEducationOrganizationId; + + // Copy non-PK properties + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.AssessmentAdministrationResourceId = source.AssessmentAdministrationResourceId; + target.AssessmentAdministrationDiscriminator = source.AssessmentAdministrationDiscriminator; + target.ParticipatingEducationOrganizationResourceId = source.ParticipatingEducationOrganizationResourceId; + target.ParticipatingEducationOrganizationDiscriminator = source.ParticipatingEducationOrganizationDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + if (mappingContract?.IsAssesssmentAdministrationParticipationAdministrationPointOfContactsSupported != false) + { + source.AssesssmentAdministrationParticipationAdministrationPointOfContacts.MapCollectionTo(target.AssesssmentAdministrationParticipationAdministrationPointOfContacts, mappingContract?.IsAssesssmentAdministrationParticipationAdministrationPointOfContactsItemCreatable ?? true, target, mappingContract?.IsAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded); + } + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class AssesssmentAdministrationParticipationAdministrationPointOfContactMapper + { + private static readonly FullName _fullName_edfi_AssesssmentAdministrationParticipationAdministrationPointOfContact = new FullName("edfi", "AssesssmentAdministrationParticipationAdministrationPointOfContact"); + + public static bool SynchronizeTo(this IAssesssmentAdministrationParticipationAdministrationPointOfContact source, IAssesssmentAdministrationParticipationAdministrationPointOfContact target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (AssesssmentAdministrationParticipationAdministrationPointOfContactMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssesssmentAdministrationParticipationAdministrationPointOfContact); + + + // Copy non-PK properties + + if ((mappingContract?.IsFirstNameSupported != false) + && target.FirstName != source.FirstName) + { + target.FirstName = source.FirstName; + isModified = true; + } + + if ((mappingContract?.IsLastSurnameSupported != false) + && target.LastSurname != source.LastSurname) + { + target.LastSurname = source.LastSurname; + isModified = true; + } + + if ((mappingContract?.IsLoginIdSupported != false) + && target.LoginId != source.LoginId) + { + target.LoginId = source.LoginId; + isModified = true; + } + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IAssesssmentAdministrationParticipationAdministrationPointOfContact source, IAssesssmentAdministrationParticipationAdministrationPointOfContact target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (AssesssmentAdministrationParticipationAdministrationPointOfContactMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_AssesssmentAdministrationParticipationAdministrationPointOfContact); + + // Copy contextual primary key values + target.EducationOrganizationId = source.EducationOrganizationId; + target.ElectronicMailAddress = source.ElectronicMailAddress; + + // Copy non-PK properties + + if (mappingContract?.IsFirstNameSupported != false) + target.FirstName = source.FirstName; + + if (mappingContract?.IsLastSurnameSupported != false) + target.LastSurname = source.LastSurname; + + if (mappingContract?.IsLoginIdSupported != false) + target.LoginId = source.LoginId; + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.EducationOrganizationResourceId = source.EducationOrganizationResourceId; + target.EducationOrganizationDiscriminator = source.EducationOrganizationDiscriminator; + } + + + // ---------------------------------- // Map One-to-one relationships // ---------------------------------- @@ -25588,6 +26309,14 @@ public static void MapTo(this IGeneralStudentProgramAssociation source, IGeneral sourceStudentSchoolFoodServiceProgramAssociation.MapDerivedTo((IStudentSchoolFoodServiceProgramAssociation) target, onMapped); return; } + // Map derived type StudentSection504ProgramAssociation + var sourceStudentSection504ProgramAssociation = source as IStudentSection504ProgramAssociation; + + if (sourceStudentSection504ProgramAssociation != null) + { + sourceStudentSection504ProgramAssociation.MapDerivedTo((IStudentSection504ProgramAssociation) target, onMapped); + return; + } // Map derived type StudentSpecialEducationProgramAssociation var sourceStudentSpecialEducationProgramAssociation = source as IStudentSpecialEducationProgramAssociation; @@ -52844,114 +53573,266 @@ public static void MapTo(this ISectionProgram source, ISectionProgram target, Ac } } -// Aggregate: SectionAttendanceTakenEvent +// Aggregate: Section504DisabilityTypeDescriptor -namespace EdFi.Ods.Entities.Common.EdFi //.SectionAttendanceTakenEventAggregate +namespace EdFi.Ods.Entities.Common.EdFi //.Section504DisabilityTypeDescriptorAggregate { [ExcludeFromCodeCoverage] - public static class SectionAttendanceTakenEventMapper + public static class Section504DisabilityTypeDescriptorMapper { - private static readonly FullName _fullName_edfi_SectionAttendanceTakenEvent = new FullName("edfi", "SectionAttendanceTakenEvent"); + private static readonly FullName _fullName_edfi_Section504DisabilityTypeDescriptor = new FullName("edfi", "Section504DisabilityTypeDescriptor"); - public static bool SynchronizeTo(this ISectionAttendanceTakenEvent source, ISectionAttendanceTakenEvent target) + public static bool SynchronizeTo(this ISection504DisabilityTypeDescriptor source, ISection504DisabilityTypeDescriptor target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (SectionAttendanceTakenEventMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (Section504DisabilityTypeDescriptorMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_SectionAttendanceTakenEvent); - - var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + .GetMappingContract(_fullName_edfi_Section504DisabilityTypeDescriptor); // Detect primary key changes if ( - (!keyStringComparer.Equals(target.CalendarCode, source.CalendarCode)) - || (target.Date != source.Date) - || (!keyStringComparer.Equals(target.LocalCourseCode, source.LocalCourseCode)) - || (target.SchoolId != source.SchoolId) - || (target.SchoolYear != source.SchoolYear) - || (!keyStringComparer.Equals(target.SectionIdentifier, source.SectionIdentifier)) - || (!keyStringComparer.Equals(target.SessionName, source.SessionName))) + !string.Equals(target.Namespace, source.Namespace, StringComparison.OrdinalIgnoreCase) + || !string.Equals(target.CodeValue, source.CodeValue, StringComparison.OrdinalIgnoreCase)) { - // Disallow PK column updates on SectionAttendanceTakenEvent - throw new KeyChangeNotSupportedException("SectionAttendanceTakenEvent"); + // Disallow PK column updates on Section504DisabilityTypeDescriptor + throw new KeyChangeNotSupportedException("Section504DisabilityTypeDescriptor"); } - // Copy non-PK properties + // Copy inherited non-PK properties - if ((mappingContract?.IsEventDateSupported != false) - && target.EventDate != source.EventDate) + + if ((mappingContract?.IsCodeValueSupported != false) + && target.CodeValue != source.CodeValue) { - target.EventDate = source.EventDate; + target.CodeValue = source.CodeValue; isModified = true; } - if ((mappingContract?.IsStaffUniqueIdSupported != false) - && target.StaffUniqueId != source.StaffUniqueId) + if ((mappingContract?.IsDescriptionSupported != false) + && target.Description != source.Description) { - target.StaffUniqueId = source.StaffUniqueId; + target.Description = source.Description; isModified = true; } + if ((mappingContract?.IsEffectiveBeginDateSupported != false) + && target.EffectiveBeginDate != source.EffectiveBeginDate) + { + target.EffectiveBeginDate = source.EffectiveBeginDate; + isModified = true; + } + + if ((mappingContract?.IsEffectiveEndDateSupported != false) + && target.EffectiveEndDate != source.EffectiveEndDate) + { + target.EffectiveEndDate = source.EffectiveEndDate; + isModified = true; + } + + if ((mappingContract?.IsNamespaceSupported != false) + && target.Namespace != source.Namespace) + { + target.Namespace = source.Namespace; + isModified = true; + } + + if ((mappingContract?.IsShortDescriptionSupported != false) + && target.ShortDescription != source.ShortDescription) + { + target.ShortDescription = source.ShortDescription; + isModified = true; + } + + // Copy non-PK properties + + + // Synch inherited lists // Sync lists - // Sync extensions - isModified |= source.SynchronizeExtensionsTo(target, mappingContract); return isModified; } - public static void MapTo(this ISectionAttendanceTakenEvent source, ISectionAttendanceTakenEvent target, Action onMapped) + public static void MapTo(this ISection504DisabilityTypeDescriptor source, ISection504DisabilityTypeDescriptor target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (SectionAttendanceTakenEventMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (Section504DisabilityTypeDescriptorMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_SectionAttendanceTakenEvent); + .GetMappingContract(_fullName_edfi_Section504DisabilityTypeDescriptor); // Copy resource Id target.Id = source.Id; // Copy contextual primary key values - target.CalendarCode = source.CalendarCode; - target.Date = source.Date; - target.LocalCourseCode = source.LocalCourseCode; - target.SchoolId = source.SchoolId; - target.SchoolYear = source.SchoolYear; - target.SectionIdentifier = source.SectionIdentifier; - target.SessionName = source.SessionName; + target.Section504DisabilityTypeDescriptorId = source.Section504DisabilityTypeDescriptorId; - // Copy non-PK properties + // Copy inherited non-PK properties - if (mappingContract?.IsEventDateSupported != false) - target.EventDate = source.EventDate; + if (mappingContract?.IsCodeValueSupported != false) + target.CodeValue = source.CodeValue; - if (mappingContract?.IsStaffUniqueIdSupported != false) - target.StaffUniqueId = source.StaffUniqueId; + if (mappingContract?.IsDescriptionSupported != false) + target.Description = source.Description; - // Copy Aggregate Reference Data - if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null - || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) - { - target.CalendarDateResourceId = source.CalendarDateResourceId; - target.CalendarDateDiscriminator = source.CalendarDateDiscriminator; - target.SectionResourceId = source.SectionResourceId; - target.SectionDiscriminator = source.SectionDiscriminator; - target.StaffResourceId = source.StaffResourceId; - target.StaffDiscriminator = source.StaffDiscriminator; - } + if (mappingContract?.IsEffectiveBeginDateSupported != false) + target.EffectiveBeginDate = source.EffectiveBeginDate; + + if (mappingContract?.IsEffectiveEndDateSupported != false) + target.EffectiveEndDate = source.EffectiveEndDate; + if (mappingContract?.IsNamespaceSupported != false) + target.Namespace = source.Namespace; + + if (mappingContract?.IsShortDescriptionSupported != false) + target.ShortDescription = source.ShortDescription; + + // Copy non-PK properties + + // Copy Aggregate Reference Data // ---------------------------------- // Map One-to-one relationships // ---------------------------------- + // Map inherited lists + // Map lists - // Map extensions - source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + +} +// Aggregate: SectionAttendanceTakenEvent + +namespace EdFi.Ods.Entities.Common.EdFi //.SectionAttendanceTakenEventAggregate +{ + [ExcludeFromCodeCoverage] + public static class SectionAttendanceTakenEventMapper + { + private static readonly FullName _fullName_edfi_SectionAttendanceTakenEvent = new FullName("edfi", "SectionAttendanceTakenEvent"); + + public static bool SynchronizeTo(this ISectionAttendanceTakenEvent source, ISectionAttendanceTakenEvent target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (SectionAttendanceTakenEventMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_SectionAttendanceTakenEvent); + + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + + // Detect primary key changes + if ( + (!keyStringComparer.Equals(target.CalendarCode, source.CalendarCode)) + || (target.Date != source.Date) + || (!keyStringComparer.Equals(target.LocalCourseCode, source.LocalCourseCode)) + || (target.SchoolId != source.SchoolId) + || (target.SchoolYear != source.SchoolYear) + || (!keyStringComparer.Equals(target.SectionIdentifier, source.SectionIdentifier)) + || (!keyStringComparer.Equals(target.SessionName, source.SessionName))) + { + // Disallow PK column updates on SectionAttendanceTakenEvent + throw new KeyChangeNotSupportedException("SectionAttendanceTakenEvent"); + } + + + // Copy non-PK properties + + if ((mappingContract?.IsEventDateSupported != false) + && target.EventDate != source.EventDate) + { + target.EventDate = source.EventDate; + isModified = true; + } + + if ((mappingContract?.IsStaffUniqueIdSupported != false) + && target.StaffUniqueId != source.StaffUniqueId) + { + target.StaffUniqueId = source.StaffUniqueId; + isModified = true; + } + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this ISectionAttendanceTakenEvent source, ISectionAttendanceTakenEvent target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (SectionAttendanceTakenEventMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_SectionAttendanceTakenEvent); + + // Copy resource Id + target.Id = source.Id; + + // Copy contextual primary key values + target.CalendarCode = source.CalendarCode; + target.Date = source.Date; + target.LocalCourseCode = source.LocalCourseCode; + target.SchoolId = source.SchoolId; + target.SchoolYear = source.SchoolYear; + target.SectionIdentifier = source.SectionIdentifier; + target.SessionName = source.SessionName; + + // Copy non-PK properties + + if (mappingContract?.IsEventDateSupported != false) + target.EventDate = source.EventDate; + + if (mappingContract?.IsStaffUniqueIdSupported != false) + target.StaffUniqueId = source.StaffUniqueId; + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.CalendarDateResourceId = source.CalendarDateResourceId; + target.CalendarDateDiscriminator = source.CalendarDateDiscriminator; + target.SectionResourceId = source.SectionResourceId; + target.SectionDiscriminator = source.SectionDiscriminator; + target.StaffResourceId = source.StaffResourceId; + target.StaffDiscriminator = source.StaffDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); // Convert source to an ETag, if appropriate if (target is IHasETag entityWithETag) @@ -63257,18 +64138,431 @@ public static void MapTo(this IStudentAssessmentItem source, IStudentAssessmentI } [ExcludeFromCodeCoverage] - public static class StudentAssessmentPerformanceLevelMapper + public static class StudentAssessmentPerformanceLevelMapper + { + private static readonly FullName _fullName_edfi_StudentAssessmentPerformanceLevel = new FullName("edfi", "StudentAssessmentPerformanceLevel"); + + public static bool SynchronizeTo(this IStudentAssessmentPerformanceLevel source, IStudentAssessmentPerformanceLevel target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentPerformanceLevel); + + + // Copy non-PK properties + + if ((mappingContract?.IsPerformanceLevelIndicatorNameSupported != false) + && target.PerformanceLevelIndicatorName != source.PerformanceLevelIndicatorName) + { + target.PerformanceLevelIndicatorName = source.PerformanceLevelIndicatorName; + isModified = true; + } + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentAssessmentPerformanceLevel source, IStudentAssessmentPerformanceLevel target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentPerformanceLevel); + + // Copy contextual primary key values + target.AssessmentReportingMethodDescriptor = source.AssessmentReportingMethodDescriptor; + target.PerformanceLevelDescriptor = source.PerformanceLevelDescriptor; + + // Copy non-PK properties + + if (mappingContract?.IsPerformanceLevelIndicatorNameSupported != false) + target.PerformanceLevelIndicatorName = source.PerformanceLevelIndicatorName; + + // Copy Aggregate Reference Data + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class StudentAssessmentPeriodMapper + { + private static readonly FullName _fullName_edfi_StudentAssessmentPeriod = new FullName("edfi", "StudentAssessmentPeriod"); + + public static bool SynchronizeTo(this IStudentAssessmentPeriod source, IStudentAssessmentPeriod target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentAssessmentPeriodMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentPeriod); + + + // Copy non-PK properties + + if ((mappingContract?.IsAssessmentPeriodDescriptorSupported != false) + && target.AssessmentPeriodDescriptor != source.AssessmentPeriodDescriptor) + { + target.AssessmentPeriodDescriptor = source.AssessmentPeriodDescriptor; + isModified = true; + } + + if ((mappingContract?.IsBeginDateSupported != false) + && target.BeginDate != source.BeginDate) + { + target.BeginDate = source.BeginDate; + isModified = true; + } + + if ((mappingContract?.IsEndDateSupported != false) + && target.EndDate != source.EndDate) + { + target.EndDate = source.EndDate; + isModified = true; + } + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentAssessmentPeriod source, IStudentAssessmentPeriod target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentAssessmentPeriodMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentPeriod); + + // Copy contextual primary key values + + // Copy non-PK properties + + if (mappingContract?.IsAssessmentPeriodDescriptorSupported != false) + target.AssessmentPeriodDescriptor = source.AssessmentPeriodDescriptor; + + if (mappingContract?.IsBeginDateSupported != false) + target.BeginDate = source.BeginDate; + + if (mappingContract?.IsEndDateSupported != false) + target.EndDate = source.EndDate; + + // Copy Aggregate Reference Data + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class StudentAssessmentScoreResultMapper + { + private static readonly FullName _fullName_edfi_StudentAssessmentScoreResult = new FullName("edfi", "StudentAssessmentScoreResult"); + + public static bool SynchronizeTo(this IStudentAssessmentScoreResult source, IStudentAssessmentScoreResult target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentScoreResult); + + + // Copy non-PK properties + + if ((mappingContract?.IsResultSupported != false) + && target.Result != source.Result) + { + target.Result = source.Result; + isModified = true; + } + + if ((mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) + && target.ResultDatatypeTypeDescriptor != source.ResultDatatypeTypeDescriptor) + { + target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; + isModified = true; + } + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentAssessmentScoreResult source, IStudentAssessmentScoreResult target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentScoreResult); + + // Copy contextual primary key values + target.AssessmentReportingMethodDescriptor = source.AssessmentReportingMethodDescriptor; + + // Copy non-PK properties + + if (mappingContract?.IsResultSupported != false) + target.Result = source.Result; + + if (mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) + target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; + + // Copy Aggregate Reference Data + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class StudentAssessmentStudentObjectiveAssessmentMapper + { + private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessment = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessment"); + + public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessment source, IStudentAssessmentStudentObjectiveAssessment target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentAssessmentStudentObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessment); + + + // Copy non-PK properties + + if ((mappingContract?.IsAdministrationDateSupported != false) + && target.AdministrationDate != source.AdministrationDate) + { + target.AdministrationDate = source.AdministrationDate; + isModified = true; + } + + if ((mappingContract?.IsAdministrationEndDateSupported != false) + && target.AdministrationEndDate != source.AdministrationEndDate) + { + target.AdministrationEndDate = source.AdministrationEndDate; + isModified = true; + } + + if ((mappingContract?.IsAssessedMinutesSupported != false) + && target.AssessedMinutes != source.AssessedMinutes) + { + target.AssessedMinutes = source.AssessedMinutes; + isModified = true; + } + + + // Sync lists + if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsSupported ?? true) + { + isModified |= + source.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels.SynchronizeCollectionTo( + target.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels, + onChildAdded: child => + { + child.StudentAssessmentStudentObjectiveAssessment = target; + }, + itemCreatable: mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsItemCreatable ?? true, + includeItem: item => mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelIncluded?.Invoke(item) ?? true); + } + + if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsSupported ?? true) + { + isModified |= + source.StudentAssessmentStudentObjectiveAssessmentScoreResults.SynchronizeCollectionTo( + target.StudentAssessmentStudentObjectiveAssessmentScoreResults, + onChildAdded: child => + { + child.StudentAssessmentStudentObjectiveAssessment = target; + }, + itemCreatable: mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsItemCreatable ?? true, + includeItem: item => mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded?.Invoke(item) ?? true); + } + + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentAssessmentStudentObjectiveAssessment source, IStudentAssessmentStudentObjectiveAssessment target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentAssessmentStudentObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessment); + + // Copy contextual primary key values + target.IdentificationCode = source.IdentificationCode; + + // Copy non-PK properties + + if (mappingContract?.IsAdministrationDateSupported != false) + target.AdministrationDate = source.AdministrationDate; + + if (mappingContract?.IsAdministrationEndDateSupported != false) + target.AdministrationEndDate = source.AdministrationEndDate; + + if (mappingContract?.IsAssessedMinutesSupported != false) + target.AssessedMinutes = source.AssessedMinutes; + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.ObjectiveAssessmentResourceId = source.ObjectiveAssessmentResourceId; + target.ObjectiveAssessmentDiscriminator = source.ObjectiveAssessmentDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsSupported != false) + { + source.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels.MapCollectionTo(target.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsItemCreatable ?? true, target, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelIncluded); + } + + if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsSupported != false) + { + source.StudentAssessmentStudentObjectiveAssessmentScoreResults.MapCollectionTo(target.StudentAssessmentStudentObjectiveAssessmentScoreResults, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsItemCreatable ?? true, target, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded); + } + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMapper { - private static readonly FullName _fullName_edfi_StudentAssessmentPerformanceLevel = new FullName("edfi", "StudentAssessmentPerformanceLevel"); + private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessmentPerformanceLevel = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel"); - public static bool SynchronizeTo(this IStudentAssessmentPerformanceLevel source, IStudentAssessmentPerformanceLevel target) + public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel source, IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentPerformanceLevel); + .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentPerformanceLevel); // Copy non-PK properties @@ -63288,12 +64582,12 @@ public static bool SynchronizeTo(this IStudentAssessmentPerformanceLevel source, return isModified; } - public static void MapTo(this IStudentAssessmentPerformanceLevel source, IStudentAssessmentPerformanceLevel target, Action onMapped) + public static void MapTo(this IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel source, IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentPerformanceLevel); + .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentPerformanceLevel); // Copy contextual primary key values target.AssessmentReportingMethodDescriptor = source.AssessmentReportingMethodDescriptor; @@ -63338,40 +64632,33 @@ public static void MapTo(this IStudentAssessmentPerformanceLevel source, IStuden } [ExcludeFromCodeCoverage] - public static class StudentAssessmentPeriodMapper + public static class StudentAssessmentStudentObjectiveAssessmentScoreResultMapper { - private static readonly FullName _fullName_edfi_StudentAssessmentPeriod = new FullName("edfi", "StudentAssessmentPeriod"); + private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessmentScoreResult = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentScoreResult"); - public static bool SynchronizeTo(this IStudentAssessmentPeriod source, IStudentAssessmentPeriod target) + public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessmentScoreResult source, IStudentAssessmentStudentObjectiveAssessmentScoreResult target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentAssessmentPeriodMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentStudentObjectiveAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentPeriod); + .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentScoreResult); // Copy non-PK properties - if ((mappingContract?.IsAssessmentPeriodDescriptorSupported != false) - && target.AssessmentPeriodDescriptor != source.AssessmentPeriodDescriptor) - { - target.AssessmentPeriodDescriptor = source.AssessmentPeriodDescriptor; - isModified = true; - } - - if ((mappingContract?.IsBeginDateSupported != false) - && target.BeginDate != source.BeginDate) + if ((mappingContract?.IsResultSupported != false) + && target.Result != source.Result) { - target.BeginDate = source.BeginDate; + target.Result = source.Result; isModified = true; } - if ((mappingContract?.IsEndDateSupported != false) - && target.EndDate != source.EndDate) + if ((mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) + && target.ResultDatatypeTypeDescriptor != source.ResultDatatypeTypeDescriptor) { - target.EndDate = source.EndDate; + target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; isModified = true; } @@ -63383,25 +64670,23 @@ public static bool SynchronizeTo(this IStudentAssessmentPeriod source, IStudentA return isModified; } - public static void MapTo(this IStudentAssessmentPeriod source, IStudentAssessmentPeriod target, Action onMapped) + public static void MapTo(this IStudentAssessmentStudentObjectiveAssessmentScoreResult source, IStudentAssessmentStudentObjectiveAssessmentScoreResult target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentAssessmentPeriodMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentStudentObjectiveAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentPeriod); + .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentScoreResult); // Copy contextual primary key values + target.AssessmentReportingMethodDescriptor = source.AssessmentReportingMethodDescriptor; // Copy non-PK properties - if (mappingContract?.IsAssessmentPeriodDescriptorSupported != false) - target.AssessmentPeriodDescriptor = source.AssessmentPeriodDescriptor; - - if (mappingContract?.IsBeginDateSupported != false) - target.BeginDate = source.BeginDate; + if (mappingContract?.IsResultSupported != false) + target.Result = source.Result; - if (mappingContract?.IsEndDateSupported != false) - target.EndDate = source.EndDate; + if (mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) + target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; // Copy Aggregate Reference Data @@ -63436,34 +64721,47 @@ public static void MapTo(this IStudentAssessmentPeriod source, IStudentAssessmen } } +} +// Aggregate: StudentAssessmentEducationOrganizationAssociation + +namespace EdFi.Ods.Entities.Common.EdFi //.StudentAssessmentEducationOrganizationAssociationAggregate +{ [ExcludeFromCodeCoverage] - public static class StudentAssessmentScoreResultMapper + public static class StudentAssessmentEducationOrganizationAssociationMapper { - private static readonly FullName _fullName_edfi_StudentAssessmentScoreResult = new FullName("edfi", "StudentAssessmentScoreResult"); + private static readonly FullName _fullName_edfi_StudentAssessmentEducationOrganizationAssociation = new FullName("edfi", "StudentAssessmentEducationOrganizationAssociation"); - public static bool SynchronizeTo(this IStudentAssessmentScoreResult source, IStudentAssessmentScoreResult target) + public static bool SynchronizeTo(this IStudentAssessmentEducationOrganizationAssociation source, IStudentAssessmentEducationOrganizationAssociation target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentEducationOrganizationAssociationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentScoreResult); - + .GetMappingContract(_fullName_edfi_StudentAssessmentEducationOrganizationAssociation); - // Copy non-PK properties + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; - if ((mappingContract?.IsResultSupported != false) - && target.Result != source.Result) + // Detect primary key changes + if ( + (!keyStringComparer.Equals(target.AssessmentIdentifier, source.AssessmentIdentifier)) + || !string.Equals(target.EducationOrganizationAssociationTypeDescriptor, source.EducationOrganizationAssociationTypeDescriptor, StringComparison.OrdinalIgnoreCase) + || (target.EducationOrganizationId != source.EducationOrganizationId) + || (!keyStringComparer.Equals(target.Namespace, source.Namespace)) + || (!keyStringComparer.Equals(target.StudentAssessmentIdentifier, source.StudentAssessmentIdentifier)) + || (target.StudentUniqueId != source.StudentUniqueId)) { - target.Result = source.Result; - isModified = true; + // Disallow PK column updates on StudentAssessmentEducationOrganizationAssociation + throw new KeyChangeNotSupportedException("StudentAssessmentEducationOrganizationAssociation"); } - if ((mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) - && target.ResultDatatypeTypeDescriptor != source.ResultDatatypeTypeDescriptor) + + // Copy non-PK properties + + if ((mappingContract?.IsSchoolYearSupported != false) + && target.SchoolYear != source.SchoolYear) { - target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; + target.SchoolYear = source.SchoolYear; isModified = true; } @@ -63475,25 +64773,40 @@ public static bool SynchronizeTo(this IStudentAssessmentScoreResult source, IStu return isModified; } - public static void MapTo(this IStudentAssessmentScoreResult source, IStudentAssessmentScoreResult target, Action onMapped) + public static void MapTo(this IStudentAssessmentEducationOrganizationAssociation source, IStudentAssessmentEducationOrganizationAssociation target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentEducationOrganizationAssociationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentScoreResult); + .GetMappingContract(_fullName_edfi_StudentAssessmentEducationOrganizationAssociation); + // Copy resource Id + target.Id = source.Id; + // Copy contextual primary key values - target.AssessmentReportingMethodDescriptor = source.AssessmentReportingMethodDescriptor; + target.AssessmentIdentifier = source.AssessmentIdentifier; + target.EducationOrganizationAssociationTypeDescriptor = source.EducationOrganizationAssociationTypeDescriptor; + target.EducationOrganizationId = source.EducationOrganizationId; + target.Namespace = source.Namespace; + target.StudentAssessmentIdentifier = source.StudentAssessmentIdentifier; + target.StudentUniqueId = source.StudentUniqueId; // Copy non-PK properties - if (mappingContract?.IsResultSupported != false) - target.Result = source.Result; - - if (mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) - target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; + if (mappingContract?.IsSchoolYearSupported != false) + target.SchoolYear = source.SchoolYear; // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.EducationOrganizationResourceId = source.EducationOrganizationResourceId; + target.EducationOrganizationDiscriminator = source.EducationOrganizationDiscriminator; + target.SchoolYearTypeResourceId = source.SchoolYearTypeResourceId; + target.StudentAssessmentResourceId = source.StudentAssessmentResourceId; + target.StudentAssessmentDiscriminator = source.StudentAssessmentDiscriminator; + } + // ---------------------------------- @@ -63526,70 +64839,111 @@ public static void MapTo(this IStudentAssessmentScoreResult source, IStudentAsse } } +} +// Aggregate: StudentAssessmentRegistration + +namespace EdFi.Ods.Entities.Common.EdFi //.StudentAssessmentRegistrationAggregate +{ [ExcludeFromCodeCoverage] - public static class StudentAssessmentStudentObjectiveAssessmentMapper + public static class StudentAssessmentRegistrationMapper { - private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessment = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessment"); + private static readonly FullName _fullName_edfi_StudentAssessmentRegistration = new FullName("edfi", "StudentAssessmentRegistration"); - public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessment source, IStudentAssessmentStudentObjectiveAssessment target) + public static bool SynchronizeTo(this IStudentAssessmentRegistration source, IStudentAssessmentRegistration target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentAssessmentStudentObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessment); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistration); + + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + + // Detect primary key changes + if ( + (!keyStringComparer.Equals(target.AdministrationIdentifier, source.AdministrationIdentifier)) + || (!keyStringComparer.Equals(target.AssessmentIdentifier, source.AssessmentIdentifier)) + || (target.AssigningEducationOrganizationId != source.AssigningEducationOrganizationId) + || (target.EducationOrganizationId != source.EducationOrganizationId) + || (!keyStringComparer.Equals(target.Namespace, source.Namespace)) + || (target.StudentUniqueId != source.StudentUniqueId)) + { + // Disallow PK column updates on StudentAssessmentRegistration + throw new KeyChangeNotSupportedException("StudentAssessmentRegistration"); + } // Copy non-PK properties - if ((mappingContract?.IsAdministrationDateSupported != false) - && target.AdministrationDate != source.AdministrationDate) + if ((mappingContract?.IsAssessmentGradeLevelDescriptorSupported != false) + && target.AssessmentGradeLevelDescriptor != source.AssessmentGradeLevelDescriptor) { - target.AdministrationDate = source.AdministrationDate; + target.AssessmentGradeLevelDescriptor = source.AssessmentGradeLevelDescriptor; isModified = true; } - if ((mappingContract?.IsAdministrationEndDateSupported != false) - && target.AdministrationEndDate != source.AdministrationEndDate) + if ((mappingContract?.IsEntryDateSupported != false) + && target.EntryDate != source.EntryDate) { - target.AdministrationEndDate = source.AdministrationEndDate; + target.EntryDate = source.EntryDate; isModified = true; } - if ((mappingContract?.IsAssessedMinutesSupported != false) - && target.AssessedMinutes != source.AssessedMinutes) + if ((mappingContract?.IsPlatformTypeDescriptorSupported != false) + && target.PlatformTypeDescriptor != source.PlatformTypeDescriptor) { - target.AssessedMinutes = source.AssessedMinutes; + target.PlatformTypeDescriptor = source.PlatformTypeDescriptor; + isModified = true; + } + + if ((mappingContract?.IsReportingEducationOrganizationIdSupported != false) + && target.ReportingEducationOrganizationId != source.ReportingEducationOrganizationId) + { + target.ReportingEducationOrganizationId = source.ReportingEducationOrganizationId; + isModified = true; + } + + if ((mappingContract?.IsSchoolIdSupported != false) + && target.SchoolId != source.SchoolId) + { + target.SchoolId = source.SchoolId; + isModified = true; + } + + if ((mappingContract?.IsTestingEducationOrganizationIdSupported != false) + && target.TestingEducationOrganizationId != source.TestingEducationOrganizationId) + { + target.TestingEducationOrganizationId = source.TestingEducationOrganizationId; isModified = true; } // Sync lists - if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsSupported ?? true) + if (mappingContract?.IsStudentAssessmentRegistrationAssessmentAccommodationsSupported ?? true) { isModified |= - source.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels.SynchronizeCollectionTo( - target.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels, + source.StudentAssessmentRegistrationAssessmentAccommodations.SynchronizeCollectionTo( + target.StudentAssessmentRegistrationAssessmentAccommodations, onChildAdded: child => { - child.StudentAssessmentStudentObjectiveAssessment = target; + child.StudentAssessmentRegistration = target; }, - itemCreatable: mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsItemCreatable ?? true, - includeItem: item => mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelIncluded?.Invoke(item) ?? true); + itemCreatable: mappingContract?.IsStudentAssessmentRegistrationAssessmentAccommodationsItemCreatable ?? true, + includeItem: item => mappingContract?.IsStudentAssessmentRegistrationAssessmentAccommodationIncluded?.Invoke(item) ?? true); } - if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsSupported ?? true) + if (mappingContract?.IsStudentAssessmentRegistrationAssessmentCustomizationsSupported ?? true) { isModified |= - source.StudentAssessmentStudentObjectiveAssessmentScoreResults.SynchronizeCollectionTo( - target.StudentAssessmentStudentObjectiveAssessmentScoreResults, + source.StudentAssessmentRegistrationAssessmentCustomizations.SynchronizeCollectionTo( + target.StudentAssessmentRegistrationAssessmentCustomizations, onChildAdded: child => { - child.StudentAssessmentStudentObjectiveAssessment = target; + child.StudentAssessmentRegistration = target; }, - itemCreatable: mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsItemCreatable ?? true, - includeItem: item => mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded?.Invoke(item) ?? true); + itemCreatable: mappingContract?.IsStudentAssessmentRegistrationAssessmentCustomizationsItemCreatable ?? true, + includeItem: item => mappingContract?.IsStudentAssessmentRegistrationAssessmentCustomizationIncluded?.Invoke(item) ?? true); } // Sync extensions @@ -63598,33 +64952,60 @@ public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessme return isModified; } - public static void MapTo(this IStudentAssessmentStudentObjectiveAssessment source, IStudentAssessmentStudentObjectiveAssessment target, Action onMapped) + public static void MapTo(this IStudentAssessmentRegistration source, IStudentAssessmentRegistration target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentAssessmentStudentObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessment); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistration); + // Copy resource Id + target.Id = source.Id; + // Copy contextual primary key values - target.IdentificationCode = source.IdentificationCode; + target.AdministrationIdentifier = source.AdministrationIdentifier; + target.AssessmentIdentifier = source.AssessmentIdentifier; + target.AssigningEducationOrganizationId = source.AssigningEducationOrganizationId; + target.EducationOrganizationId = source.EducationOrganizationId; + target.Namespace = source.Namespace; + target.StudentUniqueId = source.StudentUniqueId; // Copy non-PK properties - if (mappingContract?.IsAdministrationDateSupported != false) - target.AdministrationDate = source.AdministrationDate; + if (mappingContract?.IsAssessmentGradeLevelDescriptorSupported != false) + target.AssessmentGradeLevelDescriptor = source.AssessmentGradeLevelDescriptor; - if (mappingContract?.IsAdministrationEndDateSupported != false) - target.AdministrationEndDate = source.AdministrationEndDate; + if (mappingContract?.IsEntryDateSupported != false) + target.EntryDate = source.EntryDate; - if (mappingContract?.IsAssessedMinutesSupported != false) - target.AssessedMinutes = source.AssessedMinutes; + if (mappingContract?.IsPlatformTypeDescriptorSupported != false) + target.PlatformTypeDescriptor = source.PlatformTypeDescriptor; + + if (mappingContract?.IsReportingEducationOrganizationIdSupported != false) + target.ReportingEducationOrganizationId = source.ReportingEducationOrganizationId; + + if (mappingContract?.IsSchoolIdSupported != false) + target.SchoolId = source.SchoolId; + + if (mappingContract?.IsTestingEducationOrganizationIdSupported != false) + target.TestingEducationOrganizationId = source.TestingEducationOrganizationId; // Copy Aggregate Reference Data if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) { - target.ObjectiveAssessmentResourceId = source.ObjectiveAssessmentResourceId; - target.ObjectiveAssessmentDiscriminator = source.ObjectiveAssessmentDiscriminator; + target.AssessmentAdministrationResourceId = source.AssessmentAdministrationResourceId; + target.AssessmentAdministrationDiscriminator = source.AssessmentAdministrationDiscriminator; + target.ReportingEducationOrganizationResourceId = source.ReportingEducationOrganizationResourceId; + target.ReportingEducationOrganizationDiscriminator = source.ReportingEducationOrganizationDiscriminator; + target.StudentEducationOrganizationAssessmentAccommodationResourceId = source.StudentEducationOrganizationAssessmentAccommodationResourceId; + target.StudentEducationOrganizationAssessmentAccommodationDiscriminator = source.StudentEducationOrganizationAssessmentAccommodationDiscriminator; + target.StudentEducationOrganizationAssociationResourceId = source.StudentEducationOrganizationAssociationResourceId; + target.StudentEducationOrganizationAssociationDiscriminator = source.StudentEducationOrganizationAssociationDiscriminator; + target.StudentSchoolAssociationResourceId = source.StudentSchoolAssociationResourceId; + target.StudentSchoolAssociationDiscriminator = source.StudentSchoolAssociationDiscriminator; + target.TestingEducationOrganizationResourceId = source.TestingEducationOrganizationResourceId; + target.TestingEducationOrganizationDiscriminator = source.TestingEducationOrganizationDiscriminator; } @@ -63635,14 +65016,14 @@ public static void MapTo(this IStudentAssessmentStudentObjectiveAssessment sourc // Map lists - if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsSupported != false) + if (mappingContract?.IsStudentAssessmentRegistrationAssessmentAccommodationsSupported != false) { - source.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels.MapCollectionTo(target.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsItemCreatable ?? true, target, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelIncluded); + source.StudentAssessmentRegistrationAssessmentAccommodations.MapCollectionTo(target.StudentAssessmentRegistrationAssessmentAccommodations, mappingContract?.IsStudentAssessmentRegistrationAssessmentAccommodationsItemCreatable ?? true, target, mappingContract?.IsStudentAssessmentRegistrationAssessmentAccommodationIncluded); } - if (mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsSupported != false) + if (mappingContract?.IsStudentAssessmentRegistrationAssessmentCustomizationsSupported != false) { - source.StudentAssessmentStudentObjectiveAssessmentScoreResults.MapCollectionTo(target.StudentAssessmentStudentObjectiveAssessmentScoreResults, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultsItemCreatable ?? true, target, mappingContract?.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded); + source.StudentAssessmentRegistrationAssessmentCustomizations.MapCollectionTo(target.StudentAssessmentRegistrationAssessmentCustomizations, mappingContract?.IsStudentAssessmentRegistrationAssessmentCustomizationsItemCreatable ?? true, target, mappingContract?.IsStudentAssessmentRegistrationAssessmentCustomizationIncluded); } // Map extensions @@ -63670,29 +65051,22 @@ public static void MapTo(this IStudentAssessmentStudentObjectiveAssessment sourc } [ExcludeFromCodeCoverage] - public static class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMapper + public static class StudentAssessmentRegistrationAssessmentAccommodationMapper { - private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessmentPerformanceLevel = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel"); + private static readonly FullName _fullName_edfi_StudentAssessmentRegistrationAssessmentAccommodation = new FullName("edfi", "StudentAssessmentRegistrationAssessmentAccommodation"); - public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel source, IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel target) + public static bool SynchronizeTo(this IStudentAssessmentRegistrationAssessmentAccommodation source, IStudentAssessmentRegistrationAssessmentAccommodation target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationAssessmentAccommodationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentPerformanceLevel); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationAssessmentAccommodation); // Copy non-PK properties - if ((mappingContract?.IsPerformanceLevelIndicatorNameSupported != false) - && target.PerformanceLevelIndicatorName != source.PerformanceLevelIndicatorName) - { - target.PerformanceLevelIndicatorName = source.PerformanceLevelIndicatorName; - isModified = true; - } - // Sync lists // Sync extensions @@ -63701,22 +65075,18 @@ public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessme return isModified; } - public static void MapTo(this IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel source, IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel target, Action onMapped) + public static void MapTo(this IStudentAssessmentRegistrationAssessmentAccommodation source, IStudentAssessmentRegistrationAssessmentAccommodation target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationAssessmentAccommodationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentPerformanceLevel); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationAssessmentAccommodation); // Copy contextual primary key values - target.AssessmentReportingMethodDescriptor = source.AssessmentReportingMethodDescriptor; - target.PerformanceLevelDescriptor = source.PerformanceLevelDescriptor; + target.AccommodationDescriptor = source.AccommodationDescriptor; // Copy non-PK properties - if (mappingContract?.IsPerformanceLevelIndicatorNameSupported != false) - target.PerformanceLevelIndicatorName = source.PerformanceLevelIndicatorName; - // Copy Aggregate Reference Data @@ -63751,33 +65121,26 @@ public static void MapTo(this IStudentAssessmentStudentObjectiveAssessmentPerfor } [ExcludeFromCodeCoverage] - public static class StudentAssessmentStudentObjectiveAssessmentScoreResultMapper + public static class StudentAssessmentRegistrationAssessmentCustomizationMapper { - private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessmentScoreResult = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentScoreResult"); + private static readonly FullName _fullName_edfi_StudentAssessmentRegistrationAssessmentCustomization = new FullName("edfi", "StudentAssessmentRegistrationAssessmentCustomization"); - public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessmentScoreResult source, IStudentAssessmentStudentObjectiveAssessmentScoreResult target) + public static bool SynchronizeTo(this IStudentAssessmentRegistrationAssessmentCustomization source, IStudentAssessmentRegistrationAssessmentCustomization target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentAssessmentStudentObjectiveAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationAssessmentCustomizationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentScoreResult); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationAssessmentCustomization); // Copy non-PK properties - if ((mappingContract?.IsResultSupported != false) - && target.Result != source.Result) + if ((mappingContract?.IsCustomizationValueSupported != false) + && target.CustomizationValue != source.CustomizationValue) { - target.Result = source.Result; - isModified = true; - } - - if ((mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) - && target.ResultDatatypeTypeDescriptor != source.ResultDatatypeTypeDescriptor) - { - target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; + target.CustomizationValue = source.CustomizationValue; isModified = true; } @@ -63789,23 +65152,20 @@ public static bool SynchronizeTo(this IStudentAssessmentStudentObjectiveAssessme return isModified; } - public static void MapTo(this IStudentAssessmentStudentObjectiveAssessmentScoreResult source, IStudentAssessmentStudentObjectiveAssessmentScoreResult target, Action onMapped) + public static void MapTo(this IStudentAssessmentRegistrationAssessmentCustomization source, IStudentAssessmentRegistrationAssessmentCustomization target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentAssessmentStudentObjectiveAssessmentScoreResultMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationAssessmentCustomizationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessmentScoreResult); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationAssessmentCustomization); // Copy contextual primary key values - target.AssessmentReportingMethodDescriptor = source.AssessmentReportingMethodDescriptor; + target.CustomizationKey = source.CustomizationKey; // Copy non-PK properties - if (mappingContract?.IsResultSupported != false) - target.Result = source.Result; - - if (mappingContract?.IsResultDatatypeTypeDescriptorSupported != false) - target.ResultDatatypeTypeDescriptor = source.ResultDatatypeTypeDescriptor; + if (mappingContract?.IsCustomizationValueSupported != false) + target.CustomizationValue = source.CustomizationValue; // Copy Aggregate Reference Data @@ -63841,91 +65201,170 @@ public static void MapTo(this IStudentAssessmentStudentObjectiveAssessmentScoreR } } -// Aggregate: StudentAssessmentEducationOrganizationAssociation +// Aggregate: StudentAssessmentRegistrationBatteryPartAssociation -namespace EdFi.Ods.Entities.Common.EdFi //.StudentAssessmentEducationOrganizationAssociationAggregate +namespace EdFi.Ods.Entities.Common.EdFi //.StudentAssessmentRegistrationBatteryPartAssociationAggregate { [ExcludeFromCodeCoverage] - public static class StudentAssessmentEducationOrganizationAssociationMapper + public static class StudentAssessmentRegistrationBatteryPartAssociationMapper { - private static readonly FullName _fullName_edfi_StudentAssessmentEducationOrganizationAssociation = new FullName("edfi", "StudentAssessmentEducationOrganizationAssociation"); + private static readonly FullName _fullName_edfi_StudentAssessmentRegistrationBatteryPartAssociation = new FullName("edfi", "StudentAssessmentRegistrationBatteryPartAssociation"); - public static bool SynchronizeTo(this IStudentAssessmentEducationOrganizationAssociation source, IStudentAssessmentEducationOrganizationAssociation target) + public static bool SynchronizeTo(this IStudentAssessmentRegistrationBatteryPartAssociation source, IStudentAssessmentRegistrationBatteryPartAssociation target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentAssessmentEducationOrganizationAssociationMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationBatteryPartAssociationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentEducationOrganizationAssociation); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationBatteryPartAssociation); var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; // Detect primary key changes if ( - (!keyStringComparer.Equals(target.AssessmentIdentifier, source.AssessmentIdentifier)) - || !string.Equals(target.EducationOrganizationAssociationTypeDescriptor, source.EducationOrganizationAssociationTypeDescriptor, StringComparison.OrdinalIgnoreCase) + (!keyStringComparer.Equals(target.AdministrationIdentifier, source.AdministrationIdentifier)) + || (!keyStringComparer.Equals(target.AssessmentBatteryPartName, source.AssessmentBatteryPartName)) + || (!keyStringComparer.Equals(target.AssessmentIdentifier, source.AssessmentIdentifier)) + || (target.AssigningEducationOrganizationId != source.AssigningEducationOrganizationId) || (target.EducationOrganizationId != source.EducationOrganizationId) || (!keyStringComparer.Equals(target.Namespace, source.Namespace)) - || (!keyStringComparer.Equals(target.StudentAssessmentIdentifier, source.StudentAssessmentIdentifier)) || (target.StudentUniqueId != source.StudentUniqueId)) { - // Disallow PK column updates on StudentAssessmentEducationOrganizationAssociation - throw new KeyChangeNotSupportedException("StudentAssessmentEducationOrganizationAssociation"); + // Disallow PK column updates on StudentAssessmentRegistrationBatteryPartAssociation + throw new KeyChangeNotSupportedException("StudentAssessmentRegistrationBatteryPartAssociation"); } // Copy non-PK properties - if ((mappingContract?.IsSchoolYearSupported != false) - && target.SchoolYear != source.SchoolYear) + + // Sync lists + if (mappingContract?.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsSupported ?? true) { - target.SchoolYear = source.SchoolYear; - isModified = true; + isModified |= + source.StudentAssessmentRegistrationBatteryPartAssociationAccommodations.SynchronizeCollectionTo( + target.StudentAssessmentRegistrationBatteryPartAssociationAccommodations, + onChildAdded: child => + { + child.StudentAssessmentRegistrationBatteryPartAssociation = target; + }, + itemCreatable: mappingContract?.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItemCreatable ?? true, + includeItem: item => mappingContract?.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded?.Invoke(item) ?? true); } - - // Sync lists // Sync extensions isModified |= source.SynchronizeExtensionsTo(target, mappingContract); return isModified; } - public static void MapTo(this IStudentAssessmentEducationOrganizationAssociation source, IStudentAssessmentEducationOrganizationAssociation target, Action onMapped) + public static void MapTo(this IStudentAssessmentRegistrationBatteryPartAssociation source, IStudentAssessmentRegistrationBatteryPartAssociation target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentAssessmentEducationOrganizationAssociationMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentAssessmentRegistrationBatteryPartAssociationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessmentEducationOrganizationAssociation); + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationBatteryPartAssociation); // Copy resource Id target.Id = source.Id; // Copy contextual primary key values + target.AdministrationIdentifier = source.AdministrationIdentifier; + target.AssessmentBatteryPartName = source.AssessmentBatteryPartName; target.AssessmentIdentifier = source.AssessmentIdentifier; - target.EducationOrganizationAssociationTypeDescriptor = source.EducationOrganizationAssociationTypeDescriptor; + target.AssigningEducationOrganizationId = source.AssigningEducationOrganizationId; target.EducationOrganizationId = source.EducationOrganizationId; target.Namespace = source.Namespace; - target.StudentAssessmentIdentifier = source.StudentAssessmentIdentifier; target.StudentUniqueId = source.StudentUniqueId; // Copy non-PK properties - if (mappingContract?.IsSchoolYearSupported != false) - target.SchoolYear = source.SchoolYear; - // Copy Aggregate Reference Data if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) { - target.EducationOrganizationResourceId = source.EducationOrganizationResourceId; - target.EducationOrganizationDiscriminator = source.EducationOrganizationDiscriminator; - target.SchoolYearTypeResourceId = source.SchoolYearTypeResourceId; - target.StudentAssessmentResourceId = source.StudentAssessmentResourceId; - target.StudentAssessmentDiscriminator = source.StudentAssessmentDiscriminator; + target.AssessmentBatteryPartResourceId = source.AssessmentBatteryPartResourceId; + target.AssessmentBatteryPartDiscriminator = source.AssessmentBatteryPartDiscriminator; + target.StudentAssessmentRegistrationResourceId = source.StudentAssessmentRegistrationResourceId; + target.StudentAssessmentRegistrationDiscriminator = source.StudentAssessmentRegistrationDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + if (mappingContract?.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsSupported != false) + { + source.StudentAssessmentRegistrationBatteryPartAssociationAccommodations.MapCollectionTo(target.StudentAssessmentRegistrationBatteryPartAssociationAccommodations, mappingContract?.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItemCreatable ?? true, target, mappingContract?.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded); + } + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } } + } + } + [ExcludeFromCodeCoverage] + public static class StudentAssessmentRegistrationBatteryPartAssociationAccommodationMapper + { + private static readonly FullName _fullName_edfi_StudentAssessmentRegistrationBatteryPartAssociationAccommodation = new FullName("edfi", "StudentAssessmentRegistrationBatteryPartAssociationAccommodation"); + + public static bool SynchronizeTo(this IStudentAssessmentRegistrationBatteryPartAssociationAccommodation source, IStudentAssessmentRegistrationBatteryPartAssociationAccommodation target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentAssessmentRegistrationBatteryPartAssociationAccommodationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationBatteryPartAssociationAccommodation); + + + // Copy non-PK properties + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentAssessmentRegistrationBatteryPartAssociationAccommodation source, IStudentAssessmentRegistrationBatteryPartAssociationAccommodation target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentAssessmentRegistrationBatteryPartAssociationAccommodationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistrationBatteryPartAssociationAccommodation); + + // Copy contextual primary key values + target.AccommodationDescriptor = source.AccommodationDescriptor; + + // Copy non-PK properties + + // Copy Aggregate Reference Data // ---------------------------------- @@ -65502,6 +66941,191 @@ public static void MapTo(this IStudentDisciplineIncidentNonOffenderAssociationDi // Copy Aggregate Reference Data + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + +} +// Aggregate: StudentEducationOrganizationAssessmentAccommodation + +namespace EdFi.Ods.Entities.Common.EdFi //.StudentEducationOrganizationAssessmentAccommodationAggregate +{ + [ExcludeFromCodeCoverage] + public static class StudentEducationOrganizationAssessmentAccommodationMapper + { + private static readonly FullName _fullName_edfi_StudentEducationOrganizationAssessmentAccommodation = new FullName("edfi", "StudentEducationOrganizationAssessmentAccommodation"); + + public static bool SynchronizeTo(this IStudentEducationOrganizationAssessmentAccommodation source, IStudentEducationOrganizationAssessmentAccommodation target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentEducationOrganizationAssessmentAccommodationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentEducationOrganizationAssessmentAccommodation); + + // Detect primary key changes + if ( + (target.EducationOrganizationId != source.EducationOrganizationId) + || (target.StudentUniqueId != source.StudentUniqueId)) + { + // Disallow PK column updates on StudentEducationOrganizationAssessmentAccommodation + throw new KeyChangeNotSupportedException("StudentEducationOrganizationAssessmentAccommodation"); + } + + + // Copy non-PK properties + + + // Sync lists + if (mappingContract?.IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsSupported ?? true) + { + isModified |= + source.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations.SynchronizeCollectionTo( + target.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations, + onChildAdded: child => + { + child.StudentEducationOrganizationAssessmentAccommodation = target; + }, + itemCreatable: mappingContract?.IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItemCreatable ?? true, + includeItem: item => mappingContract?.IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationIncluded?.Invoke(item) ?? true); + } + + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentEducationOrganizationAssessmentAccommodation source, IStudentEducationOrganizationAssessmentAccommodation target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentEducationOrganizationAssessmentAccommodationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentEducationOrganizationAssessmentAccommodation); + + // Copy resource Id + target.Id = source.Id; + + // Copy contextual primary key values + target.EducationOrganizationId = source.EducationOrganizationId; + target.StudentUniqueId = source.StudentUniqueId; + + // Copy non-PK properties + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.EducationOrganizationResourceId = source.EducationOrganizationResourceId; + target.EducationOrganizationDiscriminator = source.EducationOrganizationDiscriminator; + target.StudentResourceId = source.StudentResourceId; + target.StudentDiscriminator = source.StudentDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + if (mappingContract?.IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsSupported != false) + { + source.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations.MapCollectionTo(target.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations, mappingContract?.IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItemCreatable ?? true, target, mappingContract?.IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationIncluded); + } + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + + [ExcludeFromCodeCoverage] + public static class StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationMapper + { + private static readonly FullName _fullName_edfi_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation = new FullName("edfi", "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation"); + + public static bool SynchronizeTo(this IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation source, IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation); + + + // Copy non-PK properties + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation source, IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation); + + // Copy contextual primary key values + target.AccommodationDescriptor = source.AccommodationDescriptor; + + // Copy non-PK properties + + // Copy Aggregate Reference Data + + // ---------------------------------- // Map One-to-one relationships // ---------------------------------- @@ -72100,82 +73724,400 @@ public static void MapTo(this IStudentSchoolAssociationEducationPlan source, ISt } } -} -// Aggregate: StudentSchoolAttendanceEvent - -namespace EdFi.Ods.Entities.Common.EdFi //.StudentSchoolAttendanceEventAggregate -{ +} +// Aggregate: StudentSchoolAttendanceEvent + +namespace EdFi.Ods.Entities.Common.EdFi //.StudentSchoolAttendanceEventAggregate +{ + [ExcludeFromCodeCoverage] + public static class StudentSchoolAttendanceEventMapper + { + private static readonly FullName _fullName_edfi_StudentSchoolAttendanceEvent = new FullName("edfi", "StudentSchoolAttendanceEvent"); + + public static bool SynchronizeTo(this IStudentSchoolAttendanceEvent source, IStudentSchoolAttendanceEvent target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentSchoolAttendanceEventMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentSchoolAttendanceEvent); + + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + + // Detect primary key changes + if ( + !string.Equals(target.AttendanceEventCategoryDescriptor, source.AttendanceEventCategoryDescriptor, StringComparison.OrdinalIgnoreCase) + || (target.EventDate != source.EventDate) + || (target.SchoolId != source.SchoolId) + || (target.SchoolYear != source.SchoolYear) + || (!keyStringComparer.Equals(target.SessionName, source.SessionName)) + || (target.StudentUniqueId != source.StudentUniqueId)) + { + // Disallow PK column updates on StudentSchoolAttendanceEvent + throw new KeyChangeNotSupportedException("StudentSchoolAttendanceEvent"); + } + + + // Copy non-PK properties + + if ((mappingContract?.IsArrivalTimeSupported != false) + && target.ArrivalTime != source.ArrivalTime) + { + target.ArrivalTime = source.ArrivalTime; + isModified = true; + } + + if ((mappingContract?.IsAttendanceEventReasonSupported != false) + && target.AttendanceEventReason != source.AttendanceEventReason) + { + target.AttendanceEventReason = source.AttendanceEventReason; + isModified = true; + } + + if ((mappingContract?.IsDepartureTimeSupported != false) + && target.DepartureTime != source.DepartureTime) + { + target.DepartureTime = source.DepartureTime; + isModified = true; + } + + if ((mappingContract?.IsEducationalEnvironmentDescriptorSupported != false) + && target.EducationalEnvironmentDescriptor != source.EducationalEnvironmentDescriptor) + { + target.EducationalEnvironmentDescriptor = source.EducationalEnvironmentDescriptor; + isModified = true; + } + + if ((mappingContract?.IsEventDurationSupported != false) + && target.EventDuration != source.EventDuration) + { + target.EventDuration = source.EventDuration; + isModified = true; + } + + if ((mappingContract?.IsSchoolAttendanceDurationSupported != false) + && target.SchoolAttendanceDuration != source.SchoolAttendanceDuration) + { + target.SchoolAttendanceDuration = source.SchoolAttendanceDuration; + isModified = true; + } + + + // Sync lists + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapTo(this IStudentSchoolAttendanceEvent source, IStudentSchoolAttendanceEvent target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentSchoolAttendanceEventMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentSchoolAttendanceEvent); + + // Copy resource Id + target.Id = source.Id; + + // Copy contextual primary key values + target.AttendanceEventCategoryDescriptor = source.AttendanceEventCategoryDescriptor; + target.EventDate = source.EventDate; + target.SchoolId = source.SchoolId; + target.SchoolYear = source.SchoolYear; + target.SessionName = source.SessionName; + target.StudentUniqueId = source.StudentUniqueId; + + // Copy non-PK properties + + if (mappingContract?.IsArrivalTimeSupported != false) + target.ArrivalTime = source.ArrivalTime; + + if (mappingContract?.IsAttendanceEventReasonSupported != false) + target.AttendanceEventReason = source.AttendanceEventReason; + + if (mappingContract?.IsDepartureTimeSupported != false) + target.DepartureTime = source.DepartureTime; + + if (mappingContract?.IsEducationalEnvironmentDescriptorSupported != false) + target.EducationalEnvironmentDescriptor = source.EducationalEnvironmentDescriptor; + + if (mappingContract?.IsEventDurationSupported != false) + target.EventDuration = source.EventDuration; + + if (mappingContract?.IsSchoolAttendanceDurationSupported != false) + target.SchoolAttendanceDuration = source.SchoolAttendanceDuration; + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.SchoolResourceId = source.SchoolResourceId; + target.SessionResourceId = source.SessionResourceId; + target.SessionDiscriminator = source.SessionDiscriminator; + target.StudentResourceId = source.StudentResourceId; + target.StudentDiscriminator = source.StudentDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map lists + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + +} +// Aggregate: StudentSchoolFoodServiceProgramAssociation + +namespace EdFi.Ods.Entities.Common.EdFi //.StudentSchoolFoodServiceProgramAssociationAggregate +{ + [ExcludeFromCodeCoverage] + public static class StudentSchoolFoodServiceProgramAssociationMapper + { + private static readonly FullName _fullName_edfi_StudentSchoolFoodServiceProgramAssociation = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociation"); + + public static bool SynchronizeTo(this IStudentSchoolFoodServiceProgramAssociation source, IStudentSchoolFoodServiceProgramAssociation target) + { + bool isModified = false; + + // Get the mapping contract for knowing what values to synchronize through to target entity + var mappingContract = (StudentSchoolFoodServiceProgramAssociationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociation); + + var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; + + // Detect primary key changes + if ( + (target.BeginDate != source.BeginDate) + || (target.EducationOrganizationId != source.EducationOrganizationId) + || (target.ProgramEducationOrganizationId != source.ProgramEducationOrganizationId) + || (!keyStringComparer.Equals(target.ProgramName, source.ProgramName)) + || !string.Equals(target.ProgramTypeDescriptor, source.ProgramTypeDescriptor, StringComparison.OrdinalIgnoreCase) + || (target.StudentUniqueId != source.StudentUniqueId)) + { + // Disallow PK column updates on StudentSchoolFoodServiceProgramAssociation + throw new KeyChangeNotSupportedException("StudentSchoolFoodServiceProgramAssociation"); + } + + + // Copy inherited non-PK properties + + + if ((mappingContract?.IsEndDateSupported != false) + && target.EndDate != source.EndDate) + { + target.EndDate = source.EndDate; + isModified = true; + } + + if ((mappingContract?.IsReasonExitedDescriptorSupported != false) + && target.ReasonExitedDescriptor != source.ReasonExitedDescriptor) + { + target.ReasonExitedDescriptor = source.ReasonExitedDescriptor; + isModified = true; + } + + if ((mappingContract?.IsServedOutsideOfRegularSessionSupported != false) + && target.ServedOutsideOfRegularSession != source.ServedOutsideOfRegularSession) + { + target.ServedOutsideOfRegularSession = source.ServedOutsideOfRegularSession; + isModified = true; + } + + // Copy non-PK properties + + if ((mappingContract?.IsDirectCertificationSupported != false) + && target.DirectCertification != source.DirectCertification) + { + target.DirectCertification = source.DirectCertification; + isModified = true; + } + + + // Synch inherited lists + if (mappingContract?.IsGeneralStudentProgramAssociationProgramParticipationStatusesSupported ?? true) + { + isModified |= + source.GeneralStudentProgramAssociationProgramParticipationStatuses.SynchronizeCollectionTo( + target.GeneralStudentProgramAssociationProgramParticipationStatuses, + onChildAdded: child => child.GeneralStudentProgramAssociation = target, + itemCreatable: mappingContract?.IsGeneralStudentProgramAssociationProgramParticipationStatusesItemCreatable ?? true, + includeItem: item => mappingContract?.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded?.Invoke(item) ?? true); + } + + + // Sync lists + if (mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesSupported ?? true) + { + isModified |= + source.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices.SynchronizeCollectionTo( + target.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices, + onChildAdded: child => + { + child.StudentSchoolFoodServiceProgramAssociation = target; + }, + itemCreatable: mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesItemCreatable ?? true, + includeItem: item => mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceIncluded?.Invoke(item) ?? true); + } + + // Sync extensions + isModified |= source.SynchronizeExtensionsTo(target, mappingContract); + + return isModified; + } + + public static void MapDerivedTo(this IStudentSchoolFoodServiceProgramAssociation source, IStudentSchoolFoodServiceProgramAssociation target, Action onMapped) + { + // Get the mapping contract for determining what values to map through to target + var mappingContract = (StudentSchoolFoodServiceProgramAssociationMappingContract) GeneratedArtifactStaticDependencies + .MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociation); + + // Copy resource Id + target.Id = source.Id; + + // Copy contextual primary key values + target.BeginDate = source.BeginDate; + target.EducationOrganizationId = source.EducationOrganizationId; + target.ProgramEducationOrganizationId = source.ProgramEducationOrganizationId; + target.ProgramName = source.ProgramName; + target.ProgramTypeDescriptor = source.ProgramTypeDescriptor; + target.StudentUniqueId = source.StudentUniqueId; + + // Copy inherited non-PK properties + + if (mappingContract?.IsEndDateSupported != false) + target.EndDate = source.EndDate; + + if (mappingContract?.IsReasonExitedDescriptorSupported != false) + target.ReasonExitedDescriptor = source.ReasonExitedDescriptor; + + if (mappingContract?.IsServedOutsideOfRegularSessionSupported != false) + target.ServedOutsideOfRegularSession = source.ServedOutsideOfRegularSession; + + // Copy non-PK properties + + if (mappingContract?.IsDirectCertificationSupported != false) + target.DirectCertification = source.DirectCertification; + + // Copy Aggregate Reference Data + if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null + || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) + { + target.EducationOrganizationResourceId = source.EducationOrganizationResourceId; + target.EducationOrganizationDiscriminator = source.EducationOrganizationDiscriminator; + target.ProgramResourceId = source.ProgramResourceId; + target.ProgramDiscriminator = source.ProgramDiscriminator; + target.StudentResourceId = source.StudentResourceId; + target.StudentDiscriminator = source.StudentDiscriminator; + } + + + + // ---------------------------------- + // Map One-to-one relationships + // ---------------------------------- + + // Map inherited lists + + if (mappingContract?.IsGeneralStudentProgramAssociationProgramParticipationStatusesSupported != false) + { + source.GeneralStudentProgramAssociationProgramParticipationStatuses.MapCollectionTo(target.GeneralStudentProgramAssociationProgramParticipationStatuses, mappingContract?.IsGeneralStudentProgramAssociationProgramParticipationStatusesItemCreatable ?? true, target, mappingContract?.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded); + } + + // Map lists + + if (mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesSupported != false) + { + source.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices.MapCollectionTo(target.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices, mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesItemCreatable ?? true, target, mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceIncluded); + } + + // Map extensions + source.MapExtensionsTo(target, mappingContract); + + // Convert source to an ETag, if appropriate + if (target is IHasETag entityWithETag) + entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); + + // Copy/assign LastModifiedDate, if appropriate + if (target is IDateVersionedEntity targetDateVersionedEntity) + { + if (source is IHasETag etagSource) + { + // Convert resource's supplied eTag value to entity's LastModifiedDate + targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); + } + else if (source is IDateVersionedEntity sourceDateVersionedEntity) + { + // Copy LastModifiedDate, when mapping from entities to resources/entities + targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; + } + } + } + } + [ExcludeFromCodeCoverage] - public static class StudentSchoolAttendanceEventMapper + public static class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMapper { - private static readonly FullName _fullName_edfi_StudentSchoolAttendanceEvent = new FullName("edfi", "StudentSchoolAttendanceEvent"); + private static readonly FullName _fullName_edfi_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService"); - public static bool SynchronizeTo(this IStudentSchoolAttendanceEvent source, IStudentSchoolAttendanceEvent target) + public static bool SynchronizeTo(this IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService source, IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentSchoolAttendanceEventMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentSchoolAttendanceEvent); - - var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; - - // Detect primary key changes - if ( - !string.Equals(target.AttendanceEventCategoryDescriptor, source.AttendanceEventCategoryDescriptor, StringComparison.OrdinalIgnoreCase) - || (target.EventDate != source.EventDate) - || (target.SchoolId != source.SchoolId) - || (target.SchoolYear != source.SchoolYear) - || (!keyStringComparer.Equals(target.SessionName, source.SessionName)) - || (target.StudentUniqueId != source.StudentUniqueId)) - { - // Disallow PK column updates on StudentSchoolAttendanceEvent - throw new KeyChangeNotSupportedException("StudentSchoolAttendanceEvent"); - } + .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService); // Copy non-PK properties - if ((mappingContract?.IsArrivalTimeSupported != false) - && target.ArrivalTime != source.ArrivalTime) - { - target.ArrivalTime = source.ArrivalTime; - isModified = true; - } - - if ((mappingContract?.IsAttendanceEventReasonSupported != false) - && target.AttendanceEventReason != source.AttendanceEventReason) - { - target.AttendanceEventReason = source.AttendanceEventReason; - isModified = true; - } - - if ((mappingContract?.IsDepartureTimeSupported != false) - && target.DepartureTime != source.DepartureTime) - { - target.DepartureTime = source.DepartureTime; - isModified = true; - } - - if ((mappingContract?.IsEducationalEnvironmentDescriptorSupported != false) - && target.EducationalEnvironmentDescriptor != source.EducationalEnvironmentDescriptor) + if ((mappingContract?.IsPrimaryIndicatorSupported != false) + && target.PrimaryIndicator != source.PrimaryIndicator) { - target.EducationalEnvironmentDescriptor = source.EducationalEnvironmentDescriptor; + target.PrimaryIndicator = source.PrimaryIndicator; isModified = true; } - if ((mappingContract?.IsEventDurationSupported != false) - && target.EventDuration != source.EventDuration) + if ((mappingContract?.IsServiceBeginDateSupported != false) + && target.ServiceBeginDate != source.ServiceBeginDate) { - target.EventDuration = source.EventDuration; + target.ServiceBeginDate = source.ServiceBeginDate; isModified = true; } - if ((mappingContract?.IsSchoolAttendanceDurationSupported != false) - && target.SchoolAttendanceDuration != source.SchoolAttendanceDuration) + if ((mappingContract?.IsServiceEndDateSupported != false) + && target.ServiceEndDate != source.ServiceEndDate) { - target.SchoolAttendanceDuration = source.SchoolAttendanceDuration; + target.ServiceEndDate = source.ServiceEndDate; isModified = true; } @@ -72187,55 +74129,28 @@ public static bool SynchronizeTo(this IStudentSchoolAttendanceEvent source, IStu return isModified; } - public static void MapTo(this IStudentSchoolAttendanceEvent source, IStudentSchoolAttendanceEvent target, Action onMapped) + public static void MapTo(this IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService source, IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentSchoolAttendanceEventMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentSchoolAttendanceEvent); + .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService); - // Copy resource Id - target.Id = source.Id; - // Copy contextual primary key values - target.AttendanceEventCategoryDescriptor = source.AttendanceEventCategoryDescriptor; - target.EventDate = source.EventDate; - target.SchoolId = source.SchoolId; - target.SchoolYear = source.SchoolYear; - target.SessionName = source.SessionName; - target.StudentUniqueId = source.StudentUniqueId; + target.SchoolFoodServiceProgramServiceDescriptor = source.SchoolFoodServiceProgramServiceDescriptor; // Copy non-PK properties - if (mappingContract?.IsArrivalTimeSupported != false) - target.ArrivalTime = source.ArrivalTime; - - if (mappingContract?.IsAttendanceEventReasonSupported != false) - target.AttendanceEventReason = source.AttendanceEventReason; - - if (mappingContract?.IsDepartureTimeSupported != false) - target.DepartureTime = source.DepartureTime; - - if (mappingContract?.IsEducationalEnvironmentDescriptorSupported != false) - target.EducationalEnvironmentDescriptor = source.EducationalEnvironmentDescriptor; + if (mappingContract?.IsPrimaryIndicatorSupported != false) + target.PrimaryIndicator = source.PrimaryIndicator; - if (mappingContract?.IsEventDurationSupported != false) - target.EventDuration = source.EventDuration; + if (mappingContract?.IsServiceBeginDateSupported != false) + target.ServiceBeginDate = source.ServiceBeginDate; - if (mappingContract?.IsSchoolAttendanceDurationSupported != false) - target.SchoolAttendanceDuration = source.SchoolAttendanceDuration; + if (mappingContract?.IsServiceEndDateSupported != false) + target.ServiceEndDate = source.ServiceEndDate; // Copy Aggregate Reference Data - if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null - || GeneratedArtifactStaticDependencies.AuthorizationContextProvider.GetAction() == RequestActions.ReadActionUri) - { - target.SchoolResourceId = source.SchoolResourceId; - target.SessionResourceId = source.SessionResourceId; - target.SessionDiscriminator = source.SessionDiscriminator; - target.StudentResourceId = source.StudentResourceId; - target.StudentDiscriminator = source.StudentDiscriminator; - } - // ---------------------------------- @@ -72269,23 +74184,23 @@ public static void MapTo(this IStudentSchoolAttendanceEvent source, IStudentScho } } -// Aggregate: StudentSchoolFoodServiceProgramAssociation +// Aggregate: StudentSection504ProgramAssociation -namespace EdFi.Ods.Entities.Common.EdFi //.StudentSchoolFoodServiceProgramAssociationAggregate +namespace EdFi.Ods.Entities.Common.EdFi //.StudentSection504ProgramAssociationAggregate { [ExcludeFromCodeCoverage] - public static class StudentSchoolFoodServiceProgramAssociationMapper + public static class StudentSection504ProgramAssociationMapper { - private static readonly FullName _fullName_edfi_StudentSchoolFoodServiceProgramAssociation = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociation"); + private static readonly FullName _fullName_edfi_StudentSection504ProgramAssociation = new FullName("edfi", "StudentSection504ProgramAssociation"); - public static bool SynchronizeTo(this IStudentSchoolFoodServiceProgramAssociation source, IStudentSchoolFoodServiceProgramAssociation target) + public static bool SynchronizeTo(this IStudentSection504ProgramAssociation source, IStudentSection504ProgramAssociation target) { bool isModified = false; // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentSchoolFoodServiceProgramAssociationMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentSection504ProgramAssociationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociation); + .GetMappingContract(_fullName_edfi_StudentSection504ProgramAssociation); var keyStringComparer = GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer; @@ -72298,8 +74213,8 @@ public static bool SynchronizeTo(this IStudentSchoolFoodServiceProgramAssociatio || !string.Equals(target.ProgramTypeDescriptor, source.ProgramTypeDescriptor, StringComparison.OrdinalIgnoreCase) || (target.StudentUniqueId != source.StudentUniqueId)) { - // Disallow PK column updates on StudentSchoolFoodServiceProgramAssociation - throw new KeyChangeNotSupportedException("StudentSchoolFoodServiceProgramAssociation"); + // Disallow PK column updates on StudentSection504ProgramAssociation + throw new KeyChangeNotSupportedException("StudentSection504ProgramAssociation"); } @@ -72329,10 +74244,38 @@ public static bool SynchronizeTo(this IStudentSchoolFoodServiceProgramAssociatio // Copy non-PK properties - if ((mappingContract?.IsDirectCertificationSupported != false) - && target.DirectCertification != source.DirectCertification) + if ((mappingContract?.IsAccommodationPlanSupported != false) + && target.AccommodationPlan != source.AccommodationPlan) { - target.DirectCertification = source.DirectCertification; + target.AccommodationPlan = source.AccommodationPlan; + isModified = true; + } + + if ((mappingContract?.IsSection504DisabilityTypeDescriptorSupported != false) + && target.Section504DisabilityTypeDescriptor != source.Section504DisabilityTypeDescriptor) + { + target.Section504DisabilityTypeDescriptor = source.Section504DisabilityTypeDescriptor; + isModified = true; + } + + if ((mappingContract?.IsSection504EligibilitySupported != false) + && target.Section504Eligibility != source.Section504Eligibility) + { + target.Section504Eligibility = source.Section504Eligibility; + isModified = true; + } + + if ((mappingContract?.IsSection504EligibilityDecisionDateSupported != false) + && target.Section504EligibilityDecisionDate != source.Section504EligibilityDecisionDate) + { + target.Section504EligibilityDecisionDate = source.Section504EligibilityDecisionDate; + isModified = true; + } + + if ((mappingContract?.IsSection504MeetingDateSupported != false) + && target.Section504MeetingDate != source.Section504MeetingDate) + { + target.Section504MeetingDate = source.Section504MeetingDate; isModified = true; } @@ -72350,31 +74293,18 @@ public static bool SynchronizeTo(this IStudentSchoolFoodServiceProgramAssociatio // Sync lists - if (mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesSupported ?? true) - { - isModified |= - source.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices.SynchronizeCollectionTo( - target.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices, - onChildAdded: child => - { - child.StudentSchoolFoodServiceProgramAssociation = target; - }, - itemCreatable: mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesItemCreatable ?? true, - includeItem: item => mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceIncluded?.Invoke(item) ?? true); - } - // Sync extensions isModified |= source.SynchronizeExtensionsTo(target, mappingContract); return isModified; } - public static void MapDerivedTo(this IStudentSchoolFoodServiceProgramAssociation source, IStudentSchoolFoodServiceProgramAssociation target, Action onMapped) + public static void MapDerivedTo(this IStudentSection504ProgramAssociation source, IStudentSection504ProgramAssociation target, Action onMapped) { // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentSchoolFoodServiceProgramAssociationMappingContract) GeneratedArtifactStaticDependencies + var mappingContract = (StudentSection504ProgramAssociationMappingContract) GeneratedArtifactStaticDependencies .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociation); + .GetMappingContract(_fullName_edfi_StudentSection504ProgramAssociation); // Copy resource Id target.Id = source.Id; @@ -72400,8 +74330,20 @@ public static void MapDerivedTo(this IStudentSchoolFoodServiceProgramAssociation // Copy non-PK properties - if (mappingContract?.IsDirectCertificationSupported != false) - target.DirectCertification = source.DirectCertification; + if (mappingContract?.IsAccommodationPlanSupported != false) + target.AccommodationPlan = source.AccommodationPlan; + + if (mappingContract?.IsSection504DisabilityTypeDescriptorSupported != false) + target.Section504DisabilityTypeDescriptor = source.Section504DisabilityTypeDescriptor; + + if (mappingContract?.IsSection504EligibilitySupported != false) + target.Section504Eligibility = source.Section504Eligibility; + + if (mappingContract?.IsSection504EligibilityDecisionDateSupported != false) + target.Section504EligibilityDecisionDate = source.Section504EligibilityDecisionDate; + + if (mappingContract?.IsSection504MeetingDateSupported != false) + target.Section504MeetingDate = source.Section504MeetingDate; // Copy Aggregate Reference Data if (GeneratedArtifactStaticDependencies.AuthorizationContextProvider == null @@ -72430,111 +74372,6 @@ public static void MapDerivedTo(this IStudentSchoolFoodServiceProgramAssociation // Map lists - if (mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesSupported != false) - { - source.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices.MapCollectionTo(target.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices, mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesItemCreatable ?? true, target, mappingContract?.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceIncluded); - } - - // Map extensions - source.MapExtensionsTo(target, mappingContract); - - // Convert source to an ETag, if appropriate - if (target is IHasETag entityWithETag) - entityWithETag.ETag = GeneratedArtifactStaticDependencies.ETagProvider.GetETag(source); - - // Copy/assign LastModifiedDate, if appropriate - if (target is IDateVersionedEntity targetDateVersionedEntity) - { - if (source is IHasETag etagSource) - { - // Convert resource's supplied eTag value to entity's LastModifiedDate - targetDateVersionedEntity.LastModifiedDate = GeneratedArtifactStaticDependencies.ETagProvider.GetDateTime(etagSource.ETag); - } - else if (source is IDateVersionedEntity sourceDateVersionedEntity) - { - // Copy LastModifiedDate, when mapping from entities to resources/entities - targetDateVersionedEntity.LastModifiedDate = sourceDateVersionedEntity.LastModifiedDate; - } - } - } - } - - [ExcludeFromCodeCoverage] - public static class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMapper - { - private static readonly FullName _fullName_edfi_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService"); - - public static bool SynchronizeTo(this IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService source, IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService target) - { - bool isModified = false; - - // Get the mapping contract for knowing what values to synchronize through to target entity - var mappingContract = (StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMappingContract) GeneratedArtifactStaticDependencies - .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService); - - - // Copy non-PK properties - - if ((mappingContract?.IsPrimaryIndicatorSupported != false) - && target.PrimaryIndicator != source.PrimaryIndicator) - { - target.PrimaryIndicator = source.PrimaryIndicator; - isModified = true; - } - - if ((mappingContract?.IsServiceBeginDateSupported != false) - && target.ServiceBeginDate != source.ServiceBeginDate) - { - target.ServiceBeginDate = source.ServiceBeginDate; - isModified = true; - } - - if ((mappingContract?.IsServiceEndDateSupported != false) - && target.ServiceEndDate != source.ServiceEndDate) - { - target.ServiceEndDate = source.ServiceEndDate; - isModified = true; - } - - - // Sync lists - // Sync extensions - isModified |= source.SynchronizeExtensionsTo(target, mappingContract); - - return isModified; - } - - public static void MapTo(this IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService source, IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService target, Action onMapped) - { - // Get the mapping contract for determining what values to map through to target - var mappingContract = (StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMappingContract) GeneratedArtifactStaticDependencies - .MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService); - - // Copy contextual primary key values - target.SchoolFoodServiceProgramServiceDescriptor = source.SchoolFoodServiceProgramServiceDescriptor; - - // Copy non-PK properties - - if (mappingContract?.IsPrimaryIndicatorSupported != false) - target.PrimaryIndicator = source.PrimaryIndicator; - - if (mappingContract?.IsServiceBeginDateSupported != false) - target.ServiceBeginDate = source.ServiceBeginDate; - - if (mappingContract?.IsServiceEndDateSupported != false) - target.ServiceEndDate = source.ServiceEndDate; - - // Copy Aggregate Reference Data - - - // ---------------------------------- - // Map One-to-one relationships - // ---------------------------------- - - // Map lists - // Map extensions source.MapExtensionsTo(target, mappingContract); @@ -73973,6 +75810,7 @@ public static bool SynchronizeTo(this IStudentSpecialEducationProgramEligibility if ( (target.ConsentToEvaluationReceivedDate != source.ConsentToEvaluationReceivedDate) || (target.EducationOrganizationId != source.EducationOrganizationId) + || (target.ProgramEducationOrganizationId != source.ProgramEducationOrganizationId) || (!keyStringComparer.Equals(target.ProgramName, source.ProgramName)) || !string.Equals(target.ProgramTypeDescriptor, source.ProgramTypeDescriptor, StringComparison.OrdinalIgnoreCase) || (target.StudentUniqueId != source.StudentUniqueId)) @@ -74110,6 +75948,7 @@ public static void MapTo(this IStudentSpecialEducationProgramEligibilityAssociat // Copy contextual primary key values target.ConsentToEvaluationReceivedDate = source.ConsentToEvaluationReceivedDate; target.EducationOrganizationId = source.EducationOrganizationId; + target.ProgramEducationOrganizationId = source.ProgramEducationOrganizationId; target.ProgramName = source.ProgramName; target.ProgramTypeDescriptor = source.ProgramTypeDescriptor; target.StudentUniqueId = source.StudentUniqueId; diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Pipelines_CreateOrUpdatePipelines.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Pipelines_CreateOrUpdatePipelines.generated.approved.cs index cdcf463d3f..1033104107 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Pipelines_CreateOrUpdatePipelines.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Pipelines_CreateOrUpdatePipelines.generated.approved.cs @@ -88,6 +88,18 @@ public class AssessmentCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public AssessmentAdministrationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public AssessmentBatteryPartCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + [ExcludeFromCodeCoverage] public class AssessmentCategoryDescriptorCreateOrUpdatePipeline : CreateOrUpdatePipeline { @@ -136,6 +148,12 @@ public class AssessmentScoreRangeLearningStandardCreateOrUpdatePipeline : Create public AssessmentScoreRangeLearningStandardCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } } + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public AssesssmentAdministrationParticipationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + [ExcludeFromCodeCoverage] public class AssignmentLateStatusDescriptorCreateOrUpdatePipeline : CreateOrUpdatePipeline { @@ -1468,6 +1486,12 @@ public class SectionCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public Section504DisabilityTypeDescriptorCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + [ExcludeFromCodeCoverage] public class SectionAttendanceTakenEventCreateOrUpdatePipeline : CreateOrUpdatePipeline { @@ -1666,6 +1690,18 @@ public class StudentAssessmentEducationOrganizationAssociationCreateOrUpdatePipe public StudentAssessmentEducationOrganizationAssociationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } } + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public StudentAssessmentRegistrationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public StudentAssessmentRegistrationBatteryPartAssociationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + [ExcludeFromCodeCoverage] public class StudentCharacteristicDescriptorCreateOrUpdatePipeline : CreateOrUpdatePipeline { @@ -1708,6 +1744,12 @@ public class StudentDisciplineIncidentNonOffenderAssociationCreateOrUpdatePipeli public StudentDisciplineIncidentNonOffenderAssociationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } } + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public StudentEducationOrganizationAssessmentAccommodationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + [ExcludeFromCodeCoverage] public class StudentEducationOrganizationAssociationCreateOrUpdatePipeline : CreateOrUpdatePipeline { @@ -1810,6 +1852,12 @@ public class StudentSchoolFoodServiceProgramAssociationCreateOrUpdatePipeline : public StudentSchoolFoodServiceProgramAssociationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } } + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationCreateOrUpdatePipeline : CreateOrUpdatePipeline + { + public StudentSection504ProgramAssociationCreateOrUpdatePipeline(IPipelineFactory factory) : base(factory) { } + } + [ExcludeFromCodeCoverage] public class StudentSectionAssociationCreateOrUpdatePipeline : CreateOrUpdatePipeline { diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Requests_Requests.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Requests_Requests.generated.approved.cs index f7e0f4fdc1..8b7c464163 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Requests_Requests.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Requests_Requests.generated.approved.cs @@ -750,6 +750,105 @@ public AssessmentDelete(Guid id) } } +namespace EdFi.Ods.Api.Common.Models.Requests.AssessmentAdministrations.EdFi +{ + + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationGetByExample + { + public string AdministrationIdentifier { get; set; } + public string AssessmentIdentifier { get; set; } + public long AssigningEducationOrganizationId { get; set; } + public Guid Id { get; set; } + public string Namespace { get; set; } + } + + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationGetByIds : IHasIdentifiers + { + public AssessmentAdministrationGetByIds() { } + + public AssessmentAdministrationGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationPost : Resources.AssessmentAdministration.EdFi.AssessmentAdministration + { + } + + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationPut : Resources.AssessmentAdministration.EdFi.AssessmentAdministration + { + } + + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationDelete : IHasIdentifier + { + public AssessmentAdministrationDelete() { } + + public AssessmentAdministrationDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + +namespace EdFi.Ods.Api.Common.Models.Requests.AssessmentBatteryParts.EdFi +{ + + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartGetByExample + { + public string AssessmentBatteryPartName { get; set; } + public string AssessmentIdentifier { get; set; } + public Guid Id { get; set; } + public string Namespace { get; set; } + } + + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartGetByIds : IHasIdentifiers + { + public AssessmentBatteryPartGetByIds() { } + + public AssessmentBatteryPartGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartPost : Resources.AssessmentBatteryPart.EdFi.AssessmentBatteryPart + { + } + + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartPut : Resources.AssessmentBatteryPart.EdFi.AssessmentBatteryPart + { + } + + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPartDelete : IHasIdentifier + { + public AssessmentBatteryPartDelete() { } + + public AssessmentBatteryPartDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + namespace EdFi.Ods.Api.Common.Models.Requests.AssessmentCategoryDescriptors.EdFi { @@ -1176,6 +1275,57 @@ public AssessmentScoreRangeLearningStandardDelete(Guid id) } } +namespace EdFi.Ods.Api.Common.Models.Requests.AssesssmentAdministrationParticipations.EdFi +{ + + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationGetByExample + { + public string AdministrationIdentifier { get; set; } + public string AssessmentIdentifier { get; set; } + public long AssigningEducationOrganizationId { get; set; } + public Guid Id { get; set; } + public string Namespace { get; set; } + public long ParticipatingEducationOrganizationId { get; set; } + } + + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationGetByIds : IHasIdentifiers + { + public AssesssmentAdministrationParticipationGetByIds() { } + + public AssesssmentAdministrationParticipationGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationPost : Resources.AssesssmentAdministrationParticipation.EdFi.AssesssmentAdministrationParticipation + { + } + + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationPut : Resources.AssesssmentAdministrationParticipation.EdFi.AssesssmentAdministrationParticipation + { + } + + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationDelete : IHasIdentifier + { + public AssesssmentAdministrationParticipationDelete() { } + + public AssesssmentAdministrationParticipationDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + namespace EdFi.Ods.Api.Common.Models.Requests.AssignmentLateStatusDescriptors.EdFi { @@ -12997,6 +13147,59 @@ public SectionDelete(Guid id) } } +namespace EdFi.Ods.Api.Common.Models.Requests.Section504DisabilityTypeDescriptors.EdFi +{ + + [ExcludeFromCodeCoverage] + public class Section504DisabilityTypeDescriptorGetByExample + { + public string CodeValue { get; set; } + public string Description { get; set; } + public DateTime EffectiveBeginDate { get; set; } + public DateTime EffectiveEndDate { get; set; } + public Guid Id { get; set; } + public string Namespace { get; set; } + public int Section504DisabilityTypeDescriptorId { get; set; } + public string ShortDescription { get; set; } + } + + [ExcludeFromCodeCoverage] + public class Section504DisabilityTypeDescriptorGetByIds : IHasIdentifiers + { + public Section504DisabilityTypeDescriptorGetByIds() { } + + public Section504DisabilityTypeDescriptorGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class Section504DisabilityTypeDescriptorPost : Resources.Section504DisabilityTypeDescriptor.EdFi.Section504DisabilityTypeDescriptor + { + } + + [ExcludeFromCodeCoverage] + public class Section504DisabilityTypeDescriptorPut : Resources.Section504DisabilityTypeDescriptor.EdFi.Section504DisabilityTypeDescriptor + { + } + + [ExcludeFromCodeCoverage] + public class Section504DisabilityTypeDescriptorDelete : IHasIdentifier + { + public Section504DisabilityTypeDescriptorDelete() { } + + public Section504DisabilityTypeDescriptorDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + namespace EdFi.Ods.Api.Common.Models.Requests.SectionAttendanceTakenEvents.EdFi { @@ -14797,6 +15000,117 @@ public StudentAssessmentEducationOrganizationAssociationDelete(Guid id) } } +namespace EdFi.Ods.Api.Common.Models.Requests.StudentAssessmentRegistrations.EdFi +{ + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationGetByExample + { + public string AdministrationIdentifier { get; set; } + public string AssessmentGradeLevelDescriptor { get; set; } + public string AssessmentIdentifier { get; set; } + public long AssigningEducationOrganizationId { get; set; } + public long EducationOrganizationId { get; set; } + public DateTime EntryDate { get; set; } + public Guid Id { get; set; } + public string Namespace { get; set; } + public string PlatformTypeDescriptor { get; set; } + public long ReportingEducationOrganizationId { get; set; } + public long SchoolId { get; set; } + public string StudentUniqueId { get; set; } + public long TestingEducationOrganizationId { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationGetByIds : IHasIdentifiers + { + public StudentAssessmentRegistrationGetByIds() { } + + public StudentAssessmentRegistrationGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationPost : Resources.StudentAssessmentRegistration.EdFi.StudentAssessmentRegistration + { + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationPut : Resources.StudentAssessmentRegistration.EdFi.StudentAssessmentRegistration + { + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationDelete : IHasIdentifier + { + public StudentAssessmentRegistrationDelete() { } + + public StudentAssessmentRegistrationDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + +namespace EdFi.Ods.Api.Common.Models.Requests.StudentAssessmentRegistrationBatteryPartAssociations.EdFi +{ + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationGetByExample + { + public string AdministrationIdentifier { get; set; } + public string AssessmentBatteryPartName { get; set; } + public string AssessmentIdentifier { get; set; } + public long AssigningEducationOrganizationId { get; set; } + public long EducationOrganizationId { get; set; } + public Guid Id { get; set; } + public string Namespace { get; set; } + public string StudentUniqueId { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationGetByIds : IHasIdentifiers + { + public StudentAssessmentRegistrationBatteryPartAssociationGetByIds() { } + + public StudentAssessmentRegistrationBatteryPartAssociationGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationPost : Resources.StudentAssessmentRegistrationBatteryPartAssociation.EdFi.StudentAssessmentRegistrationBatteryPartAssociation + { + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationPut : Resources.StudentAssessmentRegistrationBatteryPartAssociation.EdFi.StudentAssessmentRegistrationBatteryPartAssociation + { + } + + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationDelete : IHasIdentifier + { + public StudentAssessmentRegistrationBatteryPartAssociationDelete() { } + + public StudentAssessmentRegistrationBatteryPartAssociationDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + namespace EdFi.Ods.Api.Common.Models.Requests.StudentCharacteristicDescriptors.EdFi { @@ -15170,6 +15484,54 @@ public StudentDisciplineIncidentNonOffenderAssociationDelete(Guid id) } } +namespace EdFi.Ods.Api.Common.Models.Requests.StudentEducationOrganizationAssessmentAccommodations.EdFi +{ + + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationGetByExample + { + public long EducationOrganizationId { get; set; } + public Guid Id { get; set; } + public string StudentUniqueId { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationGetByIds : IHasIdentifiers + { + public StudentEducationOrganizationAssessmentAccommodationGetByIds() { } + + public StudentEducationOrganizationAssessmentAccommodationGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationPost : Resources.StudentEducationOrganizationAssessmentAccommodation.EdFi.StudentEducationOrganizationAssessmentAccommodation + { + } + + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationPut : Resources.StudentEducationOrganizationAssessmentAccommodation.EdFi.StudentEducationOrganizationAssessmentAccommodation + { + } + + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationDelete : IHasIdentifier + { + public StudentEducationOrganizationAssessmentAccommodationDelete() { } + + public StudentEducationOrganizationAssessmentAccommodationDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + namespace EdFi.Ods.Api.Common.Models.Requests.StudentEducationOrganizationAssociations.EdFi { @@ -16148,6 +16510,66 @@ public StudentSchoolFoodServiceProgramAssociationDelete(Guid id) } } +namespace EdFi.Ods.Api.Common.Models.Requests.StudentSection504ProgramAssociations.EdFi +{ + + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationGetByExample + { + public bool AccommodationPlan { get; set; } + public DateTime BeginDate { get; set; } + public long EducationOrganizationId { get; set; } + public DateTime EndDate { get; set; } + public Guid Id { get; set; } + public long ProgramEducationOrganizationId { get; set; } + public string ProgramName { get; set; } + public string ProgramTypeDescriptor { get; set; } + public string ReasonExitedDescriptor { get; set; } + public string Section504DisabilityTypeDescriptor { get; set; } + public bool Section504Eligibility { get; set; } + public DateTime Section504EligibilityDecisionDate { get; set; } + public DateTime Section504MeetingDate { get; set; } + public bool ServedOutsideOfRegularSession { get; set; } + public string StudentUniqueId { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationGetByIds : IHasIdentifiers + { + public StudentSection504ProgramAssociationGetByIds() { } + + public StudentSection504ProgramAssociationGetByIds(params Guid[] ids) + { + Ids = new List(ids); + } + + public List Ids { get; set; } + } + + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationPost : Resources.StudentSection504ProgramAssociation.EdFi.StudentSection504ProgramAssociation + { + } + + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationPut : Resources.StudentSection504ProgramAssociation.EdFi.StudentSection504ProgramAssociation + { + } + + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationDelete : IHasIdentifier + { + public StudentSection504ProgramAssociationDelete() { } + + public StudentSection504ProgramAssociationDelete(Guid id) + { + Id = id; + } + + public Guid Id { get; set; } + } +} + namespace EdFi.Ods.Api.Common.Models.Requests.StudentSectionAssociations.EdFi { @@ -16356,6 +16778,7 @@ public class StudentSpecialEducationProgramEligibilityAssociationGetByExample public bool IDEAIndicator { get; set; } public string IDEAPartDescriptor { get; set; } public DateTime OriginalECIServicesDate { get; set; } + public long ProgramEducationOrganizationId { get; set; } public string ProgramName { get; set; } public string ProgramTypeDescriptor { get; set; } public string StudentUniqueId { get; set; } diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Resources_Resources.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Resources_Resources.generated.approved.cs index 1757c176ff..cb037fe0b4 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Resources_Resources.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Resources_Resources.generated.approved.cs @@ -9242,564 +9242,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentCategoryDescriptor table of the AssessmentCategoryDescriptor aggregate in the ODS Database. - ///
- [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class AssessmentCategoryDescriptor : Entities.Common.EdFi.IAssessmentCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "AssessmentCategoryDescriptor"); - - // Fluent validator instance (threadsafe) - private static AssessmentCategoryDescriptorPutPostRequestValidator _validator = new AssessmentCategoryDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the AssessmentCategoryDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int AssessmentCategoryDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return AssessmentCategoryDescriptorId; } - set { AssessmentCategoryDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IAssessmentCategoryDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IAssessmentCategoryDescriptor).AssessmentCategoryDescriptorId.Equals(compareTo.AssessmentCategoryDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IAssessmentCategoryDescriptor).AssessmentCategoryDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.AssessmentCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.AssessmentCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentCategoryDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class AssessmentCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: AssessmentIdentificationSystemDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.AssessmentIdentificationSystemDescriptor.EdFi -{ - /// - /// A class which represents the edfi.AssessmentIdentificationSystemDescriptor table of the AssessmentIdentificationSystemDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class AssessmentIdentificationSystemDescriptor : Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "AssessmentIdentificationSystemDescriptor"); - - // Fluent validator instance (threadsafe) - private static AssessmentIdentificationSystemDescriptorPutPostRequestValidator _validator = new AssessmentIdentificationSystemDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the AssessmentIdentificationSystemDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int AssessmentIdentificationSystemDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return AssessmentIdentificationSystemDescriptorId; } - set { AssessmentIdentificationSystemDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor).AssessmentIdentificationSystemDescriptorId.Equals(compareTo.AssessmentIdentificationSystemDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor).AssessmentIdentificationSystemDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.AssessmentIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.AssessmentIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class AssessmentIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- +// Aggregate: AssessmentAdministration -} -// Aggregate: AssessmentItem - -namespace EdFi.Ods.Api.Common.Models.Resources.AssessmentItem.EdFi +namespace EdFi.Ods.Api.Common.Models.Resources.AssessmentAdministration.EdFi { /// - /// Represents a reference to the AssessmentItem resource. + /// Represents a reference to the AssessmentAdministration resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class AssessmentItemReference : IResourceReference + public class AssessmentAdministrationReference : IResourceReference { + [DataMember(Name="administrationIdentifier")] + public string AdministrationIdentifier { get; set; } + [DataMember(Name="assessmentIdentifier")] public string AssessmentIdentifier { get; set; } - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } + [DataMember(Name="assigningEducationOrganizationId")] + public long AssigningEducationOrganizationId { get; set; } [DataMember(Name="namespace")] public string Namespace { get; set; } @@ -9840,19 +9301,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AssessmentIdentifier != default(string) && IdentificationCode != default(string) && Namespace != default(string); + return AdministrationIdentifier != default(string) && AssessmentIdentifier != default(string) && AssigningEducationOrganizationId != default(long) && Namespace != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { + if (AdministrationIdentifier == default) + { + yield return "AdministrationIdentifier"; + } + if (AssessmentIdentifier == default) { yield return "AssessmentIdentifier"; } - if (IdentificationCode == default) + if (AssigningEducationOrganizationId == default) { - yield return "IdentificationCode"; + yield return "AssigningEducationOrganizationId"; } if (Namespace == default) @@ -9866,8 +9332,8 @@ private Link CreateLink() { var link = new Link { - Rel = "AssessmentItem", - Href = $"/ed-fi/assessmentItems/{ResourceId:n}" + Rel = "AssessmentAdministration", + Href = $"/ed-fi/assessmentAdministrations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -9894,16 +9360,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.AssessmentItem table of the AssessmentItem aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentAdministration table of the AssessmentAdministration aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentItem : Entities.Common.EdFi.IAssessmentItem, IHasETag, IDateVersionedEntity, IValidatableObject + public class AssessmentAdministration : Entities.Common.EdFi.IAssessmentAdministration, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "AssessmentItem"); + private static FullName _fullName = new FullName("edfi", "AssessmentAdministration"); // Fluent validator instance (threadsafe) - private static AssessmentItemPutPostRequestValidator _validator = new AssessmentItemPutPostRequestValidator(); + private static AssessmentAdministrationPutPostRequestValidator _validator = new AssessmentAdministrationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -9914,10 +9380,10 @@ public class AssessmentItem : Entities.Common.EdFi.IAssessmentItem, IHasETag, ID // Constructor // ------------------------------------------------------------- - public AssessmentItem() + public AssessmentAdministration() { - AssessmentItemLearningStandards = new List(); - AssessmentItemPossibleResponses = new List(); + AssessmentAdministrationAssessmentAdminstrationPeriods = new List(); + AssessmentAdministrationAssessmentBatteryParts = new List(); } // ------------------------------------------------------------ @@ -9927,7 +9393,7 @@ public AssessmentItem() // ------------------------------------------------------------ /// - /// The unique identifier for the AssessmentItem resource. + /// The unique identifier for the AssessmentAdministration resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -9971,17 +9437,59 @@ public Assessment.EdFi.AssessmentReference AssessmentReference _assessmentReference = value; } } + private bool _assigningEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _assigningEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitAssigningEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assigningEducationOrganizationReference == null && !_assigningEducationOrganizationReferenceExplicitlyAssigned) + _assigningEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _assigningEducationOrganizationReference; + } + } + + [DataMember(Name="assigningEducationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference AssigningEducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssigningEducationOrganizationReference != null + && (_assigningEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssigningEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitAssigningEducationOrganizationReference; + + return null; + } + set + { + _assigningEducationOrganizationReferenceExplicitlyAssigned = true; + _assigningEducationOrganizationReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + /// + /// The title or name of the assessment in the context of its administration. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="administrationIdentifier")] + public string AdministrationIdentifier { get; set; } + /// /// A unique number or alphanumeric code assigned to an assessment. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IAssessmentItem.AssessmentIdentifier + string Entities.Common.EdFi.IAssessmentAdministration.AssessmentIdentifier { get { @@ -10003,19 +9511,35 @@ string Entities.Common.EdFi.IAssessmentItem.AssessmentIdentifier } /// - /// A unique number or alphanumeric code assigned to a space, room, site, building, individual, organization, program, or institution by a school, school system, state, or other agency or entity. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationId + { + get + { + if (ImplicitAssigningEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssigningEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitAssigningEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssigningEducationOrganization + _assigningEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitAssigningEducationOrganizationReference.EducationOrganizationId = value; + } + } /// /// Namespace for the assessment. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IAssessmentItem.Namespace + string Entities.Common.EdFi.IAssessmentAdministration.Namespace { get { @@ -10049,7 +9573,7 @@ string Entities.Common.EdFi.IAssessmentItem.Namespace /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentItem; + var compareTo = obj as Entities.Common.EdFi.IAssessmentAdministration; if (ReferenceEquals(this, compareTo)) return true; @@ -10058,18 +9582,23 @@ public override bool Equals(object obj) return false; + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentAdministration).AdministrationIdentifier, compareTo.AdministrationIdentifier)) + return false; + + // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItem).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentAdministration).AssessmentIdentifier, compareTo.AssessmentIdentifier)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItem).IdentificationCode, compareTo.IdentificationCode)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IAssessmentAdministration).AssigningEducationOrganizationId.Equals(compareTo.AssigningEducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItem).Namespace, compareTo.Namespace)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentAdministration).Namespace, compareTo.Namespace)) return false; @@ -10086,15 +9615,18 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IAssessmentItem).AssessmentIdentifier); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IAssessmentItem).IdentificationCode); + hash.Add((this as Entities.Common.EdFi.IAssessmentAdministration).AdministrationIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IAssessmentItem).Namespace); + hash.Add((this as Entities.Common.EdFi.IAssessmentAdministration).AssessmentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentAdministration).AssigningEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentAdministration).Namespace); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -10107,54 +9639,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Category or type of the assessment item. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assessmentItemCategoryDescriptor")][DescriptorExists("AssessmentItemCategoryDescriptor")] - public string AssessmentItemCategoryDescriptor { get; set; } - - /// - /// The URI (typical a URL) pointing to the entry in an assessment item bank, which describes this content item. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="assessmentItemURI")] - public string AssessmentItemURI { get; set; } - - /// - /// The duration allotted for the assessment item expressed in minutes. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="expectedTimeAssessed")] - public string ExpectedTimeAssessed { get; set; } - - /// - /// The text of the item. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="itemText")] - public string ItemText { get; set; } - - /// - /// The maximum raw score achievable across all assessment items that are correct and scored at the maximum. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999999.99999", "9999999999.99999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxRawScore")] - public decimal? MaxRawScore { get; set; } - - /// - /// Reflects the specific nomenclature used for assessment item. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nomenclature")] - public string Nomenclature { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10175,71 +9659,71 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentItem", "AssessmentItem")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentAdministration", "AssessmentAdministration")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _assessmentItemLearningStandards; - private ICollection _assessmentItemLearningStandardsCovariant; + private ICollection _assessmentAdministrationAssessmentAdminstrationPeriods; + private ICollection _assessmentAdministrationAssessmentAdminstrationPeriodsCovariant; [NoDuplicateMembers] - [DataMember(Name="learningStandards")] - public ICollection AssessmentItemLearningStandards + [DataMember(Name="assessmentAdminstrationPeriods")] + public ICollection AssessmentAdministrationAssessmentAdminstrationPeriods { - get { return _assessmentItemLearningStandards; } + get { return _assessmentAdministrationAssessmentAdminstrationPeriods; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IAssessmentItemLearningStandard)e.Item).AssessmentItem = this); - _assessmentItemLearningStandards = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod)e.Item).AssessmentAdministration = this); + _assessmentAdministrationAssessmentAdminstrationPeriods = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentItemLearningStandard)e.Item).AssessmentItem = this; - _assessmentItemLearningStandardsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod)e.Item).AssessmentAdministration = this; + _assessmentAdministrationAssessmentAdminstrationPeriodsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemLearningStandards + ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationAssessmentAdminstrationPeriods { - get { return _assessmentItemLearningStandardsCovariant; } - set { AssessmentItemLearningStandards = new List(value.Cast()); } + get { return _assessmentAdministrationAssessmentAdminstrationPeriodsCovariant; } + set { AssessmentAdministrationAssessmentAdminstrationPeriods = new List(value.Cast()); } } - private ICollection _assessmentItemPossibleResponses; - private ICollection _assessmentItemPossibleResponsesCovariant; + private ICollection _assessmentAdministrationAssessmentBatteryParts; + private ICollection _assessmentAdministrationAssessmentBatteryPartsCovariant; [NoDuplicateMembers] - [DataMember(Name="possibleResponses")] - public ICollection AssessmentItemPossibleResponses + [DataMember(Name="assessmentBatteryParts")] + public ICollection AssessmentAdministrationAssessmentBatteryParts { - get { return _assessmentItemPossibleResponses; } + get { return _assessmentAdministrationAssessmentBatteryParts; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IAssessmentItemPossibleResponse)e.Item).AssessmentItem = this); - _assessmentItemPossibleResponses = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart)e.Item).AssessmentAdministration = this); + _assessmentAdministrationAssessmentBatteryParts = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentItemPossibleResponse)e.Item).AssessmentItem = this; - _assessmentItemPossibleResponsesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart)e.Item).AssessmentAdministration = this; + _assessmentAdministrationAssessmentBatteryPartsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemPossibleResponses + ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationAssessmentBatteryParts { - get { return _assessmentItemPossibleResponsesCovariant; } - set { AssessmentItemPossibleResponses = new List(value.Cast()); } + get { return _assessmentAdministrationAssessmentBatteryPartsCovariant; } + set { AssessmentAdministrationAssessmentBatteryParts = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -10264,14 +9748,14 @@ public ICollection AssessmentItemPossibleRespons internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_assessmentItemLearningStandards != null) foreach (var item in _assessmentItemLearningStandards) + if (_assessmentAdministrationAssessmentAdminstrationPeriods != null) foreach (var item in _assessmentAdministrationAssessmentAdminstrationPeriods) { - item.AssessmentItem = this; + item.AssessmentAdministration = this; } - if (_assessmentItemPossibleResponses != null) foreach (var item in _assessmentItemPossibleResponses) + if (_assessmentAdministrationAssessmentBatteryParts != null) foreach (var item in _assessmentAdministrationAssessmentBatteryParts) { - item.AssessmentItem = this; + item.AssessmentAdministration = this; } } @@ -10282,25 +9766,25 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentItemMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItem)target); + return Entities.Common.EdFi.AssessmentAdministrationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentAdministration)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentItemMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItem)target, null); + Entities.Common.EdFi.AssessmentAdministrationMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentAdministration)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IAssessmentItem.AssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentAdministration.AssessmentResourceId { get { return null; } set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentAdministration.AssessmentDiscriminator { // Not supported for Resources get { return null; } @@ -10308,6 +9792,20 @@ string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator } + Guid? Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationResourceId + { + get { return null; } + set { ImplicitAssigningEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssigningEducationOrganizationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -10330,25 +9828,25 @@ string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator // ---------------------- // Validate collections // ---------------------- - if (AssessmentItemLearningStandards.Any() && mappingContract?.IsMemberSupported("AssessmentItemLearningStandards") != false) + if (AssessmentAdministrationAssessmentAdminstrationPeriods.Any() && mappingContract?.IsMemberSupported("AssessmentAdministrationAssessmentAdminstrationPeriods") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("AssessmentItemLearningStandards"); + pathBuilder.Append("AssessmentAdministrationAssessmentAdminstrationPeriods"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentItemLearningStandards, validationContext, validationContext.Items.ForCollection("AssessmentItemLearningStandards")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentAdministrationAssessmentAdminstrationPeriods, validationContext, validationContext.Items.ForCollection("AssessmentAdministrationAssessmentAdminstrationPeriods")))) { yield return result; } } - if (AssessmentItemPossibleResponses.Any() && mappingContract?.IsMemberSupported("AssessmentItemPossibleResponses") != false) + if (AssessmentAdministrationAssessmentBatteryParts.Any() && mappingContract?.IsMemberSupported("AssessmentAdministrationAssessmentBatteryParts") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("AssessmentItemPossibleResponses"); + pathBuilder.Append("AssessmentAdministrationAssessmentBatteryParts"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentItemPossibleResponses, validationContext, validationContext.Items.ForCollection("AssessmentItemPossibleResponses")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentAdministrationAssessmentBatteryParts, validationContext, validationContext.Items.ForCollection("AssessmentAdministrationAssessmentBatteryParts")))) { yield return result; } @@ -10399,15 +9897,15 @@ string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentItemPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentAdministrationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_AssessmentItem = new FullName("edfi", "AssessmentItem"); + private static readonly FullName _fullName_edfi_AssessmentAdministration = new FullName("edfi", "AssessmentAdministration"); // Declare collection item validators - private AssessmentItemLearningStandardPutPostRequestValidator _assessmentItemLearningStandardsValidator = new (); - private AssessmentItemPossibleResponsePutPostRequestValidator _assessmentItemPossibleResponsesValidator = new (); + private AssessmentAdministrationAssessmentAdminstrationPeriodPutPostRequestValidator _assessmentAdministrationAssessmentAdminstrationPeriodsValidator = new (); + private AssessmentAdministrationAssessmentBatteryPartPutPostRequestValidator _assessmentAdministrationAssessmentBatteryPartsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -10424,30 +9922,30 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsAssessmentItemLearningStandardIncluded(x)); + var hasInvalidAssessmentAdministrationAssessmentAdminstrationPeriodsItems = instance.AssessmentAdministrationAssessmentAdminstrationPeriods.Any(x => !mappingContract.IsAssessmentAdministrationAssessmentAdminstrationPeriodIncluded(x)); - if (hasInvalidAssessmentItemLearningStandardsItems) + if (hasInvalidAssessmentAdministrationAssessmentAdminstrationPeriodsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("AssessmentItemLearningStandards", $"A supplied 'AssessmentItemLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("AssessmentAdministrationAssessmentAdminstrationPeriods", $"A supplied 'AssessmentAdministrationAssessmentAdminstrationPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsAssessmentItemPossibleResponseIncluded != null) + if (mappingContract.IsAssessmentAdministrationAssessmentBatteryPartIncluded != null) { - var hasInvalidAssessmentItemPossibleResponsesItems = instance.AssessmentItemPossibleResponses.Any(x => !mappingContract.IsAssessmentItemPossibleResponseIncluded(x)); + var hasInvalidAssessmentAdministrationAssessmentBatteryPartsItems = instance.AssessmentAdministrationAssessmentBatteryParts.Any(x => !mappingContract.IsAssessmentAdministrationAssessmentBatteryPartIncluded(x)); - if (hasInvalidAssessmentItemPossibleResponsesItems) + if (hasInvalidAssessmentAdministrationAssessmentBatteryPartsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("AssessmentItemPossibleResponses", $"A supplied 'AssessmentItemPossibleResponse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("AssessmentAdministrationAssessmentBatteryParts", $"A supplied 'AssessmentAdministrationAssessmentBatteryPart' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -10469,16 +9967,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentItemLearningStandard table of the AssessmentItem aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentAdministrationAssessmentAdminstrationPeriod table of the AssessmentAdministration aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentItemLearningStandard : Entities.Common.EdFi.IAssessmentItemLearningStandard, IValidatableObject + public class AssessmentAdministrationAssessmentAdminstrationPeriod : Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "AssessmentItemLearningStandard"); + private static FullName _fullName = new FullName("edfi", "AssessmentAdministrationAssessmentAdminstrationPeriod"); // Fluent validator instance (threadsafe) - private static AssessmentItemLearningStandardPutPostRequestValidator _validator = new AssessmentItemLearningStandardPutPostRequestValidator(); + private static AssessmentAdministrationAssessmentAdminstrationPeriodPutPostRequestValidator _validator = new AssessmentAdministrationAssessmentAdminstrationPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -10500,88 +9998,37 @@ public class AssessmentItemLearningStandard : Entities.Common.EdFi.IAssessmentIt // ============================================================= // References // ------------------------------------------------------------- - - private bool _learningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) - _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _learningStandardReference; - } - } - - [DataMember(Name="learningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference LearningStandardReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLearningStandardReference != null - && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference; - - return null; - } - set - { - _learningStandardReferenceExplicitlyAssigned = true; - _learningStandardReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IAssessmentItem _assessmentItem; + private Entities.Common.EdFi.IAssessmentAdministration _assessmentAdministration; [IgnoreDataMember] - Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentItem + Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationAssessmentAdminstrationPeriod.AssessmentAdministration { - get { return _assessmentItem; } - set { SetAssessmentItem(value); } + get { return _assessmentAdministration; } + set { SetAssessmentAdministration(value); } } - public Entities.Common.EdFi.IAssessmentItem AssessmentItem + public Entities.Common.EdFi.IAssessmentAdministration AssessmentAdministration { - set { SetAssessmentItem(value); } + set { SetAssessmentAdministration(value); } } - private void SetAssessmentItem(Entities.Common.EdFi.IAssessmentItem value) + private void SetAssessmentAdministration(Entities.Common.EdFi.IAssessmentAdministration value) { - _assessmentItem = value; + _assessmentAdministration = value; } /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardId - { - get - { - if (ImplicitLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LearningStandard - _learningStandardReferenceExplicitlyAssigned = false; - ImplicitLearningStandardReference.LearningStandardId = value; - } - } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10596,7 +10043,7 @@ string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentItemLearningStandard; + var compareTo = obj as Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -10605,12 +10052,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_assessmentItem == null || !_assessmentItem.Equals(compareTo.AssessmentItem)) + if (_assessmentAdministration == null || !_assessmentAdministration.Equals(compareTo.AssessmentAdministration)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItemLearningStandard).LearningStandardId, compareTo.LearningStandardId)) + // Standard Property + if (!(this as Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod).BeginDate.Equals(compareTo.BeginDate)) return false; @@ -10627,11 +10074,12 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_assessmentItem != null) - hash.Add(_assessmentItem); + if (_assessmentAdministration != null) + hash.Add(_assessmentAdministration); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod).BeginDate); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IAssessmentItemLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -10644,6 +10092,13 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10664,7 +10119,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentItem", "AssessmentItemLearningStandard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentAdministration", "AssessmentAdministrationAssessmentAdminstrationPeriod")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -10688,32 +10143,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentItemLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemLearningStandard)target); + return Entities.Common.EdFi.AssessmentAdministrationAssessmentAdminstrationPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentItemLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemLearningStandard)target, null); + Entities.Common.EdFi.AssessmentAdministrationAssessmentAdminstrationPeriodMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentAdministrationAssessmentAdminstrationPeriod)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardResourceId - { - get { return null; } - set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLearningStandardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -10782,9 +10223,9 @@ string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardDisc // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentItemLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentAdministrationAssessmentAdminstrationPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -10813,16 +10254,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentItemPossibleResponse table of the AssessmentItem aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentAdministrationAssessmentBatteryPart table of the AssessmentAdministration aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentItemPossibleResponse : Entities.Common.EdFi.IAssessmentItemPossibleResponse, IValidatableObject + public class AssessmentAdministrationAssessmentBatteryPart : Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "AssessmentItemPossibleResponse"); + private static FullName _fullName = new FullName("edfi", "AssessmentAdministrationAssessmentBatteryPart"); // Fluent validator instance (threadsafe) - private static AssessmentItemPossibleResponsePutPostRequestValidator _validator = new AssessmentItemPossibleResponsePutPostRequestValidator(); + private static AssessmentAdministrationAssessmentBatteryPartPutPostRequestValidator _validator = new AssessmentAdministrationAssessmentBatteryPartPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -10844,38 +10285,95 @@ public class AssessmentItemPossibleResponse : Entities.Common.EdFi.IAssessmentIt // ============================================================= // References // ------------------------------------------------------------- + + private bool _assessmentBatteryPartReferenceExplicitlyAssigned; + private AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference _assessmentBatteryPartReference; + private AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference ImplicitAssessmentBatteryPartReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assessmentBatteryPartReference == null && !_assessmentBatteryPartReferenceExplicitlyAssigned) + _assessmentBatteryPartReference = new AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference(); + + return _assessmentBatteryPartReference; + } + } + + [DataMember(Name="assessmentBatteryPartReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference AssessmentBatteryPartReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssessmentBatteryPartReference != null + && (_assessmentBatteryPartReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentBatteryPartReference.IsReferenceFullyDefined())) + return ImplicitAssessmentBatteryPartReference; + + return null; + } + set + { + _assessmentBatteryPartReferenceExplicitlyAssigned = true; + _assessmentBatteryPartReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IAssessmentItem _assessmentItem; + private Entities.Common.EdFi.IAssessmentAdministration _assessmentAdministration; [IgnoreDataMember] - Entities.Common.EdFi.IAssessmentItem IAssessmentItemPossibleResponse.AssessmentItem + Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationAssessmentBatteryPart.AssessmentAdministration { - get { return _assessmentItem; } - set { SetAssessmentItem(value); } + get { return _assessmentAdministration; } + set { SetAssessmentAdministration(value); } } - public Entities.Common.EdFi.IAssessmentItem AssessmentItem + public Entities.Common.EdFi.IAssessmentAdministration AssessmentAdministration { - set { SetAssessmentItem(value); } + set { SetAssessmentAdministration(value); } } - private void SetAssessmentItem(Entities.Common.EdFi.IAssessmentItem value) + private void SetAssessmentAdministration(Entities.Common.EdFi.IAssessmentAdministration value) { - _assessmentItem = value; + _assessmentAdministration = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_assessmentBatteryPartReferenceExplicitlyAssigned) + { + ImplicitAssessmentBatteryPartReference.AssessmentIdentifier = _assessmentAdministration.AssessmentIdentifier; + ImplicitAssessmentBatteryPartReference.Namespace = _assessmentAdministration.Namespace; + } } /// - /// The response value, often an option number or code value (e.g., 1, 2, A, B, true, false). + /// The name of the part of an assessment battery. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="responseValue")] - public string ResponseValue { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartName + { + get + { + if (ImplicitAssessmentBatteryPartReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentBatteryPartReference.IsReferenceFullyDefined())) + return ImplicitAssessmentBatteryPartReference.AssessmentBatteryPartName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentBatteryPart + _assessmentBatteryPartReferenceExplicitlyAssigned = false; + ImplicitAssessmentBatteryPartReference.AssessmentBatteryPartName = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -10890,7 +10388,7 @@ private void SetAssessmentItem(Entities.Common.EdFi.IAssessmentItem value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentItemPossibleResponse; + var compareTo = obj as Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart; if (ReferenceEquals(this, compareTo)) return true; @@ -10899,12 +10397,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_assessmentItem == null || !_assessmentItem.Equals(compareTo.AssessmentItem)) + if (_assessmentAdministration == null || !_assessmentAdministration.Equals(compareTo.AssessmentAdministration)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItemPossibleResponse).ResponseValue, compareTo.ResponseValue)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart).AssessmentBatteryPartName, compareTo.AssessmentBatteryPartName)) return false; @@ -10921,12 +10419,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_assessmentItem != null) - hash.Add(_assessmentItem); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IAssessmentItemPossibleResponse).ResponseValue); + if (_assessmentAdministration != null) + hash.Add(_assessmentAdministration); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart).AssessmentBatteryPartName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -10939,21 +10436,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Indicates the response is correct. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="correctResponse")] - public bool? CorrectResponse { get; set; } - - /// - /// Additional text provided to define the response value. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="responseDescription")] - public string ResponseDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10974,7 +10456,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentItem", "AssessmentItemPossibleResponse")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentAdministration", "AssessmentAdministrationAssessmentBatteryPart")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -10991,6 +10473,12 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -10998,18 +10486,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentItemPossibleResponseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemPossibleResponse)target); + return Entities.Common.EdFi.AssessmentAdministrationAssessmentBatteryPartMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentItemPossibleResponseMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemPossibleResponse)target, null); + Entities.Common.EdFi.AssessmentAdministrationAssessmentBatteryPartMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartResourceId + { + get { return null; } + set { ImplicitAssessmentBatteryPartReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssessmentBatteryPartReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -11052,6 +10554,67 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); + + if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart).AssessmentAdministration.AssessmentIdentifier); + + // Obtain value from other references + var valueFromAssessmentBatteryPartReference = this.AssessmentBatteryPartReference?.AssessmentIdentifier; + + if (valueFromAssessmentBatteryPartReference != null) + { + yield return ("assessmentBatteryPartReference.assessmentIdentifier", this.AssessmentBatteryPartReference.AssessmentIdentifier); + } + + } + var sourcesForNamespace = GetNamespaceSources().ToArray(); + + if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetNamespaceSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart).AssessmentAdministration.Namespace); + + // Obtain value from other references + var valueFromAssessmentBatteryPartReference = this.AssessmentBatteryPartReference?.Namespace; + + if (valueFromAssessmentBatteryPartReference != null) + { + yield return ("assessmentBatteryPartReference.namespace", this.AssessmentBatteryPartReference.Namespace); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -11078,9 +10641,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentItemPossibleResponsePutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentAdministrationAssessmentBatteryPartPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -11109,21 +10672,126 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentItemCategoryDescriptor table of the AssessmentItemCategoryDescriptor aggregate in the ODS Database. + /// Represents a reference to the AssessmentBatteryPart resource. ///
- [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class AssessmentItemCategoryDescriptor : Entities.Common.EdFi.IAssessmentItemCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentBatteryPartReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "AssessmentItemCategoryDescriptor"); + [DataMember(Name="assessmentBatteryPartName")] + public string AssessmentBatteryPartName { get; set; } - // Fluent validator instance (threadsafe) - private static AssessmentItemCategoryDescriptorPutPostRequestValidator _validator = new AssessmentItemCategoryDescriptorPutPostRequestValidator(); + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } + + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AssessmentBatteryPartName != default(string) && AssessmentIdentifier != default(string) && Namespace != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AssessmentBatteryPartName == default) + { + yield return "AssessmentBatteryPartName"; + } + + if (AssessmentIdentifier == default) + { + yield return "AssessmentIdentifier"; + } + + if (Namespace == default) + { + yield return "Namespace"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "AssessmentBatteryPart", + Href = $"/ed-fi/assessmentBatteryParts/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.AssessmentBatteryPart table of the AssessmentBatteryPart aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class AssessmentBatteryPart : Entities.Common.EdFi.IAssessmentBatteryPart, IHasETag, IDateVersionedEntity, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "AssessmentBatteryPart"); + + // Fluent validator instance (threadsafe) + private static AssessmentBatteryPartPutPostRequestValidator _validator = new AssessmentBatteryPartPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -11134,6 +10802,10 @@ public class AssessmentItemCategoryDescriptor : Entities.Common.EdFi.IAssessment // Constructor // ------------------------------------------------------------- + public AssessmentBatteryPart() + { + AssessmentBatteryPartObjectiveAssessments = new List(); + } // ------------------------------------------------------------ @@ -11142,7 +10814,7 @@ public class AssessmentItemCategoryDescriptor : Entities.Common.EdFi.IAssessment // ------------------------------------------------------------ /// - /// The unique identifier for the AssessmentItemCategoryDescriptor resource. + /// The unique identifier for the AssessmentBatteryPart resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -11152,6 +10824,40 @@ public class AssessmentItemCategoryDescriptor : Entities.Common.EdFi.IAssessment // ============================================================= // References // ------------------------------------------------------------- + + private bool _assessmentReferenceExplicitlyAssigned; + private Assessment.EdFi.AssessmentReference _assessmentReference; + private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) + _assessmentReference = new Assessment.EdFi.AssessmentReference(); + + return _assessmentReference; + } + } + + [DataMember(Name="assessmentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Assessment.EdFi.AssessmentReference AssessmentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssessmentReference != null + && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference; + + return null; + } + set + { + _assessmentReferenceExplicitlyAssigned = true; + _assessmentReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -11159,16 +10865,62 @@ public class AssessmentItemCategoryDescriptor : Entities.Common.EdFi.IAssessment // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The name of the part of an assessment battery. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int AssessmentItemCategoryDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(65, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="assessmentBatteryPartName")] + public string AssessmentBatteryPartName { get; set; } - int IDescriptor.DescriptorId + /// + /// A unique number or alphanumeric code assigned to an assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentIdentifier { - get { return AssessmentItemCategoryDescriptorId; } - set { AssessmentItemCategoryDescriptorId = value; } + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.AssessmentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.AssessmentIdentifier = value; + } + } + + /// + /// Namespace for the assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssessmentBatteryPart.Namespace + { + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.Namespace; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.Namespace = value; + } } // ------------------------------------------------------------- @@ -11184,7 +10936,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentItemCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentBatteryPart; if (ReferenceEquals(this, compareTo)) return true; @@ -11193,8 +10945,18 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IAssessmentItemCategoryDescriptor).AssessmentItemCategoryDescriptorId.Equals(compareTo.AssessmentItemCategoryDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentBatteryPart).AssessmentBatteryPartName, compareTo.AssessmentBatteryPartName)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentBatteryPart).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentBatteryPart).Namespace, compareTo.Namespace)) return false; @@ -11211,9 +10973,15 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IAssessmentItemCategoryDescriptor).AssessmentItemCategoryDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IAssessmentBatteryPart).AssessmentBatteryPartName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentBatteryPart).AssessmentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentBatteryPart).Namespace); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -11221,55 +10989,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -11295,16 +11014,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentBatteryPart", "AssessmentBatteryPart")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _assessmentBatteryPartObjectiveAssessments; + private ICollection _assessmentBatteryPartObjectiveAssessmentsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="objectiveAssessments")] + public ICollection AssessmentBatteryPartObjectiveAssessments + { + get { return _assessmentBatteryPartObjectiveAssessments; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment)e.Item).AssessmentBatteryPart = this); + _assessmentBatteryPartObjectiveAssessments = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment)e.Item).AssessmentBatteryPart = this; + _assessmentBatteryPartObjectiveAssessmentsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentBatteryPartObjectiveAssessments + { + get { return _assessmentBatteryPartObjectiveAssessmentsCovariant; } + set { AssessmentBatteryPartObjectiveAssessments = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -11322,6 +11068,17 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_assessmentBatteryPartObjectiveAssessments != null) foreach (var item in _assessmentBatteryPartObjectiveAssessments) + { + item.AssessmentBatteryPart = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -11329,19 +11086,104 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentItemCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target); + return Entities.Common.EdFi.AssessmentBatteryPartMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentBatteryPart)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentItemCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target, null); + Entities.Common.EdFi.AssessmentBatteryPartMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentBatteryPart)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentResourceId + { + get { return null; } + set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssessmentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (AssessmentBatteryPartObjectiveAssessments.Any() && mappingContract?.IsMemberSupported("AssessmentBatteryPartObjectiveAssessments") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("AssessmentBatteryPartObjectiveAssessments"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentBatteryPartObjectiveAssessments, validationContext, validationContext.Items.ForCollection("AssessmentBatteryPartObjectiveAssessments")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -11349,9 +11191,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentItemCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentBatteryPartPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_AssessmentBatteryPart = new FullName("edfi", "AssessmentBatteryPart"); + + // Declare collection item validators + private AssessmentBatteryPartObjectiveAssessmentPutPostRequestValidator _assessmentBatteryPartObjectiveAssessmentsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -11364,6 +11211,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (AssessmentBatteryPartMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_AssessmentBatteryPart); + + if (mappingContract != null) + { + if (mappingContract.IsAssessmentBatteryPartObjectiveAssessmentIncluded != null) + { + var hasInvalidAssessmentBatteryPartObjectiveAssessmentsItems = instance.AssessmentBatteryPartObjectiveAssessments.Any(x => !mappingContract.IsAssessmentBatteryPartObjectiveAssessmentIncluded(x)); + + if (hasInvalidAssessmentBatteryPartObjectiveAssessmentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("AssessmentBatteryPartObjectiveAssessments", $"A supplied 'AssessmentBatteryPartObjectiveAssessment' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -11379,22 +11248,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentItemResultDescriptor table of the AssessmentItemResultDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentBatteryPartObjectiveAssessment table of the AssessmentBatteryPart aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentItemResultDescriptor : Entities.Common.EdFi.IAssessmentItemResultDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentBatteryPartObjectiveAssessment : Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "AssessmentItemResultDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentBatteryPartObjectiveAssessment"); // Fluent validator instance (threadsafe) - private static AssessmentItemResultDescriptorPutPostRequestValidator _validator = new AssessmentItemResultDescriptorPutPostRequestValidator(); + private static AssessmentBatteryPartObjectiveAssessmentPutPostRequestValidator _validator = new AssessmentBatteryPartObjectiveAssessmentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -11411,35 +11275,99 @@ public class AssessmentItemResultDescriptor : Entities.Common.EdFi.IAssessmentIt // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the AssessmentItemResultDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _objectiveAssessmentReferenceExplicitlyAssigned; + private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference _objectiveAssessmentReference; + private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ImplicitObjectiveAssessmentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_objectiveAssessmentReference == null && !_objectiveAssessmentReferenceExplicitlyAssigned) + _objectiveAssessmentReference = new ObjectiveAssessment.EdFi.ObjectiveAssessmentReference(); + + return _objectiveAssessmentReference; + } + } + + [DataMember(Name="objectiveAssessmentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ObjectiveAssessmentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitObjectiveAssessmentReference != null + && (_objectiveAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) + return ImplicitObjectiveAssessmentReference; + + return null; + } + set + { + _objectiveAssessmentReferenceExplicitlyAssigned = true; + _objectiveAssessmentReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IAssessmentBatteryPart _assessmentBatteryPart; + + [IgnoreDataMember] + Entities.Common.EdFi.IAssessmentBatteryPart IAssessmentBatteryPartObjectiveAssessment.AssessmentBatteryPart + { + get { return _assessmentBatteryPart; } + set { SetAssessmentBatteryPart(value); } + } + + public Entities.Common.EdFi.IAssessmentBatteryPart AssessmentBatteryPart + { + set { SetAssessmentBatteryPart(value); } + } + + private void SetAssessmentBatteryPart(Entities.Common.EdFi.IAssessmentBatteryPart value) + { + _assessmentBatteryPart = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_objectiveAssessmentReferenceExplicitlyAssigned) + { + ImplicitObjectiveAssessmentReference.AssessmentIdentifier = _assessmentBatteryPart.AssessmentIdentifier; + ImplicitObjectiveAssessmentReference.Namespace = _assessmentBatteryPart.Namespace; + } + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int AssessmentItemResultDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.IdentificationCode { - get { return AssessmentItemResultDescriptorId; } - set { AssessmentItemResultDescriptorId = value; } + get + { + if (ImplicitObjectiveAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) + return ImplicitObjectiveAssessmentReference.IdentificationCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ObjectiveAssessment + _objectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitObjectiveAssessmentReference.IdentificationCode = value; + } } // ------------------------------------------------------------- @@ -11455,7 +11383,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentItemResultDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment; if (ReferenceEquals(this, compareTo)) return true; @@ -11463,9 +11391,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_assessmentBatteryPart == null || !_assessmentBatteryPart.Equals(compareTo.AssessmentBatteryPart)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IAssessmentItemResultDescriptor).AssessmentItemResultDescriptorId.Equals(compareTo.AssessmentItemResultDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment).IdentificationCode, compareTo.IdentificationCode)) return false; @@ -11481,10 +11413,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_assessmentBatteryPart != null) + hash.Add(_assessmentBatteryPart); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IAssessmentItemResultDescriptor).AssessmentItemResultDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment).IdentificationCode); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -11492,55 +11426,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -11566,11 +11451,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentBatteryPart", "AssessmentBatteryPartObjectiveAssessment")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -11581,18 +11463,17 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -11600,19 +11481,154 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentItemResultDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemResultDescriptor)target); + return Entities.Common.EdFi.AssessmentBatteryPartObjectiveAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentItemResultDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemResultDescriptor)target, null); + Entities.Common.EdFi.AssessmentBatteryPartObjectiveAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentResourceId + { + get { return null; } + set { ImplicitObjectiveAssessmentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitObjectiveAssessmentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); + + if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment).AssessmentBatteryPart.AssessmentIdentifier); + + // Obtain value from other references + var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.AssessmentIdentifier; + + if (valueFromObjectiveAssessmentReference != null) + { + yield return ("objectiveAssessmentReference.assessmentIdentifier", this.ObjectiveAssessmentReference.AssessmentIdentifier); + } + + } + var sourcesForNamespace = GetNamespaceSources().ToArray(); + + if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetNamespaceSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment).AssessmentBatteryPart.Namespace); + + // Obtain value from other references + var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.Namespace; + + if (valueFromObjectiveAssessmentReference != null) + { + yield return ("objectiveAssessmentReference.namespace", this.ObjectiveAssessmentReference.Namespace); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -11620,9 +11636,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentItemResultDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentBatteryPartObjectiveAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -11651,21 +11667,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentPeriodDescriptor table of the AssessmentPeriodDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentCategoryDescriptor table of the AssessmentCategoryDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentPeriodDescriptor : Entities.Common.EdFi.IAssessmentPeriodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentCategoryDescriptor : Entities.Common.EdFi.IAssessmentCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "AssessmentPeriodDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static AssessmentPeriodDescriptorPutPostRequestValidator _validator = new AssessmentPeriodDescriptorPutPostRequestValidator(); + private static AssessmentCategoryDescriptorPutPostRequestValidator _validator = new AssessmentCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -11684,7 +11700,7 @@ public class AssessmentPeriodDescriptor : Entities.Common.EdFi.IAssessmentPeriod // ------------------------------------------------------------ /// - /// The unique identifier for the AssessmentPeriodDescriptor resource. + /// The unique identifier for the AssessmentCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -11705,12 +11721,12 @@ public class AssessmentPeriodDescriptor : Entities.Common.EdFi.IAssessmentPeriod ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int AssessmentPeriodDescriptorId { get; set; } + public int AssessmentCategoryDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return AssessmentPeriodDescriptorId; } - set { AssessmentPeriodDescriptorId = value; } + get { return AssessmentCategoryDescriptorId; } + set { AssessmentCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -11726,7 +11742,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentPeriodDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -11736,7 +11752,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IAssessmentPeriodDescriptor).AssessmentPeriodDescriptorId.Equals(compareTo.AssessmentPeriodDescriptorId)) + if (!(this as Entities.Common.EdFi.IAssessmentCategoryDescriptor).AssessmentCategoryDescriptorId.Equals(compareTo.AssessmentCategoryDescriptorId)) return false; @@ -11754,7 +11770,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IAssessmentPeriodDescriptor).AssessmentPeriodDescriptorId); + hash.Add((this as Entities.Common.EdFi.IAssessmentCategoryDescriptor).AssessmentCategoryDescriptorId); return hash.ToHashCode(); } @@ -11871,12 +11887,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentPeriodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentPeriodDescriptor)target); + return Entities.Common.EdFi.AssessmentCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentPeriodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentPeriodDescriptor)target, null); + Entities.Common.EdFi.AssessmentCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentCategoryDescriptor)target, null); } // ------------------------------------------------------------- @@ -11891,9 +11907,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentPeriodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -11922,21 +11938,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentReportingMethodDescriptor table of the AssessmentReportingMethodDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentIdentificationSystemDescriptor table of the AssessmentIdentificationSystemDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentReportingMethodDescriptor : Entities.Common.EdFi.IAssessmentReportingMethodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentIdentificationSystemDescriptor : Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "AssessmentReportingMethodDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentIdentificationSystemDescriptor"); // Fluent validator instance (threadsafe) - private static AssessmentReportingMethodDescriptorPutPostRequestValidator _validator = new AssessmentReportingMethodDescriptorPutPostRequestValidator(); + private static AssessmentIdentificationSystemDescriptorPutPostRequestValidator _validator = new AssessmentIdentificationSystemDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -11955,7 +11971,7 @@ public class AssessmentReportingMethodDescriptor : Entities.Common.EdFi.IAssessm // ------------------------------------------------------------ /// - /// The unique identifier for the AssessmentReportingMethodDescriptor resource. + /// The unique identifier for the AssessmentIdentificationSystemDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -11976,12 +11992,12 @@ public class AssessmentReportingMethodDescriptor : Entities.Common.EdFi.IAssessm ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int AssessmentReportingMethodDescriptorId { get; set; } + public int AssessmentIdentificationSystemDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return AssessmentReportingMethodDescriptorId; } - set { AssessmentReportingMethodDescriptorId = value; } + get { return AssessmentIdentificationSystemDescriptorId; } + set { AssessmentIdentificationSystemDescriptorId = value; } } // ------------------------------------------------------------- @@ -11997,7 +12013,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentReportingMethodDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -12007,7 +12023,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IAssessmentReportingMethodDescriptor).AssessmentReportingMethodDescriptorId.Equals(compareTo.AssessmentReportingMethodDescriptorId)) + if (!(this as Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor).AssessmentIdentificationSystemDescriptorId.Equals(compareTo.AssessmentIdentificationSystemDescriptorId)) return false; @@ -12025,7 +12041,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IAssessmentReportingMethodDescriptor).AssessmentReportingMethodDescriptorId); + hash.Add((this as Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor).AssessmentIdentificationSystemDescriptorId); return hash.ToHashCode(); } @@ -12142,12 +12158,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentReportingMethodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target); + return Entities.Common.EdFi.AssessmentIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentReportingMethodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target, null); + Entities.Common.EdFi.AssessmentIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target, null); } // ------------------------------------------------------------- @@ -12162,9 +12178,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentReportingMethodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -12193,26 +12209,26 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the AssessmentScoreRangeLearningStandard resource. + /// Represents a reference to the AssessmentItem resource. ///
[DataContract] [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandardReference : IResourceReference + public class AssessmentItemReference : IResourceReference { [DataMember(Name="assessmentIdentifier")] public string AssessmentIdentifier { get; set; } + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } + [DataMember(Name="namespace")] public string Namespace { get; set; } - [DataMember(Name="scoreRangeId")] - public string ScoreRangeId { get; set; } - /// /// Gets or sets the resource identifier of the referenced resource. /// @@ -12249,7 +12265,7 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AssessmentIdentifier != default(string) && Namespace != default(string) && ScoreRangeId != default(string); + return AssessmentIdentifier != default(string) && IdentificationCode != default(string) && Namespace != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() @@ -12259,14 +12275,14 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "AssessmentIdentifier"; } - if (Namespace == default) + if (IdentificationCode == default) { - yield return "Namespace"; + yield return "IdentificationCode"; } - if (ScoreRangeId == default) + if (Namespace == default) { - yield return "ScoreRangeId"; + yield return "Namespace"; } } @@ -12275,8 +12291,8 @@ private Link CreateLink() { var link = new Link { - Rel = "AssessmentScoreRangeLearningStandard", - Href = $"/ed-fi/assessmentScoreRangeLearningStandards/{ResourceId:n}" + Rel = "AssessmentItem", + Href = $"/ed-fi/assessmentItems/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -12303,16 +12319,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.AssessmentScoreRangeLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentItem table of the AssessmentItem aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandard : Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard, IHasETag, IDateVersionedEntity, IValidatableObject + public class AssessmentItem : Entities.Common.EdFi.IAssessmentItem, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "AssessmentScoreRangeLearningStandard"); + private static FullName _fullName = new FullName("edfi", "AssessmentItem"); // Fluent validator instance (threadsafe) - private static AssessmentScoreRangeLearningStandardPutPostRequestValidator _validator = new AssessmentScoreRangeLearningStandardPutPostRequestValidator(); + private static AssessmentItemPutPostRequestValidator _validator = new AssessmentItemPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -12323,9 +12339,10 @@ public class AssessmentScoreRangeLearningStandard : Entities.Common.EdFi.IAssess // Constructor // ------------------------------------------------------------- - public AssessmentScoreRangeLearningStandard() + public AssessmentItem() { - AssessmentScoreRangeLearningStandardLearningStandards = new List(); + AssessmentItemLearningStandards = new List(); + AssessmentItemPossibleResponses = new List(); } // ------------------------------------------------------------ @@ -12335,7 +12352,7 @@ public AssessmentScoreRangeLearningStandard() // ------------------------------------------------------------ /// - /// The unique identifier for the AssessmentScoreRangeLearningStandard resource. + /// The unique identifier for the AssessmentItem resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -12379,39 +12396,6 @@ public Assessment.EdFi.AssessmentReference AssessmentReference _assessmentReference = value; } } - private bool _objectiveAssessmentReferenceExplicitlyAssigned; - private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference _objectiveAssessmentReference; - private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ImplicitObjectiveAssessmentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_objectiveAssessmentReference == null && !_objectiveAssessmentReferenceExplicitlyAssigned) - _objectiveAssessmentReference = new ObjectiveAssessment.EdFi.ObjectiveAssessmentReference(); - - return _objectiveAssessmentReference; - } - } - - [DataMember(Name="objectiveAssessmentReference")] - [FullyDefinedReference] - public ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ObjectiveAssessmentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitObjectiveAssessmentReference != null - && (_objectiveAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) - return ImplicitObjectiveAssessmentReference; - - return null; - } - set - { - _objectiveAssessmentReferenceExplicitlyAssigned = true; - _objectiveAssessmentReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -12422,7 +12406,7 @@ public ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ObjectiveAssessment /// A unique number or alphanumeric code assigned to an assessment. ///
// IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentIdentifier + string Entities.Common.EdFi.IAssessmentItem.AssessmentIdentifier { get { @@ -12440,18 +12424,23 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentIden // Assessment _assessmentReferenceExplicitlyAssigned = false; ImplicitAssessmentReference.AssessmentIdentifier = value; - - // ObjectiveAssessment - _objectiveAssessmentReferenceExplicitlyAssigned = false; - ImplicitObjectiveAssessmentReference.AssessmentIdentifier = value; } } + /// + /// A unique number or alphanumeric code assigned to a space, room, site, building, individual, organization, program, or institution by a school, school system, state, or other agency or entity. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } + /// /// Namespace for the assessment. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.Namespace + string Entities.Common.EdFi.IAssessmentItem.Namespace { get { @@ -12469,21 +12458,8 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.Namespace // Assessment _assessmentReferenceExplicitlyAssigned = false; ImplicitAssessmentReference.Namespace = value; - - // ObjectiveAssessment - _objectiveAssessmentReferenceExplicitlyAssigned = false; - ImplicitObjectiveAssessmentReference.Namespace = value; } } - - /// - /// A unique number or alphanumeric code assigned to the score range associated with one or more learning standards. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="scoreRangeId")] - public string ScoreRangeId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12498,7 +12474,7 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.Namespace /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard; + var compareTo = obj as Entities.Common.EdFi.IAssessmentItem; if (ReferenceEquals(this, compareTo)) return true; @@ -12508,17 +12484,17 @@ public override bool Equals(object obj) // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItem).AssessmentIdentifier, compareTo.AssessmentIdentifier)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).Namespace, compareTo.Namespace)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItem).IdentificationCode, compareTo.IdentificationCode)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).ScoreRangeId, compareTo.ScoreRangeId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItem).Namespace, compareTo.Namespace)) return false; @@ -12536,14 +12512,14 @@ public override int GetHashCode() var hash = new HashCode(); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).AssessmentIdentifier); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).Namespace); + hash.Add((this as Entities.Common.EdFi.IAssessmentItem).AssessmentIdentifier); // Standard Property - hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).ScoreRangeId); + hash.Add((this as Entities.Common.EdFi.IAssessmentItem).IdentificationCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentItem).Namespace); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -12558,57 +12534,52 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The assessment reporting method defined (e.g., scale score, RIT scale score) associated with the referenced learning standard(s). + /// Category or type of the assessment item. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } + [DataMember(Name="assessmentItemCategoryDescriptor")][DescriptorExists("AssessmentItemCategoryDescriptor")] + public string AssessmentItemCategoryDescriptor { get; set; } /// - /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. + /// The URI (typical a URL) pointing to the entry in an assessment item bank, which describes this content item. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.IdentificationCode - { - get - { - if (ImplicitObjectiveAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) - { - return ImplicitObjectiveAssessmentReference.IdentificationCode; - } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="assessmentItemURI")] + public string AssessmentItemURI { get; set; } - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + /// + /// The duration allotted for the assessment item expressed in minutes. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="expectedTimeAssessed")] + public string ExpectedTimeAssessed { get; set; } - // ObjectiveAssessment - _objectiveAssessmentReferenceExplicitlyAssigned = false; - ImplicitObjectiveAssessmentReference.IdentificationCode = value; - } - } + /// + /// The text of the item. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="itemText")] + public string ItemText { get; set; } /// - /// The maximum score in the score range. + /// The maximum raw score achievable across all assessment items that are correct and scored at the maximum. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maximumScore")] - public string MaximumScore { get; set; } + [Range(typeof(decimal), "-9999999999.99999", "9999999999.99999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxRawScore")] + public decimal? MaxRawScore { get; set; } /// - /// The minimum score in the score range. + /// Reflects the specific nomenclature used for assessment item. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="minimumScore")] - public string MinimumScore { get; set; } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nomenclature")] + public string Nomenclature { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12629,41 +12600,71 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.Identification // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentItem", "AssessmentItem")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _assessmentScoreRangeLearningStandardLearningStandards; - private ICollection _assessmentScoreRangeLearningStandardLearningStandardsCovariant; + private ICollection _assessmentItemLearningStandards; + private ICollection _assessmentItemLearningStandardsCovariant; - [NoDuplicateMembers][RequiredCollection] + [NoDuplicateMembers] [DataMember(Name="learningStandards")] - public ICollection AssessmentScoreRangeLearningStandardLearningStandards + public ICollection AssessmentItemLearningStandards { - get { return _assessmentScoreRangeLearningStandardLearningStandards; } + get { return _assessmentItemLearningStandards; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)e.Item).AssessmentScoreRangeLearningStandard = this); - _assessmentScoreRangeLearningStandardLearningStandards = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IAssessmentItemLearningStandard)e.Item).AssessmentItem = this); + _assessmentItemLearningStandards = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)e.Item).AssessmentScoreRangeLearningStandard = this; - _assessmentScoreRangeLearningStandardLearningStandardsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentItemLearningStandard)e.Item).AssessmentItem = this; + _assessmentItemLearningStandardsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentScoreRangeLearningStandardLearningStandards + ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemLearningStandards { - get { return _assessmentScoreRangeLearningStandardLearningStandardsCovariant; } - set { AssessmentScoreRangeLearningStandardLearningStandards = new List(value.Cast()); } + get { return _assessmentItemLearningStandardsCovariant; } + set { AssessmentItemLearningStandards = new List(value.Cast()); } + } + + private ICollection _assessmentItemPossibleResponses; + private ICollection _assessmentItemPossibleResponsesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="possibleResponses")] + public ICollection AssessmentItemPossibleResponses + { + get { return _assessmentItemPossibleResponses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IAssessmentItemPossibleResponse)e.Item).AssessmentItem = this); + _assessmentItemPossibleResponses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentItemPossibleResponse)e.Item).AssessmentItem = this; + _assessmentItemPossibleResponsesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemPossibleResponses + { + get { return _assessmentItemPossibleResponsesCovariant; } + set { AssessmentItemPossibleResponses = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -12688,38 +12689,43 @@ public ICollection Assessm internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_assessmentScoreRangeLearningStandardLearningStandards != null) foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) + if (_assessmentItemLearningStandards != null) foreach (var item in _assessmentItemLearningStandards) { - item.AssessmentScoreRangeLearningStandard = this; + item.AssessmentItem = this; } - } - // ------------------------------------------------------------ + if (_assessmentItemPossibleResponses != null) foreach (var item in _assessmentItemPossibleResponses) + { + item.AssessmentItem = this; + } + + } + // ------------------------------------------------------------ // ============================================================ // Data Synchronization // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentScoreRangeLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target); + return Entities.Common.EdFi.AssessmentItemMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItem)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentScoreRangeLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target, null); + Entities.Common.EdFi.AssessmentItemMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItem)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentItem.AssessmentResourceId { get { return null; } set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator { // Not supported for Resources get { return null; } @@ -12727,20 +12733,6 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDisc } - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentResourceId - { - get { return null; } - set { ImplicitObjectiveAssessmentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitObjectiveAssessmentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -12763,13 +12755,25 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAsses // ---------------------- // Validate collections // ---------------------- - if (AssessmentScoreRangeLearningStandardLearningStandards.Any() && mappingContract?.IsMemberSupported("AssessmentScoreRangeLearningStandardLearningStandards") != false) + if (AssessmentItemLearningStandards.Any() && mappingContract?.IsMemberSupported("AssessmentItemLearningStandards") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("AssessmentScoreRangeLearningStandardLearningStandards"); + pathBuilder.Append("AssessmentItemLearningStandards"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentScoreRangeLearningStandardLearningStandards, validationContext, validationContext.Items.ForCollection("AssessmentScoreRangeLearningStandardLearningStandards")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentItemLearningStandards, validationContext, validationContext.Items.ForCollection("AssessmentItemLearningStandards")))) + { + yield return result; + } + } + + if (AssessmentItemPossibleResponses.Any() && mappingContract?.IsMemberSupported("AssessmentItemPossibleResponses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("AssessmentItemPossibleResponses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentItemPossibleResponses, validationContext, validationContext.Items.ForCollection("AssessmentItemPossibleResponses")))) { yield return result; } @@ -12794,77 +12798,6 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAsses yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); - - if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() - { - // Obtain value from other references - var valueFromAssessmentReference = this.AssessmentReference?.AssessmentIdentifier; - - if (valueFromAssessmentReference != null) - { - yield return ("assessmentReference.assessmentIdentifier", this.AssessmentReference.AssessmentIdentifier); - } - - // Obtain value from other references - var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.AssessmentIdentifier; - - if (valueFromObjectiveAssessmentReference != null) - { - yield return ("objectiveAssessmentReference.assessmentIdentifier", this.ObjectiveAssessmentReference.AssessmentIdentifier); - } - - } - var sourcesForNamespace = GetNamespaceSources().ToArray(); - - if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetNamespaceSources() - { - // Obtain value from other references - var valueFromAssessmentReference = this.AssessmentReference?.Namespace; - - if (valueFromAssessmentReference != null) - { - yield return ("assessmentReference.namespace", this.AssessmentReference.Namespace); - } - - // Obtain value from other references - var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.Namespace; - - if (valueFromObjectiveAssessmentReference != null) - { - yield return ("objectiveAssessmentReference.namespace", this.ObjectiveAssessmentReference.Namespace); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -12891,14 +12824,15 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAsses // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentItemPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_AssessmentScoreRangeLearningStandard = new FullName("edfi", "AssessmentScoreRangeLearningStandard"); + private static readonly FullName _fullName_edfi_AssessmentItem = new FullName("edfi", "AssessmentItem"); // Declare collection item validators - private AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator _assessmentScoreRangeLearningStandardLearningStandardsValidator = new (); + private AssessmentItemLearningStandardPutPostRequestValidator _assessmentItemLearningStandardsValidator = new (); + private AssessmentItemPossibleResponsePutPostRequestValidator _assessmentItemPossibleResponsesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -12915,19 +12849,30 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsAssessmentScoreRangeLearningStandardLearningStandardIncluded(x)); + var hasInvalidAssessmentItemLearningStandardsItems = instance.AssessmentItemLearningStandards.Any(x => !mappingContract.IsAssessmentItemLearningStandardIncluded(x)); - if (hasInvalidAssessmentScoreRangeLearningStandardLearningStandardsItems) + if (hasInvalidAssessmentItemLearningStandardsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("AssessmentScoreRangeLearningStandardLearningStandards", $"A supplied 'AssessmentScoreRangeLearningStandardLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("AssessmentItemLearningStandards", $"A supplied 'AssessmentItemLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsAssessmentItemPossibleResponseIncluded != null) + { + var hasInvalidAssessmentItemPossibleResponsesItems = instance.AssessmentItemPossibleResponses.Any(x => !mappingContract.IsAssessmentItemPossibleResponseIncluded(x)); + + if (hasInvalidAssessmentItemPossibleResponsesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("AssessmentItemPossibleResponses", $"A supplied 'AssessmentItemPossibleResponse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -12949,16 +12894,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssessmentScoreRangeLearningStandardLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentItemLearningStandard table of the AssessmentItem aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandardLearningStandard : Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard, IValidatableObject + public class AssessmentItemLearningStandard : Entities.Common.EdFi.IAssessmentItemLearningStandard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "AssessmentScoreRangeLearningStandardLearningStandard"); + private static FullName _fullName = new FullName("edfi", "AssessmentItemLearningStandard"); // Fluent validator instance (threadsafe) - private static AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator _validator = new AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator(); + private static AssessmentItemLearningStandardPutPostRequestValidator _validator = new AssessmentItemLearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -13019,30 +12964,30 @@ public LearningStandard.EdFi.LearningStandardReference LearningStandardReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard _assessmentScoreRangeLearningStandard; + private Entities.Common.EdFi.IAssessmentItem _assessmentItem; [IgnoreDataMember] - Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard IAssessmentScoreRangeLearningStandardLearningStandard.AssessmentScoreRangeLearningStandard + Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentItem { - get { return _assessmentScoreRangeLearningStandard; } - set { SetAssessmentScoreRangeLearningStandard(value); } + get { return _assessmentItem; } + set { SetAssessmentItem(value); } } - public Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard AssessmentScoreRangeLearningStandard + public Entities.Common.EdFi.IAssessmentItem AssessmentItem { - set { SetAssessmentScoreRangeLearningStandard(value); } + set { SetAssessmentItem(value); } } - private void SetAssessmentScoreRangeLearningStandard(Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard value) + private void SetAssessmentItem(Entities.Common.EdFi.IAssessmentItem value) { - _assessmentScoreRangeLearningStandard = value; + _assessmentItem = value; } /// /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardId + string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardId { get { @@ -13076,7 +13021,7 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandar /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard; + var compareTo = obj as Entities.Common.EdFi.IAssessmentItemLearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -13085,12 +13030,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_assessmentScoreRangeLearningStandard == null || !_assessmentScoreRangeLearningStandard.Equals(compareTo.AssessmentScoreRangeLearningStandard)) + if (_assessmentItem == null || !_assessmentItem.Equals(compareTo.AssessmentItem)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard).LearningStandardId, compareTo.LearningStandardId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItemLearningStandard).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -13107,11 +13052,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_assessmentScoreRangeLearningStandard != null) - hash.Add(_assessmentScoreRangeLearningStandard); + if (_assessmentItem != null) + hash.Add(_assessmentItem); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard).LearningStandardId); + hash.Add((this as Entities.Common.EdFi.IAssessmentItemLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -13144,7 +13089,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandardLearningStandard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentItem", "AssessmentItemLearningStandard")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -13168,25 +13113,25 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssessmentScoreRangeLearningStandardLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target); + return Entities.Common.EdFi.AssessmentItemLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemLearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssessmentScoreRangeLearningStandardLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target, null); + Entities.Common.EdFi.AssessmentItemLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemLearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardResourceId + Guid? Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardResourceId { get { return null; } set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardDiscriminator + string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardDiscriminator { // Not supported for Resources get { return null; } @@ -13262,9 +13207,9 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandar // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentItemLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -13292,22 +13237,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AssignmentLateStatusDescriptor table of the AssignmentLateStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentItemPossibleResponse table of the AssessmentItem aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AssignmentLateStatusDescriptor : Entities.Common.EdFi.IAssignmentLateStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentItemPossibleResponse : Entities.Common.EdFi.IAssessmentItemPossibleResponse, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "AssignmentLateStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentItemPossibleResponse"); // Fluent validator instance (threadsafe) - private static AssignmentLateStatusDescriptorPutPostRequestValidator _validator = new AssignmentLateStatusDescriptorPutPostRequestValidator(); + private static AssessmentItemPossibleResponsePutPostRequestValidator _validator = new AssessmentItemPossibleResponsePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -13324,13 +13264,6 @@ public class AssignmentLateStatusDescriptor : Entities.Common.EdFi.IAssignmentLa // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the AssignmentLateStatusDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -13341,19 +13274,33 @@ public class AssignmentLateStatusDescriptor : Entities.Common.EdFi.IAssignmentLa //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IAssessmentItem _assessmentItem; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int AssignmentLateStatusDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IAssessmentItem IAssessmentItemPossibleResponse.AssessmentItem + { + get { return _assessmentItem; } + set { SetAssessmentItem(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IAssessmentItem AssessmentItem { - get { return AssignmentLateStatusDescriptorId; } - set { AssignmentLateStatusDescriptorId = value; } + set { SetAssessmentItem(value); } } + + private void SetAssessmentItem(Entities.Common.EdFi.IAssessmentItem value) + { + _assessmentItem = value; + } + + /// + /// The response value, often an option number or code value (e.g., 1, 2, A, B, true, false). + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="responseValue")] + public string ResponseValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13368,7 +13315,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAssignmentLateStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentItemPossibleResponse; if (ReferenceEquals(this, compareTo)) return true; @@ -13376,9 +13323,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_assessmentItem == null || !_assessmentItem.Equals(compareTo.AssessmentItem)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IAssignmentLateStatusDescriptor).AssignmentLateStatusDescriptorId.Equals(compareTo.AssignmentLateStatusDescriptorId)) + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentItemPossibleResponse).ResponseValue, compareTo.ResponseValue)) return false; @@ -13394,9 +13345,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_assessmentItem != null) + hash.Add(_assessmentItem); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IAssignmentLateStatusDescriptor).AssignmentLateStatusDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IAssessmentItemPossibleResponse).ResponseValue); return hash.ToHashCode(); } @@ -13405,60 +13359,26 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// Indicates the response is correct. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="correctResponse")] + public bool? CorrectResponse { get; set; } /// - /// A shortened description for the descriptor. + /// Additional text provided to define the response value. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="responseDescription")] + public string ResponseDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13479,11 +13399,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentItem", "AssessmentItemPossibleResponse")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13494,13 +13411,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -13513,12 +13423,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AssignmentLateStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target); + return Entities.Common.EdFi.AssessmentItemPossibleResponseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemPossibleResponse)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AssignmentLateStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target, null); + Entities.Common.EdFi.AssessmentItemPossibleResponseMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemPossibleResponse)target, null); } // ------------------------------------------------------------- @@ -13526,6 +13436,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -13533,9 +13503,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AssignmentLateStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentItemPossibleResponsePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -13564,21 +13534,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AttemptStatusDescriptor table of the AttemptStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentItemCategoryDescriptor table of the AssessmentItemCategoryDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AttemptStatusDescriptor : Entities.Common.EdFi.IAttemptStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentItemCategoryDescriptor : Entities.Common.EdFi.IAssessmentItemCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "AttemptStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentItemCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static AttemptStatusDescriptorPutPostRequestValidator _validator = new AttemptStatusDescriptorPutPostRequestValidator(); + private static AssessmentItemCategoryDescriptorPutPostRequestValidator _validator = new AssessmentItemCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -13597,7 +13567,7 @@ public class AttemptStatusDescriptor : Entities.Common.EdFi.IAttemptStatusDescri // ------------------------------------------------------------ /// - /// The unique identifier for the AttemptStatusDescriptor resource. + /// The unique identifier for the AssessmentItemCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -13618,12 +13588,12 @@ public class AttemptStatusDescriptor : Entities.Common.EdFi.IAttemptStatusDescri ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int AttemptStatusDescriptorId { get; set; } + public int AssessmentItemCategoryDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return AttemptStatusDescriptorId; } - set { AttemptStatusDescriptorId = value; } + get { return AssessmentItemCategoryDescriptorId; } + set { AssessmentItemCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -13639,7 +13609,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAttemptStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentItemCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -13649,7 +13619,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IAttemptStatusDescriptor).AttemptStatusDescriptorId.Equals(compareTo.AttemptStatusDescriptorId)) + if (!(this as Entities.Common.EdFi.IAssessmentItemCategoryDescriptor).AssessmentItemCategoryDescriptorId.Equals(compareTo.AssessmentItemCategoryDescriptorId)) return false; @@ -13667,7 +13637,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IAttemptStatusDescriptor).AttemptStatusDescriptorId); + hash.Add((this as Entities.Common.EdFi.IAssessmentItemCategoryDescriptor).AssessmentItemCategoryDescriptorId); return hash.ToHashCode(); } @@ -13784,12 +13754,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AttemptStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAttemptStatusDescriptor)target); + return Entities.Common.EdFi.AssessmentItemCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.AttemptStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAttemptStatusDescriptor)target, null); + Entities.Common.EdFi.AssessmentItemCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target, null); } // ------------------------------------------------------------- @@ -13804,9 +13774,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class AttemptStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentItemCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -13835,21 +13805,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.AttendanceEventCategoryDescriptor table of the AttendanceEventCategoryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentItemResultDescriptor table of the AssessmentItemResultDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class AttendanceEventCategoryDescriptor : Entities.Common.EdFi.IAttendanceEventCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentItemResultDescriptor : Entities.Common.EdFi.IAssessmentItemResultDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "AttendanceEventCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentItemResultDescriptor"); // Fluent validator instance (threadsafe) - private static AttendanceEventCategoryDescriptorPutPostRequestValidator _validator = new AttendanceEventCategoryDescriptorPutPostRequestValidator(); + private static AssessmentItemResultDescriptorPutPostRequestValidator _validator = new AssessmentItemResultDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -13868,7 +13838,7 @@ public class AttendanceEventCategoryDescriptor : Entities.Common.EdFi.IAttendanc // ------------------------------------------------------------ /// - /// The unique identifier for the AttendanceEventCategoryDescriptor resource. + /// The unique identifier for the AssessmentItemResultDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -13889,12 +13859,12 @@ public class AttendanceEventCategoryDescriptor : Entities.Common.EdFi.IAttendanc ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int AttendanceEventCategoryDescriptorId { get; set; } + public int AssessmentItemResultDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return AttendanceEventCategoryDescriptorId; } - set { AttendanceEventCategoryDescriptorId = value; } + get { return AssessmentItemResultDescriptorId; } + set { AssessmentItemResultDescriptorId = value; } } // ------------------------------------------------------------- @@ -13910,7 +13880,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IAttendanceEventCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentItemResultDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -13920,7 +13890,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IAttendanceEventCategoryDescriptor).AttendanceEventCategoryDescriptorId.Equals(compareTo.AttendanceEventCategoryDescriptorId)) + if (!(this as Entities.Common.EdFi.IAssessmentItemResultDescriptor).AssessmentItemResultDescriptorId.Equals(compareTo.AssessmentItemResultDescriptorId)) return false; @@ -13938,7 +13908,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IAttendanceEventCategoryDescriptor).AttendanceEventCategoryDescriptorId); + hash.Add((this as Entities.Common.EdFi.IAssessmentItemResultDescriptor).AssessmentItemResultDescriptorId); return hash.ToHashCode(); } @@ -14055,734 +14025,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.AttendanceEventCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.AttendanceEventCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class AttendanceEventCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: BalanceSheetDimension - -namespace EdFi.Ods.Api.Common.Models.Resources.BalanceSheetDimension.EdFi -{ - /// - /// Represents a reference to the BalanceSheetDimension resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class BalanceSheetDimensionReference : IResourceReference - { - [DataMember(Name="code")] - public string Code { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return Code != default(string) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (Code == default) - { - yield return "Code"; - } - - if (FiscalYear == default) - { - yield return "FiscalYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "BalanceSheetDimension", - Href = $"/ed-fi/balanceSheetDimensions/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.BalanceSheetDimension table of the BalanceSheetDimension aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class BalanceSheetDimension : Entities.Common.EdFi.IBalanceSheetDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "BalanceSheetDimension"); - - // Fluent validator instance (threadsafe) - private static BalanceSheetDimensionPutPostRequestValidator _validator = new BalanceSheetDimensionPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - public BalanceSheetDimension() - { - BalanceSheetDimensionReportingTags = new List(); - } - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the BalanceSheetDimension resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// The code representation of the account balance sheet dimension. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="code")] - public string Code { get; set; } - - private bool _fiscalYearExplicitlyAssigned = false; - private int _fiscalYear; - - /// - /// The fiscal year for which the account balance sheet dimension is valid. - /// - // NOT in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get => _fiscalYear; - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; - } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IBalanceSheetDimension; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IBalanceSheetDimension).Code, compareTo.Code)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IBalanceSheetDimension).FiscalYear.Equals(compareTo.FiscalYear)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IBalanceSheetDimension).Code); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IBalanceSheetDimension).FiscalYear); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// A description of the account balance sheet dimension. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeName")] - public string CodeName { get; set; } - // ------------------------------------------------------------- - - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } - } - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BalanceSheetDimension", "BalanceSheetDimension")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _balanceSheetDimensionReportingTags; - private ICollection _balanceSheetDimensionReportingTagsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection BalanceSheetDimensionReportingTags - { - get { return _balanceSheetDimensionReportingTags; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)e.Item).BalanceSheetDimension = this); - _balanceSheetDimensionReportingTags = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)e.Item).BalanceSheetDimension = this; - _balanceSheetDimensionReportingTagsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBalanceSheetDimension.BalanceSheetDimensionReportingTags - { - get { return _balanceSheetDimensionReportingTagsCovariant; } - set { BalanceSheetDimensionReportingTags = new List(value.Cast()); } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_balanceSheetDimensionReportingTags != null) foreach (var item in _balanceSheetDimensionReportingTags) - { - item.BalanceSheetDimension = this; - } - - } - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.BalanceSheetDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBalanceSheetDimension)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.BalanceSheetDimensionMapper.MapTo(this, (Entities.Common.EdFi.IBalanceSheetDimension)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (BalanceSheetDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("BalanceSheetDimensionReportingTags") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("BalanceSheetDimensionReportingTags"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BalanceSheetDimensionReportingTags, validationContext, validationContext.Items.ForCollection("BalanceSheetDimensionReportingTags")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class BalanceSheetDimensionPutPostRequestValidator : FluentValidation.AbstractValidator - { - private static readonly FullName _fullName_edfi_BalanceSheetDimension = new FullName("edfi", "BalanceSheetDimension"); - - // Declare collection item validators - private BalanceSheetDimensionReportingTagPutPostRequestValidator _balanceSheetDimensionReportingTagsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (BalanceSheetDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_BalanceSheetDimension); - - if (mappingContract != null) - { - if (mappingContract.IsBalanceSheetDimensionReportingTagIncluded != null) - { - var hasInvalidBalanceSheetDimensionReportingTagsItems = instance.BalanceSheetDimensionReportingTags.Any(x => !mappingContract.IsBalanceSheetDimensionReportingTagIncluded(x)); - - if (hasInvalidBalanceSheetDimensionReportingTagsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("BalanceSheetDimensionReportingTags", $"A supplied 'BalanceSheetDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.BalanceSheetDimensionReportingTag table of the BalanceSheetDimension aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class BalanceSheetDimensionReportingTag : Entities.Common.EdFi.IBalanceSheetDimensionReportingTag, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "BalanceSheetDimensionReportingTag"); - - // Fluent validator instance (threadsafe) - private static BalanceSheetDimensionReportingTagPutPostRequestValidator _validator = new BalanceSheetDimensionReportingTagPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IBalanceSheetDimension _balanceSheetDimension; - - [IgnoreDataMember] - Entities.Common.EdFi.IBalanceSheetDimension IBalanceSheetDimensionReportingTag.BalanceSheetDimension - { - get { return _balanceSheetDimension; } - set { SetBalanceSheetDimension(value); } - } - - public Entities.Common.EdFi.IBalanceSheetDimension BalanceSheetDimension - { - set { SetBalanceSheetDimension(value); } - } - - private void SetBalanceSheetDimension(Entities.Common.EdFi.IBalanceSheetDimension value) - { - _balanceSheetDimension = value; - } - - /// - /// Optional tag for accountability reporting. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IBalanceSheetDimensionReportingTag; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_balanceSheetDimension == null || !_balanceSheetDimension.Equals(compareTo.BalanceSheetDimension)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IBalanceSheetDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_balanceSheetDimension != null) - hash.Add(_balanceSheetDimension); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IBalanceSheetDimensionReportingTag).ReportingTagDescriptor); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BalanceSheetDimension", "BalanceSheetDimensionReportingTag")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.BalanceSheetDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target); + return Entities.Common.EdFi.AssessmentItemResultDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentItemResultDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BalanceSheetDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target, null); + Entities.Common.EdFi.AssessmentItemResultDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentItemResultDescriptor)target, null); } // ------------------------------------------------------------- @@ -14790,66 +14038,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -14857,9 +14045,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BalanceSheetDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentItemResultDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -14888,21 +14076,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.BarrierToInternetAccessInResidenceDescriptor table of the BarrierToInternetAccessInResidenceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentPeriodDescriptor table of the AssessmentPeriodDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class BarrierToInternetAccessInResidenceDescriptor : Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentPeriodDescriptor : Entities.Common.EdFi.IAssessmentPeriodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "BarrierToInternetAccessInResidenceDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentPeriodDescriptor"); // Fluent validator instance (threadsafe) - private static BarrierToInternetAccessInResidenceDescriptorPutPostRequestValidator _validator = new BarrierToInternetAccessInResidenceDescriptorPutPostRequestValidator(); + private static AssessmentPeriodDescriptorPutPostRequestValidator _validator = new AssessmentPeriodDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -14921,7 +14109,7 @@ public class BarrierToInternetAccessInResidenceDescriptor : Entities.Common.EdFi // ------------------------------------------------------------ /// - /// The unique identifier for the BarrierToInternetAccessInResidenceDescriptor resource. + /// The unique identifier for the AssessmentPeriodDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -14942,12 +14130,12 @@ public class BarrierToInternetAccessInResidenceDescriptor : Entities.Common.EdFi ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int BarrierToInternetAccessInResidenceDescriptorId { get; set; } + public int AssessmentPeriodDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return BarrierToInternetAccessInResidenceDescriptorId; } - set { BarrierToInternetAccessInResidenceDescriptorId = value; } + get { return AssessmentPeriodDescriptorId; } + set { AssessmentPeriodDescriptorId = value; } } // ------------------------------------------------------------- @@ -14963,7 +14151,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentPeriodDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -14973,7 +14161,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor).BarrierToInternetAccessInResidenceDescriptorId.Equals(compareTo.BarrierToInternetAccessInResidenceDescriptorId)) + if (!(this as Entities.Common.EdFi.IAssessmentPeriodDescriptor).AssessmentPeriodDescriptorId.Equals(compareTo.AssessmentPeriodDescriptorId)) return false; @@ -14991,7 +14179,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor).BarrierToInternetAccessInResidenceDescriptorId); + hash.Add((this as Entities.Common.EdFi.IAssessmentPeriodDescriptor).AssessmentPeriodDescriptorId); return hash.ToHashCode(); } @@ -15108,12 +14296,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.BarrierToInternetAccessInResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target); + return Entities.Common.EdFi.AssessmentPeriodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentPeriodDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BarrierToInternetAccessInResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target, null); + Entities.Common.EdFi.AssessmentPeriodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentPeriodDescriptor)target, null); } // ------------------------------------------------------------- @@ -15128,9 +14316,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BarrierToInternetAccessInResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentPeriodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -15159,21 +14347,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.BehaviorDescriptor table of the BehaviorDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentReportingMethodDescriptor table of the AssessmentReportingMethodDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class BehaviorDescriptor : Entities.Common.EdFi.IBehaviorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssessmentReportingMethodDescriptor : Entities.Common.EdFi.IAssessmentReportingMethodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "BehaviorDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssessmentReportingMethodDescriptor"); // Fluent validator instance (threadsafe) - private static BehaviorDescriptorPutPostRequestValidator _validator = new BehaviorDescriptorPutPostRequestValidator(); + private static AssessmentReportingMethodDescriptorPutPostRequestValidator _validator = new AssessmentReportingMethodDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -15192,7 +14380,7 @@ public class BehaviorDescriptor : Entities.Common.EdFi.IBehaviorDescriptor, Enti // ------------------------------------------------------------ /// - /// The unique identifier for the BehaviorDescriptor resource. + /// The unique identifier for the AssessmentReportingMethodDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -15213,12 +14401,12 @@ public class BehaviorDescriptor : Entities.Common.EdFi.IBehaviorDescriptor, Enti ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int BehaviorDescriptorId { get; set; } + public int AssessmentReportingMethodDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return BehaviorDescriptorId; } - set { BehaviorDescriptorId = value; } + get { return AssessmentReportingMethodDescriptorId; } + set { AssessmentReportingMethodDescriptorId = value; } } // ------------------------------------------------------------- @@ -15234,7 +14422,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IBehaviorDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssessmentReportingMethodDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -15244,7 +14432,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IBehaviorDescriptor).BehaviorDescriptorId.Equals(compareTo.BehaviorDescriptorId)) + if (!(this as Entities.Common.EdFi.IAssessmentReportingMethodDescriptor).AssessmentReportingMethodDescriptorId.Equals(compareTo.AssessmentReportingMethodDescriptorId)) return false; @@ -15262,7 +14450,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IBehaviorDescriptor).BehaviorDescriptorId); + hash.Add((this as Entities.Common.EdFi.IAssessmentReportingMethodDescriptor).AssessmentReportingMethodDescriptorId); return hash.ToHashCode(); } @@ -15379,12 +14567,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.BehaviorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBehaviorDescriptor)target); + return Entities.Common.EdFi.AssessmentReportingMethodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BehaviorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IBehaviorDescriptor)target, null); + Entities.Common.EdFi.AssessmentReportingMethodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target, null); } // ------------------------------------------------------------- @@ -15399,9 +14587,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BehaviorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentReportingMethodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -15430,22 +14618,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the BellSchedule resource. + /// Represents a reference to the AssessmentScoreRangeLearningStandard resource. ///
[DataContract] [ExcludeFromCodeCoverage] - public class BellScheduleReference : IResourceReference + public class AssessmentScoreRangeLearningStandardReference : IResourceReference { - [DataMember(Name="bellScheduleName")] - public string BellScheduleName { get; set; } + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + [DataMember(Name="scoreRangeId")] + public string ScoreRangeId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -15483,19 +14674,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BellScheduleName != default(string) && SchoolId != default(long); + return AssessmentIdentifier != default(string) && Namespace != default(string) && ScoreRangeId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BellScheduleName == default) + if (AssessmentIdentifier == default) { - yield return "BellScheduleName"; + yield return "AssessmentIdentifier"; } - if (SchoolId == default) + if (Namespace == default) { - yield return "SchoolId"; + yield return "Namespace"; + } + + if (ScoreRangeId == default) + { + yield return "ScoreRangeId"; } } @@ -15504,8 +14700,8 @@ private Link CreateLink() { var link = new Link { - Rel = "BellSchedule", - Href = $"/ed-fi/bellSchedules/{ResourceId:n}" + Rel = "AssessmentScoreRangeLearningStandard", + Href = $"/ed-fi/assessmentScoreRangeLearningStandards/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -15532,16 +14728,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.BellSchedule table of the BellSchedule aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentScoreRangeLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class BellSchedule : Entities.Common.EdFi.IBellSchedule, IHasETag, IDateVersionedEntity, IValidatableObject + public class AssessmentScoreRangeLearningStandard : Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "BellSchedule"); + private static FullName _fullName = new FullName("edfi", "AssessmentScoreRangeLearningStandard"); // Fluent validator instance (threadsafe) - private static BellSchedulePutPostRequestValidator _validator = new BellSchedulePutPostRequestValidator(); + private static AssessmentScoreRangeLearningStandardPutPostRequestValidator _validator = new AssessmentScoreRangeLearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -15552,11 +14748,9 @@ public class BellSchedule : Entities.Common.EdFi.IBellSchedule, IHasETag, IDateV // Constructor // ------------------------------------------------------------- - public BellSchedule() + public AssessmentScoreRangeLearningStandard() { - BellScheduleClassPeriods = new List(); - BellScheduleDates = new List(); - BellScheduleGradeLevels = new List(); + AssessmentScoreRangeLearningStandardLearningStandards = new List(); } // ------------------------------------------------------------ @@ -15566,7 +14760,7 @@ public BellSchedule() // ------------------------------------------------------------ /// - /// The unique identifier for the BellSchedule resource. + /// The unique identifier for the AssessmentScoreRangeLearningStandard resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -15577,78 +14771,144 @@ public BellSchedule() // References // ------------------------------------------------------------- - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference + private bool _assessmentReferenceExplicitlyAssigned; + private Assessment.EdFi.AssessmentReference _assessmentReference; + private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); + if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) + _assessmentReference = new Assessment.EdFi.AssessmentReference(); - return _schoolReference; + return _assessmentReference; } } - [DataMember(Name="schoolReference")] + [DataMember(Name="assessmentReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference + public Assessment.EdFi.AssessmentReference AssessmentReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; + if (ImplicitAssessmentReference != null + && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference; return null; } set { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; + _assessmentReferenceExplicitlyAssigned = true; + _assessmentReference = value; } } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// Name or title of the bell schedule. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="bellScheduleName")] - public string BellScheduleName { get; set; } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IBellSchedule.SchoolId + private bool _objectiveAssessmentReferenceExplicitlyAssigned; + private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference _objectiveAssessmentReference; + private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ImplicitObjectiveAssessmentReference { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_objectiveAssessmentReference == null && !_objectiveAssessmentReferenceExplicitlyAssigned) + _objectiveAssessmentReference = new ObjectiveAssessment.EdFi.ObjectiveAssessmentReference(); - return default(long); + return _objectiveAssessmentReference; + } + } + + [DataMember(Name="objectiveAssessmentReference")] + [FullyDefinedReference] + public ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ObjectiveAssessmentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitObjectiveAssessmentReference != null + && (_objectiveAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) + return ImplicitObjectiveAssessmentReference; + + return null; + } + set + { + _objectiveAssessmentReferenceExplicitlyAssigned = true; + _objectiveAssessmentReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique number or alphanumeric code assigned to an assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentIdentifier + { + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.AssessmentIdentifier; + + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.AssessmentIdentifier = value; + + // ObjectiveAssessment + _objectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitObjectiveAssessmentReference.AssessmentIdentifier = value; + } + } + + /// + /// Namespace for the assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.Namespace + { + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.Namespace; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.Namespace = value; + + // ObjectiveAssessment + _objectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitObjectiveAssessmentReference.Namespace = value; } } + + /// + /// A unique number or alphanumeric code assigned to the score range associated with one or more learning standards. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="scoreRangeId")] + public string ScoreRangeId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15663,7 +14923,7 @@ long Entities.Common.EdFi.IBellSchedule.SchoolId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IBellSchedule; + var compareTo = obj as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -15672,13 +14932,18 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IBellSchedule).BellScheduleName, compareTo.BellScheduleName)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).AssessmentIdentifier, compareTo.AssessmentIdentifier)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IBellSchedule).SchoolId.Equals(compareTo.SchoolId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).Namespace, compareTo.Namespace)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).ScoreRangeId, compareTo.ScoreRangeId)) return false; @@ -15695,12 +14960,15 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IBellSchedule).BellScheduleName); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).AssessmentIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IBellSchedule).SchoolId); + hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).Namespace); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard).ScoreRangeId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -15715,33 +14983,57 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// An alternate name for the day (e.g., Red, Blue). + /// The assessment reporting method defined (e.g., scale score, RIT scale score) associated with the referenced learning standard(s). /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="alternateDayName")] - public string AlternateDayName { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } /// - /// An indication of the time of day the bell schedule ends. + /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan? EndTime { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.IdentificationCode + { + get + { + if (ImplicitObjectiveAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) + { + return ImplicitObjectiveAssessmentReference.IdentificationCode; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ObjectiveAssessment + _objectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitObjectiveAssessmentReference.IdentificationCode = value; + } + } /// - /// An indication of the time of day the bell schedule begins. + /// The maximum score in the score range. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="startTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan? StartTime { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maximumScore")] + public string MaximumScore { get; set; } /// - /// The total instructional time in minutes per day for the bell schedule. + /// The minimum score in the score range. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="totalInstructionalTime")] - public int? TotalInstructionalTime { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="minimumScore")] + public string MinimumScore { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15762,101 +15054,41 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellSchedule")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandard")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _bellScheduleClassPeriods; - private ICollection _bellScheduleClassPeriodsCovariant; + private ICollection _assessmentScoreRangeLearningStandardLearningStandards; + private ICollection _assessmentScoreRangeLearningStandardLearningStandardsCovariant; [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="classPeriods")] - public ICollection BellScheduleClassPeriods - { - get { return _bellScheduleClassPeriods; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IBellScheduleClassPeriod)e.Item).BellSchedule = this); - _bellScheduleClassPeriods = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBellScheduleClassPeriod)e.Item).BellSchedule = this; - _bellScheduleClassPeriodsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleClassPeriods - { - get { return _bellScheduleClassPeriodsCovariant; } - set { BellScheduleClassPeriods = new List(value.Cast()); } - } - - private ICollection _bellScheduleDates; - private ICollection _bellScheduleDatesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="dates")] - public ICollection BellScheduleDates - { - get { return _bellScheduleDates; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IBellScheduleDate)e.Item).BellSchedule = this); - _bellScheduleDates = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBellScheduleDate)e.Item).BellSchedule = this; - _bellScheduleDatesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleDates - { - get { return _bellScheduleDatesCovariant; } - set { BellScheduleDates = new List(value.Cast()); } - } - - private ICollection _bellScheduleGradeLevels; - private ICollection _bellScheduleGradeLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="gradeLevels")] - public ICollection BellScheduleGradeLevels + [DataMember(Name="learningStandards")] + public ICollection AssessmentScoreRangeLearningStandardLearningStandards { - get { return _bellScheduleGradeLevels; } + get { return _assessmentScoreRangeLearningStandardLearningStandards; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IBellScheduleGradeLevel)e.Item).BellSchedule = this); - _bellScheduleGradeLevels = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)e.Item).AssessmentScoreRangeLearningStandard = this); + _assessmentScoreRangeLearningStandardLearningStandards = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBellScheduleGradeLevel)e.Item).BellSchedule = this; - _bellScheduleGradeLevelsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)e.Item).AssessmentScoreRangeLearningStandard = this; + _assessmentScoreRangeLearningStandardLearningStandardsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleGradeLevels + ICollection Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentScoreRangeLearningStandardLearningStandards { - get { return _bellScheduleGradeLevelsCovariant; } - set { BellScheduleGradeLevels = new List(value.Cast()); } + get { return _assessmentScoreRangeLearningStandardLearningStandardsCovariant; } + set { AssessmentScoreRangeLearningStandardLearningStandards = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -15881,19 +15113,9 @@ public ICollection BellScheduleGradeLevels internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_bellScheduleClassPeriods != null) foreach (var item in _bellScheduleClassPeriods) - { - item.BellSchedule = this; - } - - if (_bellScheduleDates != null) foreach (var item in _bellScheduleDates) - { - item.BellSchedule = this; - } - - if (_bellScheduleGradeLevels != null) foreach (var item in _bellScheduleGradeLevels) + if (_assessmentScoreRangeLearningStandardLearningStandards != null) foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) { - item.BellSchedule = this; + item.AssessmentScoreRangeLearningStandard = this; } } @@ -15904,22 +15126,43 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.BellScheduleMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellSchedule)target); + return Entities.Common.EdFi.AssessmentScoreRangeLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BellScheduleMapper.MapTo(this, (Entities.Common.EdFi.IBellSchedule)target, null); + Entities.Common.EdFi.AssessmentScoreRangeLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IBellSchedule.SchoolResourceId + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentResourceId { get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssessmentReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentResourceId + { + get { return null; } + set { ImplicitObjectiveAssessmentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitObjectiveAssessmentReference.Discriminator = value; } } @@ -15945,60 +15188,107 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (BellScheduleClassPeriods.Any() && mappingContract?.IsMemberSupported("BellScheduleClassPeriods") != false) + if (AssessmentScoreRangeLearningStandardLearningStandards.Any() && mappingContract?.IsMemberSupported("AssessmentScoreRangeLearningStandardLearningStandards") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("BellScheduleClassPeriods"); + pathBuilder.Append("AssessmentScoreRangeLearningStandardLearningStandards"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BellScheduleClassPeriods, validationContext, validationContext.Items.ForCollection("BellScheduleClassPeriods")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssessmentScoreRangeLearningStandardLearningStandards, validationContext, validationContext.Items.ForCollection("AssessmentScoreRangeLearningStandardLearningStandards")))) { yield return result; } } - if (BellScheduleDates.Any() && mappingContract?.IsMemberSupported("BellScheduleDates") != false) + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("BellScheduleDates"); + pathBuilder.Append(nameof(Extensions)); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BellScheduleDates, validationContext, validationContext.Items.ForCollection("BellScheduleDates")))) + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) { yield return result; } } - if (BellScheduleGradeLevels.Any() && mappingContract?.IsMemberSupported("BellScheduleGradeLevels") != false) + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); + + if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("BellScheduleGradeLevels"); + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BellScheduleGradeLevels, validationContext, validationContext.Items.ForCollection("BellScheduleGradeLevels")))) + IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + { + // Obtain value from other references + var valueFromAssessmentReference = this.AssessmentReference?.AssessmentIdentifier; + + if (valueFromAssessmentReference != null) { - yield return result; + yield return ("assessmentReference.assessmentIdentifier", this.AssessmentReference.AssessmentIdentifier); + } + + // Obtain value from other references + var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.AssessmentIdentifier; + + if (valueFromObjectiveAssessmentReference != null) + { + yield return ("objectiveAssessmentReference.assessmentIdentifier", this.ObjectiveAssessmentReference.AssessmentIdentifier); } + } + var sourcesForNamespace = GetNamespaceSources().ToArray(); + if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); - // --------------------------- - // Validate embedded objects - // --------------------------- + string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetNamespaceSources() { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); + // Obtain value from other references + var valueFromAssessmentReference = this.AssessmentReference?.Namespace; - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + if (valueFromAssessmentReference != null) { - yield return result; + yield return ("assessmentReference.namespace", this.AssessmentReference.Namespace); + } + + // Obtain value from other references + var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.Namespace; + + if (valueFromObjectiveAssessmentReference != null) + { + yield return ("objectiveAssessmentReference.namespace", this.ObjectiveAssessmentReference.Namespace); } + } // Execute the resource's fluent validator @@ -16026,16 +15316,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BellSchedulePutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentScoreRangeLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_BellSchedule = new FullName("edfi", "BellSchedule"); + private static readonly FullName _fullName_edfi_AssessmentScoreRangeLearningStandard = new FullName("edfi", "AssessmentScoreRangeLearningStandard"); // Declare collection item validators - private BellScheduleClassPeriodPutPostRequestValidator _bellScheduleClassPeriodsValidator = new (); - private BellScheduleDatePutPostRequestValidator _bellScheduleDatesValidator = new (); - private BellScheduleGradeLevelPutPostRequestValidator _bellScheduleGradeLevelsValidator = new (); + private AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator _assessmentScoreRangeLearningStandardLearningStandardsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -16052,41 +15340,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsBellScheduleClassPeriodIncluded(x)); - - if (hasInvalidBellScheduleClassPeriodsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("BellScheduleClassPeriods", $"A supplied 'BellScheduleClassPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsBellScheduleDateIncluded != null) - { - var hasInvalidBellScheduleDatesItems = instance.BellScheduleDates.Any(x => !mappingContract.IsBellScheduleDateIncluded(x)); - - if (hasInvalidBellScheduleDatesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("BellScheduleDates", $"A supplied 'BellScheduleDate' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsBellScheduleGradeLevelIncluded != null) + if (mappingContract.IsAssessmentScoreRangeLearningStandardLearningStandardIncluded != null) { - var hasInvalidBellScheduleGradeLevelsItems = instance.BellScheduleGradeLevels.Any(x => !mappingContract.IsBellScheduleGradeLevelIncluded(x)); + var hasInvalidAssessmentScoreRangeLearningStandardLearningStandardsItems = instance.AssessmentScoreRangeLearningStandardLearningStandards.Any(x => !mappingContract.IsAssessmentScoreRangeLearningStandardLearningStandardIncluded(x)); - if (hasInvalidBellScheduleGradeLevelsItems) + if (hasInvalidAssessmentScoreRangeLearningStandardLearningStandardsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("BellScheduleGradeLevels", $"A supplied 'BellScheduleGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("AssessmentScoreRangeLearningStandardLearningStandards", $"A supplied 'AssessmentScoreRangeLearningStandardLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -16108,16 +15374,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.BellScheduleClassPeriod table of the BellSchedule aggregate in the ODS Database. + /// A class which represents the edfi.AssessmentScoreRangeLearningStandardLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class BellScheduleClassPeriod : Entities.Common.EdFi.IBellScheduleClassPeriod, IValidatableObject + public class AssessmentScoreRangeLearningStandardLearningStandard : Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "BellScheduleClassPeriod"); + private static FullName _fullName = new FullName("edfi", "AssessmentScoreRangeLearningStandardLearningStandard"); // Fluent validator instance (threadsafe) - private static BellScheduleClassPeriodPutPostRequestValidator _validator = new BellScheduleClassPeriodPutPostRequestValidator(); + private static AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator _validator = new AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -16140,37 +15406,37 @@ public class BellScheduleClassPeriod : Entities.Common.EdFi.IBellScheduleClassPe // References // ------------------------------------------------------------- - private bool _classPeriodReferenceExplicitlyAssigned; - private ClassPeriod.EdFi.ClassPeriodReference _classPeriodReference; - private ClassPeriod.EdFi.ClassPeriodReference ImplicitClassPeriodReference + private bool _learningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_classPeriodReference == null && !_classPeriodReferenceExplicitlyAssigned) - _classPeriodReference = new ClassPeriod.EdFi.ClassPeriodReference(); + if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) + _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - return _classPeriodReference; + return _learningStandardReference; } } - [DataMember(Name="classPeriodReference")] + [DataMember(Name="learningStandardReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public ClassPeriod.EdFi.ClassPeriodReference ClassPeriodReference + public LearningStandard.EdFi.LearningStandardReference LearningStandardReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitClassPeriodReference != null - && (_classPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) - return ImplicitClassPeriodReference; + if (ImplicitLearningStandardReference != null + && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference; return null; } set { - _classPeriodReferenceExplicitlyAssigned = true; - _classPeriodReference = value; + _learningStandardReferenceExplicitlyAssigned = true; + _learningStandardReference = value; } } // ------------------------------------------------------------- @@ -16178,42 +15444,36 @@ public ClassPeriod.EdFi.ClassPeriodReference ClassPeriodReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IBellSchedule _bellSchedule; + private Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard _assessmentScoreRangeLearningStandard; [IgnoreDataMember] - Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule + Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard IAssessmentScoreRangeLearningStandardLearningStandard.AssessmentScoreRangeLearningStandard { - get { return _bellSchedule; } - set { SetBellSchedule(value); } + get { return _assessmentScoreRangeLearningStandard; } + set { SetAssessmentScoreRangeLearningStandard(value); } } - public Entities.Common.EdFi.IBellSchedule BellSchedule + public Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard AssessmentScoreRangeLearningStandard { - set { SetBellSchedule(value); } + set { SetAssessmentScoreRangeLearningStandard(value); } } - private void SetBellSchedule(Entities.Common.EdFi.IBellSchedule value) + private void SetAssessmentScoreRangeLearningStandard(Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard value) { - _bellSchedule = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_classPeriodReferenceExplicitlyAssigned) - { - ImplicitClassPeriodReference.SchoolId = _bellSchedule.SchoolId; - } + _assessmentScoreRangeLearningStandard = value; } /// - /// An indication of the portion of a typical daily session in which students receive instruction in a specified subject (e.g., morning, sixth period, block period, or AB schedules). + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodName + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardId { get { - if (ImplicitClassPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) - return ImplicitClassPeriodReference.ClassPeriodName; + if (ImplicitLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference.LearningStandardId; return default(string); } @@ -16222,9 +15482,9 @@ string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodName // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ClassPeriod - _classPeriodReferenceExplicitlyAssigned = false; - ImplicitClassPeriodReference.ClassPeriodName = value; + // LearningStandard + _learningStandardReferenceExplicitlyAssigned = false; + ImplicitLearningStandardReference.LearningStandardId = value; } } // ------------------------------------------------------------- @@ -16241,7 +15501,7 @@ string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IBellScheduleClassPeriod; + var compareTo = obj as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -16250,12 +15510,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_bellSchedule == null || !_bellSchedule.Equals(compareTo.BellSchedule)) + if (_assessmentScoreRangeLearningStandard == null || !_assessmentScoreRangeLearningStandard.Equals(compareTo.AssessmentScoreRangeLearningStandard)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IBellScheduleClassPeriod).ClassPeriodName, compareTo.ClassPeriodName)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -16272,11 +15532,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_bellSchedule != null) - hash.Add(_bellSchedule); + if (_assessmentScoreRangeLearningStandard != null) + hash.Add(_assessmentScoreRangeLearningStandard); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IBellScheduleClassPeriod).ClassPeriodName); + hash.Add((this as Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -16309,7 +15569,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellScheduleClassPeriod")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandardLearningStandard")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -16326,12 +15586,6 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -16339,29 +15593,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.BellScheduleClassPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellScheduleClassPeriod)target); + return Entities.Common.EdFi.AssessmentScoreRangeLearningStandardLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BellScheduleClassPeriodMapper.MapTo(this, (Entities.Common.EdFi.IBellScheduleClassPeriod)target, null); + Entities.Common.EdFi.AssessmentScoreRangeLearningStandardLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodResourceId + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardResourceId { get { return null; } - set { ImplicitClassPeriodReference.ResourceId = value ?? default(Guid); } + set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitClassPeriodReference.Discriminator = value; } + set { ImplicitLearningStandardReference.Discriminator = value; } } @@ -16407,40 +15661,6 @@ string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetSchoolIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IBellScheduleClassPeriod).BellSchedule.SchoolId); - - // Obtain value from other references - var valueFromClassPeriodReference = this.ClassPeriodReference?.SchoolId; - - if (valueFromClassPeriodReference != null) - { - yield return ("classPeriodReference.schoolId", this.ClassPeriodReference.SchoolId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -16467,9 +15687,9 @@ string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BellScheduleClassPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssessmentScoreRangeLearningStandardLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -16497,17 +15717,143 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.BellScheduleDate table of the BellSchedule aggregate in the ODS Database. + /// Represents a reference to the AssesssmentAdministrationParticipation resource. + ///
+ [DataContract] + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationReference : IResourceReference + { + [DataMember(Name="administrationIdentifier")] + public string AdministrationIdentifier { get; set; } + + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } + + [DataMember(Name="assigningEducationOrganizationId")] + public long AssigningEducationOrganizationId { get; set; } + + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + [DataMember(Name="participatingEducationOrganizationId")] + public long ParticipatingEducationOrganizationId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AdministrationIdentifier != default(string) && AssessmentIdentifier != default(string) && AssigningEducationOrganizationId != default(long) && Namespace != default(string) && ParticipatingEducationOrganizationId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AdministrationIdentifier == default) + { + yield return "AdministrationIdentifier"; + } + + if (AssessmentIdentifier == default) + { + yield return "AssessmentIdentifier"; + } + + if (AssigningEducationOrganizationId == default) + { + yield return "AssigningEducationOrganizationId"; + } + + if (Namespace == default) + { + yield return "Namespace"; + } + + if (ParticipatingEducationOrganizationId == default) + { + yield return "ParticipatingEducationOrganizationId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "AssesssmentAdministrationParticipation", + Href = $"/ed-fi/assesssmentAdministrationParticipations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.AssesssmentAdministrationParticipation table of the AssesssmentAdministrationParticipation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class BellScheduleDate : Entities.Common.EdFi.IBellScheduleDate, IValidatableObject + public class AssesssmentAdministrationParticipation : Entities.Common.EdFi.IAssesssmentAdministrationParticipation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "BellScheduleDate"); + private static FullName _fullName = new FullName("edfi", "AssesssmentAdministrationParticipation"); // Fluent validator instance (threadsafe) - private static BellScheduleDatePutPostRequestValidator _validator = new BellScheduleDatePutPostRequestValidator(); + private static AssesssmentAdministrationParticipationPutPostRequestValidator _validator = new AssesssmentAdministrationParticipationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -16518,48 +15864,225 @@ public class BellScheduleDate : Entities.Common.EdFi.IBellScheduleDate, IValidat // Constructor // ------------------------------------------------------------- + public AssesssmentAdministrationParticipation() + { + AssesssmentAdministrationParticipationAdministrationPointOfContacts = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the AssesssmentAdministrationParticipation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _assessmentAdministrationReferenceExplicitlyAssigned; + private AssessmentAdministration.EdFi.AssessmentAdministrationReference _assessmentAdministrationReference; + private AssessmentAdministration.EdFi.AssessmentAdministrationReference ImplicitAssessmentAdministrationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assessmentAdministrationReference == null && !_assessmentAdministrationReferenceExplicitlyAssigned) + _assessmentAdministrationReference = new AssessmentAdministration.EdFi.AssessmentAdministrationReference(); + + return _assessmentAdministrationReference; + } + } + + [DataMember(Name="assessmentAdministrationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public AssessmentAdministration.EdFi.AssessmentAdministrationReference AssessmentAdministrationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssessmentAdministrationReference != null + && (_assessmentAdministrationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference; + + return null; + } + set + { + _assessmentAdministrationReferenceExplicitlyAssigned = true; + _assessmentAdministrationReference = value; + } + } + private bool _participatingEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _participatingEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitParticipatingEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_participatingEducationOrganizationReference == null && !_participatingEducationOrganizationReferenceExplicitlyAssigned) + _participatingEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _participatingEducationOrganizationReference; + } + } + + [DataMember(Name="participatingEducationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference ParticipatingEducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitParticipatingEducationOrganizationReference != null + && (_participatingEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParticipatingEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitParticipatingEducationOrganizationReference; + + return null; + } + set + { + _participatingEducationOrganizationReferenceExplicitlyAssigned = true; + _participatingEducationOrganizationReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IBellSchedule _bellSchedule; - [IgnoreDataMember] - Entities.Common.EdFi.IBellSchedule IBellScheduleDate.BellSchedule + /// + /// The title or name of the assessment in the context of its administration. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AdministrationIdentifier { - get { return _bellSchedule; } - set { SetBellSchedule(value); } + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.AdministrationIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.AdministrationIdentifier = value; + } } - public Entities.Common.EdFi.IBellSchedule BellSchedule + /// + /// A unique number or alphanumeric code assigned to an assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssessmentIdentifier { - set { SetBellSchedule(value); } + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.AssessmentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.AssessmentIdentifier = value; + } } - private void SetBellSchedule(Entities.Common.EdFi.IBellSchedule value) + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssigningEducationOrganizationId { - _bellSchedule = value; + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.AssigningEducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.AssigningEducationOrganizationId = value; + } } /// - /// The dates for which the bell schedule applies. + /// Namespace for the assessment. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime Date { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IAssesssmentAdministrationParticipation.Namespace + { + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.Namespace; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.Namespace = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IAssesssmentAdministrationParticipation.ParticipatingEducationOrganizationId + { + get + { + if (ImplicitParticipatingEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitParticipatingEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitParticipatingEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ParticipatingEducationOrganization + _participatingEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitParticipatingEducationOrganizationReference.EducationOrganizationId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -16574,7 +16097,7 @@ private void SetBellSchedule(Entities.Common.EdFi.IBellSchedule value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IBellScheduleDate; + var compareTo = obj as Entities.Common.EdFi.IAssesssmentAdministrationParticipation; if (ReferenceEquals(this, compareTo)) return true; @@ -16582,13 +16105,29 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_bellSchedule == null || !_bellSchedule.Equals(compareTo.BellSchedule)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).AdministrationIdentifier, compareTo.AdministrationIdentifier)) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IBellScheduleDate).Date.Equals(compareTo.Date)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).AssigningEducationOrganizationId.Equals(compareTo.AssigningEducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).Namespace, compareTo.Namespace)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).ParticipatingEducationOrganizationId.Equals(compareTo.ParticipatingEducationOrganizationId)) return false; @@ -16604,13 +16143,21 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_bellSchedule != null) - hash.Add(_bellSchedule); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IBellScheduleDate).Date); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).AdministrationIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).AssessmentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).AssigningEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).Namespace); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipation).ParticipatingEducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -16643,23 +16190,71 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellScheduleDate")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssesssmentAdministrationParticipation", "AssesssmentAdministrationParticipation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _assesssmentAdministrationParticipationAdministrationPointOfContacts; + private ICollection _assesssmentAdministrationParticipationAdministrationPointOfContactsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="administrationPointOfContacts")] + public ICollection AssesssmentAdministrationParticipationAdministrationPointOfContacts + { + get { return _assesssmentAdministrationParticipationAdministrationPointOfContacts; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact)e.Item).AssesssmentAdministrationParticipation = this); + _assesssmentAdministrationParticipationAdministrationPointOfContacts = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact)e.Item).AssesssmentAdministrationParticipation = this; + _assesssmentAdministrationParticipationAdministrationPointOfContactsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssesssmentAdministrationParticipationAdministrationPointOfContacts + { + get { return _assesssmentAdministrationParticipationAdministrationPointOfContactsCovariant; } + set { AssesssmentAdministrationParticipationAdministrationPointOfContacts = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_assesssmentAdministrationParticipationAdministrationPointOfContacts != null) foreach (var item in _assesssmentAdministrationParticipationAdministrationPointOfContacts) + { + item.AssesssmentAdministrationParticipation = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -16667,18 +16262,46 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.BellScheduleDateMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellScheduleDate)target); + return Entities.Common.EdFi.AssesssmentAdministrationParticipationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssesssmentAdministrationParticipation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BellScheduleDateMapper.MapTo(this, (Entities.Common.EdFi.IBellScheduleDate)target, null); + Entities.Common.EdFi.AssesssmentAdministrationParticipationMapper.MapTo(this, (Entities.Common.EdFi.IAssesssmentAdministrationParticipation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssessmentAdministrationResourceId + { + get { return null; } + set { ImplicitAssessmentAdministrationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssesssmentAdministrationParticipation.AssessmentAdministrationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssessmentAdministrationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IAssesssmentAdministrationParticipation.ParticipatingEducationOrganizationResourceId + { + get { return null; } + set { ImplicitParticipatingEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssesssmentAdministrationParticipation.ParticipatingEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitParticipatingEducationOrganizationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -16696,12 +16319,23 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (AssesssmentAdministrationParticipationAdministrationPointOfContacts.Any() && mappingContract?.IsMemberSupported("AssesssmentAdministrationParticipationAdministrationPointOfContacts") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("AssesssmentAdministrationParticipationAdministrationPointOfContacts"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(AssesssmentAdministrationParticipationAdministrationPointOfContacts, validationContext, validationContext.Items.ForCollection("AssesssmentAdministrationParticipationAdministrationPointOfContacts")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -16747,9 +16381,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BellScheduleDatePutPostRequestValidator : FluentValidation.AbstractValidator + public class AssesssmentAdministrationParticipationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_AssesssmentAdministrationParticipation = new FullName("edfi", "AssesssmentAdministrationParticipation"); + + // Declare collection item validators + private AssesssmentAdministrationParticipationAdministrationPointOfContactPutPostRequestValidator _assesssmentAdministrationParticipationAdministrationPointOfContactsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -16762,6 +16401,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (AssesssmentAdministrationParticipationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_AssesssmentAdministrationParticipation); + + if (mappingContract != null) + { + if (mappingContract.IsAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded != null) + { + var hasInvalidAssesssmentAdministrationParticipationAdministrationPointOfContactsItems = instance.AssesssmentAdministrationParticipationAdministrationPointOfContacts.Any(x => !mappingContract.IsAssesssmentAdministrationParticipationAdministrationPointOfContactIncluded(x)); + + if (hasInvalidAssesssmentAdministrationParticipationAdministrationPointOfContactsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("AssesssmentAdministrationParticipationAdministrationPointOfContacts", $"A supplied 'AssesssmentAdministrationParticipationAdministrationPointOfContact' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -16778,16 +16439,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.BellScheduleGradeLevel table of the BellSchedule aggregate in the ODS Database. + /// A class which represents the edfi.AssesssmentAdministrationParticipationAdministrationPointOfContact table of the AssesssmentAdministrationParticipation aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class BellScheduleGradeLevel : Entities.Common.EdFi.IBellScheduleGradeLevel, IValidatableObject + public class AssesssmentAdministrationParticipationAdministrationPointOfContact : Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "BellScheduleGradeLevel"); + private static FullName _fullName = new FullName("edfi", "AssesssmentAdministrationParticipationAdministrationPointOfContact"); // Fluent validator instance (threadsafe) - private static BellScheduleGradeLevelPutPostRequestValidator _validator = new BellScheduleGradeLevelPutPostRequestValidator(); + private static AssesssmentAdministrationParticipationAdministrationPointOfContactPutPostRequestValidator _validator = new AssesssmentAdministrationParticipationAdministrationPointOfContactPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -16809,53 +16470,112 @@ public class BellScheduleGradeLevel : Entities.Common.EdFi.IBellScheduleGradeLev // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IBellSchedule _bellSchedule; + private Entities.Common.EdFi.IAssesssmentAdministrationParticipation _assesssmentAdministrationParticipation; [IgnoreDataMember] - Entities.Common.EdFi.IBellSchedule IBellScheduleGradeLevel.BellSchedule + Entities.Common.EdFi.IAssesssmentAdministrationParticipation IAssesssmentAdministrationParticipationAdministrationPointOfContact.AssesssmentAdministrationParticipation { - get { return _bellSchedule; } - set { SetBellSchedule(value); } + get { return _assesssmentAdministrationParticipation; } + set { SetAssesssmentAdministrationParticipation(value); } } - public Entities.Common.EdFi.IBellSchedule BellSchedule + public Entities.Common.EdFi.IAssesssmentAdministrationParticipation AssesssmentAdministrationParticipation { - set { SetBellSchedule(value); } + set { SetAssesssmentAdministrationParticipation(value); } } - private void SetBellSchedule(Entities.Common.EdFi.IBellSchedule value) + private void SetAssesssmentAdministrationParticipation(Entities.Common.EdFi.IAssesssmentAdministrationParticipation value) { - _bellSchedule = value; + _assesssmentAdministrationParticipation = value; } /// - /// The grade levels the particular bell schedule applies to. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. + /// The identifier assigned to an education organization. /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationId { - var compareTo = obj as Entities.Common.EdFi.IBellScheduleGradeLevel; + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } + + /// + /// The email address for the contact. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(128, MinimumLength=7, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="electronicMailAddress")] + public string ElectronicMailAddress { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact; if (ReferenceEquals(this, compareTo)) return true; @@ -16864,12 +16584,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_bellSchedule == null || !_bellSchedule.Equals(compareTo.BellSchedule)) + if (_assesssmentAdministrationParticipation == null || !_assesssmentAdministrationParticipation.Equals(compareTo.AssesssmentAdministrationParticipation)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IBellScheduleGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact).ElectronicMailAddress, compareTo.ElectronicMailAddress)) return false; @@ -16886,11 +16611,14 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_bellSchedule != null) - hash.Add(_bellSchedule); + if (_assesssmentAdministrationParticipation != null) + hash.Add(_assesssmentAdministrationParticipation); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact).EducationOrganizationId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IBellScheduleGradeLevel).GradeLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact).ElectronicMailAddress); return hash.ToHashCode(); } @@ -16904,6 +16632,32 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The contact's first name. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="firstName")] + public string FirstName { get; set; } + + /// + /// The contact's last name. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } + + /// + /// The login ID for the user; used for security access control interface. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="loginId")] + public string LoginId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -16924,7 +16678,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellScheduleGradeLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "AssesssmentAdministrationParticipation", "AssesssmentAdministrationParticipationAdministrationPointOfContact")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -16948,18 +16702,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.BellScheduleGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellScheduleGradeLevel)target); + return Entities.Common.EdFi.AssesssmentAdministrationParticipationAdministrationPointOfContactMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BellScheduleGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IBellScheduleGradeLevel)target, null); + Entities.Common.EdFi.AssesssmentAdministrationParticipationAdministrationPointOfContactMapper.MapTo(this, (Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IAssesssmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -17028,9 +16796,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BellScheduleGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssesssmentAdministrationParticipationAdministrationPointOfContactPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -17059,21 +16827,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.BusRouteDescriptor table of the BusRouteDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.AssignmentLateStatusDescriptor table of the AssignmentLateStatusDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class BusRouteDescriptor : Entities.Common.EdFi.IBusRouteDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class AssignmentLateStatusDescriptor : Entities.Common.EdFi.IAssignmentLateStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "BusRouteDescriptor"); + private static FullName _fullName = new FullName("edfi", "AssignmentLateStatusDescriptor"); // Fluent validator instance (threadsafe) - private static BusRouteDescriptorPutPostRequestValidator _validator = new BusRouteDescriptorPutPostRequestValidator(); + private static AssignmentLateStatusDescriptorPutPostRequestValidator _validator = new AssignmentLateStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -17092,7 +16860,7 @@ public class BusRouteDescriptor : Entities.Common.EdFi.IBusRouteDescriptor, Enti // ------------------------------------------------------------ /// - /// The unique identifier for the BusRouteDescriptor resource. + /// The unique identifier for the AssignmentLateStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -17113,12 +16881,12 @@ public class BusRouteDescriptor : Entities.Common.EdFi.IBusRouteDescriptor, Enti ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int BusRouteDescriptorId { get; set; } + public int AssignmentLateStatusDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return BusRouteDescriptorId; } - set { BusRouteDescriptorId = value; } + get { return AssignmentLateStatusDescriptorId; } + set { AssignmentLateStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -17134,7 +16902,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IBusRouteDescriptor; + var compareTo = obj as Entities.Common.EdFi.IAssignmentLateStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -17144,7 +16912,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IBusRouteDescriptor).BusRouteDescriptorId.Equals(compareTo.BusRouteDescriptorId)) + if (!(this as Entities.Common.EdFi.IAssignmentLateStatusDescriptor).AssignmentLateStatusDescriptorId.Equals(compareTo.AssignmentLateStatusDescriptorId)) return false; @@ -17162,7 +16930,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IBusRouteDescriptor).BusRouteDescriptorId); + hash.Add((this as Entities.Common.EdFi.IAssignmentLateStatusDescriptor).AssignmentLateStatusDescriptorId); return hash.ToHashCode(); } @@ -17279,12 +17047,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.BusRouteDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBusRouteDescriptor)target); + return Entities.Common.EdFi.AssignmentLateStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.BusRouteDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IBusRouteDescriptor)target, null); + Entities.Common.EdFi.AssignmentLateStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -17299,9 +17067,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class BusRouteDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class AssignmentLateStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -17330,25 +17098,564 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Calendar resource. + /// A class which represents the edfi.AttemptStatusDescriptor table of the AttemptStatusDescriptor aggregate in the ODS Database. ///
- [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CalendarReference : IResourceReference + public class AttemptStatusDescriptor : Entities.Common.EdFi.IAttemptStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - [DataMember(Name="calendarCode")] - public string CalendarCode { get; set; } + private static FullName _fullName = new FullName("edfi", "AttemptStatusDescriptor"); - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + // Fluent validator instance (threadsafe) + private static AttemptStatusDescriptorPutPostRequestValidator _validator = new AttemptStatusDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the AttemptStatusDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int AttemptStatusDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return AttemptStatusDescriptorId; } + set { AttemptStatusDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IAttemptStatusDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IAttemptStatusDescriptor).AttemptStatusDescriptorId.Equals(compareTo.AttemptStatusDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IAttemptStatusDescriptor).AttemptStatusDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.AttemptStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAttemptStatusDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.AttemptStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAttemptStatusDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class AttemptStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: AttendanceEventCategoryDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.AttendanceEventCategoryDescriptor.EdFi +{ + /// + /// A class which represents the edfi.AttendanceEventCategoryDescriptor table of the AttendanceEventCategoryDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class AttendanceEventCategoryDescriptor : Entities.Common.EdFi.IAttendanceEventCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "AttendanceEventCategoryDescriptor"); + + // Fluent validator instance (threadsafe) + private static AttendanceEventCategoryDescriptorPutPostRequestValidator _validator = new AttendanceEventCategoryDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the AttendanceEventCategoryDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int AttendanceEventCategoryDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return AttendanceEventCategoryDescriptorId; } + set { AttendanceEventCategoryDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IAttendanceEventCategoryDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IAttendanceEventCategoryDescriptor).AttendanceEventCategoryDescriptorId.Equals(compareTo.AttendanceEventCategoryDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IAttendanceEventCategoryDescriptor).AttendanceEventCategoryDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.AttendanceEventCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.AttendanceEventCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class AttendanceEventCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: BalanceSheetDimension + +namespace EdFi.Ods.Api.Common.Models.Resources.BalanceSheetDimension.EdFi +{ + /// + /// Represents a reference to the BalanceSheetDimension resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class BalanceSheetDimensionReference : IResourceReference + { + [DataMember(Name="code")] + public string Code { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -17386,24 +17693,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return CalendarCode != default(string) && SchoolId != default(long) && SchoolYear != default(short); + return Code != default(string) && FiscalYear != default(int); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (CalendarCode == default) - { - yield return "CalendarCode"; - } - - if (SchoolId == default) + if (Code == default) { - yield return "SchoolId"; + yield return "Code"; } - if (SchoolYear == default) + if (FiscalYear == default) { - yield return "SchoolYear"; + yield return "FiscalYear"; } } @@ -17412,8 +17714,8 @@ private Link CreateLink() { var link = new Link { - Rel = "Calendar", - Href = $"/ed-fi/calendars/{ResourceId:n}" + Rel = "BalanceSheetDimension", + Href = $"/ed-fi/balanceSheetDimensions/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -17440,16 +17742,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.Calendar table of the Calendar aggregate in the ODS Database. + /// A class which represents the edfi.BalanceSheetDimension table of the BalanceSheetDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Calendar : Entities.Common.EdFi.ICalendar, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class BalanceSheetDimension : Entities.Common.EdFi.IBalanceSheetDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Calendar"); + private static FullName _fullName = new FullName("edfi", "BalanceSheetDimension"); // Fluent validator instance (threadsafe) - private static CalendarPutPostRequestValidator _validator = new CalendarPutPostRequestValidator(); + private static BalanceSheetDimensionPutPostRequestValidator _validator = new BalanceSheetDimensionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -17460,9 +17763,9 @@ public class Calendar : Entities.Common.EdFi.ICalendar, IHasETag, IDateVersioned // Constructor // ------------------------------------------------------------- - public Calendar() + public BalanceSheetDimension() { - CalendarGradeLevels = new List(); + BalanceSheetDimensionReportingTags = new List(); } // ------------------------------------------------------------ @@ -17472,7 +17775,7 @@ public Calendar() // ------------------------------------------------------------ /// - /// The unique identifier for the Calendar resource. + /// The unique identifier for the BalanceSheetDimension resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -17482,73 +17785,6 @@ public Calendar() // ============================================================= // References // ------------------------------------------------------------- - - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); - - return _schoolReference; - } - } - - [DataMember(Name="schoolReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; - - return null; - } - set - { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; - } - } - private bool _schoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) - _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - - return _schoolYearTypeReference; - } - } - - [DataMember(Name="schoolYearTypeReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolYearTypeReference != null - && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference; - - return null; - } - set - { - _schoolYearTypeReferenceExplicitlyAssigned = true; - _schoolYearTypeReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -17556,63 +17792,33 @@ public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference // ------------------------------------------------------------- /// - /// The identifier for the calendar. + /// The code representation of the account balance sheet dimension. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="calendarCode")] - public string CalendarCode { get; set; } + [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="code")] + public string Code { get; set; } + + private bool _fiscalYearExplicitlyAssigned = false; + private int _fiscalYear; /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The fiscal year for which the account balance sheet dimension is valid. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICalendar.SchoolId - { - get - { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; + // NOT in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get => _fiscalYear; + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; } } - /// - /// The identifier for the school year associated with the calendar. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ICalendar.SchoolYear - { - get - { - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value; - } - } // ------------------------------------------------------------- // ============================================================= @@ -17627,7 +17833,7 @@ short Entities.Common.EdFi.ICalendar.SchoolYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICalendar; + var compareTo = obj as Entities.Common.EdFi.IBalanceSheetDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -17637,17 +17843,12 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICalendar).CalendarCode, compareTo.CalendarCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICalendar).SchoolId.Equals(compareTo.SchoolId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IBalanceSheetDimension).Code, compareTo.Code)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.ICalendar).SchoolYear.Equals(compareTo.SchoolYear)) + // Standard Property + if (!(this as Entities.Common.EdFi.IBalanceSheetDimension).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -17665,14 +17866,12 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICalendar).CalendarCode); + hash.Add((this as Entities.Common.EdFi.IBalanceSheetDimension).Code); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICalendar).SchoolId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IBalanceSheetDimension).FiscalYear); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICalendar).SchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -17687,15 +17886,22 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Indicates the type of calendar. + /// A description of the account balance sheet dimension. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="calendarTypeDescriptor")][DescriptorExists("CalendarTypeDescriptor")] - public string CalendarTypeDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeName")] + public string CodeName { get; set; } // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_fiscalYearExplicitlyAssigned) + { + yield return "FiscalYear"; + } + } + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -17714,41 +17920,41 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Calendar", "Calendar")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BalanceSheetDimension", "BalanceSheetDimension")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _calendarGradeLevels; - private ICollection _calendarGradeLevelsCovariant; + private ICollection _balanceSheetDimensionReportingTags; + private ICollection _balanceSheetDimensionReportingTagsCovariant; [NoDuplicateMembers] - [DataMember(Name="gradeLevels")] - public ICollection CalendarGradeLevels + [DataMember(Name="reportingTags")] + public ICollection BalanceSheetDimensionReportingTags { - get { return _calendarGradeLevels; } + get { return _balanceSheetDimensionReportingTags; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICalendarGradeLevel)e.Item).Calendar = this); - _calendarGradeLevels = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)e.Item).BalanceSheetDimension = this); + _balanceSheetDimensionReportingTags = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICalendarGradeLevel)e.Item).Calendar = this; - _calendarGradeLevelsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)e.Item).BalanceSheetDimension = this; + _balanceSheetDimensionReportingTagsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICalendar.CalendarGradeLevels + ICollection Entities.Common.EdFi.IBalanceSheetDimension.BalanceSheetDimensionReportingTags { - get { return _calendarGradeLevelsCovariant; } - set { CalendarGradeLevels = new List(value.Cast()); } + get { return _balanceSheetDimensionReportingTagsCovariant; } + set { BalanceSheetDimensionReportingTags = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -17773,9 +17979,9 @@ public ICollection CalendarGradeLevels internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_calendarGradeLevels != null) foreach (var item in _calendarGradeLevels) + if (_balanceSheetDimensionReportingTags != null) foreach (var item in _balanceSheetDimensionReportingTags) { - item.Calendar = this; + item.BalanceSheetDimension = this; } } @@ -17786,32 +17992,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CalendarMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendar)target); + return Entities.Common.EdFi.BalanceSheetDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBalanceSheetDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CalendarMapper.MapTo(this, (Entities.Common.EdFi.ICalendar)target, null); + Entities.Common.EdFi.BalanceSheetDimensionMapper.MapTo(this, (Entities.Common.EdFi.IBalanceSheetDimension)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICalendar.SchoolResourceId - { - get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.ICalendar.SchoolYearTypeResourceId - { - get { return null; } - set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- // ================================== @@ -17834,13 +18026,13 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (CalendarGradeLevels.Any() && mappingContract?.IsMemberSupported("CalendarGradeLevels") != false) + if (BalanceSheetDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("BalanceSheetDimensionReportingTags") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("CalendarGradeLevels"); + pathBuilder.Append("BalanceSheetDimensionReportingTags"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CalendarGradeLevels, validationContext, validationContext.Items.ForCollection("CalendarGradeLevels")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BalanceSheetDimensionReportingTags, validationContext, validationContext.Items.ForCollection("BalanceSheetDimensionReportingTags")))) { yield return result; } @@ -17891,14 +18083,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CalendarPutPostRequestValidator : FluentValidation.AbstractValidator + public class BalanceSheetDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Calendar = new FullName("edfi", "Calendar"); + private static readonly FullName _fullName_edfi_BalanceSheetDimension = new FullName("edfi", "BalanceSheetDimension"); // Declare collection item validators - private CalendarGradeLevelPutPostRequestValidator _calendarGradeLevelsValidator = new (); + private BalanceSheetDimensionReportingTagPutPostRequestValidator _balanceSheetDimensionReportingTagsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -17915,19 +18107,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext string profileName = null; // Get the current mapping contract - var mappingContract = (CalendarMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Calendar); + var mappingContract = (BalanceSheetDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_BalanceSheetDimension); if (mappingContract != null) { - if (mappingContract.IsCalendarGradeLevelIncluded != null) + if (mappingContract.IsBalanceSheetDimensionReportingTagIncluded != null) { - var hasInvalidCalendarGradeLevelsItems = instance.CalendarGradeLevels.Any(x => !mappingContract.IsCalendarGradeLevelIncluded(x)); + var hasInvalidBalanceSheetDimensionReportingTagsItems = instance.BalanceSheetDimensionReportingTags.Any(x => !mappingContract.IsBalanceSheetDimensionReportingTagIncluded(x)); - if (hasInvalidCalendarGradeLevelsItems) + if (hasInvalidBalanceSheetDimensionReportingTagsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CalendarGradeLevels", $"A supplied 'CalendarGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("BalanceSheetDimensionReportingTags", $"A supplied 'BalanceSheetDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -17949,16 +18141,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext // ----------------------------------------------------------------- /// - /// A class which represents the edfi.CalendarGradeLevel table of the Calendar aggregate in the ODS Database. + /// A class which represents the edfi.BalanceSheetDimensionReportingTag table of the BalanceSheetDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CalendarGradeLevel : Entities.Common.EdFi.ICalendarGradeLevel, IValidatableObject + public class BalanceSheetDimensionReportingTag : Entities.Common.EdFi.IBalanceSheetDimensionReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CalendarGradeLevel"); + private static FullName _fullName = new FullName("edfi", "BalanceSheetDimensionReportingTag"); // Fluent validator instance (threadsafe) - private static CalendarGradeLevelPutPostRequestValidator _validator = new CalendarGradeLevelPutPostRequestValidator(); + private static BalanceSheetDimensionReportingTagPutPostRequestValidator _validator = new BalanceSheetDimensionReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -17985,33 +18177,33 @@ public class CalendarGradeLevel : Entities.Common.EdFi.ICalendarGradeLevel, IVal //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICalendar _calendar; + private Entities.Common.EdFi.IBalanceSheetDimension _balanceSheetDimension; [IgnoreDataMember] - Entities.Common.EdFi.ICalendar ICalendarGradeLevel.Calendar + Entities.Common.EdFi.IBalanceSheetDimension IBalanceSheetDimensionReportingTag.BalanceSheetDimension { - get { return _calendar; } - set { SetCalendar(value); } + get { return _balanceSheetDimension; } + set { SetBalanceSheetDimension(value); } } - public Entities.Common.EdFi.ICalendar Calendar + public Entities.Common.EdFi.IBalanceSheetDimension BalanceSheetDimension { - set { SetCalendar(value); } + set { SetBalanceSheetDimension(value); } } - private void SetCalendar(Entities.Common.EdFi.ICalendar value) + private void SetBalanceSheetDimension(Entities.Common.EdFi.IBalanceSheetDimension value) { - _calendar = value; + _balanceSheetDimension = value; } /// - /// Indicates the grade level associated with the calendar. + /// Optional tag for accountability reporting. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -18026,7 +18218,7 @@ private void SetCalendar(Entities.Common.EdFi.ICalendar value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICalendarGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IBalanceSheetDimensionReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -18035,12 +18227,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_calendar == null || !_calendar.Equals(compareTo.Calendar)) + if (_balanceSheetDimension == null || !_balanceSheetDimension.Equals(compareTo.BalanceSheetDimension)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICalendarGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IBalanceSheetDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -18057,11 +18249,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_calendar != null) - hash.Add(_calendar); + if (_balanceSheetDimension != null) + hash.Add(_balanceSheetDimension); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICalendarGradeLevel).GradeLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IBalanceSheetDimensionReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -18095,7 +18287,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Calendar", "CalendarGradeLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BalanceSheetDimension", "BalanceSheetDimensionReportingTag")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -18119,12 +18311,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CalendarGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarGradeLevel)target); + return Entities.Common.EdFi.BalanceSheetDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CalendarGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICalendarGradeLevel)target, null); + Entities.Common.EdFi.BalanceSheetDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target, null); } // ------------------------------------------------------------- @@ -18199,9 +18391,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CalendarGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class BalanceSheetDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -18230,134 +18422,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CalendarDate resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class CalendarDateReference : IResourceReference - { - [DataMember(Name="calendarCode")] - public string CalendarCode { get; set; } - - [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime Date { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return CalendarCode != default(string) && Date != default(DateTime) && SchoolId != default(long) && SchoolYear != default(short); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (CalendarCode == default) - { - yield return "CalendarCode"; - } - - if (Date == default) - { - yield return "Date"; - } - - if (SchoolId == default) - { - yield return "SchoolId"; - } - - if (SchoolYear == default) - { - yield return "SchoolYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "CalendarDate", - Href = $"/ed-fi/calendarDates/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.CalendarDate table of the CalendarDate aggregate in the ODS Database. + /// A class which represents the edfi.BarrierToInternetAccessInResidenceDescriptor table of the BarrierToInternetAccessInResidenceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CalendarDate : Entities.Common.EdFi.ICalendarDate, IHasETag, IDateVersionedEntity, IValidatableObject + public class BarrierToInternetAccessInResidenceDescriptor : Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CalendarDate"); + private static FullName _fullName = new FullName("edfi", "BarrierToInternetAccessInResidenceDescriptor"); // Fluent validator instance (threadsafe) - private static CalendarDatePutPostRequestValidator _validator = new CalendarDatePutPostRequestValidator(); + private static BarrierToInternetAccessInResidenceDescriptorPutPostRequestValidator _validator = new BarrierToInternetAccessInResidenceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -18368,10 +18447,6 @@ public class CalendarDate : Entities.Common.EdFi.ICalendarDate, IHasETag, IDateV // Constructor // ------------------------------------------------------------- - public CalendarDate() - { - CalendarDateCalendarEvents = new List(); - } // ------------------------------------------------------------ @@ -18380,7 +18455,7 @@ public CalendarDate() // ------------------------------------------------------------ /// - /// The unique identifier for the CalendarDate resource. + /// The unique identifier for the BarrierToInternetAccessInResidenceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -18390,40 +18465,6 @@ public CalendarDate() // ============================================================= // References // ------------------------------------------------------------- - - private bool _calendarReferenceExplicitlyAssigned; - private Calendar.EdFi.CalendarReference _calendarReference; - private Calendar.EdFi.CalendarReference ImplicitCalendarReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_calendarReference == null && !_calendarReferenceExplicitlyAssigned) - _calendarReference = new Calendar.EdFi.CalendarReference(); - - return _calendarReference; - } - } - - [DataMember(Name="calendarReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Calendar.EdFi.CalendarReference CalendarReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCalendarReference != null - && (_calendarReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) - return ImplicitCalendarReference; - - return null; - } - set - { - _calendarReferenceExplicitlyAssigned = true; - _calendarReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -18431,86 +18472,16 @@ public Calendar.EdFi.CalendarReference CalendarReference // ------------------------------------------------------------- /// - /// The identifier for the calendar. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICalendarDate.CalendarCode - { - get - { - if (ImplicitCalendarReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) - return ImplicitCalendarReference.CalendarCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Calendar - _calendarReferenceExplicitlyAssigned = false; - ImplicitCalendarReference.CalendarCode = value; - } - } - - /// - /// The month, day, and year of the calendar event. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime Date { get; set; } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICalendarDate.SchoolId - { - get - { - if (ImplicitCalendarReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) - return ImplicitCalendarReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Calendar - _calendarReferenceExplicitlyAssigned = false; - ImplicitCalendarReference.SchoolId = value; - } - } + [JsonIgnore] + public int BarrierToInternetAccessInResidenceDescriptorId { get; set; } - /// - /// The identifier for the school year associated with the calendar. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ICalendarDate.SchoolYear + int IDescriptor.DescriptorId { - get - { - if (ImplicitCalendarReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) - return ImplicitCalendarReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Calendar - _calendarReferenceExplicitlyAssigned = false; - ImplicitCalendarReference.SchoolYear = value; - } + get { return BarrierToInternetAccessInResidenceDescriptorId; } + set { BarrierToInternetAccessInResidenceDescriptorId = value; } } // ------------------------------------------------------------- @@ -18526,7 +18497,7 @@ short Entities.Common.EdFi.ICalendarDate.SchoolYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICalendarDate; + var compareTo = obj as Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -18535,23 +18506,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICalendarDate).CalendarCode, compareTo.CalendarCode)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.ICalendarDate).Date.Equals(compareTo.Date)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICalendarDate).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICalendarDate).SchoolYear.Equals(compareTo.SchoolYear)) + // Derived Property + if (!(this as Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor).BarrierToInternetAccessInResidenceDescriptorId.Equals(compareTo.BarrierToInternetAccessInResidenceDescriptorId)) return false; @@ -18568,18 +18524,9 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICalendarDate).CalendarCode); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICalendarDate).Date); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICalendarDate).SchoolId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor).BarrierToInternetAccessInResidenceDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICalendarDate).SchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -18587,387 +18534,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CalendarDate", "CalendarDate")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _calendarDateCalendarEvents; - private ICollection _calendarDateCalendarEventsCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="calendarEvents")] - public ICollection CalendarDateCalendarEvents - { - get { return _calendarDateCalendarEvents; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICalendarDateCalendarEvent)e.Item).CalendarDate = this); - _calendarDateCalendarEvents = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICalendarDateCalendarEvent)e.Item).CalendarDate = this; - _calendarDateCalendarEventsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICalendarDate.CalendarDateCalendarEvents - { - get { return _calendarDateCalendarEventsCovariant; } - set { CalendarDateCalendarEvents = new List(value.Cast()); } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_calendarDateCalendarEvents != null) foreach (var item in _calendarDateCalendarEvents) - { - item.CalendarDate = this; - } - - } - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.CalendarDateMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarDate)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.CalendarDateMapper.MapTo(this, (Entities.Common.EdFi.ICalendarDate)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICalendarDate.CalendarResourceId - { - get { return null; } - set { ImplicitCalendarReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCalendarReference.Discriminator = value; } - } - - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (CalendarDateCalendarEvents.Any() && mappingContract?.IsMemberSupported("CalendarDateCalendarEvents") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CalendarDateCalendarEvents"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CalendarDateCalendarEvents, validationContext, validationContext.Items.ForCollection("CalendarDateCalendarEvents")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class CalendarDatePutPostRequestValidator : FluentValidation.AbstractValidator - { - private static readonly FullName _fullName_edfi_CalendarDate = new FullName("edfi", "CalendarDate"); - - // Declare collection item validators - private CalendarDateCalendarEventPutPostRequestValidator _calendarDateCalendarEventsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (CalendarDateMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_CalendarDate); - - if (mappingContract != null) - { - if (mappingContract.IsCalendarDateCalendarEventIncluded != null) - { - var hasInvalidCalendarDateCalendarEventsItems = instance.CalendarDateCalendarEvents.Any(x => !mappingContract.IsCalendarDateCalendarEventIncluded(x)); - - if (hasInvalidCalendarDateCalendarEventsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CalendarDateCalendarEvents", $"A supplied 'CalendarDateCalendarEvent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.CalendarDateCalendarEvent table of the CalendarDate aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CalendarDateCalendarEvent : Entities.Common.EdFi.ICalendarDateCalendarEvent, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "CalendarDateCalendarEvent"); - - // Fluent validator instance (threadsafe) - private static CalendarDateCalendarEventPutPostRequestValidator _validator = new CalendarDateCalendarEventPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.ICalendarDate _calendarDate; - - [IgnoreDataMember] - Entities.Common.EdFi.ICalendarDate ICalendarDateCalendarEvent.CalendarDate - { - get { return _calendarDate; } - set { SetCalendarDate(value); } - } - - public Entities.Common.EdFi.ICalendarDate CalendarDate - { - set { SetCalendarDate(value); } - } - - private void SetCalendarDate(Entities.Common.EdFi.ICalendarDate value) - { - _calendarDate = value; - } /// - /// The type of scheduled or unscheduled event for the day. + /// A code or abbreviation that is used to refer to the descriptor. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="calendarEventDescriptor")][DescriptorExists("CalendarEventDescriptor")] - public string CalendarEventDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// Determines equality based on the natural key properties of the resource. + /// The description of the descriptor. /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.ICalendarDateCalendarEvent; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_calendarDate == null || !_calendarDate.Equals(compareTo.CalendarDate)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICalendarDateCalendarEvent).CalendarEventDescriptor, compareTo.CalendarEventDescriptor)) - return false; - - - return true; - } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// Builds the hash code based on the unique identifying values. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_calendarDate != null) - hash.Add(_calendarDate); + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICalendarDateCalendarEvent).CalendarEventDescriptor); + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } - return hash.ToHashCode(); - } - // ------------------------------------------------------------- + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -18993,8 +18608,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CalendarDate", "CalendarDateCalendarEvent")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -19005,6 +18623,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -19017,12 +18642,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CalendarDateCalendarEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarDateCalendarEvent)target); + return Entities.Common.EdFi.BarrierToInternetAccessInResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CalendarDateCalendarEventMapper.MapTo(this, (Entities.Common.EdFi.ICalendarDateCalendarEvent)target, null); + Entities.Common.EdFi.BarrierToInternetAccessInResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target, null); } // ------------------------------------------------------------- @@ -19030,66 +18655,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -19097,9 +18662,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CalendarDateCalendarEventPutPostRequestValidator : FluentValidation.AbstractValidator + public class BarrierToInternetAccessInResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -19128,21 +18693,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CalendarEventDescriptor table of the CalendarEventDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.BehaviorDescriptor table of the BehaviorDescriptor aggregate in the ODS Database. ///
[Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CalendarEventDescriptor : Entities.Common.EdFi.ICalendarEventDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class BehaviorDescriptor : Entities.Common.EdFi.IBehaviorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CalendarEventDescriptor"); + private static FullName _fullName = new FullName("edfi", "BehaviorDescriptor"); // Fluent validator instance (threadsafe) - private static CalendarEventDescriptorPutPostRequestValidator _validator = new CalendarEventDescriptorPutPostRequestValidator(); + private static BehaviorDescriptorPutPostRequestValidator _validator = new BehaviorDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -19161,7 +18726,7 @@ public class CalendarEventDescriptor : Entities.Common.EdFi.ICalendarEventDescri // ------------------------------------------------------------ /// - /// The unique identifier for the CalendarEventDescriptor resource. + /// The unique identifier for the BehaviorDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -19182,12 +18747,12 @@ public class CalendarEventDescriptor : Entities.Common.EdFi.ICalendarEventDescri ///
// NOT in a reference, NOT a lookup column [JsonIgnore] - public int CalendarEventDescriptorId { get; set; } + public int BehaviorDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CalendarEventDescriptorId; } - set { CalendarEventDescriptorId = value; } + get { return BehaviorDescriptorId; } + set { BehaviorDescriptorId = value; } } // ------------------------------------------------------------- @@ -19203,7 +18768,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICalendarEventDescriptor; + var compareTo = obj as Entities.Common.EdFi.IBehaviorDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -19213,7 +18778,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICalendarEventDescriptor).CalendarEventDescriptorId.Equals(compareTo.CalendarEventDescriptorId)) + if (!(this as Entities.Common.EdFi.IBehaviorDescriptor).BehaviorDescriptorId.Equals(compareTo.BehaviorDescriptorId)) return false; @@ -19231,7 +18796,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICalendarEventDescriptor).CalendarEventDescriptorId); + hash.Add((this as Entities.Common.EdFi.IBehaviorDescriptor).BehaviorDescriptorId); return hash.ToHashCode(); } @@ -19348,12 +18913,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CalendarEventDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarEventDescriptor)target); + return Entities.Common.EdFi.BehaviorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBehaviorDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CalendarEventDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICalendarEventDescriptor)target, null); + Entities.Common.EdFi.BehaviorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IBehaviorDescriptor)target, null); } // ------------------------------------------------------------- @@ -19368,9 +18933,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CalendarEventDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class BehaviorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -19399,21 +18964,118 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CalendarTypeDescriptor table of the CalendarTypeDescriptor aggregate in the ODS Database. + /// Represents a reference to the BellSchedule resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class BellScheduleReference : IResourceReference + { + [DataMember(Name="bellScheduleName")] + public string BellScheduleName { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return BellScheduleName != default(string) && SchoolId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (BellScheduleName == default) + { + yield return "BellScheduleName"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "BellSchedule", + Href = $"/ed-fi/bellSchedules/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.BellSchedule table of the BellSchedule aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CalendarTypeDescriptor : Entities.Common.EdFi.ICalendarTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class BellSchedule : Entities.Common.EdFi.IBellSchedule, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CalendarTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "BellSchedule"); // Fluent validator instance (threadsafe) - private static CalendarTypeDescriptorPutPostRequestValidator _validator = new CalendarTypeDescriptorPutPostRequestValidator(); + private static BellSchedulePutPostRequestValidator _validator = new BellSchedulePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -19424,6 +19086,12 @@ public class CalendarTypeDescriptor : Entities.Common.EdFi.ICalendarTypeDescript // Constructor // ------------------------------------------------------------- + public BellSchedule() + { + BellScheduleClassPeriods = new List(); + BellScheduleDates = new List(); + BellScheduleGradeLevels = new List(); + } // ------------------------------------------------------------ @@ -19432,7 +19100,7 @@ public class CalendarTypeDescriptor : Entities.Common.EdFi.ICalendarTypeDescript // ------------------------------------------------------------ /// - /// The unique identifier for the CalendarTypeDescriptor resource. + /// The unique identifier for the BellSchedule resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -19442,6 +19110,40 @@ public class CalendarTypeDescriptor : Entities.Common.EdFi.ICalendarTypeDescript // ============================================================= // References // ------------------------------------------------------------- + + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); + + return _schoolReference; + } + } + + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; + + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -19449,16 +19151,37 @@ public class CalendarTypeDescriptor : Entities.Common.EdFi.ICalendarTypeDescript // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Name or title of the bell schedule. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CalendarTypeDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="bellScheduleName")] + public string BellScheduleName { get; set; } - int IDescriptor.DescriptorId + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IBellSchedule.SchoolId { - get { return CalendarTypeDescriptorId; } - set { CalendarTypeDescriptorId = value; } + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + } } // ------------------------------------------------------------- @@ -19474,7 +19197,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICalendarTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IBellSchedule; if (ReferenceEquals(this, compareTo)) return true; @@ -19483,8 +19206,13 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICalendarTypeDescriptor).CalendarTypeDescriptorId.Equals(compareTo.CalendarTypeDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IBellSchedule).BellScheduleName, compareTo.BellScheduleName)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IBellSchedule).SchoolId.Equals(compareTo.SchoolId)) return false; @@ -19501,9 +19229,12 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICalendarTypeDescriptor).CalendarTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IBellSchedule).BellScheduleName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IBellSchedule).SchoolId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -19511,60 +19242,40 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// An alternate name for the day (e.g., Red, Blue). /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="alternateDayName")] + public string AlternateDayName { get; set; } /// - /// The description of the descriptor. + /// An indication of the time of day the bell schedule ends. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [DataMember(Name="endTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan? EndTime { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// An indication of the time of day the bell schedule begins. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="startTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan? StartTime { get; set; } /// - /// A shortened description for the descriptor. + /// The total instructional time in minutes per day for the bell schedule. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [DataMember(Name="totalInstructionalTime")] + public int? TotalInstructionalTime { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -19585,16 +19296,103 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellSchedule")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _bellScheduleClassPeriods; + private ICollection _bellScheduleClassPeriodsCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="classPeriods")] + public ICollection BellScheduleClassPeriods + { + get { return _bellScheduleClassPeriods; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IBellScheduleClassPeriod)e.Item).BellSchedule = this); + _bellScheduleClassPeriods = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBellScheduleClassPeriod)e.Item).BellSchedule = this; + _bellScheduleClassPeriodsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleClassPeriods + { + get { return _bellScheduleClassPeriodsCovariant; } + set { BellScheduleClassPeriods = new List(value.Cast()); } + } + + private ICollection _bellScheduleDates; + private ICollection _bellScheduleDatesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="dates")] + public ICollection BellScheduleDates + { + get { return _bellScheduleDates; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IBellScheduleDate)e.Item).BellSchedule = this); + _bellScheduleDates = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBellScheduleDate)e.Item).BellSchedule = this; + _bellScheduleDatesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleDates + { + get { return _bellScheduleDatesCovariant; } + set { BellScheduleDates = new List(value.Cast()); } + } + + private ICollection _bellScheduleGradeLevels; + private ICollection _bellScheduleGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="gradeLevels")] + public ICollection BellScheduleGradeLevels + { + get { return _bellScheduleGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IBellScheduleGradeLevel)e.Item).BellSchedule = this); + _bellScheduleGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IBellScheduleGradeLevel)e.Item).BellSchedule = this; + _bellScheduleGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleGradeLevels + { + get { return _bellScheduleGradeLevelsCovariant; } + set { BellScheduleGradeLevels = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -19612,6 +19410,27 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_bellScheduleClassPeriods != null) foreach (var item in _bellScheduleClassPeriods) + { + item.BellSchedule = this; + } + + if (_bellScheduleDates != null) foreach (var item in _bellScheduleDates) + { + item.BellSchedule = this; + } + + if (_bellScheduleGradeLevels != null) foreach (var item in _bellScheduleGradeLevels) + { + item.BellSchedule = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -19619,19 +19438,121 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CalendarTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarTypeDescriptor)target); + return Entities.Common.EdFi.BellScheduleMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellSchedule)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CalendarTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICalendarTypeDescriptor)target, null); + Entities.Common.EdFi.BellScheduleMapper.MapTo(this, (Entities.Common.EdFi.IBellSchedule)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IBellSchedule.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (BellScheduleClassPeriods.Any() && mappingContract?.IsMemberSupported("BellScheduleClassPeriods") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("BellScheduleClassPeriods"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BellScheduleClassPeriods, validationContext, validationContext.Items.ForCollection("BellScheduleClassPeriods")))) + { + yield return result; + } + } + + if (BellScheduleDates.Any() && mappingContract?.IsMemberSupported("BellScheduleDates") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("BellScheduleDates"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BellScheduleDates, validationContext, validationContext.Items.ForCollection("BellScheduleDates")))) + { + yield return result; + } + } + + if (BellScheduleGradeLevels.Any() && mappingContract?.IsMemberSupported("BellScheduleGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("BellScheduleGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(BellScheduleGradeLevels, validationContext, validationContext.Items.ForCollection("BellScheduleGradeLevels")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -19639,9 +19560,16 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CalendarTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class BellSchedulePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_BellSchedule = new FullName("edfi", "BellSchedule"); + + // Declare collection item validators + private BellScheduleClassPeriodPutPostRequestValidator _bellScheduleClassPeriodsValidator = new (); + private BellScheduleDatePutPostRequestValidator _bellScheduleDatesValidator = new (); + private BellScheduleGradeLevelPutPostRequestValidator _bellScheduleGradeLevelsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -19654,6 +19582,50 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (BellScheduleMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_BellSchedule); + + if (mappingContract != null) + { + if (mappingContract.IsBellScheduleClassPeriodIncluded != null) + { + var hasInvalidBellScheduleClassPeriodsItems = instance.BellScheduleClassPeriods.Any(x => !mappingContract.IsBellScheduleClassPeriodIncluded(x)); + + if (hasInvalidBellScheduleClassPeriodsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("BellScheduleClassPeriods", $"A supplied 'BellScheduleClassPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsBellScheduleDateIncluded != null) + { + var hasInvalidBellScheduleDatesItems = instance.BellScheduleDates.Any(x => !mappingContract.IsBellScheduleDateIncluded(x)); + + if (hasInvalidBellScheduleDatesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("BellScheduleDates", $"A supplied 'BellScheduleDate' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsBellScheduleGradeLevelIncluded != null) + { + var hasInvalidBellScheduleGradeLevelsItems = instance.BellScheduleGradeLevels.Any(x => !mappingContract.IsBellScheduleGradeLevelIncluded(x)); + + if (hasInvalidBellScheduleGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("BellScheduleGradeLevels", $"A supplied 'BellScheduleGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -19669,22 +19641,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CareerPathwayDescriptor table of the CareerPathwayDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.BellScheduleClassPeriod table of the BellSchedule aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CareerPathwayDescriptor : Entities.Common.EdFi.ICareerPathwayDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class BellScheduleClassPeriod : Entities.Common.EdFi.IBellScheduleClassPeriod, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CareerPathwayDescriptor"); + private static FullName _fullName = new FullName("edfi", "BellScheduleClassPeriod"); // Fluent validator instance (threadsafe) - private static CareerPathwayDescriptorPutPostRequestValidator _validator = new CareerPathwayDescriptorPutPostRequestValidator(); + private static BellScheduleClassPeriodPutPostRequestValidator _validator = new BellScheduleClassPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -19701,35 +19668,98 @@ public class CareerPathwayDescriptor : Entities.Common.EdFi.ICareerPathwayDescri // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CareerPathwayDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _classPeriodReferenceExplicitlyAssigned; + private ClassPeriod.EdFi.ClassPeriodReference _classPeriodReference; + private ClassPeriod.EdFi.ClassPeriodReference ImplicitClassPeriodReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_classPeriodReference == null && !_classPeriodReferenceExplicitlyAssigned) + _classPeriodReference = new ClassPeriod.EdFi.ClassPeriodReference(); + + return _classPeriodReference; + } + } + + [DataMember(Name="classPeriodReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public ClassPeriod.EdFi.ClassPeriodReference ClassPeriodReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitClassPeriodReference != null + && (_classPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) + return ImplicitClassPeriodReference; + + return null; + } + set + { + _classPeriodReferenceExplicitlyAssigned = true; + _classPeriodReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IBellSchedule _bellSchedule; + + [IgnoreDataMember] + Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule + { + get { return _bellSchedule; } + set { SetBellSchedule(value); } + } + + public Entities.Common.EdFi.IBellSchedule BellSchedule + { + set { SetBellSchedule(value); } + } + + private void SetBellSchedule(Entities.Common.EdFi.IBellSchedule value) + { + _bellSchedule = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_classPeriodReferenceExplicitlyAssigned) + { + ImplicitClassPeriodReference.SchoolId = _bellSchedule.SchoolId; + } + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// An indication of the portion of a typical daily session in which students receive instruction in a specified subject (e.g., morning, sixth period, block period, or AB schedules). /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CareerPathwayDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodName { - get { return CareerPathwayDescriptorId; } - set { CareerPathwayDescriptorId = value; } + get + { + if (ImplicitClassPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) + return ImplicitClassPeriodReference.ClassPeriodName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ClassPeriod + _classPeriodReferenceExplicitlyAssigned = false; + ImplicitClassPeriodReference.ClassPeriodName = value; + } } // ------------------------------------------------------------- @@ -19745,7 +19775,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICareerPathwayDescriptor; + var compareTo = obj as Entities.Common.EdFi.IBellScheduleClassPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -19753,9 +19783,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_bellSchedule == null || !_bellSchedule.Equals(compareTo.BellSchedule)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ICareerPathwayDescriptor).CareerPathwayDescriptorId.Equals(compareTo.CareerPathwayDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IBellScheduleClassPeriod).ClassPeriodName, compareTo.ClassPeriodName)) return false; @@ -19771,10 +19805,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_bellSchedule != null) + hash.Add(_bellSchedule); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICareerPathwayDescriptor).CareerPathwayDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IBellScheduleClassPeriod).ClassPeriodName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -19782,55 +19818,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -19856,11 +19843,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellScheduleClassPeriod")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -19871,18 +19855,17 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -19890,19 +19873,127 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CareerPathwayDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICareerPathwayDescriptor)target); + return Entities.Common.EdFi.BellScheduleClassPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellScheduleClassPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CareerPathwayDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICareerPathwayDescriptor)target, null); + Entities.Common.EdFi.BellScheduleClassPeriodMapper.MapTo(this, (Entities.Common.EdFi.IBellScheduleClassPeriod)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodResourceId + { + get { return null; } + set { ImplicitClassPeriodReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitClassPeriodReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IBellScheduleClassPeriod).BellSchedule.SchoolId); + + // Obtain value from other references + var valueFromClassPeriodReference = this.ClassPeriodReference?.SchoolId; + + if (valueFromClassPeriodReference != null) + { + yield return ("classPeriodReference.schoolId", this.ClassPeriodReference.SchoolId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -19910,9 +20001,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CareerPathwayDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class BellScheduleClassPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -19940,22 +20031,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CharterApprovalAgencyTypeDescriptor table of the CharterApprovalAgencyTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.BellScheduleDate table of the BellSchedule aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CharterApprovalAgencyTypeDescriptor : Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class BellScheduleDate : Entities.Common.EdFi.IBellScheduleDate, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CharterApprovalAgencyTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "BellScheduleDate"); // Fluent validator instance (threadsafe) - private static CharterApprovalAgencyTypeDescriptorPutPostRequestValidator _validator = new CharterApprovalAgencyTypeDescriptorPutPostRequestValidator(); + private static BellScheduleDatePutPostRequestValidator _validator = new BellScheduleDatePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -19972,13 +20058,6 @@ public class CharterApprovalAgencyTypeDescriptor : Entities.Common.EdFi.ICharter // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CharterApprovalAgencyTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -19989,19 +20068,32 @@ public class CharterApprovalAgencyTypeDescriptor : Entities.Common.EdFi.ICharter //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IBellSchedule _bellSchedule; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CharterApprovalAgencyTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IBellSchedule IBellScheduleDate.BellSchedule + { + get { return _bellSchedule; } + set { SetBellSchedule(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IBellSchedule BellSchedule { - get { return CharterApprovalAgencyTypeDescriptorId; } - set { CharterApprovalAgencyTypeDescriptorId = value; } + set { SetBellSchedule(value); } + } + + private void SetBellSchedule(Entities.Common.EdFi.IBellSchedule value) + { + _bellSchedule = value; } + + /// + /// The dates for which the bell schedule applies. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime Date { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20016,7 +20108,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IBellScheduleDate; if (ReferenceEquals(this, compareTo)) return true; @@ -20024,9 +20116,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_bellSchedule == null || !_bellSchedule.Equals(compareTo.BellSchedule)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor).CharterApprovalAgencyTypeDescriptorId.Equals(compareTo.CharterApprovalAgencyTypeDescriptorId)) + + // Standard Property + if (!(this as Entities.Common.EdFi.IBellScheduleDate).Date.Equals(compareTo.Date)) return false; @@ -20042,9 +20138,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_bellSchedule != null) + hash.Add(_bellSchedule); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor).CharterApprovalAgencyTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IBellScheduleDate).Date); return hash.ToHashCode(); } @@ -20053,55 +20152,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20127,11 +20177,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellScheduleDate")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20142,13 +20189,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -20161,12 +20201,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CharterApprovalAgencyTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target); + return Entities.Common.EdFi.BellScheduleDateMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellScheduleDate)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CharterApprovalAgencyTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target, null); + Entities.Common.EdFi.BellScheduleDateMapper.MapTo(this, (Entities.Common.EdFi.IBellScheduleDate)target, null); } // ------------------------------------------------------------- @@ -20174,6 +20214,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -20181,9 +20281,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CharterApprovalAgencyTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class BellScheduleDatePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -20211,22 +20311,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CharterStatusDescriptor table of the CharterStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.BellScheduleGradeLevel table of the BellSchedule aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CharterStatusDescriptor : Entities.Common.EdFi.ICharterStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class BellScheduleGradeLevel : Entities.Common.EdFi.IBellScheduleGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CharterStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "BellScheduleGradeLevel"); // Fluent validator instance (threadsafe) - private static CharterStatusDescriptorPutPostRequestValidator _validator = new CharterStatusDescriptorPutPostRequestValidator(); + private static BellScheduleGradeLevelPutPostRequestValidator _validator = new BellScheduleGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -20243,13 +20338,6 @@ public class CharterStatusDescriptor : Entities.Common.EdFi.ICharterStatusDescri // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CharterStatusDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -20260,19 +20348,33 @@ public class CharterStatusDescriptor : Entities.Common.EdFi.ICharterStatusDescri //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IBellSchedule _bellSchedule; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CharterStatusDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IBellSchedule IBellScheduleGradeLevel.BellSchedule + { + get { return _bellSchedule; } + set { SetBellSchedule(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IBellSchedule BellSchedule { - get { return CharterStatusDescriptorId; } - set { CharterStatusDescriptorId = value; } + set { SetBellSchedule(value); } + } + + private void SetBellSchedule(Entities.Common.EdFi.IBellSchedule value) + { + _bellSchedule = value; } + + /// + /// The grade levels the particular bell schedule applies to. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20287,7 +20389,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICharterStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IBellScheduleGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -20295,9 +20397,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_bellSchedule == null || !_bellSchedule.Equals(compareTo.BellSchedule)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICharterStatusDescriptor).CharterStatusDescriptorId.Equals(compareTo.CharterStatusDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IBellScheduleGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -20313,9 +20419,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_bellSchedule != null) + hash.Add(_bellSchedule); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICharterStatusDescriptor).CharterStatusDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IBellScheduleGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -20324,55 +20433,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20398,11 +20458,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "BellSchedule", "BellScheduleGradeLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20413,13 +20470,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -20432,12 +20482,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CharterStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICharterStatusDescriptor)target); + return Entities.Common.EdFi.BellScheduleGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBellScheduleGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CharterStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICharterStatusDescriptor)target, null); + Entities.Common.EdFi.BellScheduleGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IBellScheduleGradeLevel)target, null); } // ------------------------------------------------------------- @@ -20445,6 +20495,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -20452,9 +20562,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CharterStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class BellScheduleGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -20483,25 +20593,296 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ChartOfAccount resource. + /// A class which represents the edfi.BusRouteDescriptor table of the BusRouteDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class BusRouteDescriptor : Entities.Common.EdFi.IBusRouteDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "BusRouteDescriptor"); + + // Fluent validator instance (threadsafe) + private static BusRouteDescriptorPutPostRequestValidator _validator = new BusRouteDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the BusRouteDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int BusRouteDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return BusRouteDescriptorId; } + set { BusRouteDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IBusRouteDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IBusRouteDescriptor).BusRouteDescriptorId.Equals(compareTo.BusRouteDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IBusRouteDescriptor).BusRouteDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.BusRouteDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IBusRouteDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.BusRouteDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IBusRouteDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class BusRouteDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: Calendar + +namespace EdFi.Ods.Api.Common.Models.Resources.Calendar.EdFi +{ + /// + /// Represents a reference to the Calendar resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class ChartOfAccountReference : IResourceReference + public class CalendarReference : IResourceReference { - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } + [DataMember(Name="calendarCode")] + public string CalendarCode { get; set; } - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -20539,24 +20920,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AccountIdentifier != default(string) && EducationOrganizationId != default(long) && FiscalYear != default(int); + return CalendarCode != default(string) && SchoolId != default(long) && SchoolYear != default(short); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (AccountIdentifier == default) + if (CalendarCode == default) { - yield return "AccountIdentifier"; + yield return "CalendarCode"; } - if (EducationOrganizationId == default) + if (SchoolId == default) { - yield return "EducationOrganizationId"; + yield return "SchoolId"; } - if (FiscalYear == default) + if (SchoolYear == default) { - yield return "FiscalYear"; + yield return "SchoolYear"; } } @@ -20565,8 +20946,8 @@ private Link CreateLink() { var link = new Link { - Rel = "ChartOfAccount", - Href = $"/ed-fi/chartOfAccounts/{ResourceId:n}" + Rel = "Calendar", + Href = $"/ed-fi/calendars/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -20593,17 +20974,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.ChartOfAccount table of the ChartOfAccount aggregate in the ODS Database. + /// A class which represents the edfi.Calendar table of the Calendar aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class ChartOfAccount : Entities.Common.EdFi.IChartOfAccount, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class Calendar : Entities.Common.EdFi.ICalendar, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ChartOfAccount"); + private static FullName _fullName = new FullName("edfi", "Calendar"); // Fluent validator instance (threadsafe) - private static ChartOfAccountPutPostRequestValidator _validator = new ChartOfAccountPutPostRequestValidator(); + private static CalendarPutPostRequestValidator _validator = new CalendarPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -20614,9 +20994,9 @@ public class ChartOfAccount : Entities.Common.EdFi.IChartOfAccount, IHasETag, ID // Constructor // ------------------------------------------------------------- - public ChartOfAccount() + public Calendar() { - ChartOfAccountReportingTags = new List(); + CalendarGradeLevels = new List(); } // ------------------------------------------------------------ @@ -20626,7 +21006,7 @@ public ChartOfAccount() // ------------------------------------------------------------ /// - /// The unique identifier for the ChartOfAccount resource. + /// The unique identifier for the Calendar resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -20637,301 +21017,70 @@ public ChartOfAccount() // References // ------------------------------------------------------------- - private bool _balanceSheetDimensionReferenceExplicitlyAssigned; - private BalanceSheetDimension.EdFi.BalanceSheetDimensionReference _balanceSheetDimensionReference; - private BalanceSheetDimension.EdFi.BalanceSheetDimensionReference ImplicitBalanceSheetDimensionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_balanceSheetDimensionReference == null && !_balanceSheetDimensionReferenceExplicitlyAssigned) - _balanceSheetDimensionReference = new BalanceSheetDimension.EdFi.BalanceSheetDimensionReference(); - - return _balanceSheetDimensionReference; - } - } - - [DataMember(Name="balanceSheetDimensionReference")] - [FullyDefinedReference] - public BalanceSheetDimension.EdFi.BalanceSheetDimensionReference BalanceSheetDimensionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitBalanceSheetDimensionReference != null - && (_balanceSheetDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitBalanceSheetDimensionReference.IsReferenceFullyDefined())) - return ImplicitBalanceSheetDimensionReference; - - return null; - } - set - { - _balanceSheetDimensionReferenceExplicitlyAssigned = true; - _balanceSheetDimensionReference = value; - } - } - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); - return _educationOrganizationReference; + return _schoolReference; } } - [DataMember(Name="educationOrganizationReference")] + [DataMember(Name="schoolReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } - private bool _functionDimensionReferenceExplicitlyAssigned; - private FunctionDimension.EdFi.FunctionDimensionReference _functionDimensionReference; - private FunctionDimension.EdFi.FunctionDimensionReference ImplicitFunctionDimensionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_functionDimensionReference == null && !_functionDimensionReferenceExplicitlyAssigned) - _functionDimensionReference = new FunctionDimension.EdFi.FunctionDimensionReference(); - - return _functionDimensionReference; - } - } - - [DataMember(Name="functionDimensionReference")] - [FullyDefinedReference] - public FunctionDimension.EdFi.FunctionDimensionReference FunctionDimensionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitFunctionDimensionReference != null - && (_functionDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitFunctionDimensionReference.IsReferenceFullyDefined())) - return ImplicitFunctionDimensionReference; - - return null; - } - set - { - _functionDimensionReferenceExplicitlyAssigned = true; - _functionDimensionReference = value; - } - } - private bool _fundDimensionReferenceExplicitlyAssigned; - private FundDimension.EdFi.FundDimensionReference _fundDimensionReference; - private FundDimension.EdFi.FundDimensionReference ImplicitFundDimensionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_fundDimensionReference == null && !_fundDimensionReferenceExplicitlyAssigned) - _fundDimensionReference = new FundDimension.EdFi.FundDimensionReference(); - - return _fundDimensionReference; - } - } - - [DataMember(Name="fundDimensionReference")] - [FullyDefinedReference] - public FundDimension.EdFi.FundDimensionReference FundDimensionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitFundDimensionReference != null - && (_fundDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitFundDimensionReference.IsReferenceFullyDefined())) - return ImplicitFundDimensionReference; - - return null; - } - set - { - _fundDimensionReferenceExplicitlyAssigned = true; - _fundDimensionReference = value; - } - } - private bool _objectDimensionReferenceExplicitlyAssigned; - private ObjectDimension.EdFi.ObjectDimensionReference _objectDimensionReference; - private ObjectDimension.EdFi.ObjectDimensionReference ImplicitObjectDimensionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_objectDimensionReference == null && !_objectDimensionReferenceExplicitlyAssigned) - _objectDimensionReference = new ObjectDimension.EdFi.ObjectDimensionReference(); - - return _objectDimensionReference; - } - } - - [DataMember(Name="objectDimensionReference")] - [FullyDefinedReference] - public ObjectDimension.EdFi.ObjectDimensionReference ObjectDimensionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitObjectDimensionReference != null - && (_objectDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectDimensionReference.IsReferenceFullyDefined())) - return ImplicitObjectDimensionReference; - - return null; - } - set - { - _objectDimensionReferenceExplicitlyAssigned = true; - _objectDimensionReference = value; - } - } - private bool _operationalUnitDimensionReferenceExplicitlyAssigned; - private OperationalUnitDimension.EdFi.OperationalUnitDimensionReference _operationalUnitDimensionReference; - private OperationalUnitDimension.EdFi.OperationalUnitDimensionReference ImplicitOperationalUnitDimensionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_operationalUnitDimensionReference == null && !_operationalUnitDimensionReferenceExplicitlyAssigned) - _operationalUnitDimensionReference = new OperationalUnitDimension.EdFi.OperationalUnitDimensionReference(); - - return _operationalUnitDimensionReference; - } - } - - [DataMember(Name="operationalUnitDimensionReference")] - [FullyDefinedReference] - public OperationalUnitDimension.EdFi.OperationalUnitDimensionReference OperationalUnitDimensionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitOperationalUnitDimensionReference != null - && (_operationalUnitDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitOperationalUnitDimensionReference.IsReferenceFullyDefined())) - return ImplicitOperationalUnitDimensionReference; - - return null; - } - set - { - _operationalUnitDimensionReferenceExplicitlyAssigned = true; - _operationalUnitDimensionReference = value; - } - } - private bool _programDimensionReferenceExplicitlyAssigned; - private ProgramDimension.EdFi.ProgramDimensionReference _programDimensionReference; - private ProgramDimension.EdFi.ProgramDimensionReference ImplicitProgramDimensionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programDimensionReference == null && !_programDimensionReferenceExplicitlyAssigned) - _programDimensionReference = new ProgramDimension.EdFi.ProgramDimensionReference(); - - return _programDimensionReference; - } - } - - [DataMember(Name="programDimensionReference")] - [FullyDefinedReference] - public ProgramDimension.EdFi.ProgramDimensionReference ProgramDimensionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramDimensionReference != null - && (_programDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramDimensionReference.IsReferenceFullyDefined())) - return ImplicitProgramDimensionReference; - - return null; - } - set - { - _programDimensionReferenceExplicitlyAssigned = true; - _programDimensionReference = value; - } - } - private bool _projectDimensionReferenceExplicitlyAssigned; - private ProjectDimension.EdFi.ProjectDimensionReference _projectDimensionReference; - private ProjectDimension.EdFi.ProjectDimensionReference ImplicitProjectDimensionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_projectDimensionReference == null && !_projectDimensionReferenceExplicitlyAssigned) - _projectDimensionReference = new ProjectDimension.EdFi.ProjectDimensionReference(); - - return _projectDimensionReference; - } - } - - [DataMember(Name="projectDimensionReference")] - [FullyDefinedReference] - public ProjectDimension.EdFi.ProjectDimensionReference ProjectDimensionReference + public School.EdFi.SchoolReference SchoolReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProjectDimensionReference != null - && (_projectDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProjectDimensionReference.IsReferenceFullyDefined())) - return ImplicitProjectDimensionReference; + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; return null; } set { - _projectDimensionReferenceExplicitlyAssigned = true; - _projectDimensionReference = value; + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; } } - private bool _sourceDimensionReferenceExplicitlyAssigned; - private SourceDimension.EdFi.SourceDimensionReference _sourceDimensionReference; - private SourceDimension.EdFi.SourceDimensionReference ImplicitSourceDimensionReference + private bool _schoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sourceDimensionReference == null && !_sourceDimensionReferenceExplicitlyAssigned) - _sourceDimensionReference = new SourceDimension.EdFi.SourceDimensionReference(); + if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) + _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - return _sourceDimensionReference; + return _schoolYearTypeReference; } } - [DataMember(Name="sourceDimensionReference")] - [FullyDefinedReference] - public SourceDimension.EdFi.SourceDimensionReference SourceDimensionReference + [DataMember(Name="schoolYearTypeReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSourceDimensionReference != null - && (_sourceDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSourceDimensionReference.IsReferenceFullyDefined())) - return ImplicitSourceDimensionReference; + if (ImplicitSchoolYearTypeReference != null + && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference; return null; } set { - _sourceDimensionReferenceExplicitlyAssigned = true; - _sourceDimensionReference = value; + _schoolYearTypeReferenceExplicitlyAssigned = true; + _schoolYearTypeReference = value; } } // ------------------------------------------------------------- @@ -20941,25 +21090,25 @@ public SourceDimension.EdFi.SourceDimensionReference SourceDimensionReference // ------------------------------------------------------------- /// - /// SEA populated code value for the valid combination of account dimensions under which financials are reported. + /// The identifier for the calendar. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="calendarCode")] + public string CalendarCode { get; set; } /// - /// The identifier assigned to an education organization. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IChartOfAccount.EducationOrganizationId + long Entities.Common.EdFi.ICalendar.SchoolId { get { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; return default(long); } @@ -20968,66 +21117,34 @@ long Entities.Common.EdFi.IChartOfAccount.EducationOrganizationId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; } } - private int _fiscalYear; - private bool _fiscalYearExplicitlyAssigned = false; - /// - /// The fiscal year for the account + /// The identifier for the school year associated with the calendar. /// // IS in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear + short Entities.Common.EdFi.ICalendar.SchoolYear { get { - return _fiscalYear; + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference.SchoolYear; + + return default(short); } set { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // BalanceSheetDimension - _balanceSheetDimensionReferenceExplicitlyAssigned = false; - ImplicitBalanceSheetDimensionReference.FiscalYear = value; - - // FunctionDimension - _functionDimensionReferenceExplicitlyAssigned = false; - ImplicitFunctionDimensionReference.FiscalYear = value; - - // FundDimension - _fundDimensionReferenceExplicitlyAssigned = false; - ImplicitFundDimensionReference.FiscalYear = value; - - // ObjectDimension - _objectDimensionReferenceExplicitlyAssigned = false; - ImplicitObjectDimensionReference.FiscalYear = value; - - // OperationalUnitDimension - _operationalUnitDimensionReferenceExplicitlyAssigned = false; - ImplicitOperationalUnitDimensionReference.FiscalYear = value; - - // ProgramDimension - _programDimensionReferenceExplicitlyAssigned = false; - ImplicitProgramDimensionReference.FiscalYear = value; - - // ProjectDimension - _projectDimensionReferenceExplicitlyAssigned = false; - ImplicitProjectDimensionReference.FiscalYear = value; - - // SourceDimension - _sourceDimensionReferenceExplicitlyAssigned = false; - ImplicitSourceDimensionReference.FiscalYear = value; + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value; } } // ------------------------------------------------------------- @@ -21044,7 +21161,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IChartOfAccount; + var compareTo = obj as Entities.Common.EdFi.ICalendar; if (ReferenceEquals(this, compareTo)) return true; @@ -21054,17 +21171,17 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IChartOfAccount).AccountIdentifier, compareTo.AccountIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICalendar).CalendarCode, compareTo.CalendarCode)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IChartOfAccount).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!(this as Entities.Common.EdFi.ICalendar).SchoolId.Equals(compareTo.SchoolId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IChartOfAccount).FiscalYear.Equals(compareTo.FiscalYear)) + if (!(this as Entities.Common.EdFi.ICalendar).SchoolYear.Equals(compareTo.SchoolYear)) return false; @@ -21082,14 +21199,14 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IChartOfAccount).AccountIdentifier); + hash.Add((this as Entities.Common.EdFi.ICalendar).CalendarCode); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IChartOfAccount).EducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.ICalendar).SchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IChartOfAccount).FiscalYear); + hash.Add((this as Entities.Common.EdFi.ICalendar).SchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -21104,247 +21221,15 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A descriptive name for the account. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="accountName")] - public string AccountName { get; set; } - - /// - /// The type of account used in accounting such as revenue, expenditure, or balance sheet. + /// Indicates the type of calendar. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="accountTypeDescriptor")][DescriptorExists("AccountTypeDescriptor")] - public string AccountTypeDescriptor { get; set; } - - /// - /// The code representation of the account balance sheet dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.BalanceSheetCode - { - get - { - if (ImplicitBalanceSheetDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitBalanceSheetDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitBalanceSheetDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // BalanceSheetDimension - _balanceSheetDimensionReferenceExplicitlyAssigned = false; - ImplicitBalanceSheetDimensionReference.Code = value; - } - } - - /// - /// The code representation of the account function dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.FunctionCode - { - get - { - if (ImplicitFunctionDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitFunctionDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitFunctionDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // FunctionDimension - _functionDimensionReferenceExplicitlyAssigned = false; - ImplicitFunctionDimensionReference.Code = value; - } - } - - /// - /// The code representation of the account fund dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.FundCode - { - get - { - if (ImplicitFundDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitFundDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitFundDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // FundDimension - _fundDimensionReferenceExplicitlyAssigned = false; - ImplicitFundDimensionReference.Code = value; - } - } - - /// - /// The code representation of the account object dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.ObjectCode - { - get - { - if (ImplicitObjectDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitObjectDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitObjectDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ObjectDimension - _objectDimensionReferenceExplicitlyAssigned = false; - ImplicitObjectDimensionReference.Code = value; - } - } - - /// - /// The code representation of the account operational unit dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.OperationalUnitCode - { - get - { - if (ImplicitOperationalUnitDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitOperationalUnitDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitOperationalUnitDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // OperationalUnitDimension - _operationalUnitDimensionReferenceExplicitlyAssigned = false; - ImplicitOperationalUnitDimensionReference.Code = value; - } - } - - /// - /// The code representation of the account program dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.ProgramCode - { - get - { - if (ImplicitProgramDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitProgramDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProgramDimension - _programDimensionReferenceExplicitlyAssigned = false; - ImplicitProgramDimensionReference.Code = value; - } - } - - /// - /// The code representation of the account project dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.ProjectCode - { - get - { - if (ImplicitProjectDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProjectDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitProjectDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProjectDimension - _projectDimensionReferenceExplicitlyAssigned = false; - ImplicitProjectDimensionReference.Code = value; - } - } - - /// - /// The code representation of the account source dimension. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IChartOfAccount.SourceCode - { - get - { - if (ImplicitSourceDimensionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSourceDimensionReference.IsReferenceFullyDefined())) - { - return ImplicitSourceDimensionReference.Code; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // SourceDimension - _sourceDimensionReferenceExplicitlyAssigned = false; - ImplicitSourceDimensionReference.Code = value; - } - } + [DataMember(Name="calendarTypeDescriptor")][DescriptorExists("CalendarTypeDescriptor")] + public string CalendarTypeDescriptor { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -21363,41 +21248,41 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ChartOfAccount", "ChartOfAccount")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Calendar", "Calendar")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _chartOfAccountReportingTags; - private ICollection _chartOfAccountReportingTagsCovariant; + private ICollection _calendarGradeLevels; + private ICollection _calendarGradeLevelsCovariant; [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection ChartOfAccountReportingTags + [DataMember(Name="gradeLevels")] + public ICollection CalendarGradeLevels { - get { return _chartOfAccountReportingTags; } + get { return _calendarGradeLevels; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IChartOfAccountReportingTag)e.Item).ChartOfAccount = this); - _chartOfAccountReportingTags = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICalendarGradeLevel)e.Item).Calendar = this); + _calendarGradeLevels = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IChartOfAccountReportingTag)e.Item).ChartOfAccount = this; - _chartOfAccountReportingTagsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICalendarGradeLevel)e.Item).Calendar = this; + _calendarGradeLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IChartOfAccount.ChartOfAccountReportingTags + ICollection Entities.Common.EdFi.ICalendar.CalendarGradeLevels { - get { return _chartOfAccountReportingTagsCovariant; } - set { ChartOfAccountReportingTags = new List(value.Cast()); } + get { return _calendarGradeLevelsCovariant; } + set { CalendarGradeLevels = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -21422,9 +21307,9 @@ public ICollection ChartOfAccountReportingTags internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_chartOfAccountReportingTags != null) foreach (var item in _chartOfAccountReportingTags) + if (_calendarGradeLevels != null) foreach (var item in _calendarGradeLevels) { - item.ChartOfAccount = this; + item.Calendar = this; } } @@ -21435,173 +21320,61 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ChartOfAccountMapper.SynchronizeTo(this, (Entities.Common.EdFi.IChartOfAccount)target); + return Entities.Common.EdFi.CalendarMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendar)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ChartOfAccountMapper.MapTo(this, (Entities.Common.EdFi.IChartOfAccount)target, null); + Entities.Common.EdFi.CalendarMapper.MapTo(this, (Entities.Common.EdFi.ICalendar)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionResourceId - { - get { return null; } - set { ImplicitBalanceSheetDimensionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionDiscriminator + Guid? Entities.Common.EdFi.ICalendar.SchoolResourceId { - // Not supported for Resources get { return null; } - set { ImplicitBalanceSheetDimensionReference.Discriminator = value; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } } - Guid? Entities.Common.EdFi.IChartOfAccount.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.EducationOrganizationDiscriminator + Guid? Entities.Common.EdFi.ICalendar.SchoolYearTypeResourceId { - // Not supported for Resources get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } + set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } } - Guid? Entities.Common.EdFi.IChartOfAccount.FunctionDimensionResourceId - { - get { return null; } - set { ImplicitFunctionDimensionReference.ResourceId = value ?? default(Guid); } - } + // ----------------------------------------------------------------- - string Entities.Common.EdFi.IChartOfAccount.FunctionDimensionDiscriminator + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // Not supported for Resources - get { return null; } - set { ImplicitFunctionDimensionReference.Discriminator = value; } - } + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; - - Guid? Entities.Common.EdFi.IChartOfAccount.FundDimensionResourceId - { - get { return null; } - set { ImplicitFundDimensionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.FundDimensionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitFundDimensionReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IChartOfAccount.ObjectDimensionResourceId - { - get { return null; } - set { ImplicitObjectDimensionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.ObjectDimensionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitObjectDimensionReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionResourceId - { - get { return null; } - set { ImplicitOperationalUnitDimensionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitOperationalUnitDimensionReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IChartOfAccount.ProgramDimensionResourceId - { - get { return null; } - set { ImplicitProgramDimensionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.ProgramDimensionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitProgramDimensionReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IChartOfAccount.ProjectDimensionResourceId - { - get { return null; } - set { ImplicitProjectDimensionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.ProjectDimensionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitProjectDimensionReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IChartOfAccount.SourceDimensionResourceId - { - get { return null; } - set { ImplicitSourceDimensionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitSourceDimensionReference.Discriminator = value; } - } - - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (ChartOfAccountReportingTags.Any() && mappingContract?.IsMemberSupported("ChartOfAccountReportingTags") != false) + if (CalendarGradeLevels.Any() && mappingContract?.IsMemberSupported("CalendarGradeLevels") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("ChartOfAccountReportingTags"); + pathBuilder.Append("CalendarGradeLevels"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ChartOfAccountReportingTags, validationContext, validationContext.Items.ForCollection("ChartOfAccountReportingTags")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CalendarGradeLevels, validationContext, validationContext.Items.ForCollection("CalendarGradeLevels")))) { yield return result; } @@ -21626,96 +21399,6 @@ string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForFiscalYear = GetFiscalYearSources().ToArray(); - - if (!sourcesForFiscalYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForFiscalYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForFiscalYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'fiscalYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForFiscalYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, int value)> GetFiscalYearSources() - { - // Obtain value from the locally defined property - yield return ("FiscalYear", this.FiscalYear); - - // Obtain value from other references - var valueFromBalanceSheetDimensionReference = this.BalanceSheetDimensionReference?.FiscalYear; - - if (valueFromBalanceSheetDimensionReference != null) - { - yield return ("balanceSheetDimensionReference.fiscalYear", this.BalanceSheetDimensionReference.FiscalYear); - } - - // Obtain value from other references - var valueFromFunctionDimensionReference = this.FunctionDimensionReference?.FiscalYear; - - if (valueFromFunctionDimensionReference != null) - { - yield return ("functionDimensionReference.fiscalYear", this.FunctionDimensionReference.FiscalYear); - } - - // Obtain value from other references - var valueFromFundDimensionReference = this.FundDimensionReference?.FiscalYear; - - if (valueFromFundDimensionReference != null) - { - yield return ("fundDimensionReference.fiscalYear", this.FundDimensionReference.FiscalYear); - } - - // Obtain value from other references - var valueFromObjectDimensionReference = this.ObjectDimensionReference?.FiscalYear; - - if (valueFromObjectDimensionReference != null) - { - yield return ("objectDimensionReference.fiscalYear", this.ObjectDimensionReference.FiscalYear); - } - - // Obtain value from other references - var valueFromOperationalUnitDimensionReference = this.OperationalUnitDimensionReference?.FiscalYear; - - if (valueFromOperationalUnitDimensionReference != null) - { - yield return ("operationalUnitDimensionReference.fiscalYear", this.OperationalUnitDimensionReference.FiscalYear); - } - - // Obtain value from other references - var valueFromProgramDimensionReference = this.ProgramDimensionReference?.FiscalYear; - - if (valueFromProgramDimensionReference != null) - { - yield return ("programDimensionReference.fiscalYear", this.ProgramDimensionReference.FiscalYear); - } - - // Obtain value from other references - var valueFromProjectDimensionReference = this.ProjectDimensionReference?.FiscalYear; - - if (valueFromProjectDimensionReference != null) - { - yield return ("projectDimensionReference.fiscalYear", this.ProjectDimensionReference.FiscalYear); - } - - // Obtain value from other references - var valueFromSourceDimensionReference = this.SourceDimensionReference?.FiscalYear; - - if (valueFromSourceDimensionReference != null) - { - yield return ("sourceDimensionReference.fiscalYear", this.SourceDimensionReference.FiscalYear); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -21742,14 +21425,14 @@ string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ChartOfAccountPutPostRequestValidator : FluentValidation.AbstractValidator + public class CalendarPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ChartOfAccount = new FullName("edfi", "ChartOfAccount"); + private static readonly FullName _fullName_edfi_Calendar = new FullName("edfi", "Calendar"); // Declare collection item validators - private ChartOfAccountReportingTagPutPostRequestValidator _chartOfAccountReportingTagsValidator = new (); + private CalendarGradeLevelPutPostRequestValidator _calendarGradeLevelsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -21766,19 +21449,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsChartOfAccountReportingTagIncluded(x)); + var hasInvalidCalendarGradeLevelsItems = instance.CalendarGradeLevels.Any(x => !mappingContract.IsCalendarGradeLevelIncluded(x)); - if (hasInvalidChartOfAccountReportingTagsItems) + if (hasInvalidCalendarGradeLevelsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ChartOfAccountReportingTags", $"A supplied 'ChartOfAccountReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("CalendarGradeLevels", $"A supplied 'CalendarGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -21800,16 +21483,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ChartOfAccountReportingTag table of the ChartOfAccount aggregate in the ODS Database. + /// A class which represents the edfi.CalendarGradeLevel table of the Calendar aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ChartOfAccountReportingTag : Entities.Common.EdFi.IChartOfAccountReportingTag, IValidatableObject + public class CalendarGradeLevel : Entities.Common.EdFi.ICalendarGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ChartOfAccountReportingTag"); + private static FullName _fullName = new FullName("edfi", "CalendarGradeLevel"); // Fluent validator instance (threadsafe) - private static ChartOfAccountReportingTagPutPostRequestValidator _validator = new ChartOfAccountReportingTagPutPostRequestValidator(); + private static CalendarGradeLevelPutPostRequestValidator _validator = new CalendarGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -21836,33 +21519,33 @@ public class ChartOfAccountReportingTag : Entities.Common.EdFi.IChartOfAccountRe //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IChartOfAccount _chartOfAccount; + private Entities.Common.EdFi.ICalendar _calendar; [IgnoreDataMember] - Entities.Common.EdFi.IChartOfAccount IChartOfAccountReportingTag.ChartOfAccount + Entities.Common.EdFi.ICalendar ICalendarGradeLevel.Calendar { - get { return _chartOfAccount; } - set { SetChartOfAccount(value); } + get { return _calendar; } + set { SetCalendar(value); } } - public Entities.Common.EdFi.IChartOfAccount ChartOfAccount + public Entities.Common.EdFi.ICalendar Calendar { - set { SetChartOfAccount(value); } + set { SetCalendar(value); } } - private void SetChartOfAccount(Entities.Common.EdFi.IChartOfAccount value) + private void SetCalendar(Entities.Common.EdFi.ICalendar value) { - _chartOfAccount = value; + _calendar = value; } /// - /// A descriptor used at the dimension and/or chart of account levels to demote specific state needs for reporting. + /// Indicates the grade level associated with the calendar. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21877,7 +21560,7 @@ private void SetChartOfAccount(Entities.Common.EdFi.IChartOfAccount value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IChartOfAccountReportingTag; + var compareTo = obj as Entities.Common.EdFi.ICalendarGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -21886,12 +21569,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_chartOfAccount == null || !_chartOfAccount.Equals(compareTo.ChartOfAccount)) + if (_calendar == null || !_calendar.Equals(compareTo.Calendar)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IChartOfAccountReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICalendarGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -21908,11 +21591,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_chartOfAccount != null) - hash.Add(_chartOfAccount); + if (_calendar != null) + hash.Add(_calendar); // Standard Property - hash.Add((this as Entities.Common.EdFi.IChartOfAccountReportingTag).ReportingTagDescriptor); + hash.Add((this as Entities.Common.EdFi.ICalendarGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -21926,14 +21609,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The value associated with the reporting tag. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="tagValue")] - public string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21954,7 +21629,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ChartOfAccount", "ChartOfAccountReportingTag")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Calendar", "CalendarGradeLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -21978,12 +21653,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ChartOfAccountReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IChartOfAccountReportingTag)target); + return Entities.Common.EdFi.CalendarGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ChartOfAccountReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IChartOfAccountReportingTag)target, null); + Entities.Common.EdFi.CalendarGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICalendarGradeLevel)target, null); } // ------------------------------------------------------------- @@ -22058,280 +21733,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ChartOfAccountReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: CitizenshipStatusDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.CitizenshipStatusDescriptor.EdFi -{ - /// - /// A class which represents the edfi.CitizenshipStatusDescriptor table of the CitizenshipStatusDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CitizenshipStatusDescriptor : Entities.Common.EdFi.ICitizenshipStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "CitizenshipStatusDescriptor"); - - // Fluent validator instance (threadsafe) - private static CitizenshipStatusDescriptorPutPostRequestValidator _validator = new CitizenshipStatusDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the CitizenshipStatusDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CitizenshipStatusDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return CitizenshipStatusDescriptorId; } - set { CitizenshipStatusDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.ICitizenshipStatusDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.ICitizenshipStatusDescriptor).CitizenshipStatusDescriptorId.Equals(compareTo.CitizenshipStatusDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICitizenshipStatusDescriptor).CitizenshipStatusDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.CitizenshipStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICitizenshipStatusDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.CitizenshipStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICitizenshipStatusDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class CitizenshipStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CalendarGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -22360,23 +21764,29 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ClassPeriod resource. + /// Represents a reference to the CalendarDate resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class ClassPeriodReference : IResourceReference + public class CalendarDateReference : IResourceReference { - [DataMember(Name="classPeriodName")] - public string ClassPeriodName { get; set; } + [DataMember(Name="calendarCode")] + public string CalendarCode { get; set; } + + [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime Date { get; set; } [DataMember(Name="schoolId")] public long SchoolId { get; set; } + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + /// /// Gets or sets the resource identifier of the referenced resource. /// @@ -22413,14 +21823,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return ClassPeriodName != default(string) && SchoolId != default(long); + return CalendarCode != default(string) && Date != default(DateTime) && SchoolId != default(long) && SchoolYear != default(short); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (ClassPeriodName == default) + if (CalendarCode == default) { - yield return "ClassPeriodName"; + yield return "CalendarCode"; + } + + if (Date == default) + { + yield return "Date"; } if (SchoolId == default) @@ -22428,14 +21843,19 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "SchoolId"; } + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + } private Link CreateLink() { var link = new Link { - Rel = "ClassPeriod", - Href = $"/ed-fi/classPeriods/{ResourceId:n}" + Rel = "CalendarDate", + Href = $"/ed-fi/calendarDates/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -22462,16 +21882,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.ClassPeriod table of the ClassPeriod aggregate in the ODS Database. + /// A class which represents the edfi.CalendarDate table of the CalendarDate aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ClassPeriod : Entities.Common.EdFi.IClassPeriod, IHasETag, IDateVersionedEntity, IValidatableObject + public class CalendarDate : Entities.Common.EdFi.ICalendarDate, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ClassPeriod"); + private static FullName _fullName = new FullName("edfi", "CalendarDate"); // Fluent validator instance (threadsafe) - private static ClassPeriodPutPostRequestValidator _validator = new ClassPeriodPutPostRequestValidator(); + private static CalendarDatePutPostRequestValidator _validator = new CalendarDatePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -22482,9 +21902,9 @@ public class ClassPeriod : Entities.Common.EdFi.IClassPeriod, IHasETag, IDateVer // Constructor // ------------------------------------------------------------- - public ClassPeriod() + public CalendarDate() { - ClassPeriodMeetingTimes = new List(); + CalendarDateCalendarEvents = new List(); } // ------------------------------------------------------------ @@ -22494,7 +21914,7 @@ public ClassPeriod() // ------------------------------------------------------------ /// - /// The unique identifier for the ClassPeriod resource. + /// The unique identifier for the CalendarDate resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -22505,37 +21925,37 @@ public ClassPeriod() // References // ------------------------------------------------------------- - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference + private bool _calendarReferenceExplicitlyAssigned; + private Calendar.EdFi.CalendarReference _calendarReference; + private Calendar.EdFi.CalendarReference ImplicitCalendarReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); + if (_calendarReference == null && !_calendarReferenceExplicitlyAssigned) + _calendarReference = new Calendar.EdFi.CalendarReference(); - return _schoolReference; + return _calendarReference; } } - [DataMember(Name="schoolReference")] + [DataMember(Name="calendarReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference + public Calendar.EdFi.CalendarReference CalendarReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; + if (ImplicitCalendarReference != null + && (_calendarReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) + return ImplicitCalendarReference; return null; } set { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; + _calendarReferenceExplicitlyAssigned = true; + _calendarReference = value; } } // ------------------------------------------------------------- @@ -22545,25 +21965,49 @@ public School.EdFi.SchoolReference SchoolReference // ------------------------------------------------------------- /// - /// An indication of the portion of a typical daily session in which students receive instruction in a specified subject (e.g., morning, sixth period, block period, or AB schedules). + /// The identifier for the calendar. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICalendarDate.CalendarCode + { + get + { + if (ImplicitCalendarReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) + return ImplicitCalendarReference.CalendarCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Calendar + _calendarReferenceExplicitlyAssigned = false; + ImplicitCalendarReference.CalendarCode = value; + } + } + + /// + /// The month, day, and year of the calendar event. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="classPeriodName")] - public string ClassPeriodName { get; set; } + [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime Date { get; set; } /// /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IClassPeriod.SchoolId + long Entities.Common.EdFi.ICalendarDate.SchoolId { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + if (ImplicitCalendarReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) + return ImplicitCalendarReference.SchoolId; return default(long); } @@ -22572,9 +22016,34 @@ long Entities.Common.EdFi.IClassPeriod.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; + // Calendar + _calendarReferenceExplicitlyAssigned = false; + ImplicitCalendarReference.SchoolId = value; + } + } + + /// + /// The identifier for the school year associated with the calendar. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.ICalendarDate.SchoolYear + { + get + { + if (ImplicitCalendarReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) + return ImplicitCalendarReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Calendar + _calendarReferenceExplicitlyAssigned = false; + ImplicitCalendarReference.SchoolYear = value; } } // ------------------------------------------------------------- @@ -22591,7 +22060,7 @@ long Entities.Common.EdFi.IClassPeriod.SchoolId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IClassPeriod; + var compareTo = obj as Entities.Common.EdFi.ICalendarDate; if (ReferenceEquals(this, compareTo)) return true; @@ -22600,13 +22069,23 @@ public override bool Equals(object obj) return false; + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICalendarDate).CalendarCode, compareTo.CalendarCode)) + return false; + + // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IClassPeriod).ClassPeriodName, compareTo.ClassPeriodName)) + if (!(this as Entities.Common.EdFi.ICalendarDate).Date.Equals(compareTo.Date)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IClassPeriod).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.ICalendarDate).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICalendarDate).SchoolYear.Equals(compareTo.SchoolYear)) return false; @@ -22623,12 +22102,18 @@ public override int GetHashCode() { var hash = new HashCode(); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICalendarDate).CalendarCode); + // Standard Property - hash.Add((this as Entities.Common.EdFi.IClassPeriod).ClassPeriodName); + hash.Add((this as Entities.Common.EdFi.ICalendarDate).Date); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IClassPeriod).SchoolId); + hash.Add((this as Entities.Common.EdFi.ICalendarDate).SchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICalendarDate).SchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -22641,13 +22126,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Indicator of whether this class period is used for official daily attendance. Alternatively, official daily attendance may be tied to a section. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="officialAttendancePeriod")] - public bool? OfficialAttendancePeriod { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -22668,41 +22146,41 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ClassPeriod", "ClassPeriod")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CalendarDate", "CalendarDate")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _classPeriodMeetingTimes; - private ICollection _classPeriodMeetingTimesCovariant; + private ICollection _calendarDateCalendarEvents; + private ICollection _calendarDateCalendarEventsCovariant; - [NoDuplicateMembers] - [DataMember(Name="meetingTimes")] - public ICollection ClassPeriodMeetingTimes + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="calendarEvents")] + public ICollection CalendarDateCalendarEvents { - get { return _classPeriodMeetingTimes; } + get { return _calendarDateCalendarEvents; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IClassPeriodMeetingTime)e.Item).ClassPeriod = this); - _classPeriodMeetingTimes = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICalendarDateCalendarEvent)e.Item).CalendarDate = this); + _calendarDateCalendarEvents = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IClassPeriodMeetingTime)e.Item).ClassPeriod = this; - _classPeriodMeetingTimesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICalendarDateCalendarEvent)e.Item).CalendarDate = this; + _calendarDateCalendarEventsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IClassPeriod.ClassPeriodMeetingTimes + ICollection Entities.Common.EdFi.ICalendarDate.CalendarDateCalendarEvents { - get { return _classPeriodMeetingTimesCovariant; } - set { ClassPeriodMeetingTimes = new List(value.Cast()); } + get { return _calendarDateCalendarEventsCovariant; } + set { CalendarDateCalendarEvents = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -22727,9 +22205,9 @@ public ICollection ClassPeriodMeetingTimes internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_classPeriodMeetingTimes != null) foreach (var item in _classPeriodMeetingTimes) + if (_calendarDateCalendarEvents != null) foreach (var item in _calendarDateCalendarEvents) { - item.ClassPeriod = this; + item.CalendarDate = this; } } @@ -22740,22 +22218,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ClassPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IClassPeriod)target); + return Entities.Common.EdFi.CalendarDateMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarDate)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ClassPeriodMapper.MapTo(this, (Entities.Common.EdFi.IClassPeriod)target, null); + Entities.Common.EdFi.CalendarDateMapper.MapTo(this, (Entities.Common.EdFi.ICalendarDate)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IClassPeriod.SchoolResourceId + Guid? Entities.Common.EdFi.ICalendarDate.CalendarResourceId { get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitCalendarReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitCalendarReference.Discriminator = value; } } @@ -22781,13 +22266,13 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (ClassPeriodMeetingTimes.Any() && mappingContract?.IsMemberSupported("ClassPeriodMeetingTimes") != false) + if (CalendarDateCalendarEvents.Any() && mappingContract?.IsMemberSupported("CalendarDateCalendarEvents") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("ClassPeriodMeetingTimes"); + pathBuilder.Append("CalendarDateCalendarEvents"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ClassPeriodMeetingTimes, validationContext, validationContext.Items.ForCollection("ClassPeriodMeetingTimes")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CalendarDateCalendarEvents, validationContext, validationContext.Items.ForCollection("CalendarDateCalendarEvents")))) { yield return result; } @@ -22838,14 +22323,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ClassPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class CalendarDatePutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ClassPeriod = new FullName("edfi", "ClassPeriod"); + private static readonly FullName _fullName_edfi_CalendarDate = new FullName("edfi", "CalendarDate"); // Declare collection item validators - private ClassPeriodMeetingTimePutPostRequestValidator _classPeriodMeetingTimesValidator = new (); + private CalendarDateCalendarEventPutPostRequestValidator _calendarDateCalendarEventsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -22862,19 +22347,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsClassPeriodMeetingTimeIncluded(x)); + var hasInvalidCalendarDateCalendarEventsItems = instance.CalendarDateCalendarEvents.Any(x => !mappingContract.IsCalendarDateCalendarEventIncluded(x)); - if (hasInvalidClassPeriodMeetingTimesItems) + if (hasInvalidCalendarDateCalendarEventsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ClassPeriodMeetingTimes", $"A supplied 'ClassPeriodMeetingTime' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("CalendarDateCalendarEvents", $"A supplied 'CalendarDateCalendarEvent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -22896,16 +22381,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ClassPeriodMeetingTime table of the ClassPeriod aggregate in the ODS Database. + /// A class which represents the edfi.CalendarDateCalendarEvent table of the CalendarDate aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ClassPeriodMeetingTime : Entities.Common.EdFi.IClassPeriodMeetingTime, IValidatableObject + public class CalendarDateCalendarEvent : Entities.Common.EdFi.ICalendarDateCalendarEvent, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ClassPeriodMeetingTime"); + private static FullName _fullName = new FullName("edfi", "CalendarDateCalendarEvent"); // Fluent validator instance (threadsafe) - private static ClassPeriodMeetingTimePutPostRequestValidator _validator = new ClassPeriodMeetingTimePutPostRequestValidator(); + private static CalendarDateCalendarEventPutPostRequestValidator _validator = new CalendarDateCalendarEventPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -22932,40 +22417,33 @@ public class ClassPeriodMeetingTime : Entities.Common.EdFi.IClassPeriodMeetingTi //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IClassPeriod _classPeriod; + private Entities.Common.EdFi.ICalendarDate _calendarDate; [IgnoreDataMember] - Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod + Entities.Common.EdFi.ICalendarDate ICalendarDateCalendarEvent.CalendarDate { - get { return _classPeriod; } - set { SetClassPeriod(value); } + get { return _calendarDate; } + set { SetCalendarDate(value); } } - public Entities.Common.EdFi.IClassPeriod ClassPeriod + public Entities.Common.EdFi.ICalendarDate CalendarDate { - set { SetClassPeriod(value); } + set { SetCalendarDate(value); } } - private void SetClassPeriod(Entities.Common.EdFi.IClassPeriod value) + private void SetCalendarDate(Entities.Common.EdFi.ICalendarDate value) { - _classPeriod = value; + _calendarDate = value; } /// - /// An indication of the time of day the meeting time ends. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="endTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan EndTime { get; set; } - - /// - /// An indication of the time of day the meeting time begins. + /// The type of scheduled or unscheduled event for the day. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="startTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan StartTime { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="calendarEventDescriptor")][DescriptorExists("CalendarEventDescriptor")] + public string CalendarEventDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -22980,7 +22458,7 @@ private void SetClassPeriod(Entities.Common.EdFi.IClassPeriod value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IClassPeriodMeetingTime; + var compareTo = obj as Entities.Common.EdFi.ICalendarDateCalendarEvent; if (ReferenceEquals(this, compareTo)) return true; @@ -22989,17 +22467,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_classPeriod == null || !_classPeriod.Equals(compareTo.ClassPeriod)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IClassPeriodMeetingTime).EndTime.Equals(compareTo.EndTime)) + if (_calendarDate == null || !_calendarDate.Equals(compareTo.CalendarDate)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.IClassPeriodMeetingTime).StartTime.Equals(compareTo.StartTime)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICalendarDateCalendarEvent).CalendarEventDescriptor, compareTo.CalendarEventDescriptor)) return false; @@ -23016,15 +22489,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_classPeriod != null) - hash.Add(_classPeriod); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IClassPeriodMeetingTime).EndTime); - + if (_calendarDate != null) + hash.Add(_calendarDate); // Standard Property - hash.Add((this as Entities.Common.EdFi.IClassPeriodMeetingTime).StartTime); + hash.Add((this as Entities.Common.EdFi.ICalendarDateCalendarEvent).CalendarEventDescriptor); return hash.ToHashCode(); } @@ -23058,7 +22527,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ClassPeriod", "ClassPeriodMeetingTime")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CalendarDate", "CalendarDateCalendarEvent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -23082,12 +22551,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ClassPeriodMeetingTimeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IClassPeriodMeetingTime)target); + return Entities.Common.EdFi.CalendarDateCalendarEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarDateCalendarEvent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ClassPeriodMeetingTimeMapper.MapTo(this, (Entities.Common.EdFi.IClassPeriodMeetingTime)target, null); + Entities.Common.EdFi.CalendarDateCalendarEventMapper.MapTo(this, (Entities.Common.EdFi.ICalendarDateCalendarEvent)target, null); } // ------------------------------------------------------------- @@ -23162,9 +22631,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ClassPeriodMeetingTimePutPostRequestValidator : FluentValidation.AbstractValidator + public class CalendarDateCalendarEventPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -23193,21 +22662,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ClassroomPositionDescriptor table of the ClassroomPositionDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CalendarEventDescriptor table of the CalendarEventDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ClassroomPositionDescriptor : Entities.Common.EdFi.IClassroomPositionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CalendarEventDescriptor : Entities.Common.EdFi.ICalendarEventDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ClassroomPositionDescriptor"); + private static FullName _fullName = new FullName("edfi", "CalendarEventDescriptor"); // Fluent validator instance (threadsafe) - private static ClassroomPositionDescriptorPutPostRequestValidator _validator = new ClassroomPositionDescriptorPutPostRequestValidator(); + private static CalendarEventDescriptorPutPostRequestValidator _validator = new CalendarEventDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -23226,7 +22695,7 @@ public class ClassroomPositionDescriptor : Entities.Common.EdFi.IClassroomPositi // ------------------------------------------------------------ /// - /// The unique identifier for the ClassroomPositionDescriptor resource. + /// The unique identifier for the CalendarEventDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -23247,12 +22716,12 @@ public class ClassroomPositionDescriptor : Entities.Common.EdFi.IClassroomPositi /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ClassroomPositionDescriptorId { get; set; } + public int CalendarEventDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ClassroomPositionDescriptorId; } - set { ClassroomPositionDescriptorId = value; } + get { return CalendarEventDescriptorId; } + set { CalendarEventDescriptorId = value; } } // ------------------------------------------------------------- @@ -23268,7 +22737,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IClassroomPositionDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICalendarEventDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -23278,7 +22747,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IClassroomPositionDescriptor).ClassroomPositionDescriptorId.Equals(compareTo.ClassroomPositionDescriptorId)) + if (!(this as Entities.Common.EdFi.ICalendarEventDescriptor).CalendarEventDescriptorId.Equals(compareTo.CalendarEventDescriptorId)) return false; @@ -23296,7 +22765,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IClassroomPositionDescriptor).ClassroomPositionDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICalendarEventDescriptor).CalendarEventDescriptorId); return hash.ToHashCode(); } @@ -23413,12 +22882,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ClassroomPositionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IClassroomPositionDescriptor)target); + return Entities.Common.EdFi.CalendarEventDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarEventDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ClassroomPositionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IClassroomPositionDescriptor)target, null); + Entities.Common.EdFi.CalendarEventDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICalendarEventDescriptor)target, null); } // ------------------------------------------------------------- @@ -23433,9 +22902,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ClassroomPositionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CalendarEventDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -23464,118 +22933,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Cohort resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class CohortReference : IResourceReference - { - [DataMember(Name="cohortIdentifier")] - public string CohortIdentifier { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return CohortIdentifier != default(string) && EducationOrganizationId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (CohortIdentifier == default) - { - yield return "CohortIdentifier"; - } - - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Cohort", - Href = $"/ed-fi/cohorts/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.Cohort table of the Cohort aggregate in the ODS Database. + /// A class which represents the edfi.CalendarTypeDescriptor table of the CalendarTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Cohort : Entities.Common.EdFi.ICohort, IHasETag, IDateVersionedEntity, IValidatableObject + public class CalendarTypeDescriptor : Entities.Common.EdFi.ICalendarTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "Cohort"); + private static FullName _fullName = new FullName("edfi", "CalendarTypeDescriptor"); // Fluent validator instance (threadsafe) - private static CohortPutPostRequestValidator _validator = new CohortPutPostRequestValidator(); + private static CalendarTypeDescriptorPutPostRequestValidator _validator = new CalendarTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -23586,10 +22958,6 @@ public class Cohort : Entities.Common.EdFi.ICohort, IHasETag, IDateVersionedEnti // Constructor // ------------------------------------------------------------- - public Cohort() - { - CohortPrograms = new List(); - } // ------------------------------------------------------------ @@ -23598,7 +22966,7 @@ public Cohort() // ------------------------------------------------------------ /// - /// The unique identifier for the Cohort resource. + /// The unique identifier for the CalendarTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -23608,40 +22976,6 @@ public Cohort() // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -23649,37 +22983,16 @@ public EducationOrganization.EdFi.EducationOrganizationReference EducationOrgani // ------------------------------------------------------------- /// - /// The name or ID for the cohort. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="cohortIdentifier")] - public string CohortIdentifier { get; set; } + [JsonIgnore] + public int CalendarTypeDescriptorId { get; set; } - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICohort.EducationOrganizationId + int IDescriptor.DescriptorId { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } + get { return CalendarTypeDescriptorId; } + set { CalendarTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -23695,7 +23008,7 @@ long Entities.Common.EdFi.ICohort.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICohort; + var compareTo = obj as Entities.Common.EdFi.ICalendarTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -23704,13 +23017,8 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICohort).CohortIdentifier, compareTo.CohortIdentifier)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICohort).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICalendarTypeDescriptor).CalendarTypeDescriptorId.Equals(compareTo.CalendarTypeDescriptorId)) return false; @@ -23727,12 +23035,9 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICohort).CohortIdentifier); - + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICalendarTypeDescriptor).CalendarTypeDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICohort).EducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -23740,532 +23045,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The academic subject associated with an academic intervention. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } /// - /// The description of the cohort and its purpose. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="cohortDescription")] - public string CohortDescription { get; set; } - - /// - /// The scope of cohort (e.g., school, district, classroom). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="cohortScopeDescriptor")][DescriptorExists("CohortScopeDescriptor")] - public string CohortScopeDescriptor { get; set; } - - /// - /// The type of cohort (e.g., academic intervention, classroom breakout). - /// - // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="cohortTypeDescriptor")][DescriptorExists("CohortTypeDescriptor")] - public string CohortTypeDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Cohort", "Cohort")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _cohortPrograms; - private ICollection _cohortProgramsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="programs")] - public ICollection CohortPrograms - { - get { return _cohortPrograms; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICohortProgram)e.Item).Cohort = this); - _cohortPrograms = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICohortProgram)e.Item).Cohort = this; - _cohortProgramsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICohort.CohortPrograms - { - get { return _cohortProgramsCovariant; } - set { CohortPrograms = new List(value.Cast()); } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_cohortPrograms != null) foreach (var item in _cohortPrograms) - { - item.Cohort = this; - } - - } - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.CohortMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohort)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.CohortMapper.MapTo(this, (Entities.Common.EdFi.ICohort)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICohort.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (CohortPrograms.Any() && mappingContract?.IsMemberSupported("CohortPrograms") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CohortPrograms"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CohortPrograms, validationContext, validationContext.Items.ForCollection("CohortPrograms")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class CohortPutPostRequestValidator : FluentValidation.AbstractValidator - { - private static readonly FullName _fullName_edfi_Cohort = new FullName("edfi", "Cohort"); - - // Declare collection item validators - private CohortProgramPutPostRequestValidator _cohortProgramsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (CohortMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Cohort); - - if (mappingContract != null) - { - if (mappingContract.IsCohortProgramIncluded != null) - { - var hasInvalidCohortProgramsItems = instance.CohortPrograms.Any(x => !mappingContract.IsCohortProgramIncluded(x)); - - if (hasInvalidCohortProgramsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CohortPrograms", $"A supplied 'CohortProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.CohortProgram table of the Cohort aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CohortProgram : Entities.Common.EdFi.ICohortProgram, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "CohortProgram"); - - // Fluent validator instance (threadsafe) - private static CohortProgramPutPostRequestValidator _validator = new CohortProgramPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - - private bool _programReferenceExplicitlyAssigned; - private Program.EdFi.ProgramReference _programReference; - private Program.EdFi.ProgramReference ImplicitProgramReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programReference == null && !_programReferenceExplicitlyAssigned) - _programReference = new Program.EdFi.ProgramReference(); - - return _programReference; - } - } - - [DataMember(Name="programReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Program.EdFi.ProgramReference ProgramReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramReference != null - && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference; - - return null; - } - set - { - _programReferenceExplicitlyAssigned = true; - _programReference = value; - } - } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.ICohort _cohort; - - [IgnoreDataMember] - Entities.Common.EdFi.ICohort ICohortProgram.Cohort - { - get { return _cohort; } - set { SetCohort(value); } - } - - public Entities.Common.EdFi.ICohort Cohort - { - set { SetCohort(value); } - } - - private void SetCohort(Entities.Common.EdFi.ICohort value) - { - _cohort = value; - } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The identifier assigned to an education organization. + /// The description of the descriptor. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICohortProgram.ProgramEducationOrganizationId - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.EducationOrganizationId = value; - } - } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICohortProgram.ProgramName - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.ProgramName = value; - } - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The type of program. + /// The end date of the period when the descriptor is in effect. /// - - // IS in a reference (CohortProgram.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.ICohortProgram.ProgramTypeDescriptor - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramReference.ProgramTypeDescriptor = value; - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// Determines equality based on the natural key properties of the resource. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.ICohortProgram; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_cohort == null || !_cohort.Equals(compareTo.Cohort)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICohortProgram).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICohortProgram).ProgramName, compareTo.ProgramName)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICohortProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) - return false; - - - return true; - } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// Builds the hash code based on the unique identifying values. + /// A shortened description for the descriptor. /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_cohort != null) - hash.Add(_cohort); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICohortProgram).ProgramEducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICohortProgram).ProgramName); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.ICohortProgram).ProgramTypeDescriptor); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24291,8 +23119,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Cohort", "CohortProgram")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -24303,6 +23134,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -24315,93 +23153,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CohortProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortProgram)target); + return Entities.Common.EdFi.CalendarTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICalendarTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CohortProgramMapper.MapTo(this, (Entities.Common.EdFi.ICohortProgram)target, null); + Entities.Common.EdFi.CalendarTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICalendarTypeDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICohortProgram.ProgramResourceId - { - get { return null; } - set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitProgramReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -24409,9 +23173,9 @@ string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CohortProgramPutPostRequestValidator : FluentValidation.AbstractValidator + public class CalendarTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -24440,21 +23204,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CohortScopeDescriptor table of the CohortScopeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CareerPathwayDescriptor table of the CareerPathwayDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CohortScopeDescriptor : Entities.Common.EdFi.ICohortScopeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CareerPathwayDescriptor : Entities.Common.EdFi.ICareerPathwayDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CohortScopeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CareerPathwayDescriptor"); // Fluent validator instance (threadsafe) - private static CohortScopeDescriptorPutPostRequestValidator _validator = new CohortScopeDescriptorPutPostRequestValidator(); + private static CareerPathwayDescriptorPutPostRequestValidator _validator = new CareerPathwayDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -24473,7 +23237,7 @@ public class CohortScopeDescriptor : Entities.Common.EdFi.ICohortScopeDescriptor // ------------------------------------------------------------ /// - /// The unique identifier for the CohortScopeDescriptor resource. + /// The unique identifier for the CareerPathwayDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -24494,12 +23258,12 @@ public class CohortScopeDescriptor : Entities.Common.EdFi.ICohortScopeDescriptor /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CohortScopeDescriptorId { get; set; } + public int CareerPathwayDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CohortScopeDescriptorId; } - set { CohortScopeDescriptorId = value; } + get { return CareerPathwayDescriptorId; } + set { CareerPathwayDescriptorId = value; } } // ------------------------------------------------------------- @@ -24515,7 +23279,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICohortScopeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICareerPathwayDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -24525,7 +23289,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICohortScopeDescriptor).CohortScopeDescriptorId.Equals(compareTo.CohortScopeDescriptorId)) + if (!(this as Entities.Common.EdFi.ICareerPathwayDescriptor).CareerPathwayDescriptorId.Equals(compareTo.CareerPathwayDescriptorId)) return false; @@ -24543,7 +23307,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICohortScopeDescriptor).CohortScopeDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICareerPathwayDescriptor).CareerPathwayDescriptorId); return hash.ToHashCode(); } @@ -24660,12 +23424,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CohortScopeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortScopeDescriptor)target); + return Entities.Common.EdFi.CareerPathwayDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICareerPathwayDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CohortScopeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICohortScopeDescriptor)target, null); + Entities.Common.EdFi.CareerPathwayDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICareerPathwayDescriptor)target, null); } // ------------------------------------------------------------- @@ -24680,9 +23444,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CohortScopeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CareerPathwayDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -24711,21 +23475,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CohortTypeDescriptor table of the CohortTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CharterApprovalAgencyTypeDescriptor table of the CharterApprovalAgencyTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CohortTypeDescriptor : Entities.Common.EdFi.ICohortTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CharterApprovalAgencyTypeDescriptor : Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CohortTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CharterApprovalAgencyTypeDescriptor"); // Fluent validator instance (threadsafe) - private static CohortTypeDescriptorPutPostRequestValidator _validator = new CohortTypeDescriptorPutPostRequestValidator(); + private static CharterApprovalAgencyTypeDescriptorPutPostRequestValidator _validator = new CharterApprovalAgencyTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -24744,7 +23508,7 @@ public class CohortTypeDescriptor : Entities.Common.EdFi.ICohortTypeDescriptor, // ------------------------------------------------------------ /// - /// The unique identifier for the CohortTypeDescriptor resource. + /// The unique identifier for the CharterApprovalAgencyTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -24765,12 +23529,12 @@ public class CohortTypeDescriptor : Entities.Common.EdFi.ICohortTypeDescriptor, /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CohortTypeDescriptorId { get; set; } + public int CharterApprovalAgencyTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CohortTypeDescriptorId; } - set { CohortTypeDescriptorId = value; } + get { return CharterApprovalAgencyTypeDescriptorId; } + set { CharterApprovalAgencyTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -24786,7 +23550,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICohortTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -24796,7 +23560,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICohortTypeDescriptor).CohortTypeDescriptorId.Equals(compareTo.CohortTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor).CharterApprovalAgencyTypeDescriptorId.Equals(compareTo.CharterApprovalAgencyTypeDescriptorId)) return false; @@ -24814,7 +23578,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICohortTypeDescriptor).CohortTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor).CharterApprovalAgencyTypeDescriptorId); return hash.ToHashCode(); } @@ -24931,12 +23695,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CohortTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortTypeDescriptor)target); + return Entities.Common.EdFi.CharterApprovalAgencyTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CohortTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICohortTypeDescriptor)target, null); + Entities.Common.EdFi.CharterApprovalAgencyTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -24951,9 +23715,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CohortTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CharterApprovalAgencyTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -24982,21 +23746,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CohortYearTypeDescriptor table of the CohortYearTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CharterStatusDescriptor table of the CharterStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CohortYearTypeDescriptor : Entities.Common.EdFi.ICohortYearTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CharterStatusDescriptor : Entities.Common.EdFi.ICharterStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CohortYearTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CharterStatusDescriptor"); // Fluent validator instance (threadsafe) - private static CohortYearTypeDescriptorPutPostRequestValidator _validator = new CohortYearTypeDescriptorPutPostRequestValidator(); + private static CharterStatusDescriptorPutPostRequestValidator _validator = new CharterStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -25015,7 +23779,7 @@ public class CohortYearTypeDescriptor : Entities.Common.EdFi.ICohortYearTypeDesc // ------------------------------------------------------------ /// - /// The unique identifier for the CohortYearTypeDescriptor resource. + /// The unique identifier for the CharterStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -25036,12 +23800,12 @@ public class CohortYearTypeDescriptor : Entities.Common.EdFi.ICohortYearTypeDesc /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CohortYearTypeDescriptorId { get; set; } + public int CharterStatusDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CohortYearTypeDescriptorId; } - set { CohortYearTypeDescriptorId = value; } + get { return CharterStatusDescriptorId; } + set { CharterStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -25057,7 +23821,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICohortYearTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICharterStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -25067,7 +23831,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICohortYearTypeDescriptor).CohortYearTypeDescriptorId.Equals(compareTo.CohortYearTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.ICharterStatusDescriptor).CharterStatusDescriptorId.Equals(compareTo.CharterStatusDescriptorId)) return false; @@ -25085,7 +23849,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICohortYearTypeDescriptor).CohortYearTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICharterStatusDescriptor).CharterStatusDescriptorId); return hash.ToHashCode(); } @@ -25202,12 +23966,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CohortYearTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortYearTypeDescriptor)target); + return Entities.Common.EdFi.CharterStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICharterStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CohortYearTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICohortYearTypeDescriptor)target, null); + Entities.Common.EdFi.CharterStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICharterStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -25222,9 +23986,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CohortYearTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CharterStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -25253,25 +24017,37 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CommunityOrganization resource. + /// Represents a reference to the ChartOfAccount resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class CommunityOrganizationReference : IResourceReference + public class ChartOfAccountReference : IResourceReference { - [DataMember(Name="communityOrganizationId")] - public long CommunityOrganizationId { get; set; } + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. /// public Guid ResourceId { get; set; } + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + private Link _link; @@ -25297,14 +24073,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return CommunityOrganizationId != default(long); + return AccountIdentifier != default(string) && EducationOrganizationId != default(long) && FiscalYear != default(int); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (CommunityOrganizationId == default) + if (AccountIdentifier == default) { - yield return "CommunityOrganizationId"; + yield return "AccountIdentifier"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; } } @@ -25313,25 +24099,45 @@ private Link CreateLink() { var link = new Link { - Rel = "CommunityOrganization", - Href = $"/ed-fi/communityOrganizations/{ResourceId:n}" + Rel = "ChartOfAccount", + Href = $"/ed-fi/chartOfAccounts/{ResourceId:n}" }; - return link; + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } } // Aggregate reference /// - /// A class which represents the edfi.CommunityOrganization table of the CommunityOrganization aggregate in the ODS Database. + /// A class which represents the edfi.ChartOfAccount table of the ChartOfAccount aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CommunityOrganization : Entities.Common.EdFi.ICommunityOrganization, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class ChartOfAccount : Entities.Common.EdFi.IChartOfAccount, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CommunityOrganization"); + private static FullName _fullName = new FullName("edfi", "ChartOfAccount"); // Fluent validator instance (threadsafe) - private static CommunityOrganizationPutPostRequestValidator _validator = new CommunityOrganizationPutPostRequestValidator(); + private static ChartOfAccountPutPostRequestValidator _validator = new ChartOfAccountPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -25342,16 +24148,9 @@ public class CommunityOrganization : Entities.Common.EdFi.ICommunityOrganization // Constructor // ------------------------------------------------------------- - public CommunityOrganization() + public ChartOfAccount() { - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); + ChartOfAccountReportingTags = new List(); } // ------------------------------------------------------------ @@ -25361,7 +24160,7 @@ public CommunityOrganization() // ------------------------------------------------------------ /// - /// The unique identifier for the CommunityOrganization resource. + /// The unique identifier for the ChartOfAccount resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -25371,267 +24170,770 @@ public CommunityOrganization() // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - /// - /// The identifier assigned to a community organization. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="communityOrganizationId")] - public long CommunityOrganizationId { get; set; } - - long IEducationOrganization.EducationOrganizationId + private bool _balanceSheetDimensionReferenceExplicitlyAssigned; + private BalanceSheetDimension.EdFi.BalanceSheetDimensionReference _balanceSheetDimensionReference; + private BalanceSheetDimension.EdFi.BalanceSheetDimensionReference ImplicitBalanceSheetDimensionReference { - get { return CommunityOrganizationId; } - set { CommunityOrganizationId = value; } - } - // ------------------------------------------------------------- + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_balanceSheetDimensionReference == null && !_balanceSheetDimensionReferenceExplicitlyAssigned) + _balanceSheetDimensionReference = new BalanceSheetDimension.EdFi.BalanceSheetDimensionReference(); - // ============================================================= - // Equality - // ------------------------------------------------------------- + return _balanceSheetDimensionReference; + } + } - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + [DataMember(Name="balanceSheetDimensionReference")] + [FullyDefinedReference] + public BalanceSheetDimension.EdFi.BalanceSheetDimensionReference BalanceSheetDimensionReference { - var compareTo = obj as Entities.Common.EdFi.ICommunityOrganization; - - if (ReferenceEquals(this, compareTo)) - return true; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitBalanceSheetDimensionReference != null + && (_balanceSheetDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitBalanceSheetDimensionReference.IsReferenceFullyDefined())) + return ImplicitBalanceSheetDimensionReference; - if (compareTo == null) - return false; + return null; + } + set + { + _balanceSheetDimensionReferenceExplicitlyAssigned = true; + _balanceSheetDimensionReference = value; + } + } + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + return _educationOrganizationReference; + } + } - // Derived Property - if (!(this as Entities.Common.EdFi.ICommunityOrganization).CommunityOrganizationId.Equals(compareTo.CommunityOrganizationId)) - return false; + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } + private bool _functionDimensionReferenceExplicitlyAssigned; + private FunctionDimension.EdFi.FunctionDimensionReference _functionDimensionReference; + private FunctionDimension.EdFi.FunctionDimensionReference ImplicitFunctionDimensionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_functionDimensionReference == null && !_functionDimensionReferenceExplicitlyAssigned) + _functionDimensionReference = new FunctionDimension.EdFi.FunctionDimensionReference(); - return true; + return _functionDimensionReference; + } } - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + [DataMember(Name="functionDimensionReference")] + [FullyDefinedReference] + public FunctionDimension.EdFi.FunctionDimensionReference FunctionDimensionReference { - var hash = new HashCode(); + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitFunctionDimensionReference != null + && (_functionDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitFunctionDimensionReference.IsReferenceFullyDefined())) + return ImplicitFunctionDimensionReference; - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICommunityOrganization).CommunityOrganizationId); + return null; + } + set + { + _functionDimensionReferenceExplicitlyAssigned = true; + _functionDimensionReference = value; + } + } + private bool _fundDimensionReferenceExplicitlyAssigned; + private FundDimension.EdFi.FundDimensionReference _fundDimensionReference; + private FundDimension.EdFi.FundDimensionReference ImplicitFundDimensionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_fundDimensionReference == null && !_fundDimensionReferenceExplicitlyAssigned) + _fundDimensionReference = new FundDimension.EdFi.FundDimensionReference(); - return hash.ToHashCode(); + return _fundDimensionReference; + } + } + + [DataMember(Name="fundDimensionReference")] + [FullyDefinedReference] + public FundDimension.EdFi.FundDimensionReference FundDimensionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitFundDimensionReference != null + && (_fundDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitFundDimensionReference.IsReferenceFullyDefined())) + return ImplicitFundDimensionReference; + + return null; + } + set + { + _fundDimensionReferenceExplicitlyAssigned = true; + _fundDimensionReference = value; + } + } + private bool _objectDimensionReferenceExplicitlyAssigned; + private ObjectDimension.EdFi.ObjectDimensionReference _objectDimensionReference; + private ObjectDimension.EdFi.ObjectDimensionReference ImplicitObjectDimensionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_objectDimensionReference == null && !_objectDimensionReferenceExplicitlyAssigned) + _objectDimensionReference = new ObjectDimension.EdFi.ObjectDimensionReference(); + + return _objectDimensionReference; + } + } + + [DataMember(Name="objectDimensionReference")] + [FullyDefinedReference] + public ObjectDimension.EdFi.ObjectDimensionReference ObjectDimensionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitObjectDimensionReference != null + && (_objectDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectDimensionReference.IsReferenceFullyDefined())) + return ImplicitObjectDimensionReference; + + return null; + } + set + { + _objectDimensionReferenceExplicitlyAssigned = true; + _objectDimensionReference = value; + } + } + private bool _operationalUnitDimensionReferenceExplicitlyAssigned; + private OperationalUnitDimension.EdFi.OperationalUnitDimensionReference _operationalUnitDimensionReference; + private OperationalUnitDimension.EdFi.OperationalUnitDimensionReference ImplicitOperationalUnitDimensionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_operationalUnitDimensionReference == null && !_operationalUnitDimensionReferenceExplicitlyAssigned) + _operationalUnitDimensionReference = new OperationalUnitDimension.EdFi.OperationalUnitDimensionReference(); + + return _operationalUnitDimensionReference; + } + } + + [DataMember(Name="operationalUnitDimensionReference")] + [FullyDefinedReference] + public OperationalUnitDimension.EdFi.OperationalUnitDimensionReference OperationalUnitDimensionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitOperationalUnitDimensionReference != null + && (_operationalUnitDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitOperationalUnitDimensionReference.IsReferenceFullyDefined())) + return ImplicitOperationalUnitDimensionReference; + + return null; + } + set + { + _operationalUnitDimensionReferenceExplicitlyAssigned = true; + _operationalUnitDimensionReference = value; + } + } + private bool _programDimensionReferenceExplicitlyAssigned; + private ProgramDimension.EdFi.ProgramDimensionReference _programDimensionReference; + private ProgramDimension.EdFi.ProgramDimensionReference ImplicitProgramDimensionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programDimensionReference == null && !_programDimensionReferenceExplicitlyAssigned) + _programDimensionReference = new ProgramDimension.EdFi.ProgramDimensionReference(); + + return _programDimensionReference; + } + } + + [DataMember(Name="programDimensionReference")] + [FullyDefinedReference] + public ProgramDimension.EdFi.ProgramDimensionReference ProgramDimensionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramDimensionReference != null + && (_programDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramDimensionReference.IsReferenceFullyDefined())) + return ImplicitProgramDimensionReference; + + return null; + } + set + { + _programDimensionReferenceExplicitlyAssigned = true; + _programDimensionReference = value; + } + } + private bool _projectDimensionReferenceExplicitlyAssigned; + private ProjectDimension.EdFi.ProjectDimensionReference _projectDimensionReference; + private ProjectDimension.EdFi.ProjectDimensionReference ImplicitProjectDimensionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_projectDimensionReference == null && !_projectDimensionReferenceExplicitlyAssigned) + _projectDimensionReference = new ProjectDimension.EdFi.ProjectDimensionReference(); + + return _projectDimensionReference; + } + } + + [DataMember(Name="projectDimensionReference")] + [FullyDefinedReference] + public ProjectDimension.EdFi.ProjectDimensionReference ProjectDimensionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProjectDimensionReference != null + && (_projectDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProjectDimensionReference.IsReferenceFullyDefined())) + return ImplicitProjectDimensionReference; + + return null; + } + set + { + _projectDimensionReferenceExplicitlyAssigned = true; + _projectDimensionReference = value; + } + } + private bool _sourceDimensionReferenceExplicitlyAssigned; + private SourceDimension.EdFi.SourceDimensionReference _sourceDimensionReference; + private SourceDimension.EdFi.SourceDimensionReference ImplicitSourceDimensionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_sourceDimensionReference == null && !_sourceDimensionReferenceExplicitlyAssigned) + _sourceDimensionReference = new SourceDimension.EdFi.SourceDimensionReference(); + + return _sourceDimensionReference; + } + } + + [DataMember(Name="sourceDimensionReference")] + [FullyDefinedReference] + public SourceDimension.EdFi.SourceDimensionReference SourceDimensionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSourceDimensionReference != null + && (_sourceDimensionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSourceDimensionReference.IsReferenceFullyDefined())) + return ImplicitSourceDimensionReference; + + return null; + } + set + { + _sourceDimensionReferenceExplicitlyAssigned = true; + _sourceDimensionReference = value; + } } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties + //============================================================== + // Primary Key // ------------------------------------------------------------- /// - /// The full, legally accepted name of the institution. + /// SEA populated code value for the valid combination of account dimensions under which financials are reported. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } /// - /// The current operational status of the education organization (e.g., active, inactive). + /// The identifier assigned to an education organization. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IChartOfAccount.EducationOrganizationId + { + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; - /// - /// A short name for the institution. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } + + private int _fiscalYear; + private bool _fiscalYearExplicitlyAssigned = false; /// - /// The public web site address (URL) for the education organization. + /// The fiscal year for the account /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } - // ------------------------------------------------------------- + // IS in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get + { + return _fiscalYear; + } + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; - // ============================================================= - // Properties - // ------------------------------------------------------------- + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // BalanceSheetDimension + _balanceSheetDimensionReferenceExplicitlyAssigned = false; + ImplicitBalanceSheetDimensionReference.FiscalYear = value; + + // FunctionDimension + _functionDimensionReferenceExplicitlyAssigned = false; + ImplicitFunctionDimensionReference.FiscalYear = value; + + // FundDimension + _fundDimensionReferenceExplicitlyAssigned = false; + ImplicitFundDimensionReference.FiscalYear = value; + + // ObjectDimension + _objectDimensionReferenceExplicitlyAssigned = false; + ImplicitObjectDimensionReference.FiscalYear = value; + + // OperationalUnitDimension + _operationalUnitDimensionReferenceExplicitlyAssigned = false; + ImplicitOperationalUnitDimensionReference.FiscalYear = value; + + // ProgramDimension + _programDimensionReferenceExplicitlyAssigned = false; + ImplicitProgramDimensionReference.FiscalYear = value; + + // ProjectDimension + _projectDimensionReferenceExplicitlyAssigned = false; + ImplicitProjectDimensionReference.FiscalYear = value; + + // SourceDimension + _sourceDimensionReferenceExplicitlyAssigned = false; + ImplicitSourceDimensionReference.FiscalYear = value; + } + } // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Equality // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IChartOfAccount; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IChartOfAccount).AccountIdentifier, compareTo.AccountIdentifier)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IChartOfAccount).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IChartOfAccount).FiscalYear.Equals(compareTo.FiscalYear)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IChartOfAccount).AccountIdentifier); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IChartOfAccount).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IChartOfAccount).FiscalYear); + return hash.ToHashCode(); + } // ------------------------------------------------------------- // ============================================================= - // Inherited One-to-one relationships + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Inherited Collections + // Properties // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses + /// + /// A descriptive name for the account. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="accountName")] + public string AccountName { get; set; } + + /// + /// The type of account used in accounting such as revenue, expenditure, or balance sheet. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="accountTypeDescriptor")][DescriptorExists("AccountTypeDescriptor")] + public string AccountTypeDescriptor { get; set; } + + /// + /// The code representation of the account balance sheet dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.BalanceSheetCode { - get { return _educationOrganizationAddresses; } + get + { + if (ImplicitBalanceSheetDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitBalanceSheetDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitBalanceSheetDimensionReference.Code; + } + + return default(string); + } set { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // BalanceSheetDimension + _balanceSheetDimensionReferenceExplicitlyAssigned = false; + ImplicitBalanceSheetDimensionReference.Code = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + /// + /// The code representation of the account function dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.FunctionCode { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; + get + { + if (ImplicitFunctionDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitFunctionDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitFunctionDimensionReference.Code; + } - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } + return default(string); + } set { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // FunctionDimension + _functionDimensionReferenceExplicitlyAssigned = false; + ImplicitFunctionDimensionReference.Code = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + /// + /// The code representation of the account fund dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.FundCode { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; + get + { + if (ImplicitFundDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitFundDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitFundDimensionReference.Code; + } - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodes; } + return default(string); + } set { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // FundDimension + _fundDimensionReferenceExplicitlyAssigned = false; + ImplicitFundDimensionReference.Code = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + /// + /// The code representation of the account object dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.ObjectCode { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; + get + { + if (ImplicitObjectDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitObjectDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitObjectDimensionReference.Code; + } - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } + return default(string); + } set { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ObjectDimension + _objectDimensionReferenceExplicitlyAssigned = false; + ImplicitObjectDimensionReference.Code = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + /// + /// The code representation of the account operational unit dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.OperationalUnitCode { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } + get + { + if (ImplicitOperationalUnitDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitOperationalUnitDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitOperationalUnitDimensionReference.Code; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // OperationalUnitDimension + _operationalUnitDimensionReferenceExplicitlyAssigned = false; + ImplicitOperationalUnitDimensionReference.Code = value; + } } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones + /// + /// The code representation of the account program dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.ProgramCode { - get { return _educationOrganizationInstitutionTelephones; } + get + { + if (ImplicitProgramDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitProgramDimensionReference.Code; + } + + return default(string); + } set { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramDimension + _programDimensionReferenceExplicitlyAssigned = false; + ImplicitProgramDimensionReference.Code = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + /// + /// The code representation of the account project dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.ProjectCode { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + get + { + if (ImplicitProjectDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProjectDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitProjectDimensionReference.Code; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProjectDimension + _projectDimensionReferenceExplicitlyAssigned = false; + ImplicitProjectDimensionReference.Code = value; + } } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses + /// + /// The code representation of the account source dimension. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IChartOfAccount.SourceCode { - get { return _educationOrganizationInternationalAddresses; } + get + { + if (ImplicitSourceDimensionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSourceDimensionReference.IsReferenceFullyDefined())) + { + return ImplicitSourceDimensionReference.Code; + } + + return default(string); + } set { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // SourceDimension + _sourceDimensionReferenceExplicitlyAssigned = false; + ImplicitSourceDimensionReference.Code = value; } } + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + if (!_fiscalYearExplicitlyAssigned) + { + yield return "FiscalYear"; + } } + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CommunityOrganization", "CommunityOrganization")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ChartOfAccount", "ChartOfAccount")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _chartOfAccountReportingTags; + private ICollection _chartOfAccountReportingTagsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportingTags")] + public ICollection ChartOfAccountReportingTags + { + get { return _chartOfAccountReportingTags; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IChartOfAccountReportingTag)e.Item).ChartOfAccount = this); + _chartOfAccountReportingTags = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IChartOfAccountReportingTag)e.Item).ChartOfAccount = this; + _chartOfAccountReportingTagsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IChartOfAccount.ChartOfAccountReportingTags + { + get { return _chartOfAccountReportingTagsCovariant; } + set { ChartOfAccountReportingTags = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -25654,34 +24956,9 @@ public ICollection t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIdentificationCodes"); + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForFiscalYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForFiscalYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'fiscalYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForFiscalYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + IEnumerable<(string path, int value)> GetFiscalYearSources() + { + // Obtain value from the locally defined property + yield return ("FiscalYear", this.FiscalYear); + + // Obtain value from other references + var valueFromBalanceSheetDimensionReference = this.BalanceSheetDimensionReference?.FiscalYear; + + if (valueFromBalanceSheetDimensionReference != null) { - yield return result; + yield return ("balanceSheetDimensionReference.fiscalYear", this.BalanceSheetDimensionReference.FiscalYear); } - } - - if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIndicators"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + // Obtain value from other references + var valueFromFunctionDimensionReference = this.FunctionDimensionReference?.FiscalYear; + + if (valueFromFunctionDimensionReference != null) { - yield return result; + yield return ("functionDimensionReference.fiscalYear", this.FunctionDimensionReference.FiscalYear); } - } - - if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInstitutionTelephones"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + // Obtain value from other references + var valueFromFundDimensionReference = this.FundDimensionReference?.FiscalYear; + + if (valueFromFundDimensionReference != null) { - yield return result; + yield return ("fundDimensionReference.fiscalYear", this.FundDimensionReference.FiscalYear); } - } - - if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInternationalAddresses"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + // Obtain value from other references + var valueFromObjectDimensionReference = this.ObjectDimensionReference?.FiscalYear; + + if (valueFromObjectDimensionReference != null) { - yield return result; + yield return ("objectDimensionReference.fiscalYear", this.ObjectDimensionReference.FiscalYear); } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + // Obtain value from other references + var valueFromOperationalUnitDimensionReference = this.OperationalUnitDimensionReference?.FiscalYear; + + if (valueFromOperationalUnitDimensionReference != null) { - yield return result; + yield return ("operationalUnitDimensionReference.fiscalYear", this.OperationalUnitDimensionReference.FiscalYear); + } + + // Obtain value from other references + var valueFromProgramDimensionReference = this.ProgramDimensionReference?.FiscalYear; + + if (valueFromProgramDimensionReference != null) + { + yield return ("programDimensionReference.fiscalYear", this.ProgramDimensionReference.FiscalYear); + } + + // Obtain value from other references + var valueFromProjectDimensionReference = this.ProjectDimensionReference?.FiscalYear; + + if (valueFromProjectDimensionReference != null) + { + yield return ("projectDimensionReference.fiscalYear", this.ProjectDimensionReference.FiscalYear); + } + + // Obtain value from other references + var valueFromSourceDimensionReference = this.SourceDimensionReference?.FiscalYear; + + if (valueFromSourceDimensionReference != null) + { + yield return ("sourceDimensionReference.fiscalYear", this.SourceDimensionReference.FiscalYear); } + } // Execute the resource's fluent validator @@ -25843,19 +25276,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CommunityOrganizationPutPostRequestValidator : FluentValidation.AbstractValidator + public class ChartOfAccountPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_CommunityOrganization = new FullName("edfi", "CommunityOrganization"); + private static readonly FullName _fullName_edfi_ChartOfAccount = new FullName("edfi", "ChartOfAccount"); // Declare collection item validators - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); + private ChartOfAccountReportingTagPutPostRequestValidator _chartOfAccountReportingTagsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -25872,74 +25300,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsEducationOrganizationAddressIncluded(x)); + var hasInvalidChartOfAccountReportingTagsItems = instance.ChartOfAccountReportingTags.Any(x => !mappingContract.IsChartOfAccountReportingTagIncluded(x)); - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); - - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) - { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - - if (hasInvalidEducationOrganizationInternationalAddressesItems) + if (hasInvalidChartOfAccountReportingTagsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ChartOfAccountReportingTags", $"A supplied 'ChartOfAccountReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -25960,86 +25333,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CommunityProvider resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class CommunityProviderReference : IResourceReference - { - [DataMember(Name="communityProviderId")] - public long CommunityProviderId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return CommunityProviderId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (CommunityProviderId == default) - { - yield return "CommunityProviderId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "CommunityProvider", - Href = $"/ed-fi/communityProviders/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - /// - /// A class which represents the edfi.CommunityProvider table of the CommunityProvider aggregate in the ODS Database. + /// A class which represents the edfi.ChartOfAccountReportingTag table of the ChartOfAccount aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CommunityProvider : Entities.Common.EdFi.ICommunityProvider, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + public class ChartOfAccountReportingTag : Entities.Common.EdFi.IChartOfAccountReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CommunityProvider"); + private static FullName _fullName = new FullName("edfi", "ChartOfAccountReportingTag"); // Fluent validator instance (threadsafe) - private static CommunityProviderPutPostRequestValidator _validator = new CommunityProviderPutPostRequestValidator(); + private static ChartOfAccountReportingTagPutPostRequestValidator _validator = new ChartOfAccountReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -26050,88 +25354,49 @@ public class CommunityProvider : Entities.Common.EdFi.ICommunityProvider, Entiti // Constructor // ------------------------------------------------------------- - public CommunityProvider() - { - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CommunityProvider resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _communityOrganizationReferenceExplicitlyAssigned; - private CommunityOrganization.EdFi.CommunityOrganizationReference _communityOrganizationReference; - private CommunityOrganization.EdFi.CommunityOrganizationReference ImplicitCommunityOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_communityOrganizationReference == null && !_communityOrganizationReferenceExplicitlyAssigned) - _communityOrganizationReference = new CommunityOrganization.EdFi.CommunityOrganizationReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IChartOfAccount _chartOfAccount; - return _communityOrganizationReference; - } + [IgnoreDataMember] + Entities.Common.EdFi.IChartOfAccount IChartOfAccountReportingTag.ChartOfAccount + { + get { return _chartOfAccount; } + set { SetChartOfAccount(value); } } - [DataMember(Name="communityOrganizationReference")] - [FullyDefinedReference] - public CommunityOrganization.EdFi.CommunityOrganizationReference CommunityOrganizationReference + public Entities.Common.EdFi.IChartOfAccount ChartOfAccount { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCommunityOrganizationReference != null - && (_communityOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCommunityOrganizationReference.IsReferenceFullyDefined())) - return ImplicitCommunityOrganizationReference; - - return null; - } - set - { - _communityOrganizationReferenceExplicitlyAssigned = true; - _communityOrganizationReference = value; - } + set { SetChartOfAccount(value); } } - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- + private void SetChartOfAccount(Entities.Common.EdFi.IChartOfAccount value) + { + _chartOfAccount = value; + } /// - /// The identifier assigned to a community provider. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// A descriptor used at the dimension and/or chart of account levels to demote specific state needs for reporting. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="communityProviderId")] - public long CommunityProviderId { get; set; } - - long IEducationOrganization.EducationOrganizationId - { - get { return CommunityProviderId; } - set { CommunityProviderId = value; } - } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -26146,7 +25411,7 @@ long IEducationOrganization.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICommunityProvider; + var compareTo = obj as Entities.Common.EdFi.IChartOfAccountReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -26154,9 +25419,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_chartOfAccount == null || !_chartOfAccount.Equals(compareTo.ChartOfAccount)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICommunityProvider).CommunityProviderId.Equals(compareTo.CommunityProviderId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IChartOfAccountReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -26172,9 +25441,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_chartOfAccount != null) + hash.Add(_chartOfAccount); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICommunityProvider).CommunityProviderId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IChartOfAccountReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -26183,39 +25455,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// The full, legally accepted name of the institution. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } - - /// - /// The current operational status of the education organization (e.g., active, inactive). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } - - /// - /// A short name for the institution. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } - - /// - /// The public web site address (URL) for the education organization. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -26223,71 +25462,12 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The identifier assigned to a community organization. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ICommunityProvider.CommunityOrganizationId - { - get - { - if (ImplicitCommunityOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCommunityOrganizationReference.IsReferenceFullyDefined())) - { - return ImplicitCommunityOrganizationReference.CommunityOrganizationId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CommunityOrganization - _communityOrganizationReferenceExplicitlyAssigned = false; - ImplicitCommunityOrganizationReference.CommunityOrganizationId = value.GetValueOrDefault(); - } - } - - /// - /// An indication of whether the provider is exempt from having a license. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="licenseExemptIndicator")] - public bool? LicenseExemptIndicator { get; set; } - - /// - /// Indicates the category of the provider. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="providerCategoryDescriptor")][DescriptorExists("ProviderCategoryDescriptor")] - public string ProviderCategoryDescriptor { get; set; } - - /// - /// Indicates the profitability status of the provider. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="providerProfitabilityDescriptor")][DescriptorExists("ProviderProfitabilityDescriptor")] - public string ProviderProfitabilityDescriptor { get; set; } - - /// - /// Indicates the status of the provider. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="providerStatusDescriptor")][DescriptorExists("ProviderStatusDescriptor")] - public string ProviderStatusDescriptor { get; set; } - - /// - /// An indication of whether the community provider is a school. + /// The value associated with the reporting tag. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="schoolIndicator")] - public bool? SchoolIndicator { get; set; } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="tagValue")] + public string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -26303,138 +25483,12 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses - { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses - { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } - set - { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodes; } - set - { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } - set - { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators - { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } - } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephones; } - set - { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } - } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddresses; } - set - { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } - } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CommunityProvider", "CommunityProvider")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ChartOfAccount", "ChartOfAccountReportingTag")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -26446,54 +25500,11 @@ public ICollection + public class ChartOfAccountReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_CommunityProvider = new FullName("edfi", "CommunityProvider"); - - // Declare collection item validators - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -26684,83 +25607,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (CommunityProviderMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_CommunityProvider); - - if (mappingContract != null) - { - if (mappingContract.IsEducationOrganizationAddressIncluded != null) - { - var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); - - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) - { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - - if (hasInvalidEducationOrganizationInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -26777,126 +25623,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CommunityProviderLicense resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class CommunityProviderLicenseReference : IResourceReference - { - [DataMember(Name="communityProviderId")] - public long CommunityProviderId { get; set; } - - [DataMember(Name="licenseIdentifier")] - public string LicenseIdentifier { get; set; } - - [DataMember(Name="licensingOrganization")] - public string LicensingOrganization { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return CommunityProviderId != default(long) && LicenseIdentifier != default(string) && LicensingOrganization != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (CommunityProviderId == default) - { - yield return "CommunityProviderId"; - } - - if (LicenseIdentifier == default) - { - yield return "LicenseIdentifier"; - } - - if (LicensingOrganization == default) - { - yield return "LicensingOrganization"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "CommunityProviderLicense", - Href = $"/ed-fi/communityProviderLicenses/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.CommunityProviderLicense table of the CommunityProviderLicense aggregate in the ODS Database. + /// A class which represents the edfi.CitizenshipStatusDescriptor table of the CitizenshipStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CommunityProviderLicense : Entities.Common.EdFi.ICommunityProviderLicense, IHasETag, IDateVersionedEntity, IValidatableObject + public class CitizenshipStatusDescriptor : Entities.Common.EdFi.ICitizenshipStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CommunityProviderLicense"); + private static FullName _fullName = new FullName("edfi", "CitizenshipStatusDescriptor"); // Fluent validator instance (threadsafe) - private static CommunityProviderLicensePutPostRequestValidator _validator = new CommunityProviderLicensePutPostRequestValidator(); + private static CitizenshipStatusDescriptorPutPostRequestValidator _validator = new CitizenshipStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -26915,7 +25656,7 @@ public class CommunityProviderLicense : Entities.Common.EdFi.ICommunityProviderL // ------------------------------------------------------------ /// - /// The unique identifier for the CommunityProviderLicense resource. + /// The unique identifier for the CitizenshipStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -26925,40 +25666,6 @@ public class CommunityProviderLicense : Entities.Common.EdFi.ICommunityProviderL // ============================================================= // References // ------------------------------------------------------------- - - private bool _communityProviderReferenceExplicitlyAssigned; - private CommunityProvider.EdFi.CommunityProviderReference _communityProviderReference; - private CommunityProvider.EdFi.CommunityProviderReference ImplicitCommunityProviderReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_communityProviderReference == null && !_communityProviderReferenceExplicitlyAssigned) - _communityProviderReference = new CommunityProvider.EdFi.CommunityProviderReference(); - - return _communityProviderReference; - } - } - - [DataMember(Name="communityProviderReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public CommunityProvider.EdFi.CommunityProviderReference CommunityProviderReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCommunityProviderReference != null - && (_communityProviderReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCommunityProviderReference.IsReferenceFullyDefined())) - return ImplicitCommunityProviderReference; - - return null; - } - set - { - _communityProviderReferenceExplicitlyAssigned = true; - _communityProviderReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -26966,47 +25673,17 @@ public CommunityProvider.EdFi.CommunityProviderReference CommunityProviderRefere // ------------------------------------------------------------- /// - /// The identifier assigned to a community provider. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderId - { - get - { - if (ImplicitCommunityProviderReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCommunityProviderReference.IsReferenceFullyDefined())) - return ImplicitCommunityProviderReference.CommunityProviderId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CommunityProvider - _communityProviderReferenceExplicitlyAssigned = false; - ImplicitCommunityProviderReference.CommunityProviderId = value; - } - } - - /// - /// The unique identifier issued by the licensing organization. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="licenseIdentifier")] - public string LicenseIdentifier { get; set; } + [JsonIgnore] + public int CitizenshipStatusDescriptorId { get; set; } - /// - /// The organization issuing the license. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="licensingOrganization")] - public string LicensingOrganization { get; set; } + int IDescriptor.DescriptorId + { + get { return CitizenshipStatusDescriptorId; } + set { CitizenshipStatusDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -27021,7 +25698,7 @@ long Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICommunityProviderLicense; + var compareTo = obj as Entities.Common.EdFi.ICitizenshipStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -27030,18 +25707,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.ICommunityProviderLicense).CommunityProviderId.Equals(compareTo.CommunityProviderId)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICommunityProviderLicense).LicenseIdentifier, compareTo.LicenseIdentifier)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICommunityProviderLicense).LicensingOrganization, compareTo.LicensingOrganization)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICitizenshipStatusDescriptor).CitizenshipStatusDescriptorId.Equals(compareTo.CitizenshipStatusDescriptorId)) return false; @@ -27058,15 +25725,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICommunityProviderLicense).CommunityProviderId); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICommunityProviderLicense).LicenseIdentifier); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICommunityProviderLicense).LicensingOrganization); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICitizenshipStatusDescriptor).CitizenshipStatusDescriptorId); return hash.ToHashCode(); } @@ -27075,71 +25735,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The maximum number that can be contained or accommodated which a provider is authorized or licensed to serve. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="authorizedFacilityCapacity")] - public int? AuthorizedFacilityCapacity { get; set; } /// - /// The month, day, and year on which a license is active or becomes effective. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="licenseEffectiveDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime LicenseEffectiveDate { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The month, day, and year on which a license will expire. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="licenseExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? LicenseExpirationDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The month, day, and year on which an active license was issued. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="licenseIssueDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? LicenseIssueDate { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// An indication of the status of the license. + /// The end date of the period when the descriptor is in effect. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="licenseStatusDescriptor")][DescriptorExists("LicenseStatusDescriptor")] - public string LicenseStatusDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// An indication of the category of the license. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="licenseTypeDescriptor")][DescriptorExists("LicenseTypeDescriptor")] - public string LicenseTypeDescriptor { get; set; } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The oldest age of children a provider is authorized or licensed to serve. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="oldestAgeAuthorizedToServe")] - public int? OldestAgeAuthorizedToServe { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - /// - /// The youngest age of children a provider is authorized or licensed to serve. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="youngestAgeAuthorizedToServe")] - public int? YoungestAgeAuthorizedToServe { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -27160,8 +25809,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CommunityProviderLicense", "CommunityProviderLicense")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -27191,49 +25843,492 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CommunityProviderLicenseMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICommunityProviderLicense)target); + return Entities.Common.EdFi.CitizenshipStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICitizenshipStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CommunityProviderLicenseMapper.MapTo(this, (Entities.Common.EdFi.ICommunityProviderLicense)target, null); + Entities.Common.EdFi.CitizenshipStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICitizenshipStatusDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderResourceId - { - get { return null; } - set { ImplicitCommunityProviderReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- + } - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; + // ================================================================= + // Validators + // ----------------------------------------------------------------- - try + [ExcludeFromCodeCoverage] + public class CitizenshipStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // ---------------------- - // Validate collections - // ---------------------- + return false; + } - // --------------------------- + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: ClassPeriod + +namespace EdFi.Ods.Api.Common.Models.Resources.ClassPeriod.EdFi +{ + /// + /// Represents a reference to the ClassPeriod resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class ClassPeriodReference : IResourceReference + { + [DataMember(Name="classPeriodName")] + public string ClassPeriodName { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return ClassPeriodName != default(string) && SchoolId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (ClassPeriodName == default) + { + yield return "ClassPeriodName"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "ClassPeriod", + Href = $"/ed-fi/classPeriods/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.ClassPeriod table of the ClassPeriod aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class ClassPeriod : Entities.Common.EdFi.IClassPeriod, IHasETag, IDateVersionedEntity, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "ClassPeriod"); + + // Fluent validator instance (threadsafe) + private static ClassPeriodPutPostRequestValidator _validator = new ClassPeriodPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public ClassPeriod() + { + ClassPeriodMeetingTimes = new List(); + } + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the ClassPeriod resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); + + return _schoolReference; + } + } + + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; + + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// An indication of the portion of a typical daily session in which students receive instruction in a specified subject (e.g., morning, sixth period, block period, or AB schedules). + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="classPeriodName")] + public string ClassPeriodName { get; set; } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IClassPeriod.SchoolId + { + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IClassPeriod; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IClassPeriod).ClassPeriodName, compareTo.ClassPeriodName)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IClassPeriod).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IClassPeriod).ClassPeriodName); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IClassPeriod).SchoolId); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// Indicator of whether this class period is used for official daily attendance. Alternatively, official daily attendance may be tied to a section. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="officialAttendancePeriod")] + public bool? OfficialAttendancePeriod { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ClassPeriod", "ClassPeriod")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _classPeriodMeetingTimes; + private ICollection _classPeriodMeetingTimesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="meetingTimes")] + public ICollection ClassPeriodMeetingTimes + { + get { return _classPeriodMeetingTimes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IClassPeriodMeetingTime)e.Item).ClassPeriod = this); + _classPeriodMeetingTimes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IClassPeriodMeetingTime)e.Item).ClassPeriod = this; + _classPeriodMeetingTimesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IClassPeriod.ClassPeriodMeetingTimes + { + get { return _classPeriodMeetingTimesCovariant; } + set { ClassPeriodMeetingTimes = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_classPeriodMeetingTimes != null) foreach (var item in _classPeriodMeetingTimes) + { + item.ClassPeriod = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.ClassPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IClassPeriod)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.ClassPeriodMapper.MapTo(this, (Entities.Common.EdFi.IClassPeriod)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IClassPeriod.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ClassPeriodMeetingTimes.Any() && mappingContract?.IsMemberSupported("ClassPeriodMeetingTimes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ClassPeriodMeetingTimes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ClassPeriodMeetingTimes, validationContext, validationContext.Items.ForCollection("ClassPeriodMeetingTimes")))) + { + yield return result; + } + } + + + // --------------------------- // Validate embedded objects // --------------------------- @@ -27277,9 +26372,333 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CommunityProviderLicensePutPostRequestValidator : FluentValidation.AbstractValidator + public class ClassPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ClassPeriod = new FullName("edfi", "ClassPeriod"); + + // Declare collection item validators + private ClassPeriodMeetingTimePutPostRequestValidator _classPeriodMeetingTimesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ClassPeriodMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ClassPeriod); + + if (mappingContract != null) + { + if (mappingContract.IsClassPeriodMeetingTimeIncluded != null) + { + var hasInvalidClassPeriodMeetingTimesItems = instance.ClassPeriodMeetingTimes.Any(x => !mappingContract.IsClassPeriodMeetingTimeIncluded(x)); + + if (hasInvalidClassPeriodMeetingTimesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ClassPeriodMeetingTimes", $"A supplied 'ClassPeriodMeetingTime' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.ClassPeriodMeetingTime table of the ClassPeriod aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class ClassPeriodMeetingTime : Entities.Common.EdFi.IClassPeriodMeetingTime, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "ClassPeriodMeetingTime"); + + // Fluent validator instance (threadsafe) + private static ClassPeriodMeetingTimePutPostRequestValidator _validator = new ClassPeriodMeetingTimePutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IClassPeriod _classPeriod; + + [IgnoreDataMember] + Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod + { + get { return _classPeriod; } + set { SetClassPeriod(value); } + } + + public Entities.Common.EdFi.IClassPeriod ClassPeriod + { + set { SetClassPeriod(value); } + } + + private void SetClassPeriod(Entities.Common.EdFi.IClassPeriod value) + { + _classPeriod = value; + } + + /// + /// An indication of the time of day the meeting time ends. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="endTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan EndTime { get; set; } + + /// + /// An indication of the time of day the meeting time begins. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="startTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan StartTime { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IClassPeriodMeetingTime; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_classPeriod == null || !_classPeriod.Equals(compareTo.ClassPeriod)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IClassPeriodMeetingTime).EndTime.Equals(compareTo.EndTime)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IClassPeriodMeetingTime).StartTime.Equals(compareTo.StartTime)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_classPeriod != null) + hash.Add(_classPeriod); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IClassPeriodMeetingTime).EndTime); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IClassPeriodMeetingTime).StartTime); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ClassPeriod", "ClassPeriodMeetingTime")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.ClassPeriodMeetingTimeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IClassPeriodMeetingTime)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.ClassPeriodMeetingTimeMapper.MapTo(this, (Entities.Common.EdFi.IClassPeriodMeetingTime)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class ClassPeriodMeetingTimePutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -27308,21 +26727,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CompetencyLevelDescriptor table of the CompetencyLevelDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ClassroomPositionDescriptor table of the ClassroomPositionDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CompetencyLevelDescriptor : Entities.Common.EdFi.ICompetencyLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ClassroomPositionDescriptor : Entities.Common.EdFi.IClassroomPositionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CompetencyLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "ClassroomPositionDescriptor"); // Fluent validator instance (threadsafe) - private static CompetencyLevelDescriptorPutPostRequestValidator _validator = new CompetencyLevelDescriptorPutPostRequestValidator(); + private static ClassroomPositionDescriptorPutPostRequestValidator _validator = new ClassroomPositionDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -27341,7 +26760,7 @@ public class CompetencyLevelDescriptor : Entities.Common.EdFi.ICompetencyLevelDe // ------------------------------------------------------------ /// - /// The unique identifier for the CompetencyLevelDescriptor resource. + /// The unique identifier for the ClassroomPositionDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -27362,12 +26781,12 @@ public class CompetencyLevelDescriptor : Entities.Common.EdFi.ICompetencyLevelDe /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CompetencyLevelDescriptorId { get; set; } + public int ClassroomPositionDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CompetencyLevelDescriptorId; } - set { CompetencyLevelDescriptorId = value; } + get { return ClassroomPositionDescriptorId; } + set { ClassroomPositionDescriptorId = value; } } // ------------------------------------------------------------- @@ -27383,7 +26802,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICompetencyLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.IClassroomPositionDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -27393,7 +26812,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICompetencyLevelDescriptor).CompetencyLevelDescriptorId.Equals(compareTo.CompetencyLevelDescriptorId)) + if (!(this as Entities.Common.EdFi.IClassroomPositionDescriptor).ClassroomPositionDescriptorId.Equals(compareTo.ClassroomPositionDescriptorId)) return false; @@ -27411,7 +26830,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICompetencyLevelDescriptor).CompetencyLevelDescriptorId); + hash.Add((this as Entities.Common.EdFi.IClassroomPositionDescriptor).ClassroomPositionDescriptorId); return hash.ToHashCode(); } @@ -27528,12 +26947,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CompetencyLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICompetencyLevelDescriptor)target); + return Entities.Common.EdFi.ClassroomPositionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IClassroomPositionDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CompetencyLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICompetencyLevelDescriptor)target, null); + Entities.Common.EdFi.ClassroomPositionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IClassroomPositionDescriptor)target, null); } // ------------------------------------------------------------- @@ -27548,9 +26967,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CompetencyLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ClassroomPositionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -27579,26 +26998,23 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CompetencyObjective resource. + /// Represents a reference to the Cohort resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class CompetencyObjectiveReference : IResourceReference + public class CohortReference : IResourceReference { + [DataMember(Name="cohortIdentifier")] + public string CohortIdentifier { get; set; } + [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } - [DataMember(Name="objective")] - public string Objective { get; set; } - - [DataMember(Name="objectiveGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string ObjectiveGradeLevelDescriptor { get; set; } - /// /// Gets or sets the resource identifier of the referenced resource. /// @@ -27635,24 +27051,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EducationOrganizationId != default(long) && Objective != default(string) && ObjectiveGradeLevelDescriptor != default(string); + return CohortIdentifier != default(string) && EducationOrganizationId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (Objective == default) + if (CohortIdentifier == default) { - yield return "Objective"; + yield return "CohortIdentifier"; } - if (ObjectiveGradeLevelDescriptor == default) + if (EducationOrganizationId == default) { - yield return "ObjectiveGradeLevelDescriptor"; + yield return "EducationOrganizationId"; } } @@ -27661,8 +27072,8 @@ private Link CreateLink() { var link = new Link { - Rel = "CompetencyObjective", - Href = $"/ed-fi/competencyObjectives/{ResourceId:n}" + Rel = "Cohort", + Href = $"/ed-fi/cohorts/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -27689,16 +27100,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.CompetencyObjective table of the CompetencyObjective aggregate in the ODS Database. + /// A class which represents the edfi.Cohort table of the Cohort aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CompetencyObjective : Entities.Common.EdFi.ICompetencyObjective, IHasETag, IDateVersionedEntity, IValidatableObject + public class Cohort : Entities.Common.EdFi.ICohort, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CompetencyObjective"); + private static FullName _fullName = new FullName("edfi", "Cohort"); // Fluent validator instance (threadsafe) - private static CompetencyObjectivePutPostRequestValidator _validator = new CompetencyObjectivePutPostRequestValidator(); + private static CohortPutPostRequestValidator _validator = new CohortPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -27709,6 +27120,10 @@ public class CompetencyObjective : Entities.Common.EdFi.ICompetencyObjective, IH // Constructor // ------------------------------------------------------------- + public Cohort() + { + CohortPrograms = new List(); + } // ------------------------------------------------------------ @@ -27717,7 +27132,7 @@ public class CompetencyObjective : Entities.Common.EdFi.ICompetencyObjective, IH // ------------------------------------------------------------ /// - /// The unique identifier for the CompetencyObjective resource. + /// The unique identifier for the Cohort resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -27767,11 +27182,20 @@ public EducationOrganization.EdFi.EducationOrganizationReference EducationOrgani // Primary Key // ------------------------------------------------------------- + /// + /// The name or ID for the cohort. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="cohortIdentifier")] + public string CohortIdentifier { get; set; } + /// /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationId + long Entities.Common.EdFi.ICohort.EducationOrganizationId { get { @@ -27791,24 +27215,6 @@ long Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationId ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } - - /// - /// The designated title of the competency objective. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="objective")] - public string Objective { get; set; } - - /// - /// The grade level for which the competency objective is targeted. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="objectiveGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string ObjectiveGradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -27823,7 +27229,7 @@ long Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICompetencyObjective; + var compareTo = obj as Entities.Common.EdFi.ICohort; if (ReferenceEquals(this, compareTo)) return true; @@ -27832,18 +27238,13 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.ICompetencyObjective).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICompetencyObjective).Objective, compareTo.Objective)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICohort).CohortIdentifier, compareTo.CohortIdentifier)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICompetencyObjective).ObjectiveGradeLevelDescriptor, compareTo.ObjectiveGradeLevelDescriptor)) + // Referenced Property + if (!(this as Entities.Common.EdFi.ICohort).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; @@ -27860,16 +27261,12 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICompetencyObjective).EducationOrganizationId); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICompetencyObjective).Objective); - + hash.Add((this as Entities.Common.EdFi.ICohort).CohortIdentifier); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICompetencyObjective).ObjectiveGradeLevelDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICohort).EducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -27884,28 +27281,37 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The Identifier for the competency objective. + /// The academic subject associated with an academic intervention. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="competencyObjectiveId")] - public string CompetencyObjectiveId { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } /// - /// The description of the student competency objective. + /// The description of the cohort and its purpose. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [DataMember(Name="cohortDescription")] + public string CohortDescription { get; set; } /// - /// One or more statements that describes the criteria used by teachers and students to check for attainment of a competency objective. This criteria gives clear indications as to the degree to which learning is moving through the Zone or Proximal Development toward independent achievement of the competency objective. + /// The scope of cohort (e.g., school, district, classroom). /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="successCriteria")] - public string SuccessCriteria { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="cohortScopeDescriptor")][DescriptorExists("CohortScopeDescriptor")] + public string CohortScopeDescriptor { get; set; } + + /// + /// The type of cohort (e.g., academic intervention, classroom breakout). + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="cohortTypeDescriptor")][DescriptorExists("CohortTypeDescriptor")] + public string CohortTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -27926,13 +27332,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CompetencyObjective", "CompetencyObjective")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Cohort", "Cohort")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _cohortPrograms; + private ICollection _cohortProgramsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="programs")] + public ICollection CohortPrograms + { + get { return _cohortPrograms; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICohortProgram)e.Item).Cohort = this); + _cohortPrograms = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICohortProgram)e.Item).Cohort = this; + _cohortProgramsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICohort.CohortPrograms + { + get { return _cohortProgramsCovariant; } + set { CohortPrograms = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -27950,6 +27386,17 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_cohortPrograms != null) foreach (var item in _cohortPrograms) + { + item.Cohort = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -27957,25 +27404,25 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CompetencyObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICompetencyObjective)target); + return Entities.Common.EdFi.CohortMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohort)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CompetencyObjectiveMapper.MapTo(this, (Entities.Common.EdFi.ICompetencyObjective)target, null); + Entities.Common.EdFi.CohortMapper.MapTo(this, (Entities.Common.EdFi.ICohort)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.ICohort.EducationOrganizationResourceId { get { return null; } set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscriminator + string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } @@ -28005,6 +27452,18 @@ string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscrimina // ---------------------- // Validate collections // ---------------------- + if (CohortPrograms.Any() && mappingContract?.IsMemberSupported("CohortPrograms") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CohortPrograms"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CohortPrograms, validationContext, validationContext.Items.ForCollection("CohortPrograms")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -28050,13 +27509,18 @@ string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscrimina // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CompetencyObjectivePutPostRequestValidator : FluentValidation.AbstractValidator + public class CohortPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + private static readonly FullName _fullName_edfi_Cohort = new FullName("edfi", "Cohort"); + + // Declare collection item validators + private CohortProgramPutPostRequestValidator _cohortProgramsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); return false; } @@ -28065,6 +27529,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (CohortMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_Cohort); + + if (mappingContract != null) + { + if (mappingContract.IsCohortProgramIncluded != null) + { + var hasInvalidCohortProgramsItems = instance.CohortPrograms.Any(x => !mappingContract.IsCohortProgramIncluded(x)); + + if (hasInvalidCohortProgramsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CohortPrograms", $"A supplied 'CohortProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -28080,120 +27566,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Contact resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ContactReference : IResourceReference - { - [DataMember(Name="contactUniqueId")] - public string ContactUniqueId - { - get => _contactUniqueId; - set - { - _contactUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); - } - } - private string _contactUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return ContactUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (ContactUniqueId == default) - { - yield return "ContactUniqueId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Contact", - Href = $"/ed-fi/contacts/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.Contact table of the Contact aggregate in the ODS Database. + /// A class which represents the edfi.CohortProgram table of the Cohort aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Contact : Entities.Common.EdFi.IContact, IHasETag, IDateVersionedEntity, IValidatableObject + public class CohortProgram : Entities.Common.EdFi.ICohortProgram, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Contact"); + private static FullName _fullName = new FullName("edfi", "CohortProgram"); // Fluent validator instance (threadsafe) - private static ContactPutPostRequestValidator _validator = new ContactPutPostRequestValidator(); + private static CohortProgramPutPostRequestValidator _validator = new CohortProgramPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -28204,66 +27587,49 @@ public class Contact : Entities.Common.EdFi.IContact, IHasETag, IDateVersionedEn // Constructor // ------------------------------------------------------------- - public Contact() - { - ContactAddresses = new List(); - ContactElectronicMails = new List(); - ContactInternationalAddresses = new List(); - ContactLanguages = new List(); - ContactOtherNames = new List(); - ContactPersonalIdentificationDocuments = new List(); - ContactTelephones = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the Contact resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _personReferenceExplicitlyAssigned; - private Person.EdFi.PersonReference _personReference; - private Person.EdFi.PersonReference ImplicitPersonReference + private bool _programReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _programReference; + private Program.EdFi.ProgramReference ImplicitProgramReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_personReference == null && !_personReferenceExplicitlyAssigned) - _personReference = new Person.EdFi.PersonReference(); + if (_programReference == null && !_programReferenceExplicitlyAssigned) + _programReference = new Program.EdFi.ProgramReference(); - return _personReference; + return _programReference; } } - [DataMember(Name="personReference")] - [FullyDefinedReference] - public Person.EdFi.PersonReference PersonReference + [DataMember(Name="programReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Program.EdFi.ProgramReference ProgramReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitPersonReference != null - && (_personReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - return ImplicitPersonReference; + if (ImplicitProgramReference != null + && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference; return null; } set { - _personReferenceExplicitlyAssigned = true; - _personReference = value; + _programReferenceExplicitlyAssigned = true; + _programReference = value; } } // ------------------------------------------------------------- @@ -28271,26 +27637,95 @@ public Person.EdFi.PersonReference PersonReference //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICohort _cohort; + + [IgnoreDataMember] + Entities.Common.EdFi.ICohort ICohortProgram.Cohort + { + get { return _cohort; } + set { SetCohort(value); } + } + + public Entities.Common.EdFi.ICohort Cohort + { + set { SetCohort(value); } + } + + private void SetCohort(Entities.Common.EdFi.ICohort value) + { + _cohort = value; + } /// - /// A unique alphanumeric code assigned to a contact. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [UniqueId][DataMember(Name="contactUniqueId")] - public string ContactUniqueId + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ICohortProgram.ProgramEducationOrganizationId { - get => _contactUniqueId; + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; + + return default(long); + } set { - _contactUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.EducationOrganizationId = value; + } + } + + /// + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICohortProgram.ProgramName + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.ProgramName = value; + } + } + + /// + /// The type of program. + /// + + // IS in a reference (CohortProgram.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.ICohortProgram.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramReference.ProgramTypeDescriptor = value; } } - private string _contactUniqueId; - - string IIdentifiablePerson.UniqueId { get { return ContactUniqueId; } } // ------------------------------------------------------------- // ============================================================= @@ -28305,7 +27740,7 @@ public string ContactUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContact; + var compareTo = obj as Entities.Common.EdFi.ICohortProgram; if (ReferenceEquals(this, compareTo)) return true; @@ -28313,10 +27748,26 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Property - if (!((this as Entities.Common.EdFi.IContact).ContactUniqueId.Equals(compareTo.ContactUniqueId))) + // Parent Property + if (_cohort == null || !_cohort.Equals(compareTo.Cohort)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICohortProgram).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICohortProgram).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICohortProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; + return true; } @@ -28329,9 +27780,18 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_cohort != null) + hash.Add(_cohort); - //Property - hash.Add((this as Entities.Common.EdFi.IContact).ContactUniqueId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICohortProgram).ProgramEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICohortProgram).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.ICohortProgram).ProgramTypeDescriptor); return hash.ToHashCode(); } @@ -28345,155 +27805,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="firstName")] - public string FirstName { get; set; } - - /// - /// The gender the contact identifies themselves as. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="genderIdentity")] - public string GenderIdentity { get; set; } - - /// - /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="generationCodeSuffix")] - public string GenerationCodeSuffix { get; set; } - - /// - /// The extent of formal instruction an individual has received (e.g., the highest grade in school completed or its equivalent or the highest degree received). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="highestCompletedLevelOfEducationDescriptor")][DescriptorExists("LevelOfEducationDescriptor")] - public string HighestCompletedLevelOfEducationDescriptor { get; set; } - - /// - /// The name borne in common by members of a family. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="lastSurname")] - public string LastSurname { get; set; } - - /// - /// The login ID for the user; used for security access control interface. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="loginId")] - public string LoginId { get; set; } - - /// - /// The individual's maiden name. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maidenName")] - public string MaidenName { get; set; } - - /// - /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="middleName")] - public string MiddleName { get; set; } - - /// - /// A prefix used to denote the title, degree, position, or seniority of the individual. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="personalTitlePrefix")] - public string PersonalTitlePrefix { get; set; } - - /// - /// A unique alphanumeric code assigned to a person. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IContact.PersonId - { - get - { - if (ImplicitPersonReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - { - return ImplicitPersonReference.PersonId; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Person - _personReferenceExplicitlyAssigned = false; - ImplicitPersonReference.PersonId = value; - } - } - - /// - /// The first name the individual prefers, if different from their legal first name - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="preferredFirstName")] - public string PreferredFirstName { get; set; } - - /// - /// The last name the individual prefers, if different from their legal last name - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="preferredLastSurname")] - public string PreferredLastSurname { get; set; } - - /// - /// A person's birth sex. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] - public string SexDescriptor { get; set; } - - /// - /// This descriptor defines the originating record source system for the person. - /// - - // IS in a reference (Contact.SourceSystemDescriptorId), IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - string Entities.Common.EdFi.IContact.SourceSystemDescriptor - { - get - { - if (ImplicitPersonReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - { - return ImplicitPersonReference.SourceSystemDescriptor; - } - - return null; - } - set - { - ImplicitPersonReference.SourceSystemDescriptor = value; - } - } // ------------------------------------------------------------- // ============================================================= @@ -28514,281 +27825,23 @@ string Entities.Common.EdFi.IContact.SourceSystemDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "Contact")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Cohort", "CohortProgram")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _contactAddresses; - private ICollection _contactAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection ContactAddresses - { - get { return _contactAddresses; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactAddress)e.Item).Contact = this); - _contactAddresses = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactAddress)e.Item).Contact = this; - _contactAddressesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactAddresses - { - get { return _contactAddressesCovariant; } - set { ContactAddresses = new List(value.Cast()); } - } - - private ICollection _contactElectronicMails; - private ICollection _contactElectronicMailsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="electronicMails")] - public ICollection ContactElectronicMails - { - get { return _contactElectronicMails; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactElectronicMail)e.Item).Contact = this); - _contactElectronicMails = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactElectronicMail)e.Item).Contact = this; - _contactElectronicMailsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactElectronicMails - { - get { return _contactElectronicMailsCovariant; } - set { ContactElectronicMails = new List(value.Cast()); } - } - - private ICollection _contactInternationalAddresses; - private ICollection _contactInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection ContactInternationalAddresses - { - get { return _contactInternationalAddresses; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactInternationalAddress)e.Item).Contact = this); - _contactInternationalAddresses = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactInternationalAddress)e.Item).Contact = this; - _contactInternationalAddressesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactInternationalAddresses - { - get { return _contactInternationalAddressesCovariant; } - set { ContactInternationalAddresses = new List(value.Cast()); } - } - - private ICollection _contactLanguages; - private ICollection _contactLanguagesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="languages")] - public ICollection ContactLanguages - { - get { return _contactLanguages; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactLanguage)e.Item).Contact = this); - _contactLanguages = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactLanguage)e.Item).Contact = this; - _contactLanguagesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactLanguages - { - get { return _contactLanguagesCovariant; } - set { ContactLanguages = new List(value.Cast()); } - } - - private ICollection _contactOtherNames; - private ICollection _contactOtherNamesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="otherNames")] - public ICollection ContactOtherNames - { - get { return _contactOtherNames; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactOtherName)e.Item).Contact = this); - _contactOtherNames = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactOtherName)e.Item).Contact = this; - _contactOtherNamesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactOtherNames - { - get { return _contactOtherNamesCovariant; } - set { ContactOtherNames = new List(value.Cast()); } - } - - private ICollection _contactPersonalIdentificationDocuments; - private ICollection _contactPersonalIdentificationDocumentsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="personalIdentificationDocuments")] - public ICollection ContactPersonalIdentificationDocuments - { - get { return _contactPersonalIdentificationDocuments; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactPersonalIdentificationDocument)e.Item).Contact = this); - _contactPersonalIdentificationDocuments = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactPersonalIdentificationDocument)e.Item).Contact = this; - _contactPersonalIdentificationDocumentsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactPersonalIdentificationDocuments - { - get { return _contactPersonalIdentificationDocumentsCovariant; } - set { ContactPersonalIdentificationDocuments = new List(value.Cast()); } - } - - private ICollection _contactTelephones; - private ICollection _contactTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="telephones")] - public ICollection ContactTelephones - { - get { return _contactTelephones; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactTelephone)e.Item).Contact = this); - _contactTelephones = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactTelephone)e.Item).Contact = this; - _contactTelephonesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactTelephones - { - get { return _contactTelephonesCovariant; } - set { ContactTelephones = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_contactAddresses != null) foreach (var item in _contactAddresses) - { - item.Contact = this; - } - - if (_contactElectronicMails != null) foreach (var item in _contactElectronicMails) - { - item.Contact = this; - } - - if (_contactInternationalAddresses != null) foreach (var item in _contactInternationalAddresses) - { - item.Contact = this; - } - - if (_contactLanguages != null) foreach (var item in _contactLanguages) - { - item.Contact = this; - } - - if (_contactOtherNames != null) foreach (var item in _contactOtherNames) - { - item.Contact = this; - } - - if (_contactPersonalIdentificationDocuments != null) foreach (var item in _contactPersonalIdentificationDocuments) - { - item.Contact = this; - } - - if (_contactTelephones != null) foreach (var item in _contactTelephones) - { - item.Contact = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -28796,29 +27849,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContact)target); + return Entities.Common.EdFi.CohortProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortProgram)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactMapper.MapTo(this, (Entities.Common.EdFi.IContact)target, null); + Entities.Common.EdFi.CohortProgramMapper.MapTo(this, (Entities.Common.EdFi.ICohortProgram)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IContact.PersonResourceId + Guid? Entities.Common.EdFi.ICohortProgram.ProgramResourceId { get { return null; } - set { ImplicitPersonReference.ResourceId = value ?? default(Guid); } + set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IContact.PersonDiscriminator + string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitPersonReference.Discriminator = value; } + set { ImplicitProgramReference.Discriminator = value; } } @@ -28839,95 +27892,12 @@ string Entities.Common.EdFi.IContact.PersonDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (ContactAddresses.Any() && mappingContract?.IsMemberSupported("ContactAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactAddresses, validationContext, validationContext.Items.ForCollection("ContactAddresses")))) - { - yield return result; - } - } - - if (ContactElectronicMails.Any() && mappingContract?.IsMemberSupported("ContactElectronicMails") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactElectronicMails"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactElectronicMails, validationContext, validationContext.Items.ForCollection("ContactElectronicMails")))) - { - yield return result; - } - } - - if (ContactInternationalAddresses.Any() && mappingContract?.IsMemberSupported("ContactInternationalAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactInternationalAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactInternationalAddresses, validationContext, validationContext.Items.ForCollection("ContactInternationalAddresses")))) - { - yield return result; - } - } - - if (ContactLanguages.Any() && mappingContract?.IsMemberSupported("ContactLanguages") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactLanguages"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactLanguages, validationContext, validationContext.Items.ForCollection("ContactLanguages")))) - { - yield return result; - } - } - - if (ContactOtherNames.Any() && mappingContract?.IsMemberSupported("ContactOtherNames") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactOtherNames"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactOtherNames, validationContext, validationContext.Items.ForCollection("ContactOtherNames")))) - { - yield return result; - } - } - - if (ContactPersonalIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("ContactPersonalIdentificationDocuments") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactPersonalIdentificationDocuments"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactPersonalIdentificationDocuments, validationContext, validationContext.Items.ForCollection("ContactPersonalIdentificationDocuments")))) - { - yield return result; - } - } - - if (ContactTelephones.Any() && mappingContract?.IsMemberSupported("ContactTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactTelephones"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactTelephones, validationContext, validationContext.Items.ForCollection("ContactTelephones")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -28973,20 +27943,9 @@ string Entities.Common.EdFi.IContact.PersonDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactPutPostRequestValidator : FluentValidation.AbstractValidator + public class CohortProgramPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Contact = new FullName("edfi", "Contact"); - - // Declare collection item validators - private ContactAddressPutPostRequestValidator _contactAddressesValidator = new (); - private ContactElectronicMailPutPostRequestValidator _contactElectronicMailsValidator = new (); - private ContactInternationalAddressPutPostRequestValidator _contactInternationalAddressesValidator = new (); - private ContactLanguagePutPostRequestValidator _contactLanguagesValidator = new (); - private ContactOtherNamePutPostRequestValidator _contactOtherNamesValidator = new (); - private ContactPersonalIdentificationDocumentPutPostRequestValidator _contactPersonalIdentificationDocumentsValidator = new (); - private ContactTelephonePutPostRequestValidator _contactTelephonesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -28999,94 +27958,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ContactMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Contact); - - if (mappingContract != null) - { - if (mappingContract.IsContactAddressIncluded != null) - { - var hasInvalidContactAddressesItems = instance.ContactAddresses.Any(x => !mappingContract.IsContactAddressIncluded(x)); - - if (hasInvalidContactAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactAddresses", $"A supplied 'ContactAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsContactElectronicMailIncluded != null) - { - var hasInvalidContactElectronicMailsItems = instance.ContactElectronicMails.Any(x => !mappingContract.IsContactElectronicMailIncluded(x)); - - if (hasInvalidContactElectronicMailsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactElectronicMails", $"A supplied 'ContactElectronicMail' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsContactInternationalAddressIncluded != null) - { - var hasInvalidContactInternationalAddressesItems = instance.ContactInternationalAddresses.Any(x => !mappingContract.IsContactInternationalAddressIncluded(x)); - - if (hasInvalidContactInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactInternationalAddresses", $"A supplied 'ContactInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsContactLanguageIncluded != null) - { - var hasInvalidContactLanguagesItems = instance.ContactLanguages.Any(x => !mappingContract.IsContactLanguageIncluded(x)); - - if (hasInvalidContactLanguagesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactLanguages", $"A supplied 'ContactLanguage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsContactOtherNameIncluded != null) - { - var hasInvalidContactOtherNamesItems = instance.ContactOtherNames.Any(x => !mappingContract.IsContactOtherNameIncluded(x)); - - if (hasInvalidContactOtherNamesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactOtherNames", $"A supplied 'ContactOtherName' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsContactPersonalIdentificationDocumentIncluded != null) - { - var hasInvalidContactPersonalIdentificationDocumentsItems = instance.ContactPersonalIdentificationDocuments.Any(x => !mappingContract.IsContactPersonalIdentificationDocumentIncluded(x)); - - if (hasInvalidContactPersonalIdentificationDocumentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactPersonalIdentificationDocuments", $"A supplied 'ContactPersonalIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsContactTelephoneIncluded != null) - { - var hasInvalidContactTelephonesItems = instance.ContactTelephones.Any(x => !mappingContract.IsContactTelephoneIncluded(x)); - - if (hasInvalidContactTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactTelephones", $"A supplied 'ContactTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -29102,17 +27973,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext } // ----------------------------------------------------------------- +} +// Aggregate: CohortScopeDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.CohortScopeDescriptor.EdFi +{ /// - /// A class which represents the edfi.ContactAddress table of the Contact aggregate in the ODS Database. + /// A class which represents the edfi.CohortScopeDescriptor table of the CohortScopeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactAddress : Entities.Common.EdFi.IContactAddress, IValidatableObject + public class CohortScopeDescriptor : Entities.Common.EdFi.ICohortScopeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ContactAddress"); + private static FullName _fullName = new FullName("edfi", "CohortScopeDescriptor"); // Fluent validator instance (threadsafe) - private static ContactAddressPutPostRequestValidator _validator = new ContactAddressPutPostRequestValidator(); + private static CohortScopeDescriptorPutPostRequestValidator _validator = new CohortScopeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -29123,16 +27999,19 @@ public class ContactAddress : Entities.Common.EdFi.IContactAddress, IValidatable // Constructor // ------------------------------------------------------------- - public ContactAddress() - { - ContactAddressPeriods = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CohortScopeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -29143,69 +28022,19 @@ public ContactAddress() //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IContact _contact; - - [IgnoreDataMember] - Entities.Common.EdFi.IContact IContactAddress.Contact - { - get { return _contact; } - set { SetContact(value); } - } - - public Entities.Common.EdFi.IContact Contact - { - set { SetContact(value); } - } - - private void SetContact(Entities.Common.EdFi.IContact value) - { - _contact = value; - } - - /// - /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] - public string AddressTypeDescriptor { get; set; } /// - /// The name of the city in which an address is located. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="city")] - public string City { get; set; } - - /// - /// The five or nine digit zip code or overseas postal code portion of an address. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="postalCode")] - public string PostalCode { get; set; } - - /// - /// The abbreviation for the state (within the United States) or outlying area in which an address is located. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string StateAbbreviationDescriptor { get; set; } + [JsonIgnore] + public int CohortScopeDescriptorId { get; set; } - /// - /// The street number and street name or post office box number of an address. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="streetNumberName")] - public string StreetNumberName { get; set; } + int IDescriptor.DescriptorId + { + get { return CohortScopeDescriptorId; } + set { CohortScopeDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -29220,7 +28049,7 @@ private void SetContact(Entities.Common.EdFi.IContact value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactAddress; + var compareTo = obj as Entities.Common.EdFi.ICohortScopeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -29228,33 +28057,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contact == null || !_contact.Equals(compareTo.Contact)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactAddress).City, compareTo.City)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactAddress).PostalCode, compareTo.PostalCode)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactAddress).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactAddress).StreetNumberName, compareTo.StreetNumberName)) + + // Derived Property + if (!(this as Entities.Common.EdFi.ICohortScopeDescriptor).CohortScopeDescriptorId.Equals(compareTo.CohortScopeDescriptorId)) return false; @@ -29270,28 +28075,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contact != null) - hash.Add(_contact); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactAddress).AddressTypeDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactAddress).City); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactAddress).PostalCode); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactAddress).StateAbbreviationDescriptor); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactAddress).StreetNumberName); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICohortScopeDescriptor).CohortScopeDescriptorId); return hash.ToHashCode(); } @@ -29300,82 +28086,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// The apartment, room, or suite number of an address. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="apartmentRoomSuiteNumber")] - public string ApartmentRoomSuiteNumber { get; set; } - - /// - /// The number of the building on the site, if more than one building shares the same address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="buildingSiteNumber")] - public string BuildingSiteNumber { get; set; } + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The congressional district in which an address is located. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="congressionalDistrict")] - public string CongressionalDistrict { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="countyFIPSCode")] - public string CountyFIPSCode { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// An indication that the address should not be published. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The geographic latitude of the physical address. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="latitude")] - public string Latitude { get; set; } - - /// - /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] - public string LocaleDescriptor { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The geographic longitude of the physical address. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="longitude")] - public string Longitude { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - /// - /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfCounty")] - public string NameOfCounty { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -29396,64 +28160,33 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactAddress")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _contactAddressPeriods; - private ICollection _contactAddressPeriodsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="periods")] - public ICollection ContactAddressPeriods - { - get { return _contactAddressPeriods; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactAddressPeriod)e.Item).ContactAddress = this); - _contactAddressPeriods = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactAddressPeriod)e.Item).ContactAddress = this; - _contactAddressPeriodsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContactAddress.ContactAddressPeriods - { - get { return _contactAddressPeriodsCovariant; } - set { ContactAddressPeriods = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_contactAddressPeriods != null) foreach (var item in _contactAddressPeriods) - { - item.ContactAddress = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -29461,12 +28194,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactAddress)target); + return Entities.Common.EdFi.CohortScopeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortScopeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactAddressMapper.MapTo(this, (Entities.Common.EdFi.IContactAddress)target, null); + Entities.Common.EdFi.CohortScopeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICohortScopeDescriptor)target, null); } // ------------------------------------------------------------- @@ -29474,78 +28207,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (ContactAddressPeriods.Any() && mappingContract?.IsMemberSupported("ContactAddressPeriods") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ContactAddressPeriods"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactAddressPeriods, validationContext, validationContext.Items.ForCollection("ContactAddressPeriods")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -29553,14 +28214,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactAddressPutPostRequestValidator : FluentValidation.AbstractValidator + public class CohortScopeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ContactAddress = new FullName("edfi", "ContactAddress"); - - // Declare collection item validators - private ContactAddressPeriodPutPostRequestValidator _contactAddressPeriodsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -29573,28 +28229,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ContactAddressMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_ContactAddress); - - if (mappingContract != null) - { - if (mappingContract.IsContactAddressPeriodIncluded != null) - { - var hasInvalidContactAddressPeriodsItems = instance.ContactAddressPeriods.Any(x => !mappingContract.IsContactAddressPeriodIncluded(x)); - - if (hasInvalidContactAddressPeriodsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactAddressPeriods", $"A supplied 'ContactAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -29610,17 +28244,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContactAddressPeriod table of the Contact aggregate in the ODS Database. + /// A class which represents the edfi.CohortTypeDescriptor table of the CohortTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactAddressPeriod : Entities.Common.EdFi.IContactAddressPeriod, IValidatableObject + public class CohortTypeDescriptor : Entities.Common.EdFi.ICohortTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ContactAddressPeriod"); + private static FullName _fullName = new FullName("edfi", "CohortTypeDescriptor"); // Fluent validator instance (threadsafe) - private static ContactAddressPeriodPutPostRequestValidator _validator = new ContactAddressPeriodPutPostRequestValidator(); + private static CohortTypeDescriptorPutPostRequestValidator _validator = new CohortTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -29637,6 +28276,13 @@ public class ContactAddressPeriod : Entities.Common.EdFi.IContactAddressPeriod, // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CohortTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -29647,32 +28293,19 @@ public class ContactAddressPeriod : Entities.Common.EdFi.IContactAddressPeriod, //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IContactAddress _contactAddress; - - [IgnoreDataMember] - Entities.Common.EdFi.IContactAddress IContactAddressPeriod.ContactAddress - { - get { return _contactAddress; } - set { SetContactAddress(value); } - } - - public Entities.Common.EdFi.IContactAddress ContactAddress - { - set { SetContactAddress(value); } - } - - private void SetContactAddress(Entities.Common.EdFi.IContactAddress value) - { - _contactAddress = value; - } /// - /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + [JsonIgnore] + public int CohortTypeDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return CohortTypeDescriptorId; } + set { CohortTypeDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -29687,7 +28320,7 @@ private void SetContactAddress(Entities.Common.EdFi.IContactAddress value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactAddressPeriod; + var compareTo = obj as Entities.Common.EdFi.ICohortTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -29695,13 +28328,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contactAddress == null || !_contactAddress.Equals(compareTo.ContactAddress)) - return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.IContactAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICohortTypeDescriptor).CohortTypeDescriptorId.Equals(compareTo.CohortTypeDescriptorId)) return false; @@ -29717,12 +28346,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contactAddress != null) - hash.Add(_contactAddress); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactAddressPeriod).BeginDate); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICohortTypeDescriptor).CohortTypeDescriptorId); return hash.ToHashCode(); } @@ -29731,18 +28357,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -29763,8 +28431,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactAddressPeriod")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -29775,6 +28446,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -29787,12 +28465,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactAddressPeriod)target); + return Entities.Common.EdFi.CohortTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IContactAddressPeriod)target, null); + Entities.Common.EdFi.CohortTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICohortTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -29800,66 +28478,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -29867,9 +28485,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class CohortTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -29897,17 +28515,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContactElectronicMail table of the Contact aggregate in the ODS Database. + /// A class which represents the edfi.CohortYearTypeDescriptor table of the CohortYearTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactElectronicMail : Entities.Common.EdFi.IContactElectronicMail, IValidatableObject + public class CohortYearTypeDescriptor : Entities.Common.EdFi.ICohortYearTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ContactElectronicMail"); + private static FullName _fullName = new FullName("edfi", "CohortYearTypeDescriptor"); // Fluent validator instance (threadsafe) - private static ContactElectronicMailPutPostRequestValidator _validator = new ContactElectronicMailPutPostRequestValidator(); + private static CohortYearTypeDescriptorPutPostRequestValidator _validator = new CohortYearTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -29924,6 +28547,13 @@ public class ContactElectronicMail : Entities.Common.EdFi.IContactElectronicMail // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CohortYearTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -29934,42 +28564,19 @@ public class ContactElectronicMail : Entities.Common.EdFi.IContactElectronicMail //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IContact _contact; - - [IgnoreDataMember] - Entities.Common.EdFi.IContact IContactElectronicMail.Contact - { - get { return _contact; } - set { SetContact(value); } - } - - public Entities.Common.EdFi.IContact Contact - { - set { SetContact(value); } - } - - private void SetContact(Entities.Common.EdFi.IContact value) - { - _contact = value; - } /// - /// The electronic mail (e-mail) address listed for an individual or organization. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(128, MinimumLength=7, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="electronicMailAddress")] - public string ElectronicMailAddress { get; set; } + [JsonIgnore] + public int CohortYearTypeDescriptorId { get; set; } - /// - /// The type of email listed for an individual or organization. For example: Home/Personal, Work, etc.) - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="electronicMailTypeDescriptor")][DescriptorExists("ElectronicMailTypeDescriptor")] - public string ElectronicMailTypeDescriptor { get; set; } + int IDescriptor.DescriptorId + { + get { return CohortYearTypeDescriptorId; } + set { CohortYearTypeDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -29984,7 +28591,7 @@ private void SetContact(Entities.Common.EdFi.IContact value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactElectronicMail; + var compareTo = obj as Entities.Common.EdFi.ICohortYearTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -29992,18 +28599,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contact == null || !_contact.Equals(compareTo.Contact)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailAddress, compareTo.ElectronicMailAddress)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailTypeDescriptor, compareTo.ElectronicMailTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICohortYearTypeDescriptor).CohortYearTypeDescriptorId.Equals(compareTo.CohortYearTypeDescriptorId)) return false; @@ -30019,16 +28617,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contact != null) - hash.Add(_contact); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailAddress); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICohortYearTypeDescriptor).CohortYearTypeDescriptorId); return hash.ToHashCode(); } @@ -30037,25 +28628,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// An indication that the electronic email address should not be published. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// An indication that the electronic mail address should be used as the principal electronic mail address for an individual or organization. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="primaryEmailAddressIndicator")] - public bool? PrimaryEmailAddressIndicator { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -30076,8 +28702,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactElectronicMail")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -30088,6 +28717,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -30100,12 +28736,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactElectronicMailMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactElectronicMail)target); + return Entities.Common.EdFi.CohortYearTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICohortYearTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactElectronicMailMapper.MapTo(this, (Entities.Common.EdFi.IContactElectronicMail)target, null); + Entities.Common.EdFi.CohortYearTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICohortYearTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -30113,66 +28749,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -30180,9 +28756,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactElectronicMailPutPostRequestValidator : FluentValidation.AbstractValidator + public class CohortYearTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -30210,17 +28786,86 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContactInternationalAddress table of the Contact aggregate in the ODS Database. + /// Represents a reference to the CommunityOrganization resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class CommunityOrganizationReference : IResourceReference + { + [DataMember(Name="communityOrganizationId")] + public long CommunityOrganizationId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return CommunityOrganizationId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (CommunityOrganizationId == default) + { + yield return "CommunityOrganizationId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "CommunityOrganization", + Href = $"/ed-fi/communityOrganizations/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.CommunityOrganization table of the CommunityOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactInternationalAddress : Entities.Common.EdFi.IContactInternationalAddress, IValidatableObject + public class CommunityOrganization : Entities.Common.EdFi.ICommunityOrganization, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ContactInternationalAddress"); + private static FullName _fullName = new FullName("edfi", "CommunityOrganization"); // Fluent validator instance (threadsafe) - private static ContactInternationalAddressPutPostRequestValidator _validator = new ContactInternationalAddressPutPostRequestValidator(); + private static CommunityOrganizationPutPostRequestValidator _validator = new CommunityOrganizationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -30231,12 +28876,30 @@ public class ContactInternationalAddress : Entities.Common.EdFi.IContactInternat // Constructor // ------------------------------------------------------------- + public CommunityOrganization() + { + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CommunityOrganization resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -30247,33 +28910,20 @@ public class ContactInternationalAddress : Entities.Common.EdFi.IContactInternat //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IContact _contact; - - [IgnoreDataMember] - Entities.Common.EdFi.IContact IContactInternationalAddress.Contact - { - get { return _contact; } - set { SetContact(value); } - } - - public Entities.Common.EdFi.IContact Contact - { - set { SetContact(value); } - } - - private void SetContact(Entities.Common.EdFi.IContact value) - { - _contact = value; - } /// - /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) + /// The identifier assigned to a community organization. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] - public string AddressTypeDescriptor { get; set; } + [DataMember(Name="communityOrganizationId")] + public long CommunityOrganizationId { get; set; } + + long IEducationOrganization.EducationOrganizationId + { + get { return CommunityOrganizationId; } + set { CommunityOrganizationId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -30288,7 +28938,7 @@ private void SetContact(Entities.Common.EdFi.IContact value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactInternationalAddress; + var compareTo = obj as Entities.Common.EdFi.ICommunityOrganization; if (ReferenceEquals(this, compareTo)) return true; @@ -30296,13 +28946,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contact == null || !_contact.Equals(compareTo.Contact)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactInternationalAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICommunityOrganization).CommunityOrganizationId.Equals(compareTo.CommunityOrganizationId)) return false; @@ -30318,12 +28964,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contact != null) - hash.Add(_contact); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactInternationalAddress).AddressTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICommunityOrganization).CommunityOrganizationId); return hash.ToHashCode(); } @@ -30332,443 +28975,247 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// The first line of the address. + /// The full, legally accepted name of the institution. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine1")] - public string AddressLine1 { get; set; } - - /// - /// The second line of the address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine2")] - public string AddressLine2 { get; set; } - - /// - /// The third line of the address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine3")] - public string AddressLine3 { get; set; } - - /// - /// The fourth line of the address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine4")] - public string AddressLine4 { get; set; } - - /// - /// The first date the address is valid. For physical addresses, the date the individual moved to that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BeginDate { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } /// - /// The name of the country. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// The current operational status of the education organization (e.g., active, inactive). /// // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="countryDescriptor")][DescriptorExists("CountryDescriptor")] - public string CountryDescriptor { get; set; } - - /// - /// The last date the address is valid. For physical addresses, the date the individual moved from that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } /// - /// The geographic latitude of the physical address. + /// A short name for the institution. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="latitude")] - public string Latitude { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } /// - /// The geographic longitude of the physical address. + /// The public web site address (URL) for the education organization. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="longitude")] - public string Longitude { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= - // Inherited Collections + // Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Extensions + // One-to-one relationships // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactInternationalAddress")] - public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= - // Collections + // Inherited One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize + // Inherited Collections // ------------------------------------------------------------- - // ------------------------------------------------------------ + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses { - return Entities.Common.EdFi.ContactInternationalAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactInternationalAddress)target); + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } } - void IMappable.Map(object target) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses { - Entities.Common.EdFi.ContactInternationalAddressMapper.MapTo(this, (Entities.Common.EdFi.IContactInternationalAddress)target, null); + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try + get { return _educationOrganizationCategories; } + set { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } - // ---------------------- - // Validate collections - // ---------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set { - // Restore original length - pathBuilder.Length = originalLength; + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); } - // ---------------------------------- } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - [ExcludeFromCodeCoverage] - public class ContactInternationalAddressPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.ContactLanguage table of the Contact aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class ContactLanguage : Entities.Common.EdFi.IContactLanguage, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "ContactLanguage"); - - // Fluent validator instance (threadsafe) - private static ContactLanguagePutPostRequestValidator _validator = new ContactLanguagePutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; - public ContactLanguage() + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators { - ContactLanguageUses = new List(); + get { return _educationOrganizationIndicators; } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } } - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IContact _contact; - [IgnoreDataMember] - Entities.Common.EdFi.IContact IContactLanguage.Contact + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators { - get { return _contact; } - set { SetContact(value); } + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; - public Entities.Common.EdFi.IContact Contact + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones { - set { SetContact(value); } + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } } - private void SetContact(Entities.Common.EdFi.IContact value) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones { - _contact = value; + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; - /// - /// A specification of which written or spoken communication is being used. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="languageDescriptor")][DescriptorExists("LanguageDescriptor")] - public string LanguageDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses { - var compareTo = obj as Entities.Common.EdFi.IContactLanguage; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_contact == null || !_contact.Equals(compareTo.Contact)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactLanguage).LanguageDescriptor, compareTo.LanguageDescriptor)) - return false; - - - return true; + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } } - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses { - var hash = new HashCode(); - //Parent Property - if (_contact != null) - hash.Add(_contact); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactLanguage).LanguageDescriptor); - - return hash.ToHashCode(); + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } } // ------------------------------------------------------------- // ============================================================= - // Inherited Properties + // Extensions // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CommunityOrganization", "CommunityOrganization")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= - // Properties + // Collections // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- + // Versioning // ------------------------------------------------------------- - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactLanguage")] - public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- - - // ============================================================= - // Collections + // OnDeserialize // ------------------------------------------------------------- - private ICollection _contactLanguageUses; - private ICollection _contactLanguageUsesCovariant; - [NoDuplicateMembers] - [DataMember(Name="uses")] - public ICollection ContactLanguageUses + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) { - get { return _contactLanguageUses; } - set + // Reconnect collection item parent references on deserialization + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IContactLanguageUse)e.Item).ContactLanguage = this); - _contactLanguageUses = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactLanguageUse)e.Item).ContactLanguage = this; - _contactLanguageUsesCovariant = covariantList; + item.EducationOrganization = this; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContactLanguage.ContactLanguageUses - { - get { return _contactLanguageUsesCovariant; } - set { ContactLanguageUses = new List(value.Cast()); } - } + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } - // ------------------------------------------------------------- + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_contactLanguageUses != null) foreach (var item in _contactLanguageUses) + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) { - item.ContactLanguage = this; + item.EducationOrganization = this; } } @@ -30779,12 +29226,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactLanguageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactLanguage)target); + return Entities.Common.EdFi.CommunityOrganizationMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICommunityOrganization)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactLanguageMapper.MapTo(this, (Entities.Common.EdFi.IContactLanguage)target, null); + Entities.Common.EdFi.CommunityOrganizationMapper.MapTo(this, (Entities.Common.EdFi.ICommunityOrganization)target, null); } // ------------------------------------------------------------- @@ -30808,19 +29255,78 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (ContactLanguageUses.Any() && mappingContract?.IsMemberSupported("ContactLanguageUses") != false) + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("ContactLanguageUses"); + pathBuilder.Append("EducationOrganizationAddresses"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactLanguageUses, validationContext, validationContext.Items.ForCollection("ContactLanguageUses")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) { yield return result; } @@ -30871,14 +29377,19 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactLanguagePutPostRequestValidator : FluentValidation.AbstractValidator + public class CommunityOrganizationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ContactLanguage = new FullName("edfi", "ContactLanguage"); + private static readonly FullName _fullName_edfi_CommunityOrganization = new FullName("edfi", "CommunityOrganization"); // Declare collection item validators - private ContactLanguageUsePutPostRequestValidator _contactLanguageUsesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -30895,19 +29406,74 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsContactLanguageUseIncluded(x)); + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - if (hasInvalidContactLanguageUsesItems) + if (hasInvalidEducationOrganizationAddressesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ContactLanguageUses", $"A supplied 'ContactLanguageUse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -30928,17 +29494,86 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContactLanguageUse table of the Contact aggregate in the ODS Database. + /// Represents a reference to the CommunityProvider resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class CommunityProviderReference : IResourceReference + { + [DataMember(Name="communityProviderId")] + public long CommunityProviderId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return CommunityProviderId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (CommunityProviderId == default) + { + yield return "CommunityProviderId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "CommunityProvider", + Href = $"/ed-fi/communityProviders/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.CommunityProvider table of the CommunityProvider aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactLanguageUse : Entities.Common.EdFi.IContactLanguageUse, IValidatableObject + public class CommunityProvider : Entities.Common.EdFi.ICommunityProvider, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ContactLanguageUse"); + private static FullName _fullName = new FullName("edfi", "CommunityProvider"); // Fluent validator instance (threadsafe) - private static ContactLanguageUsePutPostRequestValidator _validator = new ContactLanguageUsePutPostRequestValidator(); + private static CommunityProviderPutPostRequestValidator _validator = new CommunityProviderPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -30949,49 +29584,88 @@ public class ContactLanguageUse : Entities.Common.EdFi.IContactLanguageUse, IVal // Constructor // ------------------------------------------------------------- + public CommunityProvider() + { + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CommunityProvider resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IContactLanguage _contactLanguage; - [IgnoreDataMember] - Entities.Common.EdFi.IContactLanguage IContactLanguageUse.ContactLanguage + private bool _communityOrganizationReferenceExplicitlyAssigned; + private CommunityOrganization.EdFi.CommunityOrganizationReference _communityOrganizationReference; + private CommunityOrganization.EdFi.CommunityOrganizationReference ImplicitCommunityOrganizationReference { - get { return _contactLanguage; } - set { SetContactLanguage(value); } - } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_communityOrganizationReference == null && !_communityOrganizationReferenceExplicitlyAssigned) + _communityOrganizationReference = new CommunityOrganization.EdFi.CommunityOrganizationReference(); - public Entities.Common.EdFi.IContactLanguage ContactLanguage - { - set { SetContactLanguage(value); } + return _communityOrganizationReference; + } } - private void SetContactLanguage(Entities.Common.EdFi.IContactLanguage value) + [DataMember(Name="communityOrganizationReference")] + [FullyDefinedReference] + public CommunityOrganization.EdFi.CommunityOrganizationReference CommunityOrganizationReference { - _contactLanguage = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCommunityOrganizationReference != null + && (_communityOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCommunityOrganizationReference.IsReferenceFullyDefined())) + return ImplicitCommunityOrganizationReference; + + return null; + } + set + { + _communityOrganizationReferenceExplicitlyAssigned = true; + _communityOrganizationReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// A description of how the language is used (e.g. Home Language, Native Language, Spoken Language). + /// The identifier assigned to a community provider. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="languageUseDescriptor")][DescriptorExists("LanguageUseDescriptor")] - public string LanguageUseDescriptor { get; set; } + [DataMember(Name="communityProviderId")] + public long CommunityProviderId { get; set; } + + long IEducationOrganization.EducationOrganizationId + { + get { return CommunityProviderId; } + set { CommunityProviderId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -31006,7 +29680,7 @@ private void SetContactLanguage(Entities.Common.EdFi.IContactLanguage value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactLanguageUse; + var compareTo = obj as Entities.Common.EdFi.ICommunityProvider; if (ReferenceEquals(this, compareTo)) return true; @@ -31014,13 +29688,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contactLanguage == null || !_contactLanguage.Equals(compareTo.ContactLanguage)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactLanguageUse).LanguageUseDescriptor, compareTo.LanguageUseDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICommunityProvider).CommunityProviderId.Equals(compareTo.CommunityProviderId)) return false; @@ -31036,12 +29706,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contactLanguage != null) - hash.Add(_contactLanguage); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactLanguageUse).LanguageUseDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICommunityProvider).CommunityProviderId); return hash.ToHashCode(); } @@ -31050,11 +29717,111 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// The full, legally accepted name of the institution. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } + + /// + /// The current operational status of the education organization (e.g., active, inactive). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } + + /// + /// A short name for the institution. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } + + /// + /// The public web site address (URL) for the education organization. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The identifier assigned to a community organization. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ICommunityProvider.CommunityOrganizationId + { + get + { + if (ImplicitCommunityOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCommunityOrganizationReference.IsReferenceFullyDefined())) + { + return ImplicitCommunityOrganizationReference.CommunityOrganizationId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CommunityOrganization + _communityOrganizationReferenceExplicitlyAssigned = false; + ImplicitCommunityOrganizationReference.CommunityOrganizationId = value.GetValueOrDefault(); + } + } + + /// + /// An indication of whether the provider is exempt from having a license. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="licenseExemptIndicator")] + public bool? LicenseExemptIndicator { get; set; } + + /// + /// Indicates the category of the provider. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="providerCategoryDescriptor")][DescriptorExists("ProviderCategoryDescriptor")] + public string ProviderCategoryDescriptor { get; set; } + + /// + /// Indicates the profitability status of the provider. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="providerProfitabilityDescriptor")][DescriptorExists("ProviderProfitabilityDescriptor")] + public string ProviderProfitabilityDescriptor { get; set; } + + /// + /// Indicates the status of the provider. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="providerStatusDescriptor")][DescriptorExists("ProviderStatusDescriptor")] + public string ProviderStatusDescriptor { get; set; } + + /// + /// An indication of whether the community provider is a school. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="schoolIndicator")] + public bool? SchoolIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31070,12 +29837,138 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses + { + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories + { + get { return _educationOrganizationCategories; } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators + { + get { return _educationOrganizationIndicators; } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactLanguageUse")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CommunityProvider", "CommunityProvider")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -31087,11 +29980,54 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -31099,18 +30035,25 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactLanguageUseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactLanguageUse)target); + return Entities.Common.EdFi.CommunityProviderMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICommunityProvider)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactLanguageUseMapper.MapTo(this, (Entities.Common.EdFi.IContactLanguageUse)target, null); + Entities.Common.EdFi.CommunityProviderMapper.MapTo(this, (Entities.Common.EdFi.ICommunityProvider)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ICommunityProvider.CommunityOrganizationResourceId + { + get { return null; } + set { ImplicitCommunityOrganizationReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- // ================================== @@ -31128,12 +30071,83 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -31179,9 +30193,19 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactLanguageUsePutPostRequestValidator : FluentValidation.AbstractValidator + public class CommunityProviderPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_CommunityProvider = new FullName("edfi", "CommunityProvider"); + + // Declare collection item validators + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -31194,32 +30218,219 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + // Profile-based collection item filter validation + string profileName = null; - return false; - } + // Get the current mapping contract + var mappingContract = (CommunityProviderMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_CommunityProvider); + + if (mappingContract != null) + { + if (mappingContract.IsEducationOrganizationAddressIncluded != null) + { + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); + + if (hasInvalidEducationOrganizationAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } return true; } } // ----------------------------------------------------------------- +} +// Aggregate: CommunityProviderLicense + +namespace EdFi.Ods.Api.Common.Models.Resources.CommunityProviderLicense.EdFi +{ /// - /// A class which represents the edfi.ContactOtherName table of the Contact aggregate in the ODS Database. + /// Represents a reference to the CommunityProviderLicense resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class CommunityProviderLicenseReference : IResourceReference + { + [DataMember(Name="communityProviderId")] + public long CommunityProviderId { get; set; } + + [DataMember(Name="licenseIdentifier")] + public string LicenseIdentifier { get; set; } + + [DataMember(Name="licensingOrganization")] + public string LicensingOrganization { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return CommunityProviderId != default(long) && LicenseIdentifier != default(string) && LicensingOrganization != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (CommunityProviderId == default) + { + yield return "CommunityProviderId"; + } + + if (LicenseIdentifier == default) + { + yield return "LicenseIdentifier"; + } + + if (LicensingOrganization == default) + { + yield return "LicensingOrganization"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "CommunityProviderLicense", + Href = $"/ed-fi/communityProviderLicenses/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.CommunityProviderLicense table of the CommunityProviderLicense aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactOtherName : Entities.Common.EdFi.IContactOtherName, IValidatableObject + public class CommunityProviderLicense : Entities.Common.EdFi.ICommunityProviderLicense, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ContactOtherName"); + private static FullName _fullName = new FullName("edfi", "CommunityProviderLicense"); // Fluent validator instance (threadsafe) - private static ContactOtherNamePutPostRequestValidator _validator = new ContactOtherNamePutPostRequestValidator(); + private static CommunityProviderLicensePutPostRequestValidator _validator = new CommunityProviderLicensePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -31236,43 +30447,100 @@ public class ContactOtherName : Entities.Common.EdFi.IContactOtherName, IValidat // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CommunityProviderLicense resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _communityProviderReferenceExplicitlyAssigned; + private CommunityProvider.EdFi.CommunityProviderReference _communityProviderReference; + private CommunityProvider.EdFi.CommunityProviderReference ImplicitCommunityProviderReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_communityProviderReference == null && !_communityProviderReferenceExplicitlyAssigned) + _communityProviderReference = new CommunityProvider.EdFi.CommunityProviderReference(); + + return _communityProviderReference; + } + } + + [DataMember(Name="communityProviderReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public CommunityProvider.EdFi.CommunityProviderReference CommunityProviderReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCommunityProviderReference != null + && (_communityProviderReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCommunityProviderReference.IsReferenceFullyDefined())) + return ImplicitCommunityProviderReference; + + return null; + } + set + { + _communityProviderReferenceExplicitlyAssigned = true; + _communityProviderReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IContact _contact; - [IgnoreDataMember] - Entities.Common.EdFi.IContact IContactOtherName.Contact + /// + /// The identifier assigned to a community provider. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderId { - get { return _contact; } - set { SetContact(value); } - } + get + { + if (ImplicitCommunityProviderReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCommunityProviderReference.IsReferenceFullyDefined())) + return ImplicitCommunityProviderReference.CommunityProviderId; - public Entities.Common.EdFi.IContact Contact - { - set { SetContact(value); } - } + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - private void SetContact(Entities.Common.EdFi.IContact value) - { - _contact = value; + // CommunityProvider + _communityProviderReferenceExplicitlyAssigned = false; + ImplicitCommunityProviderReference.CommunityProviderId = value; + } } /// - /// The types of alternate names for an individual. + /// The unique identifier issued by the licensing organization. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="otherNameTypeDescriptor")][DescriptorExists("OtherNameTypeDescriptor")] - public string OtherNameTypeDescriptor { get; set; } + [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="licenseIdentifier")] + public string LicenseIdentifier { get; set; } + + /// + /// The organization issuing the license. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="licensingOrganization")] + public string LicensingOrganization { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31287,7 +30555,7 @@ private void SetContact(Entities.Common.EdFi.IContact value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactOtherName; + var compareTo = obj as Entities.Common.EdFi.ICommunityProviderLicense; if (ReferenceEquals(this, compareTo)) return true; @@ -31295,13 +30563,19 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contact == null || !_contact.Equals(compareTo.Contact)) + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICommunityProviderLicense).CommunityProviderId.Equals(compareTo.CommunityProviderId)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactOtherName).OtherNameTypeDescriptor, compareTo.OtherNameTypeDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICommunityProviderLicense).LicenseIdentifier, compareTo.LicenseIdentifier)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICommunityProviderLicense).LicensingOrganization, compareTo.LicensingOrganization)) return false; @@ -31317,12 +30591,16 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contact != null) - hash.Add(_contact); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICommunityProviderLicense).CommunityProviderId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactOtherName).OtherNameTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.ICommunityProviderLicense).LicenseIdentifier); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICommunityProviderLicense).LicensingOrganization); return hash.ToHashCode(); } @@ -31338,46 +30616,64 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. + /// The maximum number that can be contained or accommodated which a provider is authorized or licensed to serve. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="authorizedFacilityCapacity")] + public int? AuthorizedFacilityCapacity { get; set; } + + /// + /// The month, day, and year on which a license is active or becomes effective. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="firstName")] - public string FirstName { get; set; } + [DataMember(Name="licenseEffectiveDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime LicenseEffectiveDate { get; set; } /// - /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). + /// The month, day, and year on which a license will expire. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="generationCodeSuffix")] - public string GenerationCodeSuffix { get; set; } + [DataMember(Name="licenseExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? LicenseExpirationDate { get; set; } /// - /// The name borne in common by members of a family. + /// The month, day, and year on which an active license was issued. /// // NOT in a reference, NOT a lookup column + [DataMember(Name="licenseIssueDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? LicenseIssueDate { get; set; } + + /// + /// An indication of the status of the license. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="licenseStatusDescriptor")][DescriptorExists("LicenseStatusDescriptor")] + public string LicenseStatusDescriptor { get; set; } + + /// + /// An indication of the category of the license. + /// + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="lastSurname")] - public string LastSurname { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="licenseTypeDescriptor")][DescriptorExists("LicenseTypeDescriptor")] + public string LicenseTypeDescriptor { get; set; } /// - /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// The oldest age of children a provider is authorized or licensed to serve. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="middleName")] - public string MiddleName { get; set; } + [DataMember(Name="oldestAgeAuthorizedToServe")] + public int? OldestAgeAuthorizedToServe { get; set; } /// - /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// The youngest age of children a provider is authorized or licensed to serve. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="personalTitlePrefix")] - public string PersonalTitlePrefix { get; set; } + [DataMember(Name="youngestAgeAuthorizedToServe")] + public int? YoungestAgeAuthorizedToServe { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31398,7 +30694,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactOtherName")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CommunityProviderLicense", "CommunityProviderLicense")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -31410,6 +30706,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -31422,18 +30725,25 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactOtherNameMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactOtherName)target); + return Entities.Common.EdFi.CommunityProviderLicenseMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICommunityProviderLicense)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactOtherNameMapper.MapTo(this, (Entities.Common.EdFi.IContactOtherName)target, null); + Entities.Common.EdFi.CommunityProviderLicenseMapper.MapTo(this, (Entities.Common.EdFi.ICommunityProviderLicense)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderResourceId + { + get { return null; } + set { ImplicitCommunityProviderReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- // ================================== @@ -31451,7 +30761,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -31502,9 +30811,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactOtherNamePutPostRequestValidator : FluentValidation.AbstractValidator + public class CommunityProviderLicensePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -31532,17 +30841,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContactPersonalIdentificationDocument table of the Contact aggregate in the ODS Database. + /// A class which represents the edfi.CompetencyLevelDescriptor table of the CompetencyLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactPersonalIdentificationDocument : Entities.Common.EdFi.IContactPersonalIdentificationDocument, IValidatableObject + public class CompetencyLevelDescriptor : Entities.Common.EdFi.ICompetencyLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ContactPersonalIdentificationDocument"); + private static FullName _fullName = new FullName("edfi", "CompetencyLevelDescriptor"); // Fluent validator instance (threadsafe) - private static ContactPersonalIdentificationDocumentPutPostRequestValidator _validator = new ContactPersonalIdentificationDocumentPutPostRequestValidator(); + private static CompetencyLevelDescriptorPutPostRequestValidator _validator = new CompetencyLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -31559,6 +30873,13 @@ public class ContactPersonalIdentificationDocument : Entities.Common.EdFi.IConta // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CompetencyLevelDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -31569,42 +30890,19 @@ public class ContactPersonalIdentificationDocument : Entities.Common.EdFi.IConta //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IContact _contact; - - [IgnoreDataMember] - Entities.Common.EdFi.IContact IContactPersonalIdentificationDocument.Contact - { - get { return _contact; } - set { SetContact(value); } - } - - public Entities.Common.EdFi.IContact Contact - { - set { SetContact(value); } - } - - private void SetContact(Entities.Common.EdFi.IContact value) - { - _contact = value; - } /// - /// The primary function of the document used for establishing identity. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] - public string IdentificationDocumentUseDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CompetencyLevelDescriptorId { get; set; } - /// - /// The category of the document relative to its purpose. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] - public string PersonalInformationVerificationDescriptor { get; set; } + int IDescriptor.DescriptorId + { + get { return CompetencyLevelDescriptorId; } + set { CompetencyLevelDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -31619,7 +30917,7 @@ private void SetContact(Entities.Common.EdFi.IContact value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactPersonalIdentificationDocument; + var compareTo = obj as Entities.Common.EdFi.ICompetencyLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -31627,18 +30925,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contact == null || !_contact.Equals(compareTo.Contact)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICompetencyLevelDescriptor).CompetencyLevelDescriptorId.Equals(compareTo.CompetencyLevelDescriptorId)) return false; @@ -31654,16 +30943,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contact != null) - hash.Add(_contact); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).IdentificationDocumentUseDescriptor); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).PersonalInformationVerificationDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICompetencyLevelDescriptor).CompetencyLevelDescriptorId); return hash.ToHashCode(); } @@ -31672,50 +30954,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The day when the document expires, if null then never expires. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DocumentExpirationDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The title of the document given by the issuer. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="documentTitle")] - public string DocumentTitle { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// The end date of the period when the descriptor is in effect. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] - public string IssuerCountryDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The unique identifier on the issuer's identification system. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerDocumentIdentificationCode")] - public string IssuerDocumentIdentificationCode { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// Name of the entity or institution that issued the document. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerName")] - public string IssuerName { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -31736,8 +31028,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactPersonalIdentificationDocument")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -31748,6 +31043,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -31760,12 +31062,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactPersonalIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactPersonalIdentificationDocument)target); + return Entities.Common.EdFi.CompetencyLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICompetencyLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactPersonalIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IContactPersonalIdentificationDocument)target, null); + Entities.Common.EdFi.CompetencyLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICompetencyLevelDescriptor)target, null); } // ------------------------------------------------------------- @@ -31773,66 +31075,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -31840,9 +31082,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactPersonalIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator + public class CompetencyLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -31870,17 +31112,127 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContactTelephone table of the Contact aggregate in the ODS Database. + /// Represents a reference to the CompetencyObjective resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class CompetencyObjectiveReference : IResourceReference + { + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="objective")] + public string Objective { get; set; } + + [DataMember(Name="objectiveGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string ObjectiveGradeLevelDescriptor { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationId != default(long) && Objective != default(string) && ObjectiveGradeLevelDescriptor != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (Objective == default) + { + yield return "Objective"; + } + + if (ObjectiveGradeLevelDescriptor == default) + { + yield return "ObjectiveGradeLevelDescriptor"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "CompetencyObjective", + Href = $"/ed-fi/competencyObjectives/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.CompetencyObjective table of the CompetencyObjective aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContactTelephone : Entities.Common.EdFi.IContactTelephone, IValidatableObject + public class CompetencyObjective : Entities.Common.EdFi.ICompetencyObjective, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ContactTelephone"); + private static FullName _fullName = new FullName("edfi", "CompetencyObjective"); // Fluent validator instance (threadsafe) - private static ContactTelephonePutPostRequestValidator _validator = new ContactTelephonePutPostRequestValidator(); + private static CompetencyObjectivePutPostRequestValidator _validator = new CompetencyObjectivePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -31897,52 +31249,100 @@ public class ContactTelephone : Entities.Common.EdFi.IContactTelephone, IValidat // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CompetencyObjective resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IContact _contact; - [IgnoreDataMember] - Entities.Common.EdFi.IContact IContactTelephone.Contact + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationId { - get { return _contact; } - set { SetContact(value); } - } + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; - public Entities.Common.EdFi.IContact Contact - { - set { SetContact(value); } - } + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - private void SetContact(Entities.Common.EdFi.IContact value) - { - _contact = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } } /// - /// The telephone number including the area code, and extension, if applicable. + /// The designated title of the competency objective. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="telephoneNumber")] - public string TelephoneNumber { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="objective")] + public string Objective { get; set; } /// - /// The type of communication number listed for an individual or organization. + /// The grade level for which the competency objective is targeted. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="telephoneNumberTypeDescriptor")][DescriptorExists("TelephoneNumberTypeDescriptor")] - public string TelephoneNumberTypeDescriptor { get; set; } + [DataMember(Name="objectiveGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string ObjectiveGradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31957,7 +31357,7 @@ private void SetContact(Entities.Common.EdFi.IContact value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContactTelephone; + var compareTo = obj as Entities.Common.EdFi.ICompetencyObjective; if (ReferenceEquals(this, compareTo)) return true; @@ -31965,18 +31365,19 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_contact == null || !_contact.Equals(compareTo.Contact)) + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICompetencyObjective).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumber, compareTo.TelephoneNumber)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICompetencyObjective).Objective, compareTo.Objective)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumberTypeDescriptor, compareTo.TelephoneNumberTypeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICompetencyObjective).ObjectiveGradeLevelDescriptor, compareTo.ObjectiveGradeLevelDescriptor)) return false; @@ -31992,16 +31393,16 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_contact != null) - hash.Add(_contact); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICompetencyObjective).EducationOrganizationId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumber); + hash.Add((this as Entities.Common.EdFi.ICompetencyObjective).Objective); // Standard Property - hash.Add((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumberTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.ICompetencyObjective).ObjectiveGradeLevelDescriptor); return hash.ToHashCode(); } @@ -32017,26 +31418,28 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// An indication that the telephone number should not be published. + /// The Identifier for the competency objective. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="competencyObjectiveId")] + public string CompetencyObjectiveId { get; set; } /// - /// The order of priority assigned to telephone numbers to define which number to attempt first, second, etc. + /// The description of the student competency objective. /// // NOT in a reference, NOT a lookup column - [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="orderOfPriority")] - public int? OrderOfPriority { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// An indication that the telephone number is technically capable of sending and receiving Short Message Service (SMS) text messages. + /// One or more statements that describes the criteria used by teachers and students to check for attainment of a competency objective. This criteria gives clear indications as to the degree to which learning is moving through the Zone or Proximal Development toward independent achievement of the competency objective. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="textMessageCapabilityIndicator")] - public bool? TextMessageCapabilityIndicator { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="successCriteria")] + public string SuccessCriteria { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -32057,7 +31460,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactTelephone")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CompetencyObjective", "CompetencyObjective")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -32069,6 +31472,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -32081,18 +31491,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContactTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactTelephone)target); + return Entities.Common.EdFi.CompetencyObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICompetencyObjective)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContactTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IContactTelephone)target, null); + Entities.Common.EdFi.CompetencyObjectiveMapper.MapTo(this, (Entities.Common.EdFi.ICompetencyObjective)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -32110,7 +31534,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -32161,9 +31584,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContactTelephonePutPostRequestValidator : FluentValidation.AbstractValidator + public class CompetencyObjectivePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -32192,292 +31615,119 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContactTypeDescriptor table of the ContactTypeDescriptor aggregate in the ODS Database. + /// Represents a reference to the Contact resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class ContactTypeDescriptor : Entities.Common.EdFi.IContactTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ContactReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "ContactTypeDescriptor"); - - // Fluent validator instance (threadsafe) - private static ContactTypeDescriptorPutPostRequestValidator _validator = new ContactTypeDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ + [DataMember(Name="contactUniqueId")] + public string ContactUniqueId + { + get => _contactUniqueId; + set + { + _contactUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); + } + } + private string _contactUniqueId; /// - /// The unique identifier for the ContactTypeDescriptor resource. + /// Gets or sets the resource identifier of the referenced resource. /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- + public Guid ResourceId { get; set; } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ContactTypeDescriptorId { get; set; } + public string Discriminator { get; set; } - int IDescriptor.DescriptorId + + private Link _link; + + [DataMember(Name="link")] + public Link Link { - get { return ContactTypeDescriptorId; } - set { ContactTypeDescriptorId = value; } - } - // ------------------------------------------------------------- + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } - // ============================================================= - // Equality - // ------------------------------------------------------------- + return _link; + } + } /// - /// Determines equality based on the natural key properties of the resource. + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() { - var compareTo = obj as Entities.Common.EdFi.IContactTypeDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; + return ContactUniqueId != default(string); + } - if (compareTo == null) - return false; + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (ContactUniqueId == default) + { + yield return "ContactUniqueId"; + } + } - // Derived Property - if (!(this as Entities.Common.EdFi.IContactTypeDescriptor).ContactTypeDescriptorId.Equals(compareTo.ContactTypeDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IContactTypeDescriptor).ContactTypeDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.ContactTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactTypeDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.ContactTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IContactTypeDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class ContactTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private Link CreateLink() { - if (context.InstanceToValidate == null) + var link = new Link { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + Rel = "Contact", + Href = $"/ed-fi/contacts/{ResourceId:n}" + }; - return false; - } + if (string.IsNullOrEmpty(Discriminator)) + return link; - var instance = context.InstanceToValidate; + string[] linkParts = Discriminator.Split('.'); - var failures = new List(); + if (linkParts.Length < 2) + return link; - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - return false; - } + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; - return true; + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } - } - // ----------------------------------------------------------------- - -} -// Aggregate: ContentClassDescriptor + } // Aggregate reference -namespace EdFi.Ods.Api.Common.Models.Resources.ContentClassDescriptor.EdFi -{ /// - /// A class which represents the edfi.ContentClassDescriptor table of the ContentClassDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.Contact table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContentClassDescriptor : Entities.Common.EdFi.IContentClassDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class Contact : Entities.Common.EdFi.IContact, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ContentClassDescriptor"); + private static FullName _fullName = new FullName("edfi", "Contact"); // Fluent validator instance (threadsafe) - private static ContentClassDescriptorPutPostRequestValidator _validator = new ContentClassDescriptorPutPostRequestValidator(); + private static ContactPutPostRequestValidator _validator = new ContactPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -32488,6 +31738,16 @@ public class ContentClassDescriptor : Entities.Common.EdFi.IContentClassDescript // Constructor // ------------------------------------------------------------- + public Contact() + { + ContactAddresses = new List(); + ContactElectronicMails = new List(); + ContactInternationalAddresses = new List(); + ContactLanguages = new List(); + ContactOtherNames = new List(); + ContactPersonalIdentificationDocuments = new List(); + ContactTelephones = new List(); + } // ------------------------------------------------------------ @@ -32496,7 +31756,7 @@ public class ContentClassDescriptor : Entities.Common.EdFi.IContentClassDescript // ------------------------------------------------------------ /// - /// The unique identifier for the ContentClassDescriptor resource. + /// The unique identifier for the Contact resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -32506,6 +31766,40 @@ public class ContentClassDescriptor : Entities.Common.EdFi.IContentClassDescript // ============================================================= // References // ------------------------------------------------------------- + + private bool _personReferenceExplicitlyAssigned; + private Person.EdFi.PersonReference _personReference; + private Person.EdFi.PersonReference ImplicitPersonReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_personReference == null && !_personReferenceExplicitlyAssigned) + _personReference = new Person.EdFi.PersonReference(); + + return _personReference; + } + } + + [DataMember(Name="personReference")] + [FullyDefinedReference] + public Person.EdFi.PersonReference PersonReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitPersonReference != null + && (_personReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + return ImplicitPersonReference; + + return null; + } + set + { + _personReferenceExplicitlyAssigned = true; + _personReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -32513,17 +31807,24 @@ public class ContentClassDescriptor : Entities.Common.EdFi.IContentClassDescript // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// A unique alphanumeric code assigned to a contact. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ContentClassDescriptorId { get; set; } - - int IDescriptor.DescriptorId + [RequiredWithNonDefault] + [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [UniqueId][DataMember(Name="contactUniqueId")] + public string ContactUniqueId { - get { return ContentClassDescriptorId; } - set { ContentClassDescriptorId = value; } + get => _contactUniqueId; + set + { + _contactUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); + } } + private string _contactUniqueId; + + string IIdentifiablePerson.UniqueId { get { return ContactUniqueId; } } // ------------------------------------------------------------- // ============================================================= @@ -32538,7 +31839,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IContentClassDescriptor; + var compareTo = obj as Entities.Common.EdFi.IContact; if (ReferenceEquals(this, compareTo)) return true; @@ -32546,12 +31847,10 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Derived Property - if (!(this as Entities.Common.EdFi.IContentClassDescriptor).ContentClassDescriptorId.Equals(compareTo.ContentClassDescriptorId)) + // Property + if (!((this as Entities.Common.EdFi.IContact).ContactUniqueId.Equals(compareTo.ContactUniqueId))) return false; - return true; } @@ -32565,8 +31864,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IContentClassDescriptor).ContentClassDescriptorId); + //Property + hash.Add((this as Entities.Common.EdFi.IContact).ContactUniqueId); return hash.ToHashCode(); } @@ -32575,60 +31874,160 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="firstName")] + public string FirstName { get; set; } /// - /// The description of the descriptor. + /// The gender the contact identifies themselves as. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="genderIdentity")] + public string GenderIdentity { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="generationCodeSuffix")] + public string GenerationCodeSuffix { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The extent of formal instruction an individual has received (e.g., the highest grade in school completed or its equivalent or the highest degree received). /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="highestCompletedLevelOfEducationDescriptor")][DescriptorExists("LevelOfEducationDescriptor")] + public string HighestCompletedLevelOfEducationDescriptor { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The name borne in common by members of a family. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } /// - /// A shortened description for the descriptor. + /// The login ID for the user; used for security access control interface. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="loginId")] + public string LoginId { get; set; } + + /// + /// The individual's maiden name. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [DataMember(Name="maidenName")] + public string MaidenName { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="middleName")] + public string MiddleName { get; set; } + + /// + /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="personalTitlePrefix")] + public string PersonalTitlePrefix { get; set; } + + /// + /// A unique alphanumeric code assigned to a person. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IContact.PersonId + { + get + { + if (ImplicitPersonReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + { + return ImplicitPersonReference.PersonId; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Person + _personReferenceExplicitlyAssigned = false; + ImplicitPersonReference.PersonId = value; + } + } + + /// + /// The first name the individual prefers, if different from their legal first name + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="preferredFirstName")] + public string PreferredFirstName { get; set; } + + /// + /// The last name the individual prefers, if different from their legal last name + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="preferredLastSurname")] + public string PreferredLastSurname { get; set; } + + /// + /// A person's birth sex. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] + public string SexDescriptor { get; set; } + + /// + /// This descriptor defines the originating record source system for the person. + /// + + // IS in a reference (Contact.SourceSystemDescriptorId), IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + string Entities.Common.EdFi.IContact.SourceSystemDescriptor + { + get + { + if (ImplicitPersonReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + { + return ImplicitPersonReference.SourceSystemDescriptor; + } + + return null; + } + set + { + ImplicitPersonReference.SourceSystemDescriptor = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -32649,16 +32048,223 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "Contact")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _contactAddresses; + private ICollection _contactAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection ContactAddresses + { + get { return _contactAddresses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactAddress)e.Item).Contact = this); + _contactAddresses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactAddress)e.Item).Contact = this; + _contactAddressesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactAddresses + { + get { return _contactAddressesCovariant; } + set { ContactAddresses = new List(value.Cast()); } + } + + private ICollection _contactElectronicMails; + private ICollection _contactElectronicMailsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="electronicMails")] + public ICollection ContactElectronicMails + { + get { return _contactElectronicMails; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactElectronicMail)e.Item).Contact = this); + _contactElectronicMails = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactElectronicMail)e.Item).Contact = this; + _contactElectronicMailsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactElectronicMails + { + get { return _contactElectronicMailsCovariant; } + set { ContactElectronicMails = new List(value.Cast()); } + } + + private ICollection _contactInternationalAddresses; + private ICollection _contactInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection ContactInternationalAddresses + { + get { return _contactInternationalAddresses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactInternationalAddress)e.Item).Contact = this); + _contactInternationalAddresses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactInternationalAddress)e.Item).Contact = this; + _contactInternationalAddressesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactInternationalAddresses + { + get { return _contactInternationalAddressesCovariant; } + set { ContactInternationalAddresses = new List(value.Cast()); } + } + + private ICollection _contactLanguages; + private ICollection _contactLanguagesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="languages")] + public ICollection ContactLanguages + { + get { return _contactLanguages; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactLanguage)e.Item).Contact = this); + _contactLanguages = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactLanguage)e.Item).Contact = this; + _contactLanguagesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactLanguages + { + get { return _contactLanguagesCovariant; } + set { ContactLanguages = new List(value.Cast()); } + } + + private ICollection _contactOtherNames; + private ICollection _contactOtherNamesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="otherNames")] + public ICollection ContactOtherNames + { + get { return _contactOtherNames; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactOtherName)e.Item).Contact = this); + _contactOtherNames = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactOtherName)e.Item).Contact = this; + _contactOtherNamesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactOtherNames + { + get { return _contactOtherNamesCovariant; } + set { ContactOtherNames = new List(value.Cast()); } + } + + private ICollection _contactPersonalIdentificationDocuments; + private ICollection _contactPersonalIdentificationDocumentsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="personalIdentificationDocuments")] + public ICollection ContactPersonalIdentificationDocuments + { + get { return _contactPersonalIdentificationDocuments; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactPersonalIdentificationDocument)e.Item).Contact = this); + _contactPersonalIdentificationDocuments = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactPersonalIdentificationDocument)e.Item).Contact = this; + _contactPersonalIdentificationDocumentsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactPersonalIdentificationDocuments + { + get { return _contactPersonalIdentificationDocumentsCovariant; } + set { ContactPersonalIdentificationDocuments = new List(value.Cast()); } + } + + private ICollection _contactTelephones; + private ICollection _contactTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="telephones")] + public ICollection ContactTelephones + { + get { return _contactTelephones; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactTelephone)e.Item).Contact = this); + _contactTelephones = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactTelephone)e.Item).Contact = this; + _contactTelephonesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactTelephones + { + get { return _contactTelephonesCovariant; } + set { ContactTelephones = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -32676,6 +32282,47 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_contactAddresses != null) foreach (var item in _contactAddresses) + { + item.Contact = this; + } + + if (_contactElectronicMails != null) foreach (var item in _contactElectronicMails) + { + item.Contact = this; + } + + if (_contactInternationalAddresses != null) foreach (var item in _contactInternationalAddresses) + { + item.Contact = this; + } + + if (_contactLanguages != null) foreach (var item in _contactLanguages) + { + item.Contact = this; + } + + if (_contactOtherNames != null) foreach (var item in _contactOtherNames) + { + item.Contact = this; + } + + if (_contactPersonalIdentificationDocuments != null) foreach (var item in _contactPersonalIdentificationDocuments) + { + item.Contact = this; + } + + if (_contactTelephones != null) foreach (var item in _contactTelephones) + { + item.Contact = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -32683,19 +32330,176 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContentClassDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContentClassDescriptor)target); + return Entities.Common.EdFi.ContactMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContact)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContentClassDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IContentClassDescriptor)target, null); + Entities.Common.EdFi.ContactMapper.MapTo(this, (Entities.Common.EdFi.IContact)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IContact.PersonResourceId + { + get { return null; } + set { ImplicitPersonReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IContact.PersonDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitPersonReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ContactAddresses.Any() && mappingContract?.IsMemberSupported("ContactAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactAddresses, validationContext, validationContext.Items.ForCollection("ContactAddresses")))) + { + yield return result; + } + } + + if (ContactElectronicMails.Any() && mappingContract?.IsMemberSupported("ContactElectronicMails") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactElectronicMails"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactElectronicMails, validationContext, validationContext.Items.ForCollection("ContactElectronicMails")))) + { + yield return result; + } + } + + if (ContactInternationalAddresses.Any() && mappingContract?.IsMemberSupported("ContactInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactInternationalAddresses, validationContext, validationContext.Items.ForCollection("ContactInternationalAddresses")))) + { + yield return result; + } + } + + if (ContactLanguages.Any() && mappingContract?.IsMemberSupported("ContactLanguages") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactLanguages"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactLanguages, validationContext, validationContext.Items.ForCollection("ContactLanguages")))) + { + yield return result; + } + } + + if (ContactOtherNames.Any() && mappingContract?.IsMemberSupported("ContactOtherNames") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactOtherNames"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactOtherNames, validationContext, validationContext.Items.ForCollection("ContactOtherNames")))) + { + yield return result; + } + } + + if (ContactPersonalIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("ContactPersonalIdentificationDocuments") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactPersonalIdentificationDocuments"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactPersonalIdentificationDocuments, validationContext, validationContext.Items.ForCollection("ContactPersonalIdentificationDocuments")))) + { + yield return result; + } + } + + if (ContactTelephones.Any() && mappingContract?.IsMemberSupported("ContactTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactTelephones, validationContext, validationContext.Items.ForCollection("ContactTelephones")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -32703,9 +32507,20 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContentClassDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_Contact = new FullName("edfi", "Contact"); + + // Declare collection item validators + private ContactAddressPutPostRequestValidator _contactAddressesValidator = new (); + private ContactElectronicMailPutPostRequestValidator _contactElectronicMailsValidator = new (); + private ContactInternationalAddressPutPostRequestValidator _contactInternationalAddressesValidator = new (); + private ContactLanguagePutPostRequestValidator _contactLanguagesValidator = new (); + private ContactOtherNamePutPostRequestValidator _contactOtherNamesValidator = new (); + private ContactPersonalIdentificationDocumentPutPostRequestValidator _contactPersonalIdentificationDocumentsValidator = new (); + private ContactTelephonePutPostRequestValidator _contactTelephonesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -32718,6 +32533,94 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ContactMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_Contact); + + if (mappingContract != null) + { + if (mappingContract.IsContactAddressIncluded != null) + { + var hasInvalidContactAddressesItems = instance.ContactAddresses.Any(x => !mappingContract.IsContactAddressIncluded(x)); + + if (hasInvalidContactAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactAddresses", $"A supplied 'ContactAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsContactElectronicMailIncluded != null) + { + var hasInvalidContactElectronicMailsItems = instance.ContactElectronicMails.Any(x => !mappingContract.IsContactElectronicMailIncluded(x)); + + if (hasInvalidContactElectronicMailsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactElectronicMails", $"A supplied 'ContactElectronicMail' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsContactInternationalAddressIncluded != null) + { + var hasInvalidContactInternationalAddressesItems = instance.ContactInternationalAddresses.Any(x => !mappingContract.IsContactInternationalAddressIncluded(x)); + + if (hasInvalidContactInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactInternationalAddresses", $"A supplied 'ContactInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsContactLanguageIncluded != null) + { + var hasInvalidContactLanguagesItems = instance.ContactLanguages.Any(x => !mappingContract.IsContactLanguageIncluded(x)); + + if (hasInvalidContactLanguagesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactLanguages", $"A supplied 'ContactLanguage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsContactOtherNameIncluded != null) + { + var hasInvalidContactOtherNamesItems = instance.ContactOtherNames.Any(x => !mappingContract.IsContactOtherNameIncluded(x)); + + if (hasInvalidContactOtherNamesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactOtherNames", $"A supplied 'ContactOtherName' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsContactPersonalIdentificationDocumentIncluded != null) + { + var hasInvalidContactPersonalIdentificationDocumentsItems = instance.ContactPersonalIdentificationDocuments.Any(x => !mappingContract.IsContactPersonalIdentificationDocumentIncluded(x)); + + if (hasInvalidContactPersonalIdentificationDocumentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactPersonalIdentificationDocuments", $"A supplied 'ContactPersonalIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsContactTelephoneIncluded != null) + { + var hasInvalidContactTelephonesItems = instance.ContactTelephones.Any(x => !mappingContract.IsContactTelephoneIncluded(x)); + + if (hasInvalidContactTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactTelephones", $"A supplied 'ContactTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -32733,22 +32636,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ContinuationOfServicesReasonDescriptor table of the ContinuationOfServicesReasonDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ContactAddress table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ContinuationOfServicesReasonDescriptor : Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ContactAddress : Entities.Common.EdFi.IContactAddress, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ContinuationOfServicesReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "ContactAddress"); // Fluent validator instance (threadsafe) - private static ContinuationOfServicesReasonDescriptorPutPostRequestValidator _validator = new ContinuationOfServicesReasonDescriptorPutPostRequestValidator(); + private static ContactAddressPutPostRequestValidator _validator = new ContactAddressPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -32759,19 +32657,16 @@ public class ContinuationOfServicesReasonDescriptor : Entities.Common.EdFi.ICont // Constructor // ------------------------------------------------------------- + public ContactAddress() + { + ContactAddressPeriods = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ContinuationOfServicesReasonDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -32782,44 +32677,118 @@ public class ContinuationOfServicesReasonDescriptor : Entities.Common.EdFi.ICont //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IContact _contact; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ContinuationOfServicesReasonDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IContact IContactAddress.Contact + { + get { return _contact; } + set { SetContact(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IContact Contact { - get { return ContinuationOfServicesReasonDescriptorId; } - set { ContinuationOfServicesReasonDescriptorId = value; } + set { SetContact(value); } } - // ------------------------------------------------------------- - // ============================================================= - // Equality - // ------------------------------------------------------------- + private void SetContact(Entities.Common.EdFi.IContact value) + { + _contact = value; + } /// - /// Determines equality based on the natural key properties of the resource. + /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] + public string AddressTypeDescriptor { get; set; } + + /// + /// The name of the city in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="city")] + public string City { get; set; } + + /// + /// The five or nine digit zip code or overseas postal code portion of an address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="postalCode")] + public string PostalCode { get; set; } + + /// + /// The abbreviation for the state (within the United States) or outlying area in which an address is located. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string StateAbbreviationDescriptor { get; set; } + + /// + /// The street number and street name or post office box number of an address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="streetNumberName")] + public string StreetNumberName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IContactAddress; + + if (ReferenceEquals(this, compareTo)) + return true; if (compareTo == null) return false; + // Parent Property + if (_contact == null || !_contact.Equals(compareTo.Contact)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor).ContinuationOfServicesReasonDescriptorId.Equals(compareTo.ContinuationOfServicesReasonDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactAddress).City, compareTo.City)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactAddress).PostalCode, compareTo.PostalCode)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactAddress).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactAddress).StreetNumberName, compareTo.StreetNumberName)) return false; @@ -32835,9 +32804,28 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_contact != null) + hash.Add(_contact); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor).ContinuationOfServicesReasonDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactAddress).AddressTypeDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactAddress).City); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactAddress).PostalCode); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactAddress).StateAbbreviationDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactAddress).StreetNumberName); return hash.ToHashCode(); } @@ -32846,60 +32834,82 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The apartment, room, or suite number of an address. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [DataMember(Name="apartmentRoomSuiteNumber")] + public string ApartmentRoomSuiteNumber { get; set; } /// - /// The description of the descriptor. + /// The number of the building on the site, if more than one building shares the same address. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="buildingSiteNumber")] + public string BuildingSiteNumber { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The congressional district in which an address is located. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="congressionalDistrict")] + public string CongressionalDistrict { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="countyFIPSCode")] + public string CountyFIPSCode { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// An indication that the address should not be published. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } /// - /// A shortened description for the descriptor. + /// The geographic latitude of the physical address. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="latitude")] + public string Latitude { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] + public string LocaleDescriptor { get; set; } + + /// + /// The geographic longitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="longitude")] + public string Longitude { get; set; } + + /// + /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfCounty")] + public string NameOfCounty { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -32920,33 +32930,64 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactAddress")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _contactAddressPeriods; + private ICollection _contactAddressPeriodsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="periods")] + public ICollection ContactAddressPeriods + { + get { return _contactAddressPeriods; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactAddressPeriod)e.Item).ContactAddress = this); + _contactAddressPeriods = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactAddressPeriod)e.Item).ContactAddress = this; + _contactAddressPeriodsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContactAddress.ContactAddressPeriods + { + get { return _contactAddressPeriodsCovariant; } + set { ContactAddressPeriods = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_contactAddressPeriods != null) foreach (var item in _contactAddressPeriods) + { + item.ContactAddress = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -32954,12 +32995,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ContinuationOfServicesReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target); + return Entities.Common.EdFi.ContactAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactAddress)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ContinuationOfServicesReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target, null); + Entities.Common.EdFi.ContactAddressMapper.MapTo(this, (Entities.Common.EdFi.IContactAddress)target, null); } // ------------------------------------------------------------- @@ -32967,6 +33008,78 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ContactAddressPeriods.Any() && mappingContract?.IsMemberSupported("ContactAddressPeriods") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactAddressPeriods"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactAddressPeriods, validationContext, validationContext.Items.ForCollection("ContactAddressPeriods")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -32974,9 +33087,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ContinuationOfServicesReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactAddressPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ContactAddress = new FullName("edfi", "ContactAddress"); + + // Declare collection item validators + private ContactAddressPeriodPutPostRequestValidator _contactAddressPeriodsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -32989,6 +33107,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ContactAddressMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ContactAddress); + + if (mappingContract != null) + { + if (mappingContract.IsContactAddressPeriodIncluded != null) + { + var hasInvalidContactAddressPeriodsItems = instance.ContactAddressPeriods.Any(x => !mappingContract.IsContactAddressPeriodIncluded(x)); + + if (hasInvalidContactAddressPeriodsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactAddressPeriods", $"A supplied 'ContactAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -33004,22 +33144,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CostRateDescriptor table of the CostRateDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ContactAddressPeriod table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CostRateDescriptor : Entities.Common.EdFi.ICostRateDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ContactAddressPeriod : Entities.Common.EdFi.IContactAddressPeriod, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CostRateDescriptor"); + private static FullName _fullName = new FullName("edfi", "ContactAddressPeriod"); // Fluent validator instance (threadsafe) - private static CostRateDescriptorPutPostRequestValidator _validator = new CostRateDescriptorPutPostRequestValidator(); + private static ContactAddressPeriodPutPostRequestValidator _validator = new ContactAddressPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -33036,13 +33171,6 @@ public class CostRateDescriptor : Entities.Common.EdFi.ICostRateDescriptor, Enti // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CostRateDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -33053,19 +33181,32 @@ public class CostRateDescriptor : Entities.Common.EdFi.ICostRateDescriptor, Enti //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IContactAddress _contactAddress; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CostRateDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IContactAddress IContactAddressPeriod.ContactAddress + { + get { return _contactAddress; } + set { SetContactAddress(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IContactAddress ContactAddress { - get { return CostRateDescriptorId; } - set { CostRateDescriptorId = value; } + set { SetContactAddress(value); } + } + + private void SetContactAddress(Entities.Common.EdFi.IContactAddress value) + { + _contactAddress = value; } + + /// + /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33080,7 +33221,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICostRateDescriptor; + var compareTo = obj as Entities.Common.EdFi.IContactAddressPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -33088,9 +33229,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_contactAddress == null || !_contactAddress.Equals(compareTo.ContactAddress)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICostRateDescriptor).CostRateDescriptorId.Equals(compareTo.CostRateDescriptorId)) + + // Standard Property + if (!(this as Entities.Common.EdFi.IContactAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) return false; @@ -33106,9 +33251,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_contactAddress != null) + hash.Add(_contactAddress); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICostRateDescriptor).CostRateDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactAddressPeriod).BeginDate); return hash.ToHashCode(); } @@ -33117,60 +33265,18 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33191,11 +33297,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactAddressPeriod")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33206,13 +33309,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -33225,12 +33321,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CostRateDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICostRateDescriptor)target); + return Entities.Common.EdFi.ContactAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactAddressPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CostRateDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICostRateDescriptor)target, null); + Entities.Common.EdFi.ContactAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IContactAddressPeriod)target, null); } // ------------------------------------------------------------- @@ -33238,6 +33334,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -33245,9 +33401,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CostRateDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -33275,22 +33431,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CountryDescriptor table of the CountryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ContactElectronicMail table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CountryDescriptor : Entities.Common.EdFi.ICountryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ContactElectronicMail : Entities.Common.EdFi.IContactElectronicMail, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CountryDescriptor"); + private static FullName _fullName = new FullName("edfi", "ContactElectronicMail"); // Fluent validator instance (threadsafe) - private static CountryDescriptorPutPostRequestValidator _validator = new CountryDescriptorPutPostRequestValidator(); + private static ContactElectronicMailPutPostRequestValidator _validator = new ContactElectronicMailPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -33307,13 +33458,6 @@ public class CountryDescriptor : Entities.Common.EdFi.ICountryDescriptor, Entiti // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CountryDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -33324,19 +33468,42 @@ public class CountryDescriptor : Entities.Common.EdFi.ICountryDescriptor, Entiti //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IContact _contact; + + [IgnoreDataMember] + Entities.Common.EdFi.IContact IContactElectronicMail.Contact + { + get { return _contact; } + set { SetContact(value); } + } + + public Entities.Common.EdFi.IContact Contact + { + set { SetContact(value); } + } + + private void SetContact(Entities.Common.EdFi.IContact value) + { + _contact = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The electronic mail (e-mail) address listed for an individual or organization. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CountryDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(128, MinimumLength=7, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="electronicMailAddress")] + public string ElectronicMailAddress { get; set; } - int IDescriptor.DescriptorId - { - get { return CountryDescriptorId; } - set { CountryDescriptorId = value; } - } + /// + /// The type of email listed for an individual or organization. For example: Home/Personal, Work, etc.) + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="electronicMailTypeDescriptor")][DescriptorExists("ElectronicMailTypeDescriptor")] + public string ElectronicMailTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33351,7 +33518,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICountryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IContactElectronicMail; if (ReferenceEquals(this, compareTo)) return true; @@ -33359,9 +33526,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_contact == null || !_contact.Equals(compareTo.Contact)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ICountryDescriptor).CountryDescriptorId.Equals(compareTo.CountryDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailAddress, compareTo.ElectronicMailAddress)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailTypeDescriptor, compareTo.ElectronicMailTypeDescriptor)) return false; @@ -33377,9 +33553,16 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_contact != null) + hash.Add(_contact); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICountryDescriptor).CountryDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailAddress); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactElectronicMail).ElectronicMailTypeDescriptor); return hash.ToHashCode(); } @@ -33388,60 +33571,25 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// An indication that the electronic email address should not be published. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } /// - /// A shortened description for the descriptor. + /// An indication that the electronic mail address should be used as the principal electronic mail address for an individual or organization. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [DataMember(Name="primaryEmailAddressIndicator")] + public bool? PrimaryEmailAddressIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33462,11 +33610,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactElectronicMail")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33477,13 +33622,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -33496,12 +33634,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CountryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICountryDescriptor)target); + return Entities.Common.EdFi.ContactElectronicMailMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactElectronicMail)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CountryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICountryDescriptor)target, null); + Entities.Common.EdFi.ContactElectronicMailMapper.MapTo(this, (Entities.Common.EdFi.IContactElectronicMail)target, null); } // ------------------------------------------------------------- @@ -33509,6 +33647,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -33516,9 +33714,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CountryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactElectronicMailPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -33546,120 +33744,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Course resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class CourseReference : IResourceReference - { - [DataMember(Name="courseCode")] - public string CourseCode { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return CourseCode != default(string) && EducationOrganizationId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (CourseCode == default) - { - yield return "CourseCode"; - } - - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Course", - Href = $"/ed-fi/courses/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.Course table of the Course aggregate in the ODS Database. + /// A class which represents the edfi.ContactInternationalAddress table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class Course : Entities.Common.EdFi.ICourse, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class ContactInternationalAddress : Entities.Common.EdFi.IContactInternationalAddress, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Course"); + private static FullName _fullName = new FullName("edfi", "ContactInternationalAddress"); // Fluent validator instance (threadsafe) - private static CoursePutPostRequestValidator _validator = new CoursePutPostRequestValidator(); + private static ContactInternationalAddressPutPostRequestValidator _validator = new ContactInternationalAddressPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -33670,106 +33765,49 @@ public class Course : Entities.Common.EdFi.ICourse, IHasETag, IDateVersionedEnti // Constructor // ------------------------------------------------------------- - public Course() - { - CourseAcademicSubjects = new List(); - CourseCompetencyLevels = new List(); - CourseIdentificationCodes = new List(); - CourseLearningStandards = new List(); - CourseLevelCharacteristics = new List(); - CourseOfferedGradeLevels = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the Course resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IContact _contact; - return _educationOrganizationReference; - } + [IgnoreDataMember] + Entities.Common.EdFi.IContact IContactInternationalAddress.Contact + { + get { return _contact; } + set { SetContact(value); } } - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + public Entities.Common.EdFi.IContact Contact { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } + set { SetContact(value); } } - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- + private void SetContact(Entities.Common.EdFi.IContact value) + { + _contact = value; + } /// - /// A unique alphanumeric code assigned to a course. + /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseCode")] - public string CourseCode { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICourse.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] + public string AddressTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -33784,7 +33822,7 @@ long Entities.Common.EdFi.ICourse.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourse; + var compareTo = obj as Entities.Common.EdFi.IContactInternationalAddress; if (ReferenceEquals(this, compareTo)) return true; @@ -33792,14 +33830,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourse).CourseCode, compareTo.CourseCode)) + // Parent Property + if (_contact == null || !_contact.Equals(compareTo.Contact)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.ICourse).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactInternationalAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) return false; @@ -33815,13 +33852,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_contact != null) + hash.Add(_contact); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourse).CourseCode); - + hash.Add((this as Entities.Common.EdFi.IContactInternationalAddress).AddressTypeDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourse).EducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -33836,153 +33873,78 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Indicates the career cluster or pathway the course is associated with as part of a CTE curriculum. + /// The first line of the address. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="careerPathwayDescriptor")][DescriptorExists("CareerPathwayDescriptor")] - public string CareerPathwayDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine1")] + public string AddressLine1 { get; set; } /// - /// Specifies whether the course was defined by the SEA, LEA, School, or national organization. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="courseDefinedByDescriptor")][DescriptorExists("CourseDefinedByDescriptor")] - public string CourseDefinedByDescriptor { get; set; } - - /// - /// A description of the content standards and goals covered in the course. Reference may be made to state or national content standards. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="courseDescription")] - public string CourseDescription { get; set; } - - /// - /// An indicator of whether or not the course being described is included in the computation of the student's grade point average, and if so, if it is weighted differently from regular courses. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="courseGPAApplicabilityDescriptor")][DescriptorExists("CourseGPAApplicabilityDescriptor")] - public string CourseGPAApplicabilityDescriptor { get; set; } - - /// - /// The descriptive name given to a course of study offered in a school or other institution or organization. In departmentalized classes at the elementary, secondary, and postsecondary levels (and for staff development activities), this refers to the name by which a course is identified (e.g., American History, English III). For elementary and other non-departmentalized classes, it refers to any portion of the instruction for which a grade or report is assigned (e.g., reading, composition, spelling, and language arts). - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="courseTitle")] - public string CourseTitle { get; set; } - - /// - /// Date the course was adopted by the education agency. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="dateCourseAdopted")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DateCourseAdopted { get; set; } - - /// - /// An indication that this course may satisfy high school graduation requirements in the course's subject area. + /// The second line of the address. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="highSchoolCourseRequirement")] - public bool? HighSchoolCourseRequirement { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine2")] + public string AddressLine2 { get; set; } /// - /// Designates how many times the course may be taken with credit received by the student. + /// The third line of the address. /// // NOT in a reference, NOT a lookup column - [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="maxCompletionsForCredit")] - public int? MaxCompletionsForCredit { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine3")] + public string AddressLine3 { get; set; } /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// The fourth line of the address. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maximumAvailableCreditConversion")] - public decimal? MaximumAvailableCreditConversion { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine4")] + public string AddressLine4 { get; set; } /// - /// The value of credits or units of value awarded for the completion of a course. + /// The first date the address is valid. For physical addresses, the date the individual moved to that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maximumAvailableCredits")] - public decimal? MaximumAvailableCredits { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BeginDate { get; set; } /// - /// The type of credits or units of value awarded for the completion of a course. + /// The name of the country. It is strongly recommended that entries use only ISO 3166 2-letter country codes. /// // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maximumAvailableCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string MaximumAvailableCreditTypeDescriptor { get; set; } - - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="minimumAvailableCreditConversion")] - public decimal? MinimumAvailableCreditConversion { get; set; } + [DataMember(Name="countryDescriptor")][DescriptorExists("CountryDescriptor")] + public string CountryDescriptor { get; set; } /// - /// The value of credits or units of value awarded for the completion of a course. + /// The last date the address is valid. For physical addresses, the date the individual moved from that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="minimumAvailableCredits")] - public decimal? MinimumAvailableCredits { get; set; } - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="minimumAvailableCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string MinimumAvailableCreditTypeDescriptor { get; set; } - - private bool _numberOfPartsExplicitlyAssigned = false; - private int _numberOfParts; + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } /// - /// The number of parts identified for a course. + /// The geographic latitude of the physical address. /// // NOT in a reference, NOT a lookup column - [Range(1, 8, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="numberOfParts")] - public int NumberOfParts - { - get => _numberOfParts; - set - { - _numberOfParts = value; - _numberOfPartsExplicitlyAssigned = true; - } - } - + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="latitude")] + public string Latitude { get; set; } /// - /// The actual or estimated number of clock minutes required for class completion. This number is especially important for career and technical education classes and may represent (in minutes) the clock hour requirement of the class. + /// The geographic longitude of the physical address. /// // NOT in a reference, NOT a lookup column - [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="timeRequiredForCompletion")] - public int? TimeRequiredForCompletion { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="longitude")] + public string Longitude { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_numberOfPartsExplicitlyAssigned) - { - yield return "NumberOfParts"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -34001,246 +33963,23 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "Course")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactInternationalAddress")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _courseAcademicSubjects; - private ICollection _courseAcademicSubjectsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="academicSubjects")] - public ICollection CourseAcademicSubjects - { - get { return _courseAcademicSubjects; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseAcademicSubject)e.Item).Course = this); - _courseAcademicSubjects = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseAcademicSubject)e.Item).Course = this; - _courseAcademicSubjectsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseAcademicSubjects - { - get { return _courseAcademicSubjectsCovariant; } - set { CourseAcademicSubjects = new List(value.Cast()); } - } - - private ICollection _courseCompetencyLevels; - private ICollection _courseCompetencyLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="competencyLevels")] - public ICollection CourseCompetencyLevels - { - get { return _courseCompetencyLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseCompetencyLevel)e.Item).Course = this); - _courseCompetencyLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseCompetencyLevel)e.Item).Course = this; - _courseCompetencyLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseCompetencyLevels - { - get { return _courseCompetencyLevelsCovariant; } - set { CourseCompetencyLevels = new List(value.Cast()); } - } - - private ICollection _courseIdentificationCodes; - private ICollection _courseIdentificationCodesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="identificationCodes")] - public ICollection CourseIdentificationCodes - { - get { return _courseIdentificationCodes; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseIdentificationCode)e.Item).Course = this); - _courseIdentificationCodes = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseIdentificationCode)e.Item).Course = this; - _courseIdentificationCodesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseIdentificationCodes - { - get { return _courseIdentificationCodesCovariant; } - set { CourseIdentificationCodes = new List(value.Cast()); } - } - - private ICollection _courseLearningStandards; - private ICollection _courseLearningStandardsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="learningStandards")] - public ICollection CourseLearningStandards - { - get { return _courseLearningStandards; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseLearningStandard)e.Item).Course = this); - _courseLearningStandards = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseLearningStandard)e.Item).Course = this; - _courseLearningStandardsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseLearningStandards - { - get { return _courseLearningStandardsCovariant; } - set { CourseLearningStandards = new List(value.Cast()); } - } - - private ICollection _courseLevelCharacteristics; - private ICollection _courseLevelCharacteristicsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="levelCharacteristics")] - public ICollection CourseLevelCharacteristics - { - get { return _courseLevelCharacteristics; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseLevelCharacteristic)e.Item).Course = this); - _courseLevelCharacteristics = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseLevelCharacteristic)e.Item).Course = this; - _courseLevelCharacteristicsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseLevelCharacteristics - { - get { return _courseLevelCharacteristicsCovariant; } - set { CourseLevelCharacteristics = new List(value.Cast()); } - } - - private ICollection _courseOfferedGradeLevels; - private ICollection _courseOfferedGradeLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="offeredGradeLevels")] - public ICollection CourseOfferedGradeLevels - { - get { return _courseOfferedGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseOfferedGradeLevel)e.Item).Course = this); - _courseOfferedGradeLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferedGradeLevel)e.Item).Course = this; - _courseOfferedGradeLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseOfferedGradeLevels - { - get { return _courseOfferedGradeLevelsCovariant; } - set { CourseOfferedGradeLevels = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_courseAcademicSubjects != null) foreach (var item in _courseAcademicSubjects) - { - item.Course = this; - } - - if (_courseCompetencyLevels != null) foreach (var item in _courseCompetencyLevels) - { - item.Course = this; - } - - if (_courseIdentificationCodes != null) foreach (var item in _courseIdentificationCodes) - { - item.Course = this; - } - - if (_courseLearningStandards != null) foreach (var item in _courseLearningStandards) - { - item.Course = this; - } - - if (_courseLevelCharacteristics != null) foreach (var item in _courseLevelCharacteristics) - { - item.Course = this; - } - - if (_courseOfferedGradeLevels != null) foreach (var item in _courseOfferedGradeLevels) - { - item.Course = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -34248,32 +33987,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourse)target); + return Entities.Common.EdFi.ContactInternationalAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactInternationalAddress)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseMapper.MapTo(this, (Entities.Common.EdFi.ICourse)target, null); + Entities.Common.EdFi.ContactInternationalAddressMapper.MapTo(this, (Entities.Common.EdFi.IContactInternationalAddress)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICourse.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -34291,83 +34016,12 @@ string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (CourseAcademicSubjects.Any() && mappingContract?.IsMemberSupported("CourseAcademicSubjects") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseAcademicSubjects"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseAcademicSubjects, validationContext, validationContext.Items.ForCollection("CourseAcademicSubjects")))) - { - yield return result; - } - } - - if (CourseCompetencyLevels.Any() && mappingContract?.IsMemberSupported("CourseCompetencyLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseCompetencyLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseCompetencyLevels, validationContext, validationContext.Items.ForCollection("CourseCompetencyLevels")))) - { - yield return result; - } - } - - if (CourseIdentificationCodes.Any() && mappingContract?.IsMemberSupported("CourseIdentificationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseIdentificationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseIdentificationCodes, validationContext, validationContext.Items.ForCollection("CourseIdentificationCodes")))) - { - yield return result; - } - } - - if (CourseLearningStandards.Any() && mappingContract?.IsMemberSupported("CourseLearningStandards") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseLearningStandards"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseLearningStandards, validationContext, validationContext.Items.ForCollection("CourseLearningStandards")))) - { - yield return result; - } - } - - if (CourseLevelCharacteristics.Any() && mappingContract?.IsMemberSupported("CourseLevelCharacteristics") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseLevelCharacteristics"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseLevelCharacteristics, validationContext, validationContext.Items.ForCollection("CourseLevelCharacteristics")))) - { - yield return result; - } - } - - if (CourseOfferedGradeLevels.Any() && mappingContract?.IsMemberSupported("CourseOfferedGradeLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseOfferedGradeLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferedGradeLevels, validationContext, validationContext.Items.ForCollection("CourseOfferedGradeLevels")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -34413,19 +34067,9 @@ string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CoursePutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactInternationalAddressPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Course = new FullName("edfi", "Course"); - - // Declare collection item validators - private CourseAcademicSubjectPutPostRequestValidator _courseAcademicSubjectsValidator = new (); - private CourseCompetencyLevelPutPostRequestValidator _courseCompetencyLevelsValidator = new (); - private CourseIdentificationCodePutPostRequestValidator _courseIdentificationCodesValidator = new (); - private CourseLearningStandardPutPostRequestValidator _courseLearningStandardsValidator = new (); - private CourseLevelCharacteristicPutPostRequestValidator _courseLevelCharacteristicsValidator = new (); - private CourseOfferedGradeLevelPutPostRequestValidator _courseOfferedGradeLevelsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -34438,83 +34082,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext c var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (CourseMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Course); - - if (mappingContract != null) - { - if (mappingContract.IsCourseAcademicSubjectIncluded != null) - { - var hasInvalidCourseAcademicSubjectsItems = instance.CourseAcademicSubjects.Any(x => !mappingContract.IsCourseAcademicSubjectIncluded(x)); - - if (hasInvalidCourseAcademicSubjectsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseAcademicSubjects", $"A supplied 'CourseAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseCompetencyLevelIncluded != null) - { - var hasInvalidCourseCompetencyLevelsItems = instance.CourseCompetencyLevels.Any(x => !mappingContract.IsCourseCompetencyLevelIncluded(x)); - - if (hasInvalidCourseCompetencyLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseCompetencyLevels", $"A supplied 'CourseCompetencyLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseIdentificationCodeIncluded != null) - { - var hasInvalidCourseIdentificationCodesItems = instance.CourseIdentificationCodes.Any(x => !mappingContract.IsCourseIdentificationCodeIncluded(x)); - - if (hasInvalidCourseIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseIdentificationCodes", $"A supplied 'CourseIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseLearningStandardIncluded != null) - { - var hasInvalidCourseLearningStandardsItems = instance.CourseLearningStandards.Any(x => !mappingContract.IsCourseLearningStandardIncluded(x)); - - if (hasInvalidCourseLearningStandardsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseLearningStandards", $"A supplied 'CourseLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseLevelCharacteristicIncluded != null) - { - var hasInvalidCourseLevelCharacteristicsItems = instance.CourseLevelCharacteristics.Any(x => !mappingContract.IsCourseLevelCharacteristicIncluded(x)); - - if (hasInvalidCourseLevelCharacteristicsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseLevelCharacteristics", $"A supplied 'CourseLevelCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseOfferedGradeLevelIncluded != null) - { - var hasInvalidCourseOfferedGradeLevelsItems = instance.CourseOfferedGradeLevels.Any(x => !mappingContract.IsCourseOfferedGradeLevelIncluded(x)); - - if (hasInvalidCourseOfferedGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseOfferedGradeLevels", $"A supplied 'CourseOfferedGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -34531,16 +34098,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext c // ----------------------------------------------------------------- /// - /// A class which represents the edfi.CourseAcademicSubject table of the Course aggregate in the ODS Database. + /// A class which represents the edfi.ContactLanguage table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseAcademicSubject : Entities.Common.EdFi.ICourseAcademicSubject, IValidatableObject + public class ContactLanguage : Entities.Common.EdFi.IContactLanguage, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseAcademicSubject"); + private static FullName _fullName = new FullName("edfi", "ContactLanguage"); // Fluent validator instance (threadsafe) - private static CourseAcademicSubjectPutPostRequestValidator _validator = new CourseAcademicSubjectPutPostRequestValidator(); + private static ContactLanguagePutPostRequestValidator _validator = new ContactLanguagePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -34551,6 +34118,10 @@ public class CourseAcademicSubject : Entities.Common.EdFi.ICourseAcademicSubject // Constructor // ------------------------------------------------------------- + public ContactLanguage() + { + ContactLanguageUses = new List(); + } // ------------------------------------------------------------ @@ -34567,33 +34138,33 @@ public class CourseAcademicSubject : Entities.Common.EdFi.ICourseAcademicSubject //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourse _course; + private Entities.Common.EdFi.IContact _contact; [IgnoreDataMember] - Entities.Common.EdFi.ICourse ICourseAcademicSubject.Course + Entities.Common.EdFi.IContact IContactLanguage.Contact { - get { return _course; } - set { SetCourse(value); } + get { return _contact; } + set { SetContact(value); } } - public Entities.Common.EdFi.ICourse Course + public Entities.Common.EdFi.IContact Contact { - set { SetCourse(value); } + set { SetContact(value); } } - private void SetCourse(Entities.Common.EdFi.ICourse value) + private void SetContact(Entities.Common.EdFi.IContact value) { - _course = value; + _contact = value; } /// - /// The intended major subject/s area of the course. + /// A specification of which written or spoken communication is being used. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } + [DataMember(Name="languageDescriptor")][DescriptorExists("LanguageDescriptor")] + public string LanguageDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -34608,7 +34179,7 @@ private void SetCourse(Entities.Common.EdFi.ICourse value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseAcademicSubject; + var compareTo = obj as Entities.Common.EdFi.IContactLanguage; if (ReferenceEquals(this, compareTo)) return true; @@ -34617,12 +34188,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_course == null || !_course.Equals(compareTo.Course)) + if (_contact == null || !_contact.Equals(compareTo.Contact)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactLanguage).LanguageDescriptor, compareTo.LanguageDescriptor)) return false; @@ -34639,11 +34210,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_course != null) - hash.Add(_course); + if (_contact != null) + hash.Add(_contact); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseAcademicSubject).AcademicSubjectDescriptor); + hash.Add((this as Entities.Common.EdFi.IContactLanguage).LanguageDescriptor); return hash.ToHashCode(); } @@ -34677,13 +34248,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseAcademicSubject")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactLanguage")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _contactLanguageUses; + private ICollection _contactLanguageUsesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="uses")] + public ICollection ContactLanguageUses + { + get { return _contactLanguageUses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IContactLanguageUse)e.Item).ContactLanguage = this); + _contactLanguageUses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IContactLanguageUse)e.Item).ContactLanguage = this; + _contactLanguageUsesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContactLanguage.ContactLanguageUses + { + get { return _contactLanguageUsesCovariant; } + set { ContactLanguageUses = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -34694,6 +34295,17 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_contactLanguageUses != null) foreach (var item in _contactLanguageUses) + { + item.ContactLanguage = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -34701,12 +34313,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseAcademicSubject)target); + return Entities.Common.EdFi.ContactLanguageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactLanguage)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ICourseAcademicSubject)target, null); + Entities.Common.EdFi.ContactLanguageMapper.MapTo(this, (Entities.Common.EdFi.IContactLanguage)target, null); } // ------------------------------------------------------------- @@ -34736,6 +34348,18 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- + if (ContactLanguageUses.Any() && mappingContract?.IsMemberSupported("ContactLanguageUses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ContactLanguageUses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ContactLanguageUses, validationContext, validationContext.Items.ForCollection("ContactLanguageUses")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -34781,9 +34405,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactLanguagePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ContactLanguage = new FullName("edfi", "ContactLanguage"); + + // Declare collection item validators + private ContactLanguageUsePutPostRequestValidator _contactLanguageUsesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -34796,6 +34425,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ContactLanguageMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ContactLanguage); + + if (mappingContract != null) + { + if (mappingContract.IsContactLanguageUseIncluded != null) + { + var hasInvalidContactLanguageUsesItems = instance.ContactLanguageUses.Any(x => !mappingContract.IsContactLanguageUseIncluded(x)); + + if (hasInvalidContactLanguageUsesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ContactLanguageUses", $"A supplied 'ContactLanguageUse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -34812,16 +34463,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseCompetencyLevel table of the Course aggregate in the ODS Database. + /// A class which represents the edfi.ContactLanguageUse table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseCompetencyLevel : Entities.Common.EdFi.ICourseCompetencyLevel, IValidatableObject + public class ContactLanguageUse : Entities.Common.EdFi.IContactLanguageUse, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseCompetencyLevel"); + private static FullName _fullName = new FullName("edfi", "ContactLanguageUse"); // Fluent validator instance (threadsafe) - private static CourseCompetencyLevelPutPostRequestValidator _validator = new CourseCompetencyLevelPutPostRequestValidator(); + private static ContactLanguageUsePutPostRequestValidator _validator = new ContactLanguageUsePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -34848,33 +34499,33 @@ public class CourseCompetencyLevel : Entities.Common.EdFi.ICourseCompetencyLevel //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourse _course; + private Entities.Common.EdFi.IContactLanguage _contactLanguage; [IgnoreDataMember] - Entities.Common.EdFi.ICourse ICourseCompetencyLevel.Course + Entities.Common.EdFi.IContactLanguage IContactLanguageUse.ContactLanguage { - get { return _course; } - set { SetCourse(value); } + get { return _contactLanguage; } + set { SetContactLanguage(value); } } - public Entities.Common.EdFi.ICourse Course + public Entities.Common.EdFi.IContactLanguage ContactLanguage { - set { SetCourse(value); } + set { SetContactLanguage(value); } } - private void SetCourse(Entities.Common.EdFi.ICourse value) + private void SetContactLanguage(Entities.Common.EdFi.IContactLanguage value) { - _course = value; + _contactLanguage = value; } /// - /// The competency levels defined to rate the student for the course. + /// A description of how the language is used (e.g. Home Language, Native Language, Spoken Language). /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="competencyLevelDescriptor")][DescriptorExists("CompetencyLevelDescriptor")] - public string CompetencyLevelDescriptor { get; set; } + [DataMember(Name="languageUseDescriptor")][DescriptorExists("LanguageUseDescriptor")] + public string LanguageUseDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -34889,7 +34540,7 @@ private void SetCourse(Entities.Common.EdFi.ICourse value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseCompetencyLevel; + var compareTo = obj as Entities.Common.EdFi.IContactLanguageUse; if (ReferenceEquals(this, compareTo)) return true; @@ -34898,12 +34549,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_course == null || !_course.Equals(compareTo.Course)) + if (_contactLanguage == null || !_contactLanguage.Equals(compareTo.ContactLanguage)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseCompetencyLevel).CompetencyLevelDescriptor, compareTo.CompetencyLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactLanguageUse).LanguageUseDescriptor, compareTo.LanguageUseDescriptor)) return false; @@ -34920,11 +34571,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_course != null) - hash.Add(_course); + if (_contactLanguage != null) + hash.Add(_contactLanguage); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseCompetencyLevel).CompetencyLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IContactLanguageUse).LanguageUseDescriptor); return hash.ToHashCode(); } @@ -34958,7 +34609,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseCompetencyLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactLanguageUse")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -34982,12 +34633,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseCompetencyLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseCompetencyLevel)target); + return Entities.Common.EdFi.ContactLanguageUseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactLanguageUse)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseCompetencyLevelMapper.MapTo(this, (Entities.Common.EdFi.ICourseCompetencyLevel)target, null); + Entities.Common.EdFi.ContactLanguageUseMapper.MapTo(this, (Entities.Common.EdFi.IContactLanguageUse)target, null); } // ------------------------------------------------------------- @@ -35062,9 +34713,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseCompetencyLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactLanguageUsePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -35093,16 +34744,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseIdentificationCode table of the Course aggregate in the ODS Database. + /// A class which represents the edfi.ContactOtherName table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseIdentificationCode : Entities.Common.EdFi.ICourseIdentificationCode, IValidatableObject + public class ContactOtherName : Entities.Common.EdFi.IContactOtherName, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseIdentificationCode"); + private static FullName _fullName = new FullName("edfi", "ContactOtherName"); // Fluent validator instance (threadsafe) - private static CourseIdentificationCodePutPostRequestValidator _validator = new CourseIdentificationCodePutPostRequestValidator(); + private static ContactOtherNamePutPostRequestValidator _validator = new ContactOtherNamePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -35129,33 +34780,33 @@ public class CourseIdentificationCode : Entities.Common.EdFi.ICourseIdentificati //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourse _course; + private Entities.Common.EdFi.IContact _contact; [IgnoreDataMember] - Entities.Common.EdFi.ICourse ICourseIdentificationCode.Course + Entities.Common.EdFi.IContact IContactOtherName.Contact { - get { return _course; } - set { SetCourse(value); } + get { return _contact; } + set { SetContact(value); } } - public Entities.Common.EdFi.ICourse Course + public Entities.Common.EdFi.IContact Contact { - set { SetCourse(value); } + set { SetContact(value); } } - private void SetCourse(Entities.Common.EdFi.ICourse value) + private void SetContact(Entities.Common.EdFi.IContact value) { - _course = value; + _contact = value; } /// - /// A system that is used to identify the organization of subject matter and related learning experiences provided for the instruction of students. + /// The types of alternate names for an individual. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseIdentificationSystemDescriptor")][DescriptorExists("CourseIdentificationSystemDescriptor")] - public string CourseIdentificationSystemDescriptor { get; set; } + [DataMember(Name="otherNameTypeDescriptor")][DescriptorExists("OtherNameTypeDescriptor")] + public string OtherNameTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -35170,7 +34821,7 @@ private void SetCourse(Entities.Common.EdFi.ICourse value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseIdentificationCode; + var compareTo = obj as Entities.Common.EdFi.IContactOtherName; if (ReferenceEquals(this, compareTo)) return true; @@ -35179,12 +34830,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_course == null || !_course.Equals(compareTo.Course)) + if (_contact == null || !_contact.Equals(compareTo.Contact)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseIdentificationCode).CourseIdentificationSystemDescriptor, compareTo.CourseIdentificationSystemDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactOtherName).OtherNameTypeDescriptor, compareTo.OtherNameTypeDescriptor)) return false; @@ -35201,11 +34852,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_course != null) - hash.Add(_course); + if (_contact != null) + hash.Add(_contact); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseIdentificationCode).CourseIdentificationSystemDescriptor); + hash.Add((this as Entities.Common.EdFi.IContactOtherName).OtherNameTypeDescriptor); return hash.ToHashCode(); } @@ -35221,29 +34872,46 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The organization code or name assigning the Identification Code. + /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assigningOrganizationIdentificationCode")] - public string AssigningOrganizationIdentificationCode { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="firstName")] + public string FirstName { get; set; } /// - /// The URL for the course catalog that defines the course identification code. + /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="courseCatalogURL")] - public string CourseCatalogURL { get; set; } + [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="generationCodeSuffix")] + public string GenerationCodeSuffix { get; set; } /// - /// A unique number or alphanumeric code assigned to a course by a school, school system, state, or other agency or entity. For multi-part course codes, concatenate the parts separated by a \"/\". For example, consider the following SCED code- subject = 20 Math course = 272 Geometry level = G General credits = 1.00 course sequence 1 of 1- would be entered as 20/272/G/1.00/1 of 1. + /// The name borne in common by members of a family. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } + + /// + /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="middleName")] + public string MiddleName { get; set; } + + /// + /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="personalTitlePrefix")] + public string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -35264,7 +34932,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseIdentificationCode")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactOtherName")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -35288,12 +34956,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseIdentificationCode)target); + return Entities.Common.EdFi.ContactOtherNameMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactOtherName)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.ICourseIdentificationCode)target, null); + Entities.Common.EdFi.ContactOtherNameMapper.MapTo(this, (Entities.Common.EdFi.IContactOtherName)target, null); } // ------------------------------------------------------------- @@ -35368,9 +35036,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactOtherNamePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -35399,16 +35067,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseLearningStandard table of the Course aggregate in the ODS Database. + /// A class which represents the edfi.ContactPersonalIdentificationDocument table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseLearningStandard : Entities.Common.EdFi.ICourseLearningStandard, IValidatableObject + public class ContactPersonalIdentificationDocument : Entities.Common.EdFi.IContactPersonalIdentificationDocument, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseLearningStandard"); + private static FullName _fullName = new FullName("edfi", "ContactPersonalIdentificationDocument"); // Fluent validator instance (threadsafe) - private static CourseLearningStandardPutPostRequestValidator _validator = new CourseLearningStandardPutPostRequestValidator(); + private static ContactPersonalIdentificationDocumentPutPostRequestValidator _validator = new ContactPersonalIdentificationDocumentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -35430,88 +35098,47 @@ public class CourseLearningStandard : Entities.Common.EdFi.ICourseLearningStanda // ============================================================= // References // ------------------------------------------------------------- - - private bool _learningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) - _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _learningStandardReference; - } - } - - [DataMember(Name="learningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference LearningStandardReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLearningStandardReference != null - && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference; - - return null; - } - set - { - _learningStandardReferenceExplicitlyAssigned = true; - _learningStandardReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourse _course; + private Entities.Common.EdFi.IContact _contact; [IgnoreDataMember] - Entities.Common.EdFi.ICourse ICourseLearningStandard.Course + Entities.Common.EdFi.IContact IContactPersonalIdentificationDocument.Contact { - get { return _course; } - set { SetCourse(value); } + get { return _contact; } + set { SetContact(value); } } - public Entities.Common.EdFi.ICourse Course + public Entities.Common.EdFi.IContact Contact { - set { SetCourse(value); } + set { SetContact(value); } } - private void SetCourse(Entities.Common.EdFi.ICourse value) + private void SetContact(Entities.Common.EdFi.IContact value) { - _course = value; + _contact = value; } /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// The primary function of the document used for establishing identity. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardId - { - get - { - if (ImplicitLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] + public string IdentificationDocumentUseDescriptor { get; set; } - // LearningStandard - _learningStandardReferenceExplicitlyAssigned = false; - ImplicitLearningStandardReference.LearningStandardId = value; - } - } + /// + /// The category of the document relative to its purpose. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] + public string PersonalInformationVerificationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -35526,7 +35153,7 @@ string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseLearningStandard; + var compareTo = obj as Entities.Common.EdFi.IContactPersonalIdentificationDocument; if (ReferenceEquals(this, compareTo)) return true; @@ -35535,12 +35162,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_course == null || !_course.Equals(compareTo.Course)) + if (_contact == null || !_contact.Equals(compareTo.Contact)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseLearningStandard).LearningStandardId, compareTo.LearningStandardId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) return false; @@ -35557,11 +35189,16 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_course != null) - hash.Add(_course); + if (_contact != null) + hash.Add(_contact); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).IdentificationDocumentUseDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactPersonalIdentificationDocument).PersonalInformationVerificationDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -35574,6 +35211,45 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The day when the document expires, if null then never expires. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DocumentExpirationDate { get; set; } + + /// + /// The title of the document given by the issuer. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="documentTitle")] + public string DocumentTitle { get; set; } + + /// + /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] + public string IssuerCountryDescriptor { get; set; } + + /// + /// The unique identifier on the issuer's identification system. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerDocumentIdentificationCode")] + public string IssuerDocumentIdentificationCode { get; set; } + + /// + /// Name of the entity or institution that issued the document. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerName")] + public string IssuerName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -35594,7 +35270,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseLearningStandard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactPersonalIdentificationDocument")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -35618,32 +35294,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseLearningStandard)target); + return Entities.Common.EdFi.ContactPersonalIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactPersonalIdentificationDocument)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.ICourseLearningStandard)target, null); + Entities.Common.EdFi.ContactPersonalIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IContactPersonalIdentificationDocument)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICourseLearningStandard.LearningStandardResourceId - { - get { return null; } - set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLearningStandardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -35712,9 +35374,9 @@ string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardDiscriminato // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactPersonalIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -35743,16 +35405,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseLevelCharacteristic table of the Course aggregate in the ODS Database. + /// A class which represents the edfi.ContactTelephone table of the Contact aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristic : Entities.Common.EdFi.ICourseLevelCharacteristic, IValidatableObject + public class ContactTelephone : Entities.Common.EdFi.IContactTelephone, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseLevelCharacteristic"); + private static FullName _fullName = new FullName("edfi", "ContactTelephone"); // Fluent validator instance (threadsafe) - private static CourseLevelCharacteristicPutPostRequestValidator _validator = new CourseLevelCharacteristicPutPostRequestValidator(); + private static ContactTelephonePutPostRequestValidator _validator = new ContactTelephonePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -35779,33 +35441,42 @@ public class CourseLevelCharacteristic : Entities.Common.EdFi.ICourseLevelCharac //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourse _course; + private Entities.Common.EdFi.IContact _contact; [IgnoreDataMember] - Entities.Common.EdFi.ICourse ICourseLevelCharacteristic.Course + Entities.Common.EdFi.IContact IContactTelephone.Contact { - get { return _course; } - set { SetCourse(value); } + get { return _contact; } + set { SetContact(value); } } - public Entities.Common.EdFi.ICourse Course + public Entities.Common.EdFi.IContact Contact { - set { SetCourse(value); } + set { SetContact(value); } } - private void SetCourse(Entities.Common.EdFi.ICourse value) + private void SetContact(Entities.Common.EdFi.IContact value) { - _course = value; + _contact = value; } /// - /// The type of specific program or designation with which the course is associated (e.g., AP, IB, Dual Credit, CTE). + /// The telephone number including the area code, and extension, if applicable. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="telephoneNumber")] + public string TelephoneNumber { get; set; } + + /// + /// The type of communication number listed for an individual or organization. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseLevelCharacteristicDescriptor")][DescriptorExists("CourseLevelCharacteristicDescriptor")] - public string CourseLevelCharacteristicDescriptor { get; set; } + [DataMember(Name="telephoneNumberTypeDescriptor")][DescriptorExists("TelephoneNumberTypeDescriptor")] + public string TelephoneNumberTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -35820,7 +35491,7 @@ private void SetCourse(Entities.Common.EdFi.ICourse value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseLevelCharacteristic; + var compareTo = obj as Entities.Common.EdFi.IContactTelephone; if (ReferenceEquals(this, compareTo)) return true; @@ -35829,12 +35500,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_course == null || !_course.Equals(compareTo.Course)) + if (_contact == null || !_contact.Equals(compareTo.Contact)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseLevelCharacteristic).CourseLevelCharacteristicDescriptor, compareTo.CourseLevelCharacteristicDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumber, compareTo.TelephoneNumber)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumberTypeDescriptor, compareTo.TelephoneNumberTypeDescriptor)) return false; @@ -35851,11 +35527,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_course != null) - hash.Add(_course); + if (_contact != null) + hash.Add(_contact); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseLevelCharacteristic).CourseLevelCharacteristicDescriptor); + hash.Add((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumber); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IContactTelephone).TelephoneNumberTypeDescriptor); return hash.ToHashCode(); } @@ -35869,6 +35549,28 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// An indication that the telephone number should not be published. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } + + /// + /// The order of priority assigned to telephone numbers to define which number to attempt first, second, etc. + /// + // NOT in a reference, NOT a lookup column + [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="orderOfPriority")] + public int? OrderOfPriority { get; set; } + + /// + /// An indication that the telephone number is technically capable of sending and receiving Short Message Service (SMS) text messages. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="textMessageCapabilityIndicator")] + public bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -35889,7 +35591,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseLevelCharacteristic")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Contact", "ContactTelephone")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -35913,12 +35615,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseLevelCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristic)target); + return Entities.Common.EdFi.ContactTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactTelephone)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseLevelCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristic)target, null); + Entities.Common.EdFi.ContactTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IContactTelephone)target, null); } // ------------------------------------------------------------- @@ -35993,9 +35695,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactTelephonePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -36023,17 +35725,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseOfferedGradeLevel table of the Course aggregate in the ODS Database. + /// A class which represents the edfi.ContactTypeDescriptor table of the ContactTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseOfferedGradeLevel : Entities.Common.EdFi.ICourseOfferedGradeLevel, IValidatableObject + public class ContactTypeDescriptor : Entities.Common.EdFi.IContactTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseOfferedGradeLevel"); + private static FullName _fullName = new FullName("edfi", "ContactTypeDescriptor"); // Fluent validator instance (threadsafe) - private static CourseOfferedGradeLevelPutPostRequestValidator _validator = new CourseOfferedGradeLevelPutPostRequestValidator(); + private static ContactTypeDescriptorPutPostRequestValidator _validator = new ContactTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -36050,6 +35757,13 @@ public class CourseOfferedGradeLevel : Entities.Common.EdFi.ICourseOfferedGradeL // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ContactTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -36060,33 +35774,19 @@ public class CourseOfferedGradeLevel : Entities.Common.EdFi.ICourseOfferedGradeL //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourse _course; - [IgnoreDataMember] - Entities.Common.EdFi.ICourse ICourseOfferedGradeLevel.Course - { - get { return _course; } - set { SetCourse(value); } - } - - public Entities.Common.EdFi.ICourse Course - { - set { SetCourse(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ContactTypeDescriptorId { get; set; } - private void SetCourse(Entities.Common.EdFi.ICourse value) + int IDescriptor.DescriptorId { - _course = value; + get { return ContactTypeDescriptorId; } + set { ContactTypeDescriptorId = value; } } - - /// - /// The grade levels in which the course is offered. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -36101,7 +35801,7 @@ private void SetCourse(Entities.Common.EdFi.ICourse value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseOfferedGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IContactTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -36109,13 +35809,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_course == null || !_course.Equals(compareTo.Course)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferedGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IContactTypeDescriptor).ContactTypeDescriptorId.Equals(compareTo.ContactTypeDescriptorId)) return false; @@ -36131,12 +35827,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_course != null) - hash.Add(_course); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseOfferedGradeLevel).GradeLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IContactTypeDescriptor).ContactTypeDescriptorId); return hash.ToHashCode(); } @@ -36145,6 +35838,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -36170,8 +35912,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseOfferedGradeLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -36182,6 +35927,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -36194,12 +35946,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseOfferedGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferedGradeLevel)target); + return Entities.Common.EdFi.ContactTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContactTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseOfferedGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferedGradeLevel)target, null); + Entities.Common.EdFi.ContactTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IContactTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -36207,66 +35959,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -36274,9 +35966,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseOfferedGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContactTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -36305,21 +35997,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseAttemptResultDescriptor table of the CourseAttemptResultDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ContentClassDescriptor table of the ContentClassDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseAttemptResultDescriptor : Entities.Common.EdFi.ICourseAttemptResultDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ContentClassDescriptor : Entities.Common.EdFi.IContentClassDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseAttemptResultDescriptor"); + private static FullName _fullName = new FullName("edfi", "ContentClassDescriptor"); // Fluent validator instance (threadsafe) - private static CourseAttemptResultDescriptorPutPostRequestValidator _validator = new CourseAttemptResultDescriptorPutPostRequestValidator(); + private static ContentClassDescriptorPutPostRequestValidator _validator = new ContentClassDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -36338,7 +36030,7 @@ public class CourseAttemptResultDescriptor : Entities.Common.EdFi.ICourseAttempt // ------------------------------------------------------------ /// - /// The unique identifier for the CourseAttemptResultDescriptor resource. + /// The unique identifier for the ContentClassDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -36359,12 +36051,12 @@ public class CourseAttemptResultDescriptor : Entities.Common.EdFi.ICourseAttempt /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CourseAttemptResultDescriptorId { get; set; } + public int ContentClassDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CourseAttemptResultDescriptorId; } - set { CourseAttemptResultDescriptorId = value; } + get { return ContentClassDescriptorId; } + set { ContentClassDescriptorId = value; } } // ------------------------------------------------------------- @@ -36380,7 +36072,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseAttemptResultDescriptor; + var compareTo = obj as Entities.Common.EdFi.IContentClassDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -36390,7 +36082,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICourseAttemptResultDescriptor).CourseAttemptResultDescriptorId.Equals(compareTo.CourseAttemptResultDescriptorId)) + if (!(this as Entities.Common.EdFi.IContentClassDescriptor).ContentClassDescriptorId.Equals(compareTo.ContentClassDescriptorId)) return false; @@ -36408,7 +36100,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICourseAttemptResultDescriptor).CourseAttemptResultDescriptorId); + hash.Add((this as Entities.Common.EdFi.IContentClassDescriptor).ContentClassDescriptorId); return hash.ToHashCode(); } @@ -36525,283 +36217,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseAttemptResultDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseAttemptResultDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.CourseAttemptResultDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseAttemptResultDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class CourseAttemptResultDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: CourseDefinedByDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.CourseDefinedByDescriptor.EdFi -{ - /// - /// A class which represents the edfi.CourseDefinedByDescriptor table of the CourseDefinedByDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CourseDefinedByDescriptor : Entities.Common.EdFi.ICourseDefinedByDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "CourseDefinedByDescriptor"); - - // Fluent validator instance (threadsafe) - private static CourseDefinedByDescriptorPutPostRequestValidator _validator = new CourseDefinedByDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the CourseDefinedByDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CourseDefinedByDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return CourseDefinedByDescriptorId; } - set { CourseDefinedByDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.ICourseDefinedByDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.ICourseDefinedByDescriptor).CourseDefinedByDescriptorId.Equals(compareTo.CourseDefinedByDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICourseDefinedByDescriptor).CourseDefinedByDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.CourseDefinedByDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseDefinedByDescriptor)target); + return Entities.Common.EdFi.ContentClassDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContentClassDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseDefinedByDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseDefinedByDescriptor)target, null); + Entities.Common.EdFi.ContentClassDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IContentClassDescriptor)target, null); } // ------------------------------------------------------------- @@ -36816,9 +36237,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseDefinedByDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContentClassDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -36847,21 +36268,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseGPAApplicabilityDescriptor table of the CourseGPAApplicabilityDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ContinuationOfServicesReasonDescriptor table of the ContinuationOfServicesReasonDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseGPAApplicabilityDescriptor : Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ContinuationOfServicesReasonDescriptor : Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseGPAApplicabilityDescriptor"); + private static FullName _fullName = new FullName("edfi", "ContinuationOfServicesReasonDescriptor"); // Fluent validator instance (threadsafe) - private static CourseGPAApplicabilityDescriptorPutPostRequestValidator _validator = new CourseGPAApplicabilityDescriptorPutPostRequestValidator(); + private static ContinuationOfServicesReasonDescriptorPutPostRequestValidator _validator = new ContinuationOfServicesReasonDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -36880,7 +36301,7 @@ public class CourseGPAApplicabilityDescriptor : Entities.Common.EdFi.ICourseGPAA // ------------------------------------------------------------ /// - /// The unique identifier for the CourseGPAApplicabilityDescriptor resource. + /// The unique identifier for the ContinuationOfServicesReasonDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -36901,12 +36322,12 @@ public class CourseGPAApplicabilityDescriptor : Entities.Common.EdFi.ICourseGPAA /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CourseGPAApplicabilityDescriptorId { get; set; } + public int ContinuationOfServicesReasonDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CourseGPAApplicabilityDescriptorId; } - set { CourseGPAApplicabilityDescriptorId = value; } + get { return ContinuationOfServicesReasonDescriptorId; } + set { ContinuationOfServicesReasonDescriptorId = value; } } // ------------------------------------------------------------- @@ -36922,7 +36343,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor; + var compareTo = obj as Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -36932,7 +36353,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor).CourseGPAApplicabilityDescriptorId.Equals(compareTo.CourseGPAApplicabilityDescriptorId)) + if (!(this as Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor).ContinuationOfServicesReasonDescriptorId.Equals(compareTo.ContinuationOfServicesReasonDescriptorId)) return false; @@ -36950,7 +36371,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor).CourseGPAApplicabilityDescriptorId); + hash.Add((this as Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor).ContinuationOfServicesReasonDescriptorId); return hash.ToHashCode(); } @@ -37067,12 +36488,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseGPAApplicabilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target); + return Entities.Common.EdFi.ContinuationOfServicesReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseGPAApplicabilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target, null); + Entities.Common.EdFi.ContinuationOfServicesReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target, null); } // ------------------------------------------------------------- @@ -37087,9 +36508,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseGPAApplicabilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ContinuationOfServicesReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -37118,21 +36539,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseIdentificationSystemDescriptor table of the CourseIdentificationSystemDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CostRateDescriptor table of the CostRateDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseIdentificationSystemDescriptor : Entities.Common.EdFi.ICourseIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CostRateDescriptor : Entities.Common.EdFi.ICostRateDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseIdentificationSystemDescriptor"); + private static FullName _fullName = new FullName("edfi", "CostRateDescriptor"); // Fluent validator instance (threadsafe) - private static CourseIdentificationSystemDescriptorPutPostRequestValidator _validator = new CourseIdentificationSystemDescriptorPutPostRequestValidator(); + private static CostRateDescriptorPutPostRequestValidator _validator = new CostRateDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -37151,7 +36572,7 @@ public class CourseIdentificationSystemDescriptor : Entities.Common.EdFi.ICourse // ------------------------------------------------------------ /// - /// The unique identifier for the CourseIdentificationSystemDescriptor resource. + /// The unique identifier for the CostRateDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -37172,12 +36593,12 @@ public class CourseIdentificationSystemDescriptor : Entities.Common.EdFi.ICourse /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CourseIdentificationSystemDescriptorId { get; set; } + public int CostRateDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CourseIdentificationSystemDescriptorId; } - set { CourseIdentificationSystemDescriptorId = value; } + get { return CostRateDescriptorId; } + set { CostRateDescriptorId = value; } } // ------------------------------------------------------------- @@ -37193,7 +36614,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseIdentificationSystemDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICostRateDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -37203,7 +36624,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICourseIdentificationSystemDescriptor).CourseIdentificationSystemDescriptorId.Equals(compareTo.CourseIdentificationSystemDescriptorId)) + if (!(this as Entities.Common.EdFi.ICostRateDescriptor).CostRateDescriptorId.Equals(compareTo.CostRateDescriptorId)) return false; @@ -37221,7 +36642,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICourseIdentificationSystemDescriptor).CourseIdentificationSystemDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICostRateDescriptor).CostRateDescriptorId); return hash.ToHashCode(); } @@ -37338,12 +36759,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target); + return Entities.Common.EdFi.CostRateDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICostRateDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target, null); + Entities.Common.EdFi.CostRateDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICostRateDescriptor)target, null); } // ------------------------------------------------------------- @@ -37358,9 +36779,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CostRateDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -37389,21 +36810,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseLevelCharacteristicDescriptor table of the CourseLevelCharacteristicDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CountryDescriptor table of the CountryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristicDescriptor : Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CountryDescriptor : Entities.Common.EdFi.ICountryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseLevelCharacteristicDescriptor"); + private static FullName _fullName = new FullName("edfi", "CountryDescriptor"); // Fluent validator instance (threadsafe) - private static CourseLevelCharacteristicDescriptorPutPostRequestValidator _validator = new CourseLevelCharacteristicDescriptorPutPostRequestValidator(); + private static CountryDescriptorPutPostRequestValidator _validator = new CountryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -37422,7 +36843,7 @@ public class CourseLevelCharacteristicDescriptor : Entities.Common.EdFi.ICourseL // ------------------------------------------------------------ /// - /// The unique identifier for the CourseLevelCharacteristicDescriptor resource. + /// The unique identifier for the CountryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -37443,12 +36864,12 @@ public class CourseLevelCharacteristicDescriptor : Entities.Common.EdFi.ICourseL /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CourseLevelCharacteristicDescriptorId { get; set; } + public int CountryDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CourseLevelCharacteristicDescriptorId; } - set { CourseLevelCharacteristicDescriptorId = value; } + get { return CountryDescriptorId; } + set { CountryDescriptorId = value; } } // ------------------------------------------------------------- @@ -37464,7 +36885,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICountryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -37474,7 +36895,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor).CourseLevelCharacteristicDescriptorId.Equals(compareTo.CourseLevelCharacteristicDescriptorId)) + if (!(this as Entities.Common.EdFi.ICountryDescriptor).CountryDescriptorId.Equals(compareTo.CountryDescriptorId)) return false; @@ -37492,7 +36913,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor).CourseLevelCharacteristicDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICountryDescriptor).CountryDescriptorId); return hash.ToHashCode(); } @@ -37609,12 +37030,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseLevelCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target); + return Entities.Common.EdFi.CountryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICountryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseLevelCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target, null); + Entities.Common.EdFi.CountryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICountryDescriptor)target, null); } // ------------------------------------------------------------- @@ -37629,9 +37050,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CountryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -37660,28 +37081,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CourseOffering resource. + /// Represents a reference to the Course resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class CourseOfferingReference : IResourceReference + public class CourseReference : IResourceReference { - [DataMember(Name="localCourseCode")] - public string LocalCourseCode { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + [DataMember(Name="courseCode")] + public string CourseCode { get; set; } - [DataMember(Name="sessionName")] - public string SessionName { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -37719,29 +37134,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SessionName != default(string); + return CourseCode != default(string) && EducationOrganizationId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (LocalCourseCode == default) - { - yield return "LocalCourseCode"; - } - - if (SchoolId == default) - { - yield return "SchoolId"; - } - - if (SchoolYear == default) + if (CourseCode == default) { - yield return "SchoolYear"; + yield return "CourseCode"; } - if (SessionName == default) + if (EducationOrganizationId == default) { - yield return "SessionName"; + yield return "EducationOrganizationId"; } } @@ -37750,8 +37155,8 @@ private Link CreateLink() { var link = new Link { - Rel = "CourseOffering", - Href = $"/ed-fi/courseOfferings/{ResourceId:n}" + Rel = "Course", + Href = $"/ed-fi/courses/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -37778,16 +37183,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.CourseOffering table of the CourseOffering aggregate in the ODS Database. + /// A class which represents the edfi.Course table of the Course aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseOffering : Entities.Common.EdFi.ICourseOffering, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class Course : Entities.Common.EdFi.ICourse, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseOffering"); + private static FullName _fullName = new FullName("edfi", "Course"); // Fluent validator instance (threadsafe) - private static CourseOfferingPutPostRequestValidator _validator = new CourseOfferingPutPostRequestValidator(); + private static CoursePutPostRequestValidator _validator = new CoursePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -37798,11 +37204,14 @@ public class CourseOffering : Entities.Common.EdFi.ICourseOffering, IHasETag, ID // Constructor // ------------------------------------------------------------- - public CourseOffering() + public Course() { - CourseOfferingCourseLevelCharacteristics = new List(); - CourseOfferingCurriculumUseds = new List(); - CourseOfferingOfferedGradeLevels = new List(); + CourseAcademicSubjects = new List(); + CourseCompetencyLevels = new List(); + CourseIdentificationCodes = new List(); + CourseLearningStandards = new List(); + CourseLevelCharacteristics = new List(); + CourseOfferedGradeLevels = new List(); } // ------------------------------------------------------------ @@ -37812,7 +37221,7 @@ public CourseOffering() // ------------------------------------------------------------ /// - /// The unique identifier for the CourseOffering resource. + /// The unique identifier for the Course resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -37823,103 +37232,37 @@ public CourseOffering() // References // ------------------------------------------------------------- - private bool _courseReferenceExplicitlyAssigned; - private Course.EdFi.CourseReference _courseReference; - private Course.EdFi.CourseReference ImplicitCourseReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_courseReference == null && !_courseReferenceExplicitlyAssigned) - _courseReference = new Course.EdFi.CourseReference(); - - return _courseReference; - } - } - - [DataMember(Name="courseReference")] - [FullyDefinedReference][RequiredReference("edfi", "CourseOffering")] - public Course.EdFi.CourseReference CourseReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCourseReference != null - && (_courseReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - return ImplicitCourseReference; - - return null; - } - set - { - _courseReferenceExplicitlyAssigned = true; - _courseReference = value; - } - } - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); - - return _schoolReference; - } - } - - [DataMember(Name="schoolReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; - - return null; - } - set - { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; - } - } - private bool _sessionReferenceExplicitlyAssigned; - private Session.EdFi.SessionReference _sessionReference; - private Session.EdFi.SessionReference ImplicitSessionReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sessionReference == null && !_sessionReferenceExplicitlyAssigned) - _sessionReference = new Session.EdFi.SessionReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _sessionReference; + return _educationOrganizationReference; } } - [DataMember(Name="sessionReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Session.EdFi.SessionReference SessionReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSessionReference != null - && (_sessionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) - return ImplicitSessionReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _sessionReferenceExplicitlyAssigned = true; - _sessionReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } // ------------------------------------------------------------- @@ -37929,25 +37272,25 @@ public Session.EdFi.SessionReference SessionReference // ------------------------------------------------------------- /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// A unique alphanumeric code assigned to a course. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="localCourseCode")] - public string LocalCourseCode { get; set; } + [DataMember(Name="courseCode")] + public string CourseCode { get; set; } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICourseOffering.SchoolId + long Entities.Common.EdFi.ICourse.EducationOrganizationId { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -37956,63 +37299,9 @@ long Entities.Common.EdFi.ICourseOffering.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; - - // Session - _sessionReferenceExplicitlyAssigned = false; - ImplicitSessionReference.SchoolId = value; - } - } - - /// - /// The identifier for the school year. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ICourseOffering.SchoolYear - { - get - { - if (ImplicitSessionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) - return ImplicitSessionReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Session - _sessionReferenceExplicitlyAssigned = false; - ImplicitSessionReference.SchoolYear = value; - } - } - - /// - /// The identifier for the calendar for the academic session. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseOffering.SessionName - { - get - { - if (ImplicitSessionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) - return ImplicitSessionReference.SessionName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Session - _sessionReferenceExplicitlyAssigned = false; - ImplicitSessionReference.SessionName = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } // ------------------------------------------------------------- @@ -38029,7 +37318,7 @@ string Entities.Common.EdFi.ICourseOffering.SessionName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseOffering; + var compareTo = obj as Entities.Common.EdFi.ICourse; if (ReferenceEquals(this, compareTo)) return true; @@ -38039,22 +37328,12 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseOffering).LocalCourseCode, compareTo.LocalCourseCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICourseOffering).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICourseOffering).SchoolYear.Equals(compareTo.SchoolYear)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourse).CourseCode, compareTo.CourseCode)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseOffering).SessionName, compareTo.SessionName)) + if (!(this as Entities.Common.EdFi.ICourse).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; @@ -38072,17 +37351,11 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseOffering).LocalCourseCode); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseOffering).SchoolId); + hash.Add((this as Entities.Common.EdFi.ICourse).CourseCode); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseOffering).SchoolYear); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseOffering).SessionName); + hash.Add((this as Entities.Common.EdFi.ICourse).EducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -38097,76 +37370,153 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A unique alphanumeric code assigned to a course. + /// Indicates the career cluster or pathway the course is associated with as part of a CTE curriculum. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseOffering.CourseCode - { - get - { - if (ImplicitCourseReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - { - return ImplicitCourseReference.CourseCode; - } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="careerPathwayDescriptor")][DescriptorExists("CareerPathwayDescriptor")] + public string CareerPathwayDescriptor { get; set; } - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + /// + /// Specifies whether the course was defined by the SEA, LEA, School, or national organization. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="courseDefinedByDescriptor")][DescriptorExists("CourseDefinedByDescriptor")] + public string CourseDefinedByDescriptor { get; set; } - // Course - _courseReferenceExplicitlyAssigned = false; - ImplicitCourseReference.CourseCode = value; - } - } + /// + /// A description of the content standards and goals covered in the course. Reference may be made to state or national content standards. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="courseDescription")] + public string CourseDescription { get; set; } /// - /// The identifier assigned to an education organization. + /// An indicator of whether or not the course being described is included in the computation of the student's grade point average, and if so, if it is weighted differently from regular courses. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICourseOffering.EducationOrganizationId - { - get - { - if (ImplicitCourseReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - { - return ImplicitCourseReference.EducationOrganizationId; - } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="courseGPAApplicabilityDescriptor")][DescriptorExists("CourseGPAApplicabilityDescriptor")] + public string CourseGPAApplicabilityDescriptor { get; set; } - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + /// + /// The descriptive name given to a course of study offered in a school or other institution or organization. In departmentalized classes at the elementary, secondary, and postsecondary levels (and for staff development activities), this refers to the name by which a course is identified (e.g., American History, English III). For elementary and other non-departmentalized classes, it refers to any portion of the instruction for which a grade or report is assigned (e.g., reading, composition, spelling, and language arts). + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="courseTitle")] + public string CourseTitle { get; set; } - // Course - _courseReferenceExplicitlyAssigned = false; - ImplicitCourseReference.EducationOrganizationId = value; - } - } + /// + /// Date the course was adopted by the education agency. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="dateCourseAdopted")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DateCourseAdopted { get; set; } /// - /// The planned total number of clock minutes of instruction for this course offering. Generally, this should be at least as many minutes as is required for completion by the related state- or district-defined course. + /// An indication that this course may satisfy high school graduation requirements in the course's subject area. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="highSchoolCourseRequirement")] + public bool? HighSchoolCourseRequirement { get; set; } + + /// + /// Designates how many times the course may be taken with credit received by the student. /// // NOT in a reference, NOT a lookup column [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="instructionalTimePlanned")] - public int? InstructionalTimePlanned { get; set; } + [DataMember(Name="maxCompletionsForCredit")] + public int? MaxCompletionsForCredit { get; set; } /// - /// The descriptive name given to a course of study offered in the school, if different from the course title. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="localCourseTitle")] - public string LocalCourseTitle { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maximumAvailableCreditConversion")] + public decimal? MaximumAvailableCreditConversion { get; set; } + + /// + /// The value of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maximumAvailableCredits")] + public decimal? MaximumAvailableCredits { get; set; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maximumAvailableCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string MaximumAvailableCreditTypeDescriptor { get; set; } + + /// + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="minimumAvailableCreditConversion")] + public decimal? MinimumAvailableCreditConversion { get; set; } + + /// + /// The value of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="minimumAvailableCredits")] + public decimal? MinimumAvailableCredits { get; set; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="minimumAvailableCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string MinimumAvailableCreditTypeDescriptor { get; set; } + + private bool _numberOfPartsExplicitlyAssigned = false; + private int _numberOfParts; + + /// + /// The number of parts identified for a course. + /// + // NOT in a reference, NOT a lookup column + [Range(1, 8, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="numberOfParts")] + public int NumberOfParts + { + get => _numberOfParts; + set + { + _numberOfParts = value; + _numberOfPartsExplicitlyAssigned = true; + } + } + + + /// + /// The actual or estimated number of clock minutes required for class completion. This number is especially important for career and technical education classes and may represent (in minutes) the clock hour requirement of the class. + /// + // NOT in a reference, NOT a lookup column + [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="timeRequiredForCompletion")] + public int? TimeRequiredForCompletion { get; set; } // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_numberOfPartsExplicitlyAssigned) + { + yield return "NumberOfParts"; + } + } + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -38185,101 +37535,191 @@ long Entities.Common.EdFi.ICourseOffering.EducationOrganizationId // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOffering")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "Course")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _courseOfferingCourseLevelCharacteristics; - private ICollection _courseOfferingCourseLevelCharacteristicsCovariant; + private ICollection _courseAcademicSubjects; + private ICollection _courseAcademicSubjectsCovariant; [NoDuplicateMembers] - [DataMember(Name="courseLevelCharacteristics")] - public ICollection CourseOfferingCourseLevelCharacteristics + [DataMember(Name="academicSubjects")] + public ICollection CourseAcademicSubjects { - get { return _courseOfferingCourseLevelCharacteristics; } + get { return _courseAcademicSubjects; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)e.Item).CourseOffering = this); - _courseOfferingCourseLevelCharacteristics = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseAcademicSubject)e.Item).Course = this); + _courseAcademicSubjects = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)e.Item).CourseOffering = this; - _courseOfferingCourseLevelCharacteristicsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseAcademicSubject)e.Item).Course = this; + _courseAcademicSubjectsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCourseLevelCharacteristics + ICollection Entities.Common.EdFi.ICourse.CourseAcademicSubjects { - get { return _courseOfferingCourseLevelCharacteristicsCovariant; } - set { CourseOfferingCourseLevelCharacteristics = new List(value.Cast()); } + get { return _courseAcademicSubjectsCovariant; } + set { CourseAcademicSubjects = new List(value.Cast()); } } - private ICollection _courseOfferingCurriculumUseds; - private ICollection _courseOfferingCurriculumUsedsCovariant; + private ICollection _courseCompetencyLevels; + private ICollection _courseCompetencyLevelsCovariant; [NoDuplicateMembers] - [DataMember(Name="curriculumUseds")] - public ICollection CourseOfferingCurriculumUseds + [DataMember(Name="competencyLevels")] + public ICollection CourseCompetencyLevels { - get { return _courseOfferingCurriculumUseds; } + get { return _courseCompetencyLevels; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)e.Item).CourseOffering = this); - _courseOfferingCurriculumUseds = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseCompetencyLevel)e.Item).Course = this); + _courseCompetencyLevels = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)e.Item).CourseOffering = this; - _courseOfferingCurriculumUsedsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseCompetencyLevel)e.Item).Course = this; + _courseCompetencyLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCurriculumUseds + ICollection Entities.Common.EdFi.ICourse.CourseCompetencyLevels { - get { return _courseOfferingCurriculumUsedsCovariant; } - set { CourseOfferingCurriculumUseds = new List(value.Cast()); } + get { return _courseCompetencyLevelsCovariant; } + set { CourseCompetencyLevels = new List(value.Cast()); } } - private ICollection _courseOfferingOfferedGradeLevels; - private ICollection _courseOfferingOfferedGradeLevelsCovariant; + private ICollection _courseIdentificationCodes; + private ICollection _courseIdentificationCodesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="identificationCodes")] + public ICollection CourseIdentificationCodes + { + get { return _courseIdentificationCodes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseIdentificationCode)e.Item).Course = this); + _courseIdentificationCodes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseIdentificationCode)e.Item).Course = this; + _courseIdentificationCodesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseIdentificationCodes + { + get { return _courseIdentificationCodesCovariant; } + set { CourseIdentificationCodes = new List(value.Cast()); } + } + + private ICollection _courseLearningStandards; + private ICollection _courseLearningStandardsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="learningStandards")] + public ICollection CourseLearningStandards + { + get { return _courseLearningStandards; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseLearningStandard)e.Item).Course = this); + _courseLearningStandards = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseLearningStandard)e.Item).Course = this; + _courseLearningStandardsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseLearningStandards + { + get { return _courseLearningStandardsCovariant; } + set { CourseLearningStandards = new List(value.Cast()); } + } + + private ICollection _courseLevelCharacteristics; + private ICollection _courseLevelCharacteristicsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="levelCharacteristics")] + public ICollection CourseLevelCharacteristics + { + get { return _courseLevelCharacteristics; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseLevelCharacteristic)e.Item).Course = this); + _courseLevelCharacteristics = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseLevelCharacteristic)e.Item).Course = this; + _courseLevelCharacteristicsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseLevelCharacteristics + { + get { return _courseLevelCharacteristicsCovariant; } + set { CourseLevelCharacteristics = new List(value.Cast()); } + } + + private ICollection _courseOfferedGradeLevels; + private ICollection _courseOfferedGradeLevelsCovariant; [NoDuplicateMembers] [DataMember(Name="offeredGradeLevels")] - public ICollection CourseOfferingOfferedGradeLevels + public ICollection CourseOfferedGradeLevels { - get { return _courseOfferingOfferedGradeLevels; } + get { return _courseOfferedGradeLevels; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)e.Item).CourseOffering = this); - _courseOfferingOfferedGradeLevels = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseOfferedGradeLevel)e.Item).Course = this); + _courseOfferedGradeLevels = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)e.Item).CourseOffering = this; - _courseOfferingOfferedGradeLevelsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferedGradeLevel)e.Item).Course = this; + _courseOfferedGradeLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingOfferedGradeLevels + ICollection Entities.Common.EdFi.ICourse.CourseOfferedGradeLevels { - get { return _courseOfferingOfferedGradeLevelsCovariant; } - set { CourseOfferingOfferedGradeLevels = new List(value.Cast()); } + get { return _courseOfferedGradeLevelsCovariant; } + set { CourseOfferedGradeLevels = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -38304,19 +37744,34 @@ public ICollection CourseOfferingOfferedGradeLe internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_courseOfferingCourseLevelCharacteristics != null) foreach (var item in _courseOfferingCourseLevelCharacteristics) + if (_courseAcademicSubjects != null) foreach (var item in _courseAcademicSubjects) { - item.CourseOffering = this; + item.Course = this; } - if (_courseOfferingCurriculumUseds != null) foreach (var item in _courseOfferingCurriculumUseds) + if (_courseCompetencyLevels != null) foreach (var item in _courseCompetencyLevels) { - item.CourseOffering = this; + item.Course = this; } - if (_courseOfferingOfferedGradeLevels != null) foreach (var item in _courseOfferingOfferedGradeLevels) + if (_courseIdentificationCodes != null) foreach (var item in _courseIdentificationCodes) { - item.CourseOffering = this; + item.Course = this; + } + + if (_courseLearningStandards != null) foreach (var item in _courseLearningStandards) + { + item.Course = this; + } + + if (_courseLevelCharacteristics != null) foreach (var item in _courseLevelCharacteristics) + { + item.Course = this; + } + + if (_courseOfferedGradeLevels != null) foreach (var item in _courseOfferedGradeLevels) + { + item.Course = this; } } @@ -38327,50 +37782,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseOfferingMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOffering)target); + return Entities.Common.EdFi.CourseMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourse)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseOfferingMapper.MapTo(this, (Entities.Common.EdFi.ICourseOffering)target, null); + Entities.Common.EdFi.CourseMapper.MapTo(this, (Entities.Common.EdFi.ICourse)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICourseOffering.CourseResourceId - { - get { return null; } - set { ImplicitCourseReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourseOffering.CourseDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCourseReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ICourseOffering.SchoolResourceId - { - get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.ICourseOffering.SessionResourceId + Guid? Entities.Common.EdFi.ICourse.EducationOrganizationResourceId { get { return null; } - set { ImplicitSessionReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator + string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitSessionReference.Discriminator = value; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } } @@ -38396,99 +37830,96 @@ string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator // ---------------------- // Validate collections // ---------------------- - if (CourseOfferingCourseLevelCharacteristics.Any() && mappingContract?.IsMemberSupported("CourseOfferingCourseLevelCharacteristics") != false) + if (CourseAcademicSubjects.Any() && mappingContract?.IsMemberSupported("CourseAcademicSubjects") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("CourseOfferingCourseLevelCharacteristics"); + pathBuilder.Append("CourseAcademicSubjects"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferingCourseLevelCharacteristics, validationContext, validationContext.Items.ForCollection("CourseOfferingCourseLevelCharacteristics")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseAcademicSubjects, validationContext, validationContext.Items.ForCollection("CourseAcademicSubjects")))) { yield return result; } } - if (CourseOfferingCurriculumUseds.Any() && mappingContract?.IsMemberSupported("CourseOfferingCurriculumUseds") != false) + if (CourseCompetencyLevels.Any() && mappingContract?.IsMemberSupported("CourseCompetencyLevels") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("CourseOfferingCurriculumUseds"); + pathBuilder.Append("CourseCompetencyLevels"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferingCurriculumUseds, validationContext, validationContext.Items.ForCollection("CourseOfferingCurriculumUseds")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseCompetencyLevels, validationContext, validationContext.Items.ForCollection("CourseCompetencyLevels")))) { yield return result; } } - if (CourseOfferingOfferedGradeLevels.Any() && mappingContract?.IsMemberSupported("CourseOfferingOfferedGradeLevels") != false) + if (CourseIdentificationCodes.Any() && mappingContract?.IsMemberSupported("CourseIdentificationCodes") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("CourseOfferingOfferedGradeLevels"); + pathBuilder.Append("CourseIdentificationCodes"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferingOfferedGradeLevels, validationContext, validationContext.Items.ForCollection("CourseOfferingOfferedGradeLevels")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseIdentificationCodes, validationContext, validationContext.Items.ForCollection("CourseIdentificationCodes")))) { yield return result; } } - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) + if (CourseLearningStandards.Any() && mappingContract?.IsMemberSupported("CourseLearningStandards") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); + pathBuilder.Append("CourseLearningStandards"); - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseLearningStandards, validationContext, validationContext.Items.ForCollection("CourseLearningStandards")))) { yield return result; } } - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + if (CourseLevelCharacteristics.Any() && mappingContract?.IsMemberSupported("CourseLevelCharacteristics") != false) { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseLevelCharacteristics"); - IEnumerable<(string path, long value)> GetSchoolIdSources() + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseLevelCharacteristics, validationContext, validationContext.Items.ForCollection("CourseLevelCharacteristics")))) + { + yield return result; + } + } + + if (CourseOfferedGradeLevels.Any() && mappingContract?.IsMemberSupported("CourseOfferedGradeLevels") != false) { - // Obtain value from other references - var valueFromSchoolReference = this.SchoolReference?.SchoolId; + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseOfferedGradeLevels"); - if (valueFromSchoolReference != null) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferedGradeLevels, validationContext, validationContext.Items.ForCollection("CourseOfferedGradeLevels")))) { - yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); + yield return result; } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); - // Obtain value from other references - var valueFromSessionReference = this.SessionReference?.SchoolId; - - if (valueFromSessionReference != null) + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) { - yield return ("sessionReference.schoolId", this.SessionReference.SchoolId); + yield return result; } - } // Execute the resource's fluent validator @@ -38516,16 +37947,19 @@ string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseOfferingPutPostRequestValidator : FluentValidation.AbstractValidator + public class CoursePutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_CourseOffering = new FullName("edfi", "CourseOffering"); + private static readonly FullName _fullName_edfi_Course = new FullName("edfi", "Course"); // Declare collection item validators - private CourseOfferingCourseLevelCharacteristicPutPostRequestValidator _courseOfferingCourseLevelCharacteristicsValidator = new (); - private CourseOfferingCurriculumUsedPutPostRequestValidator _courseOfferingCurriculumUsedsValidator = new (); - private CourseOfferingOfferedGradeLevelPutPostRequestValidator _courseOfferingOfferedGradeLevelsValidator = new (); + private CourseAcademicSubjectPutPostRequestValidator _courseAcademicSubjectsValidator = new (); + private CourseCompetencyLevelPutPostRequestValidator _courseCompetencyLevelsValidator = new (); + private CourseIdentificationCodePutPostRequestValidator _courseIdentificationCodesValidator = new (); + private CourseLearningStandardPutPostRequestValidator _courseLearningStandardsValidator = new (); + private CourseLevelCharacteristicPutPostRequestValidator _courseLevelCharacteristicsValidator = new (); + private CourseOfferedGradeLevelPutPostRequestValidator _courseOfferedGradeLevelsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -38542,41 +37976,74 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsCourseOfferingCourseLevelCharacteristicIncluded(x)); + var hasInvalidCourseAcademicSubjectsItems = instance.CourseAcademicSubjects.Any(x => !mappingContract.IsCourseAcademicSubjectIncluded(x)); - if (hasInvalidCourseOfferingCourseLevelCharacteristicsItems) + if (hasInvalidCourseAcademicSubjectsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseOfferingCourseLevelCharacteristics", $"A supplied 'CourseOfferingCourseLevelCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("CourseAcademicSubjects", $"A supplied 'CourseAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsCourseOfferingCurriculumUsedIncluded != null) + if (mappingContract.IsCourseCompetencyLevelIncluded != null) { - var hasInvalidCourseOfferingCurriculumUsedsItems = instance.CourseOfferingCurriculumUseds.Any(x => !mappingContract.IsCourseOfferingCurriculumUsedIncluded(x)); + var hasInvalidCourseCompetencyLevelsItems = instance.CourseCompetencyLevels.Any(x => !mappingContract.IsCourseCompetencyLevelIncluded(x)); - if (hasInvalidCourseOfferingCurriculumUsedsItems) + if (hasInvalidCourseCompetencyLevelsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseOfferingCurriculumUseds", $"A supplied 'CourseOfferingCurriculumUsed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("CourseCompetencyLevels", $"A supplied 'CourseCompetencyLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsCourseOfferingOfferedGradeLevelIncluded != null) + if (mappingContract.IsCourseIdentificationCodeIncluded != null) { - var hasInvalidCourseOfferingOfferedGradeLevelsItems = instance.CourseOfferingOfferedGradeLevels.Any(x => !mappingContract.IsCourseOfferingOfferedGradeLevelIncluded(x)); + var hasInvalidCourseIdentificationCodesItems = instance.CourseIdentificationCodes.Any(x => !mappingContract.IsCourseIdentificationCodeIncluded(x)); - if (hasInvalidCourseOfferingOfferedGradeLevelsItems) + if (hasInvalidCourseIdentificationCodesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseOfferingOfferedGradeLevels", $"A supplied 'CourseOfferingOfferedGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("CourseIdentificationCodes", $"A supplied 'CourseIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseLearningStandardIncluded != null) + { + var hasInvalidCourseLearningStandardsItems = instance.CourseLearningStandards.Any(x => !mappingContract.IsCourseLearningStandardIncluded(x)); + + if (hasInvalidCourseLearningStandardsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseLearningStandards", $"A supplied 'CourseLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseLevelCharacteristicIncluded != null) + { + var hasInvalidCourseLevelCharacteristicsItems = instance.CourseLevelCharacteristics.Any(x => !mappingContract.IsCourseLevelCharacteristicIncluded(x)); + + if (hasInvalidCourseLevelCharacteristicsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseLevelCharacteristics", $"A supplied 'CourseLevelCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseOfferedGradeLevelIncluded != null) + { + var hasInvalidCourseOfferedGradeLevelsItems = instance.CourseOfferedGradeLevels.Any(x => !mappingContract.IsCourseOfferedGradeLevelIncluded(x)); + + if (hasInvalidCourseOfferedGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseOfferedGradeLevels", $"A supplied 'CourseOfferedGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -38598,16 +38065,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseOfferingCourseLevelCharacteristic table of the CourseOffering aggregate in the ODS Database. + /// A class which represents the edfi.CourseAcademicSubject table of the Course aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseOfferingCourseLevelCharacteristic : Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic, IValidatableObject + public class CourseAcademicSubject : Entities.Common.EdFi.ICourseAcademicSubject, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseOfferingCourseLevelCharacteristic"); + private static FullName _fullName = new FullName("edfi", "CourseAcademicSubject"); // Fluent validator instance (threadsafe) - private static CourseOfferingCourseLevelCharacteristicPutPostRequestValidator _validator = new CourseOfferingCourseLevelCharacteristicPutPostRequestValidator(); + private static CourseAcademicSubjectPutPostRequestValidator _validator = new CourseAcademicSubjectPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -38634,33 +38101,33 @@ public class CourseOfferingCourseLevelCharacteristic : Entities.Common.EdFi.ICou //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseOffering _courseOffering; + private Entities.Common.EdFi.ICourse _course; [IgnoreDataMember] - Entities.Common.EdFi.ICourseOffering ICourseOfferingCourseLevelCharacteristic.CourseOffering + Entities.Common.EdFi.ICourse ICourseAcademicSubject.Course { - get { return _courseOffering; } - set { SetCourseOffering(value); } + get { return _course; } + set { SetCourse(value); } } - public Entities.Common.EdFi.ICourseOffering CourseOffering + public Entities.Common.EdFi.ICourse Course { - set { SetCourseOffering(value); } + set { SetCourse(value); } } - private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) + private void SetCourse(Entities.Common.EdFi.ICourse value) { - _courseOffering = value; + _course = value; } /// - /// The type of specific program or designation with which the course offering is associated (e.g., AP, IB, Dual Credit, CTE). This collection should only be populated if it differs from the course level characteristics identified at the course level. + /// The intended major subject/s area of the course. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseLevelCharacteristicDescriptor")][DescriptorExists("CourseLevelCharacteristicDescriptor")] - public string CourseLevelCharacteristicDescriptor { get; set; } + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -38675,7 +38142,7 @@ private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic; + var compareTo = obj as Entities.Common.EdFi.ICourseAcademicSubject; if (ReferenceEquals(this, compareTo)) return true; @@ -38684,12 +38151,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_courseOffering == null || !_courseOffering.Equals(compareTo.CourseOffering)) + if (_course == null || !_course.Equals(compareTo.Course)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor, compareTo.CourseLevelCharacteristicDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) return false; @@ -38706,11 +38173,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_courseOffering != null) - hash.Add(_courseOffering); + if (_course != null) + hash.Add(_course); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor); + hash.Add((this as Entities.Common.EdFi.ICourseAcademicSubject).AcademicSubjectDescriptor); return hash.ToHashCode(); } @@ -38744,7 +38211,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOfferingCourseLevelCharacteristic")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseAcademicSubject")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -38768,12 +38235,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseOfferingCourseLevelCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target); + return Entities.Common.EdFi.CourseAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseAcademicSubject)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseOfferingCourseLevelCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target, null); + Entities.Common.EdFi.CourseAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ICourseAcademicSubject)target, null); } // ------------------------------------------------------------- @@ -38848,9 +38315,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseOfferingCourseLevelCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -38879,16 +38346,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseOfferingCurriculumUsed table of the CourseOffering aggregate in the ODS Database. + /// A class which represents the edfi.CourseCompetencyLevel table of the Course aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseOfferingCurriculumUsed : Entities.Common.EdFi.ICourseOfferingCurriculumUsed, IValidatableObject + public class CourseCompetencyLevel : Entities.Common.EdFi.ICourseCompetencyLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseOfferingCurriculumUsed"); + private static FullName _fullName = new FullName("edfi", "CourseCompetencyLevel"); // Fluent validator instance (threadsafe) - private static CourseOfferingCurriculumUsedPutPostRequestValidator _validator = new CourseOfferingCurriculumUsedPutPostRequestValidator(); + private static CourseCompetencyLevelPutPostRequestValidator _validator = new CourseCompetencyLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -38915,33 +38382,33 @@ public class CourseOfferingCurriculumUsed : Entities.Common.EdFi.ICourseOffering //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseOffering _courseOffering; + private Entities.Common.EdFi.ICourse _course; [IgnoreDataMember] - Entities.Common.EdFi.ICourseOffering ICourseOfferingCurriculumUsed.CourseOffering + Entities.Common.EdFi.ICourse ICourseCompetencyLevel.Course { - get { return _courseOffering; } - set { SetCourseOffering(value); } + get { return _course; } + set { SetCourse(value); } } - public Entities.Common.EdFi.ICourseOffering CourseOffering + public Entities.Common.EdFi.ICourse Course { - set { SetCourseOffering(value); } + set { SetCourse(value); } } - private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) + private void SetCourse(Entities.Common.EdFi.ICourse value) { - _courseOffering = value; + _course = value; } /// - /// The type of curriculum used in an early learning classroom or group. + /// The competency levels defined to rate the student for the course. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="curriculumUsedDescriptor")][DescriptorExists("CurriculumUsedDescriptor")] - public string CurriculumUsedDescriptor { get; set; } + [DataMember(Name="competencyLevelDescriptor")][DescriptorExists("CompetencyLevelDescriptor")] + public string CompetencyLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -38956,7 +38423,7 @@ private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseOfferingCurriculumUsed; + var compareTo = obj as Entities.Common.EdFi.ICourseCompetencyLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -38965,12 +38432,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_courseOffering == null || !_courseOffering.Equals(compareTo.CourseOffering)) + if (_course == null || !_course.Equals(compareTo.Course)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferingCurriculumUsed).CurriculumUsedDescriptor, compareTo.CurriculumUsedDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseCompetencyLevel).CompetencyLevelDescriptor, compareTo.CompetencyLevelDescriptor)) return false; @@ -38987,11 +38454,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_courseOffering != null) - hash.Add(_courseOffering); + if (_course != null) + hash.Add(_course); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseOfferingCurriculumUsed).CurriculumUsedDescriptor); + hash.Add((this as Entities.Common.EdFi.ICourseCompetencyLevel).CompetencyLevelDescriptor); return hash.ToHashCode(); } @@ -39025,7 +38492,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOfferingCurriculumUsed")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseCompetencyLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -39049,12 +38516,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseOfferingCurriculumUsedMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target); + return Entities.Common.EdFi.CourseCompetencyLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseCompetencyLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseOfferingCurriculumUsedMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target, null); + Entities.Common.EdFi.CourseCompetencyLevelMapper.MapTo(this, (Entities.Common.EdFi.ICourseCompetencyLevel)target, null); } // ------------------------------------------------------------- @@ -39129,9 +38596,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseOfferingCurriculumUsedPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseCompetencyLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -39160,16 +38627,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseOfferingOfferedGradeLevel table of the CourseOffering aggregate in the ODS Database. + /// A class which represents the edfi.CourseIdentificationCode table of the Course aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseOfferingOfferedGradeLevel : Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel, IValidatableObject + public class CourseIdentificationCode : Entities.Common.EdFi.ICourseIdentificationCode, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseOfferingOfferedGradeLevel"); + private static FullName _fullName = new FullName("edfi", "CourseIdentificationCode"); // Fluent validator instance (threadsafe) - private static CourseOfferingOfferedGradeLevelPutPostRequestValidator _validator = new CourseOfferingOfferedGradeLevelPutPostRequestValidator(); + private static CourseIdentificationCodePutPostRequestValidator _validator = new CourseIdentificationCodePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -39196,33 +38663,33 @@ public class CourseOfferingOfferedGradeLevel : Entities.Common.EdFi.ICourseOffer //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseOffering _courseOffering; + private Entities.Common.EdFi.ICourse _course; [IgnoreDataMember] - Entities.Common.EdFi.ICourseOffering ICourseOfferingOfferedGradeLevel.CourseOffering + Entities.Common.EdFi.ICourse ICourseIdentificationCode.Course { - get { return _courseOffering; } - set { SetCourseOffering(value); } + get { return _course; } + set { SetCourse(value); } } - public Entities.Common.EdFi.ICourseOffering CourseOffering + public Entities.Common.EdFi.ICourse Course { - set { SetCourseOffering(value); } + set { SetCourse(value); } } - private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) + private void SetCourse(Entities.Common.EdFi.ICourse value) { - _courseOffering = value; + _course = value; } /// - /// The grade levels in which the course is offered. This collection should only be populated if it differs from the offered grade levels identified at the course level. + /// A system that is used to identify the organization of subject matter and related learning experiences provided for the instruction of students. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } + [DataMember(Name="courseIdentificationSystemDescriptor")][DescriptorExists("CourseIdentificationSystemDescriptor")] + public string CourseIdentificationSystemDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39237,7 +38704,7 @@ private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel; + var compareTo = obj as Entities.Common.EdFi.ICourseIdentificationCode; if (ReferenceEquals(this, compareTo)) return true; @@ -39246,12 +38713,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_courseOffering == null || !_courseOffering.Equals(compareTo.CourseOffering)) + if (_course == null || !_course.Equals(compareTo.Course)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseIdentificationCode).CourseIdentificationSystemDescriptor, compareTo.CourseIdentificationSystemDescriptor)) return false; @@ -39268,11 +38735,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_courseOffering != null) - hash.Add(_courseOffering); + if (_course != null) + hash.Add(_course); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel).GradeLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.ICourseIdentificationCode).CourseIdentificationSystemDescriptor); return hash.ToHashCode(); } @@ -39286,6 +38753,31 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The organization code or name assigning the Identification Code. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assigningOrganizationIdentificationCode")] + public string AssigningOrganizationIdentificationCode { get; set; } + + /// + /// The URL for the course catalog that defines the course identification code. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="courseCatalogURL")] + public string CourseCatalogURL { get; set; } + + /// + /// A unique number or alphanumeric code assigned to a course by a school, school system, state, or other agency or entity. For multi-part course codes, concatenate the parts separated by a \"/\". For example, consider the following SCED code- subject = 20 Math course = 272 Geometry level = G General credits = 1.00 course sequence 1 of 1- would be entered as 20/272/G/1.00/1 of 1. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39306,7 +38798,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOfferingOfferedGradeLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseIdentificationCode")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -39330,12 +38822,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseOfferingOfferedGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target); + return Entities.Common.EdFi.CourseIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseIdentificationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseOfferingOfferedGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target, null); + Entities.Common.EdFi.CourseIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.ICourseIdentificationCode)target, null); } // ------------------------------------------------------------- @@ -39410,9 +38902,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseOfferingOfferedGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -39440,22 +38932,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseRepeatCodeDescriptor table of the CourseRepeatCodeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CourseLearningStandard table of the Course aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseRepeatCodeDescriptor : Entities.Common.EdFi.ICourseRepeatCodeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CourseLearningStandard : Entities.Common.EdFi.ICourseLearningStandard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseRepeatCodeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseLearningStandard"); // Fluent validator instance (threadsafe) - private static CourseRepeatCodeDescriptorPutPostRequestValidator _validator = new CourseRepeatCodeDescriptorPutPostRequestValidator(); + private static CourseLearningStandardPutPostRequestValidator _validator = new CourseLearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -39472,35 +38959,92 @@ public class CourseRepeatCodeDescriptor : Entities.Common.EdFi.ICourseRepeatCode // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CourseRepeatCodeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- + + private bool _learningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) + _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); + + return _learningStandardReference; + } + } + + [DataMember(Name="learningStandardReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LearningStandard.EdFi.LearningStandardReference LearningStandardReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLearningStandardReference != null + && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference; + + return null; + } + set + { + _learningStandardReferenceExplicitlyAssigned = true; + _learningStandardReference = value; + } + } + // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourse _course; + + [IgnoreDataMember] + Entities.Common.EdFi.ICourse ICourseLearningStandard.Course + { + get { return _course; } + set { SetCourse(value); } + } + + public Entities.Common.EdFi.ICourse Course + { + set { SetCourse(value); } + } + + private void SetCourse(Entities.Common.EdFi.ICourse value) + { + _course = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CourseRepeatCodeDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardId { - get { return CourseRepeatCodeDescriptorId; } - set { CourseRepeatCodeDescriptorId = value; } + get + { + if (ImplicitLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference.LearningStandardId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LearningStandard + _learningStandardReferenceExplicitlyAssigned = false; + ImplicitLearningStandardReference.LearningStandardId = value; + } } // ------------------------------------------------------------- @@ -39516,7 +39060,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseRepeatCodeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseLearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -39524,9 +39068,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_course == null || !_course.Equals(compareTo.Course)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICourseRepeatCodeDescriptor).CourseRepeatCodeDescriptorId.Equals(compareTo.CourseRepeatCodeDescriptorId)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseLearningStandard).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -39542,10 +39090,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_course != null) + hash.Add(_course); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICourseRepeatCodeDescriptor).CourseRepeatCodeDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -39553,55 +39103,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39627,11 +39128,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseLearningStandard")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39642,13 +39140,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -39661,19 +39152,93 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseRepeatCodeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target); + return Entities.Common.EdFi.CourseLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseLearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseRepeatCodeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target, null); + Entities.Common.EdFi.CourseLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.ICourseLearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ICourseLearningStandard.LearningStandardResourceId + { + get { return null; } + set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLearningStandardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -39681,9 +39246,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseRepeatCodeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -39711,168 +39276,298 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CourseTranscript resource. + /// A class which represents the edfi.CourseLevelCharacteristic table of the Course aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseTranscriptReference : IResourceReference + public class CourseLevelCharacteristic : Entities.Common.EdFi.ICourseLevelCharacteristic, IValidatableObject { - [DataMember(Name="courseAttemptResultDescriptor")][DescriptorExists("CourseAttemptResultDescriptor")] - public string CourseAttemptResultDescriptor { get; set; } + private static FullName _fullName = new FullName("edfi", "CourseLevelCharacteristic"); - [DataMember(Name="courseCode")] - public string CourseCode { get; set; } + // Fluent validator instance (threadsafe) + private static CourseLevelCharacteristicPutPostRequestValidator _validator = new CourseLevelCharacteristicPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - [DataMember(Name="courseEducationOrganizationId")] - public long CourseEducationOrganizationId { get; set; } + // ============================================================= + // Constructor + // ------------------------------------------------------------- - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + + // ------------------------------------------------------------ - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourse _course; + + [IgnoreDataMember] + Entities.Common.EdFi.ICourse ICourseLevelCharacteristic.Course { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } + get { return _course; } + set { SetCourse(value); } } - private string _studentUniqueId; - [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] - public string TermDescriptor { get; set; } + public Entities.Common.EdFi.ICourse Course + { + set { SetCourse(value); } + } + + private void SetCourse(Entities.Common.EdFi.ICourse value) + { + _course = value; + } /// - /// Gets or sets the resource identifier of the referenced resource. + /// The type of specific program or designation with which the course is associated (e.g., AP, IB, Dual Credit, CTE). /// - public Guid ResourceId { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="courseLevelCharacteristicDescriptor")][DescriptorExists("CourseLevelCharacteristicDescriptor")] + public string CourseLevelCharacteristicDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + /// Determines equality based on the natural key properties of the resource. /// - public string Discriminator { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ICourseLevelCharacteristic; + if (ReferenceEquals(this, compareTo)) + return true; - private Link _link; + if (compareTo == null) + return false; - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + // Parent Property + if (_course == null || !_course.Equals(compareTo.Course)) + return false; - return _link; - } + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseLevelCharacteristic).CourseLevelCharacteristicDescriptor, compareTo.CourseLevelCharacteristicDescriptor)) + return false; + + + return true; } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Builds the hash code based on the unique identifying values. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - return CourseAttemptResultDescriptor != default(string) && CourseCode != default(string) && CourseEducationOrganizationId != default(long) && EducationOrganizationId != default(long) && SchoolYear != default(short) && StudentUniqueId != default(string) && TermDescriptor != default(string); + var hash = new HashCode(); + //Parent Property + if (_course != null) + hash.Add(_course); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICourseLevelCharacteristic).CourseLevelCharacteristicDescriptor); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - IEnumerable IResourceReference.GetUndefinedProperties() + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseLevelCharacteristic")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - if (CourseAttemptResultDescriptor == default) - { - yield return "CourseAttemptResultDescriptor"; - } + return Entities.Common.EdFi.CourseLevelCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristic)target); + } - if (CourseCode == default) - { - yield return "CourseCode"; - } + void IMappable.Map(object target) + { + Entities.Common.EdFi.CourseLevelCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristic)target, null); + } + // ------------------------------------------------------------- - if (CourseEducationOrganizationId == default) - { - yield return "CourseEducationOrganizationId"; - } + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; - if (SchoolYear == default) + try { - yield return "SchoolYear"; - } + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } + // ---------------------- + // Validate collections + // ---------------------- - if (TermDescriptor == default) + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally { - yield return "TermDescriptor"; + // Restore original length + pathBuilder.Length = originalLength; } - + // ---------------------------------- } + } - private Link CreateLink() + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class CourseLevelCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - var link = new Link + if (context.InstanceToValidate == null) { - Rel = "CourseTranscript", - Href = $"/ed-fi/courseTranscripts/{ResourceId:n}" - }; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - if (string.IsNullOrEmpty(Discriminator)) - return link; + return false; + } - string[] linkParts = Discriminator.Split('.'); + var instance = context.InstanceToValidate; - if (linkParts.Length < 2) - return link; + var failures = new List(); - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.CourseTranscript table of the CourseTranscript aggregate in the ODS Database. + /// A class which represents the edfi.CourseOfferedGradeLevel table of the Course aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseTranscript : Entities.Common.EdFi.ICourseTranscript, IHasETag, IDateVersionedEntity, IValidatableObject + public class CourseOfferedGradeLevel : Entities.Common.EdFi.ICourseOfferedGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CourseTranscript"); + private static FullName _fullName = new FullName("edfi", "CourseOfferedGradeLevel"); // Fluent validator instance (threadsafe) - private static CourseTranscriptPutPostRequestValidator _validator = new CourseTranscriptPutPostRequestValidator(); + private static CourseOfferedGradeLevelPutPostRequestValidator _validator = new CourseOfferedGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -39883,328 +39578,49 @@ public class CourseTranscript : Entities.Common.EdFi.ICourseTranscript, IHasETag // Constructor // ------------------------------------------------------------- - public CourseTranscript() - { - CourseTranscriptAcademicSubjects = new List(); - CourseTranscriptAlternativeCourseIdentificationCodes = new List(); - CourseTranscriptCoursePrograms = new List(); - CourseTranscriptCreditCategories = new List(); - CourseTranscriptEarnedAdditionalCredits = new List(); - CourseTranscriptPartialCourseTranscriptAwards = new List(); - CourseTranscriptSections = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CourseTranscript resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _courseReferenceExplicitlyAssigned; - private Course.EdFi.CourseReference _courseReference; - private Course.EdFi.CourseReference ImplicitCourseReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_courseReference == null && !_courseReferenceExplicitlyAssigned) - _courseReference = new Course.EdFi.CourseReference(); - - return _courseReference; - } - } - - [DataMember(Name="courseReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Course.EdFi.CourseReference CourseReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCourseReference != null - && (_courseReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - return ImplicitCourseReference; - - return null; - } - set - { - _courseReferenceExplicitlyAssigned = true; - _courseReference = value; - } - } - private bool _externalEducationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _externalEducationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitExternalEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_externalEducationOrganizationReference == null && !_externalEducationOrganizationReferenceExplicitlyAssigned) - _externalEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _externalEducationOrganizationReference; - } - } - - [DataMember(Name="externalEducationOrganizationReference")] - [FullyDefinedReference] - public EducationOrganization.EdFi.EducationOrganizationReference ExternalEducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitExternalEducationOrganizationReference != null - && (_externalEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitExternalEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitExternalEducationOrganizationReference; - - return null; - } - set - { - _externalEducationOrganizationReferenceExplicitlyAssigned = true; - _externalEducationOrganizationReference = value; - } - } - private bool _responsibleTeacherStaffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _responsibleTeacherStaffReference; - private Staff.EdFi.StaffReference ImplicitResponsibleTeacherStaffReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_responsibleTeacherStaffReference == null && !_responsibleTeacherStaffReferenceExplicitlyAssigned) - _responsibleTeacherStaffReference = new Staff.EdFi.StaffReference(); - - return _responsibleTeacherStaffReference; - } - } - - [DataMember(Name="responsibleTeacherStaffReference")] - [FullyDefinedReference] - public Staff.EdFi.StaffReference ResponsibleTeacherStaffReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitResponsibleTeacherStaffReference != null - && (_responsibleTeacherStaffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitResponsibleTeacherStaffReference.IsReferenceFullyDefined())) - return ImplicitResponsibleTeacherStaffReference; - - return null; - } - set - { - _responsibleTeacherStaffReferenceExplicitlyAssigned = true; - _responsibleTeacherStaffReference = value; - } - } - private bool _studentAcademicRecordReferenceExplicitlyAssigned; - private StudentAcademicRecord.EdFi.StudentAcademicRecordReference _studentAcademicRecordReference; - private StudentAcademicRecord.EdFi.StudentAcademicRecordReference ImplicitStudentAcademicRecordReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentAcademicRecordReference == null && !_studentAcademicRecordReferenceExplicitlyAssigned) - _studentAcademicRecordReference = new StudentAcademicRecord.EdFi.StudentAcademicRecordReference(); - - return _studentAcademicRecordReference; - } - } - - [DataMember(Name="studentAcademicRecordReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public StudentAcademicRecord.EdFi.StudentAcademicRecordReference StudentAcademicRecordReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentAcademicRecordReference != null - && (_studentAcademicRecordReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) - return ImplicitStudentAcademicRecordReference; - - return null; - } - set - { - _studentAcademicRecordReferenceExplicitlyAssigned = true; - _studentAcademicRecordReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourse _course; - /// - /// The result from the student's attempt to take the course. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseAttemptResultDescriptor")][DescriptorExists("CourseAttemptResultDescriptor")] - public string CourseAttemptResultDescriptor { get; set; } - - /// - /// A unique alphanumeric code assigned to a course. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseTranscript.CourseCode - { - get - { - if (ImplicitCourseReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - return ImplicitCourseReference.CourseCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Course - _courseReferenceExplicitlyAssigned = false; - ImplicitCourseReference.CourseCode = value; - } - } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICourseTranscript.CourseEducationOrganizationId - { - get - { - if (ImplicitCourseReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - return ImplicitCourseReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Course - _courseReferenceExplicitlyAssigned = false; - ImplicitCourseReference.EducationOrganizationId = value; - } - } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICourseTranscript.EducationOrganizationId + [IgnoreDataMember] + Entities.Common.EdFi.ICourse ICourseOfferedGradeLevel.Course { - get - { - if (ImplicitStudentAcademicRecordReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) - return ImplicitStudentAcademicRecordReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentAcademicRecord - _studentAcademicRecordReferenceExplicitlyAssigned = false; - ImplicitStudentAcademicRecordReference.EducationOrganizationId = value; - } + get { return _course; } + set { SetCourse(value); } } - /// - /// The identifier for the school year. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ICourseTranscript.SchoolYear + public Entities.Common.EdFi.ICourse Course { - get - { - if (ImplicitStudentAcademicRecordReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) - return ImplicitStudentAcademicRecordReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentAcademicRecord - _studentAcademicRecordReferenceExplicitlyAssigned = false; - ImplicitStudentAcademicRecordReference.SchoolYear = value; - } + set { SetCourse(value); } } - /// - /// A unique alphanumeric code assigned to a student. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseTranscript.StudentUniqueId + private void SetCourse(Entities.Common.EdFi.ICourse value) { - get - { - if (ImplicitStudentAcademicRecordReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) - return ImplicitStudentAcademicRecordReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentAcademicRecord - _studentAcademicRecordReferenceExplicitlyAssigned = false; - ImplicitStudentAcademicRecordReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } + _course = value; } /// - /// The term for the session during the school year. + /// The grade levels in which the course is offered. /// - - // IS in a reference (CourseTranscript.TermDescriptorId), IS a lookup column - string Entities.Common.EdFi.ICourseTranscript.TermDescriptor - { - get - { - if (ImplicitStudentAcademicRecordReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) - return ImplicitStudentAcademicRecordReference.TermDescriptor; - - return null; - } - set - { - ImplicitStudentAcademicRecordReference.TermDescriptor = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40219,7 +39635,7 @@ string Entities.Common.EdFi.ICourseTranscript.TermDescriptor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscript; + var compareTo = obj as Entities.Common.EdFi.ICourseOfferedGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -40227,39 +39643,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscript).CourseAttemptResultDescriptor, compareTo.CourseAttemptResultDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscript).CourseCode, compareTo.CourseCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICourseTranscript).CourseEducationOrganizationId.Equals(compareTo.CourseEducationOrganizationId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICourseTranscript).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ICourseTranscript).SchoolYear.Equals(compareTo.SchoolYear)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscript).StudentUniqueId, compareTo.StudentUniqueId)) + // Parent Property + if (_course == null || !_course.Equals(compareTo.Course)) return false; - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscript).TermDescriptor, compareTo.TermDescriptor)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferedGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -40275,28 +39665,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_course != null) + hash.Add(_course); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscript).CourseAttemptResultDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscript).CourseCode); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscript).CourseEducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscript).EducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscript).SchoolYear); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscript).StudentUniqueId); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscript).TermDescriptor); + hash.Add((this as Entities.Common.EdFi.ICourseOfferedGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -40310,484 +39684,43 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The descriptive name given to a course of study offered in the school, if different from the CourseTitle. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="alternativeCourseTitle")] - public string AlternativeCourseTitle { get; set; } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The organization code or name assigning the course identification code. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assigningOrganizationIdentificationCode")] - public string AssigningOrganizationIdentificationCode { get; set; } + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="attemptedCreditConversion")] - public decimal? AttemptedCreditConversion { get; set; } + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The value of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="attemptedCredits")] - public decimal? AttemptedCredits { get; set; } + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Course", "CourseOfferedGradeLevel")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="attemptedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string AttemptedCreditTypeDescriptor { get; set; } + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The URL for the course catalog that defines the course identification code. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="courseCatalogURL")] - public string CourseCatalogURL { get; set; } - - /// - /// Indicates that an academic course has been repeated by a student and how that repeat is to be computed in the student's academic grade average. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="courseRepeatCodeDescriptor")][DescriptorExists("CourseRepeatCodeDescriptor")] - public string CourseRepeatCodeDescriptor { get; set; } - - /// - /// The descriptive name given to a course of study offered in a school or other institution or organization. In departmentalized classes at the elementary, secondary, and postsecondary levels (and for staff development activities), this refers to the name by which a course is identified (e.g., American History, English III). For elementary and other non-departmentalized classes, it refers to any portion of the instruction for which a grade or report is assigned (e.g., reading, composition, spelling, language arts). - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="courseTitle")] - public string CourseTitle { get; set; } - - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="earnedCreditConversion")] - public decimal? EarnedCreditConversion { get; set; } - - /// - /// The value of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="earnedCredits")] - public decimal? EarnedCredits { get; set; } - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="earnedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string EarnedCreditTypeDescriptor { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationId - { - get - { - if (ImplicitExternalEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitExternalEducationOrganizationReference.IsReferenceFullyDefined())) - { - return ImplicitExternalEducationOrganizationReference.EducationOrganizationId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ExternalEducationOrganization - _externalEducationOrganizationReferenceExplicitlyAssigned = false; - ImplicitExternalEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); - } - } - - /// - /// Name of the external institution where the student completed the course; to be used only when the reference external education organization is not available. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="externalEducationOrganizationNameOfInstitution")] - public string ExternalEducationOrganizationNameOfInstitution { get; set; } - - /// - /// The final indicator of student performance in a class as submitted by the instructor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="finalLetterGradeEarned")] - public string FinalLetterGradeEarned { get; set; } - - /// - /// The final indicator of student performance in a class as submitted by the instructor. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="finalNumericGradeEarned")] - public decimal? FinalNumericGradeEarned { get; set; } - - /// - /// The method the credits were earned. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="methodCreditEarnedDescriptor")][DescriptorExists("MethodCreditEarnedDescriptor")] - public string MethodCreditEarnedDescriptor { get; set; } - - /// - /// A unique alphanumeric code assigned to a responsibleteacherstaff. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffUniqueId - { - get - { - if (ImplicitResponsibleTeacherStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitResponsibleTeacherStaffReference.IsReferenceFullyDefined())) - { - return ImplicitResponsibleTeacherStaffReference.StaffUniqueId; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ResponsibleTeacherStaff - _responsibleTeacherStaffReferenceExplicitlyAssigned = false; - ImplicitResponsibleTeacherStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } - - /// - /// Student's grade level at time of course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="whenTakenGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string WhenTakenGradeLevelDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscript")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _courseTranscriptAcademicSubjects; - private ICollection _courseTranscriptAcademicSubjectsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="academicSubjects")] - public ICollection CourseTranscriptAcademicSubjects - { - get { return _courseTranscriptAcademicSubjects; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)e.Item).CourseTranscript = this); - _courseTranscriptAcademicSubjects = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)e.Item).CourseTranscript = this; - _courseTranscriptAcademicSubjectsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAcademicSubjects - { - get { return _courseTranscriptAcademicSubjectsCovariant; } - set { CourseTranscriptAcademicSubjects = new List(value.Cast()); } - } - - private ICollection _courseTranscriptAlternativeCourseIdentificationCodes; - private ICollection _courseTranscriptAlternativeCourseIdentificationCodesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="alternativeCourseIdentificationCodes")] - public ICollection CourseTranscriptAlternativeCourseIdentificationCodes - { - get { return _courseTranscriptAlternativeCourseIdentificationCodes; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)e.Item).CourseTranscript = this); - _courseTranscriptAlternativeCourseIdentificationCodes = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)e.Item).CourseTranscript = this; - _courseTranscriptAlternativeCourseIdentificationCodesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAlternativeCourseIdentificationCodes - { - get { return _courseTranscriptAlternativeCourseIdentificationCodesCovariant; } - set { CourseTranscriptAlternativeCourseIdentificationCodes = new List(value.Cast()); } - } - - private ICollection _courseTranscriptCoursePrograms; - private ICollection _courseTranscriptCourseProgramsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="coursePrograms")] - public ICollection CourseTranscriptCoursePrograms - { - get { return _courseTranscriptCoursePrograms; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCourseProgram)e.Item).CourseTranscript = this); - _courseTranscriptCoursePrograms = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCourseProgram)e.Item).CourseTranscript = this; - _courseTranscriptCourseProgramsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCoursePrograms - { - get { return _courseTranscriptCourseProgramsCovariant; } - set { CourseTranscriptCoursePrograms = new List(value.Cast()); } - } - - private ICollection _courseTranscriptCreditCategories; - private ICollection _courseTranscriptCreditCategoriesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="creditCategories")] - public ICollection CourseTranscriptCreditCategories - { - get { return _courseTranscriptCreditCategories; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCreditCategory)e.Item).CourseTranscript = this); - _courseTranscriptCreditCategories = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCreditCategory)e.Item).CourseTranscript = this; - _courseTranscriptCreditCategoriesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCreditCategories - { - get { return _courseTranscriptCreditCategoriesCovariant; } - set { CourseTranscriptCreditCategories = new List(value.Cast()); } - } - - private ICollection _courseTranscriptEarnedAdditionalCredits; - private ICollection _courseTranscriptEarnedAdditionalCreditsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="earnedAdditionalCredits")] - public ICollection CourseTranscriptEarnedAdditionalCredits - { - get { return _courseTranscriptEarnedAdditionalCredits; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)e.Item).CourseTranscript = this); - _courseTranscriptEarnedAdditionalCredits = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)e.Item).CourseTranscript = this; - _courseTranscriptEarnedAdditionalCreditsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptEarnedAdditionalCredits - { - get { return _courseTranscriptEarnedAdditionalCreditsCovariant; } - set { CourseTranscriptEarnedAdditionalCredits = new List(value.Cast()); } - } - - private ICollection _courseTranscriptPartialCourseTranscriptAwards; - private ICollection _courseTranscriptPartialCourseTranscriptAwardsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="partialCourseTranscriptAwards")] - public ICollection CourseTranscriptPartialCourseTranscriptAwards - { - get { return _courseTranscriptPartialCourseTranscriptAwards; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)e.Item).CourseTranscript = this); - _courseTranscriptPartialCourseTranscriptAwards = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)e.Item).CourseTranscript = this; - _courseTranscriptPartialCourseTranscriptAwardsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptPartialCourseTranscriptAwards - { - get { return _courseTranscriptPartialCourseTranscriptAwardsCovariant; } - set { CourseTranscriptPartialCourseTranscriptAwards = new List(value.Cast()); } - } - - private ICollection _courseTranscriptSections; - private ICollection _courseTranscriptSectionsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="sections")] - public ICollection CourseTranscriptSections - { - get { return _courseTranscriptSections; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICourseTranscriptSection)e.Item).CourseTranscript = this); - _courseTranscriptSections = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptSection)e.Item).CourseTranscript = this; - _courseTranscriptSectionsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptSections - { - get { return _courseTranscriptSectionsCovariant; } - set { CourseTranscriptSections = new List(value.Cast()); } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_courseTranscriptAcademicSubjects != null) foreach (var item in _courseTranscriptAcademicSubjects) - { - item.CourseTranscript = this; - } - - if (_courseTranscriptAlternativeCourseIdentificationCodes != null) foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) - { - item.CourseTranscript = this; - } - - if (_courseTranscriptCoursePrograms != null) foreach (var item in _courseTranscriptCoursePrograms) - { - item.CourseTranscript = this; - } - - if (_courseTranscriptCreditCategories != null) foreach (var item in _courseTranscriptCreditCategories) - { - item.CourseTranscript = this; - } - - if (_courseTranscriptEarnedAdditionalCredits != null) foreach (var item in _courseTranscriptEarnedAdditionalCredits) - { - item.CourseTranscript = this; - } - - if (_courseTranscriptPartialCourseTranscriptAwards != null) foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) - { - item.CourseTranscript = this; - } - - if (_courseTranscriptSections != null) foreach (var item in _courseTranscriptSections) - { - item.CourseTranscript = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -40795,74 +39728,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseTranscriptMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscript)target); + return Entities.Common.EdFi.CourseOfferedGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferedGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseTranscriptMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscript)target, null); + Entities.Common.EdFi.CourseOfferedGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferedGradeLevel)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICourseTranscript.CourseResourceId - { - get { return null; } - set { ImplicitCourseReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourseTranscript.CourseDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCourseReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationResourceId - { - get { return null; } - set { ImplicitExternalEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitExternalEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffResourceId - { - get { return null; } - set { ImplicitResponsibleTeacherStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitResponsibleTeacherStaffReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordResourceId - { - get { return null; } - set { ImplicitStudentAcademicRecordReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentAcademicRecordReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -40880,95 +39757,12 @@ string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (CourseTranscriptAcademicSubjects.Any() && mappingContract?.IsMemberSupported("CourseTranscriptAcademicSubjects") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseTranscriptAcademicSubjects"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptAcademicSubjects, validationContext, validationContext.Items.ForCollection("CourseTranscriptAcademicSubjects")))) - { - yield return result; - } - } - - if (CourseTranscriptAlternativeCourseIdentificationCodes.Any() && mappingContract?.IsMemberSupported("CourseTranscriptAlternativeCourseIdentificationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseTranscriptAlternativeCourseIdentificationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptAlternativeCourseIdentificationCodes, validationContext, validationContext.Items.ForCollection("CourseTranscriptAlternativeCourseIdentificationCodes")))) - { - yield return result; - } - } - - if (CourseTranscriptCoursePrograms.Any() && mappingContract?.IsMemberSupported("CourseTranscriptCoursePrograms") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseTranscriptCoursePrograms"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptCoursePrograms, validationContext, validationContext.Items.ForCollection("CourseTranscriptCoursePrograms")))) - { - yield return result; - } - } - - if (CourseTranscriptCreditCategories.Any() && mappingContract?.IsMemberSupported("CourseTranscriptCreditCategories") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseTranscriptCreditCategories"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptCreditCategories, validationContext, validationContext.Items.ForCollection("CourseTranscriptCreditCategories")))) - { - yield return result; - } - } - - if (CourseTranscriptEarnedAdditionalCredits.Any() && mappingContract?.IsMemberSupported("CourseTranscriptEarnedAdditionalCredits") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseTranscriptEarnedAdditionalCredits"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptEarnedAdditionalCredits, validationContext, validationContext.Items.ForCollection("CourseTranscriptEarnedAdditionalCredits")))) - { - yield return result; - } - } - - if (CourseTranscriptPartialCourseTranscriptAwards.Any() && mappingContract?.IsMemberSupported("CourseTranscriptPartialCourseTranscriptAwards") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseTranscriptPartialCourseTranscriptAwards"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptPartialCourseTranscriptAwards, validationContext, validationContext.Items.ForCollection("CourseTranscriptPartialCourseTranscriptAwards")))) - { - yield return result; - } - } - - if (CourseTranscriptSections.Any() && mappingContract?.IsMemberSupported("CourseTranscriptSections") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CourseTranscriptSections"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptSections, validationContext, validationContext.Items.ForCollection("CourseTranscriptSections")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -41014,20 +39808,9 @@ string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseTranscriptPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseOfferedGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_CourseTranscript = new FullName("edfi", "CourseTranscript"); - - // Declare collection item validators - private CourseTranscriptAcademicSubjectPutPostRequestValidator _courseTranscriptAcademicSubjectsValidator = new (); - private CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator _courseTranscriptAlternativeCourseIdentificationCodesValidator = new (); - private CourseTranscriptCourseProgramPutPostRequestValidator _courseTranscriptCourseProgramsValidator = new (); - private CourseTranscriptCreditCategoryPutPostRequestValidator _courseTranscriptCreditCategoriesValidator = new (); - private CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator _courseTranscriptEarnedAdditionalCreditsValidator = new (); - private CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator _courseTranscriptPartialCourseTranscriptAwardsValidator = new (); - private CourseTranscriptSectionPutPostRequestValidator _courseTranscriptSectionsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -41040,94 +39823,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (CourseTranscriptMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_CourseTranscript); - - if (mappingContract != null) - { - if (mappingContract.IsCourseTranscriptAcademicSubjectIncluded != null) - { - var hasInvalidCourseTranscriptAcademicSubjectsItems = instance.CourseTranscriptAcademicSubjects.Any(x => !mappingContract.IsCourseTranscriptAcademicSubjectIncluded(x)); - - if (hasInvalidCourseTranscriptAcademicSubjectsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseTranscriptAcademicSubjects", $"A supplied 'CourseTranscriptAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseTranscriptAlternativeCourseIdentificationCodeIncluded != null) - { - var hasInvalidCourseTranscriptAlternativeCourseIdentificationCodesItems = instance.CourseTranscriptAlternativeCourseIdentificationCodes.Any(x => !mappingContract.IsCourseTranscriptAlternativeCourseIdentificationCodeIncluded(x)); - - if (hasInvalidCourseTranscriptAlternativeCourseIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseTranscriptAlternativeCourseIdentificationCodes", $"A supplied 'CourseTranscriptAlternativeCourseIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseTranscriptCourseProgramIncluded != null) - { - var hasInvalidCourseTranscriptCourseProgramsItems = instance.CourseTranscriptCoursePrograms.Any(x => !mappingContract.IsCourseTranscriptCourseProgramIncluded(x)); - - if (hasInvalidCourseTranscriptCourseProgramsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseTranscriptCoursePrograms", $"A supplied 'CourseTranscriptCourseProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseTranscriptCreditCategoryIncluded != null) - { - var hasInvalidCourseTranscriptCreditCategoriesItems = instance.CourseTranscriptCreditCategories.Any(x => !mappingContract.IsCourseTranscriptCreditCategoryIncluded(x)); - - if (hasInvalidCourseTranscriptCreditCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseTranscriptCreditCategories", $"A supplied 'CourseTranscriptCreditCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseTranscriptEarnedAdditionalCreditsIncluded != null) - { - var hasInvalidCourseTranscriptEarnedAdditionalCreditsItems = instance.CourseTranscriptEarnedAdditionalCredits.Any(x => !mappingContract.IsCourseTranscriptEarnedAdditionalCreditsIncluded(x)); - - if (hasInvalidCourseTranscriptEarnedAdditionalCreditsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseTranscriptEarnedAdditionalCredits", $"A supplied 'CourseTranscriptEarnedAdditionalCredits' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseTranscriptPartialCourseTranscriptAwardsIncluded != null) - { - var hasInvalidCourseTranscriptPartialCourseTranscriptAwardsItems = instance.CourseTranscriptPartialCourseTranscriptAwards.Any(x => !mappingContract.IsCourseTranscriptPartialCourseTranscriptAwardsIncluded(x)); - - if (hasInvalidCourseTranscriptPartialCourseTranscriptAwardsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseTranscriptPartialCourseTranscriptAwards", $"A supplied 'CourseTranscriptPartialCourseTranscriptAwards' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCourseTranscriptSectionIncluded != null) - { - var hasInvalidCourseTranscriptSectionsItems = instance.CourseTranscriptSections.Any(x => !mappingContract.IsCourseTranscriptSectionIncluded(x)); - - if (hasInvalidCourseTranscriptSectionsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CourseTranscriptSections", $"A supplied 'CourseTranscriptSection' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -41143,17 +39838,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseTranscriptAcademicSubject table of the CourseTranscript aggregate in the ODS Database. + /// A class which represents the edfi.CourseAttemptResultDescriptor table of the CourseAttemptResultDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseTranscriptAcademicSubject : Entities.Common.EdFi.ICourseTranscriptAcademicSubject, IValidatableObject + public class CourseAttemptResultDescriptor : Entities.Common.EdFi.ICourseAttemptResultDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseTranscriptAcademicSubject"); + private static FullName _fullName = new FullName("edfi", "CourseAttemptResultDescriptor"); // Fluent validator instance (threadsafe) - private static CourseTranscriptAcademicSubjectPutPostRequestValidator _validator = new CourseTranscriptAcademicSubjectPutPostRequestValidator(); + private static CourseAttemptResultDescriptorPutPostRequestValidator _validator = new CourseAttemptResultDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -41170,6 +39870,13 @@ public class CourseTranscriptAcademicSubject : Entities.Common.EdFi.ICourseTrans // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CourseAttemptResultDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -41180,33 +39887,19 @@ public class CourseTranscriptAcademicSubject : Entities.Common.EdFi.ICourseTrans //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - - [IgnoreDataMember] - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAcademicSubject.CourseTranscript - { - get { return _courseTranscript; } - set { SetCourseTranscript(value); } - } - public Entities.Common.EdFi.ICourseTranscript CourseTranscript - { - set { SetCourseTranscript(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CourseAttemptResultDescriptorId { get; set; } - private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + int IDescriptor.DescriptorId { - _courseTranscript = value; + get { return CourseAttemptResultDescriptorId; } + set { CourseAttemptResultDescriptorId = value; } } - - /// - /// The subject area for the course transcript credits awarded in the course transcript. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41221,7 +39914,7 @@ private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptAcademicSubject; + var compareTo = obj as Entities.Common.EdFi.ICourseAttemptResultDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -41229,13 +39922,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICourseAttemptResultDescriptor).CourseAttemptResultDescriptorId.Equals(compareTo.CourseAttemptResultDescriptorId)) return false; @@ -41251,12 +39940,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_courseTranscript != null) - hash.Add(_courseTranscript); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptAcademicSubject).AcademicSubjectDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICourseAttemptResultDescriptor).CourseAttemptResultDescriptorId); return hash.ToHashCode(); } @@ -41265,6 +39951,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41290,8 +40025,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptAcademicSubject")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -41302,6 +40040,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -41314,12 +40059,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseTranscriptAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target); + return Entities.Common.EdFi.CourseAttemptResultDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseAttemptResultDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseTranscriptAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target, null); + Entities.Common.EdFi.CourseAttemptResultDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseAttemptResultDescriptor)target, null); } // ------------------------------------------------------------- @@ -41327,66 +40072,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -41394,9 +40079,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseTranscriptAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseAttemptResultDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -41424,17 +40109,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseTranscriptAlternativeCourseIdentificationCode table of the CourseTranscript aggregate in the ODS Database. + /// A class which represents the edfi.CourseDefinedByDescriptor table of the CourseDefinedByDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseTranscriptAlternativeCourseIdentificationCode : Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode, IValidatableObject + public class CourseDefinedByDescriptor : Entities.Common.EdFi.ICourseDefinedByDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseTranscriptAlternativeCourseIdentificationCode"); + private static FullName _fullName = new FullName("edfi", "CourseDefinedByDescriptor"); // Fluent validator instance (threadsafe) - private static CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator _validator = new CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator(); + private static CourseDefinedByDescriptorPutPostRequestValidator _validator = new CourseDefinedByDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -41451,6 +40141,13 @@ public class CourseTranscriptAlternativeCourseIdentificationCode : Entities.Comm // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CourseDefinedByDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -41461,33 +40158,19 @@ public class CourseTranscriptAlternativeCourseIdentificationCode : Entities.Comm //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - - [IgnoreDataMember] - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAlternativeCourseIdentificationCode.CourseTranscript - { - get { return _courseTranscript; } - set { SetCourseTranscript(value); } - } - public Entities.Common.EdFi.ICourseTranscript CourseTranscript - { - set { SetCourseTranscript(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CourseDefinedByDescriptorId { get; set; } - private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + int IDescriptor.DescriptorId { - _courseTranscript = value; + get { return CourseDefinedByDescriptorId; } + set { CourseDefinedByDescriptorId = value; } } - - /// - /// A system that is used to identify the organization of subject matter and related learning experiences provided for the instruction of students. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseIdentificationSystemDescriptor")][DescriptorExists("CourseIdentificationSystemDescriptor")] - public string CourseIdentificationSystemDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41502,7 +40185,7 @@ private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode; + var compareTo = obj as Entities.Common.EdFi.ICourseDefinedByDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -41510,13 +40193,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode).CourseIdentificationSystemDescriptor, compareTo.CourseIdentificationSystemDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICourseDefinedByDescriptor).CourseDefinedByDescriptorId.Equals(compareTo.CourseDefinedByDescriptorId)) return false; @@ -41532,12 +40211,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_courseTranscript != null) - hash.Add(_courseTranscript); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode).CourseIdentificationSystemDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICourseDefinedByDescriptor).CourseDefinedByDescriptorId); return hash.ToHashCode(); } @@ -41546,36 +40222,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The organization code or name assigning the Identification Code. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assigningOrganizationIdentificationCode")] - public string AssigningOrganizationIdentificationCode { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The URL for the course catalog that defines the course identification code. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="courseCatalogURL")] - public string CourseCatalogURL { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// A unique number or alphanumeric code assigned to a course by a school, school system, state, or other agency or entity. For multi-part course codes, concatenate the parts separated by a \"/\". For example, consider the following SCED code- subject = 20 Math course = 272 Geometry level = G General credits = 1.00 course sequence 1 of 1- would be entered as 20/272/G/1.00/1 of 1. + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -41596,8 +40296,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptAlternativeCourseIdentificationCode")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -41608,6 +40311,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -41620,12 +40330,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseTranscriptAlternativeCourseIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target); + return Entities.Common.EdFi.CourseDefinedByDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseDefinedByDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseTranscriptAlternativeCourseIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target, null); + Entities.Common.EdFi.CourseDefinedByDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseDefinedByDescriptor)target, null); } // ------------------------------------------------------------- @@ -41633,76 +40343,16 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } + } // ================================================================= // Validators // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseDefinedByDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -41730,17 +40380,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseTranscriptCourseProgram table of the CourseTranscript aggregate in the ODS Database. + /// A class which represents the edfi.CourseGPAApplicabilityDescriptor table of the CourseGPAApplicabilityDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseTranscriptCourseProgram : Entities.Common.EdFi.ICourseTranscriptCourseProgram, IValidatableObject + public class CourseGPAApplicabilityDescriptor : Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseTranscriptCourseProgram"); + private static FullName _fullName = new FullName("edfi", "CourseGPAApplicabilityDescriptor"); // Fluent validator instance (threadsafe) - private static CourseTranscriptCourseProgramPutPostRequestValidator _validator = new CourseTranscriptCourseProgramPutPostRequestValidator(); + private static CourseGPAApplicabilityDescriptorPutPostRequestValidator _validator = new CourseGPAApplicabilityDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -41757,119 +40412,35 @@ public class CourseTranscriptCourseProgram : Entities.Common.EdFi.ICourseTranscr // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CourseGPAApplicabilityDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _courseProgramReferenceExplicitlyAssigned; - private Program.EdFi.ProgramReference _courseProgramReference; - private Program.EdFi.ProgramReference ImplicitCourseProgramReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_courseProgramReference == null && !_courseProgramReferenceExplicitlyAssigned) - _courseProgramReference = new Program.EdFi.ProgramReference(); - - return _courseProgramReference; - } - } - - [DataMember(Name="courseProgramReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Program.EdFi.ProgramReference CourseProgramReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCourseProgramReference != null - && (_courseProgramReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseProgramReference.IsReferenceFullyDefined())) - return ImplicitCourseProgramReference; - - return null; - } - set - { - _courseProgramReferenceExplicitlyAssigned = true; - _courseProgramReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - - [IgnoreDataMember] - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCourseProgram.CourseTranscript - { - get { return _courseTranscript; } - set { SetCourseTranscript(value); } - } - - public Entities.Common.EdFi.ICourseTranscript CourseTranscript - { - set { SetCourseTranscript(value); } - } - - private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) - { - _courseTranscript = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_courseProgramReferenceExplicitlyAssigned) - { - ImplicitCourseProgramReference.EducationOrganizationId = _courseTranscript.CourseEducationOrganizationId; - } - } - - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramName - { - get - { - if (ImplicitCourseProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseProgramReference.IsReferenceFullyDefined())) - return ImplicitCourseProgramReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CourseProgram - _courseProgramReferenceExplicitlyAssigned = false; - ImplicitCourseProgramReference.ProgramName = value; - } - } /// - /// The type of program. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CourseGPAApplicabilityDescriptorId { get; set; } - // IS in a reference (CourseTranscriptCourseProgram.CourseProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramTypeDescriptor + int IDescriptor.DescriptorId { - get - { - if (ImplicitCourseProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseProgramReference.IsReferenceFullyDefined())) - return ImplicitCourseProgramReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitCourseProgramReference.ProgramTypeDescriptor = value; - } + get { return CourseGPAApplicabilityDescriptorId; } + set { CourseGPAApplicabilityDescriptorId = value; } } // ------------------------------------------------------------- @@ -41885,7 +40456,7 @@ string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramTypeDesc /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptCourseProgram; + var compareTo = obj as Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -41893,18 +40464,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramName, compareTo.CourseProgramName)) - return false; - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramTypeDescriptor, compareTo.CourseProgramTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor).CourseGPAApplicabilityDescriptorId.Equals(compareTo.CourseGPAApplicabilityDescriptorId)) return false; @@ -41920,15 +40482,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_courseTranscript != null) - hash.Add(_courseTranscript); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramName); - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor).CourseGPAApplicabilityDescriptorId); return hash.ToHashCode(); } @@ -41937,6 +40493,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41962,8 +40567,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptCourseProgram")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -41974,17 +40582,18 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -41992,127 +40601,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseTranscriptCourseProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptCourseProgram)target); + return Entities.Common.EdFi.CourseGPAApplicabilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseTranscriptCourseProgramMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptCourseProgram)target, null); + Entities.Common.EdFi.CourseGPAApplicabilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramResourceId - { - get { return null; } - set { ImplicitCourseProgramReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCourseProgramReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForCourseEducationOrganizationId = GetCourseEducationOrganizationIdSources().ToArray(); - - if (!sourcesForCourseEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForCourseEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForCourseEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'courseEducationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForCourseEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetCourseEducationOrganizationIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseTranscript.CourseEducationOrganizationId); - - // Obtain value from other references - var valueFromCourseProgramReference = this.CourseProgramReference?.EducationOrganizationId; - - if (valueFromCourseProgramReference != null) - { - yield return ("courseProgramReference.educationOrganizationId", this.CourseProgramReference.EducationOrganizationId); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -42120,9 +40621,9 @@ string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscrimi // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseTranscriptCourseProgramPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseGPAApplicabilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -42150,17 +40651,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseTranscriptCreditCategory table of the CourseTranscript aggregate in the ODS Database. + /// A class which represents the edfi.CourseIdentificationSystemDescriptor table of the CourseIdentificationSystemDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CourseTranscriptCreditCategory : Entities.Common.EdFi.ICourseTranscriptCreditCategory, IValidatableObject + public class CourseIdentificationSystemDescriptor : Entities.Common.EdFi.ICourseIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseTranscriptCreditCategory"); + private static FullName _fullName = new FullName("edfi", "CourseIdentificationSystemDescriptor"); // Fluent validator instance (threadsafe) - private static CourseTranscriptCreditCategoryPutPostRequestValidator _validator = new CourseTranscriptCreditCategoryPutPostRequestValidator(); + private static CourseIdentificationSystemDescriptorPutPostRequestValidator _validator = new CourseIdentificationSystemDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -42177,6 +40683,13 @@ public class CourseTranscriptCreditCategory : Entities.Common.EdFi.ICourseTransc // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CourseIdentificationSystemDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -42187,33 +40700,19 @@ public class CourseTranscriptCreditCategory : Entities.Common.EdFi.ICourseTransc //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - - [IgnoreDataMember] - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCreditCategory.CourseTranscript - { - get { return _courseTranscript; } - set { SetCourseTranscript(value); } - } - public Entities.Common.EdFi.ICourseTranscript CourseTranscript - { - set { SetCourseTranscript(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CourseIdentificationSystemDescriptorId { get; set; } - private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + int IDescriptor.DescriptorId { - _courseTranscript = value; + get { return CourseIdentificationSystemDescriptorId; } + set { CourseIdentificationSystemDescriptorId = value; } } - - /// - /// A categorization for the course transcript credits awarded in the course transcript. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="creditCategoryDescriptor")][DescriptorExists("CreditCategoryDescriptor")] - public string CreditCategoryDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42228,7 +40727,7 @@ private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptCreditCategory; + var compareTo = obj as Entities.Common.EdFi.ICourseIdentificationSystemDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -42236,13 +40735,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptCreditCategory).CreditCategoryDescriptor, compareTo.CreditCategoryDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICourseIdentificationSystemDescriptor).CourseIdentificationSystemDescriptorId.Equals(compareTo.CourseIdentificationSystemDescriptorId)) return false; @@ -42258,12 +40753,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_courseTranscript != null) - hash.Add(_courseTranscript); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptCreditCategory).CreditCategoryDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICourseIdentificationSystemDescriptor).CourseIdentificationSystemDescriptorId); return hash.ToHashCode(); } @@ -42272,6 +40764,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42297,8 +40838,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptCreditCategory")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -42309,6 +40853,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -42321,12 +40872,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseTranscriptCreditCategoryMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptCreditCategory)target); + return Entities.Common.EdFi.CourseIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseTranscriptCreditCategoryMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptCreditCategory)target, null); + Entities.Common.EdFi.CourseIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target, null); } // ------------------------------------------------------------- @@ -42334,66 +40885,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -42401,9 +40892,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseTranscriptCreditCategoryPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -42431,18 +40922,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseTranscriptEarnedAdditionalCredits table of the CourseTranscript aggregate in the ODS Database. + /// A class which represents the edfi.CourseLevelCharacteristicDescriptor table of the CourseLevelCharacteristicDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class CourseTranscriptEarnedAdditionalCredits : Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class CourseLevelCharacteristicDescriptor : Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CourseTranscriptEarnedAdditionalCredits"); + private static FullName _fullName = new FullName("edfi", "CourseLevelCharacteristicDescriptor"); // Fluent validator instance (threadsafe) - private static CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator _validator = new CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator(); + private static CourseLevelCharacteristicDescriptorPutPostRequestValidator _validator = new CourseLevelCharacteristicDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -42459,6 +40954,13 @@ public class CourseTranscriptEarnedAdditionalCredits : Entities.Common.EdFi.ICou // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CourseLevelCharacteristicDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -42469,33 +40971,19 @@ public class CourseTranscriptEarnedAdditionalCredits : Entities.Common.EdFi.ICou //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - - [IgnoreDataMember] - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptEarnedAdditionalCredits.CourseTranscript - { - get { return _courseTranscript; } - set { SetCourseTranscript(value); } - } - public Entities.Common.EdFi.ICourseTranscript CourseTranscript - { - set { SetCourseTranscript(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CourseLevelCharacteristicDescriptorId { get; set; } - private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + int IDescriptor.DescriptorId { - _courseTranscript = value; + get { return CourseLevelCharacteristicDescriptorId; } + set { CourseLevelCharacteristicDescriptorId = value; } } - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="additionalCreditTypeDescriptor")][DescriptorExists("AdditionalCreditTypeDescriptor")] - public string AdditionalCreditTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -42510,7 +40998,7 @@ private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits; + var compareTo = obj as Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -42518,13 +41006,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits).AdditionalCreditTypeDescriptor, compareTo.AdditionalCreditTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor).CourseLevelCharacteristicDescriptorId.Equals(compareTo.CourseLevelCharacteristicDescriptorId)) return false; @@ -42540,12 +41024,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_courseTranscript != null) - hash.Add(_courseTranscript); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits).AdditionalCreditTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor).CourseLevelCharacteristicDescriptorId); return hash.ToHashCode(); } @@ -42554,40 +41035,61 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - - private bool _creditsExplicitlyAssigned = false; - private decimal _credits; + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The value of credits or units of value awarded for the completion of a course + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="credits")] - public decimal Credits - { - get => _credits; - set - { - _credits = value; - _creditsExplicitlyAssigned = true; - } - } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_creditsExplicitlyAssigned) - { - yield return "Credits"; - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -42607,8 +41109,11 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptEarnedAdditionalCredits")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -42619,6 +41124,13 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -42631,12 +41143,12 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseTranscriptEarnedAdditionalCreditsMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target); + return Entities.Common.EdFi.CourseLevelCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseTranscriptEarnedAdditionalCreditsMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target, null); + Entities.Common.EdFi.CourseLevelCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target, null); } // ------------------------------------------------------------- @@ -42644,66 +41156,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -42711,9 +41163,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseLevelCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -42741,403 +41193,267 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CourseTranscriptPartialCourseTranscriptAwards table of the CourseTranscript aggregate in the ODS Database. + /// Represents a reference to the CourseOffering resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class CourseTranscriptPartialCourseTranscriptAwards : Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class CourseOfferingReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "CourseTranscriptPartialCourseTranscriptAwards"); + [DataMember(Name="localCourseCode")] + public string LocalCourseCode { get; set; } - // Fluent validator instance (threadsafe) - private static CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator _validator = new CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } - // ============================================================= - // Constructor - // ------------------------------------------------------------- + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } - - // ------------------------------------------------------------ + [DataMember(Name="sessionName")] + public string SessionName { get; set; } - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - [IgnoreDataMember] - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptPartialCourseTranscriptAwards.CourseTranscript - { - get { return _courseTranscript; } - set { SetCourseTranscript(value); } - } + private Link _link; - public Entities.Common.EdFi.ICourseTranscript CourseTranscript + [DataMember(Name="link")] + public Link Link { - set { SetCourseTranscript(value); } - } + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } - private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) - { - _courseTranscript = value; + return _link; + } } /// - /// The date the partial credits and/or grades were awarded or earned. + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="awardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AwardDate { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SessionName != default(string); + } - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + IEnumerable IResourceReference.GetUndefinedProperties() { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards; + if (LocalCourseCode == default) + { + yield return "LocalCourseCode"; + } - if (ReferenceEquals(this, compareTo)) - return true; + if (SchoolId == default) + { + yield return "SchoolId"; + } - if (compareTo == null) - return false; + if (SchoolYear == default) + { + yield return "SchoolYear"; + } - // Parent Property - if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) - return false; + if (SessionName == default) + { + yield return "SessionName"; + } + } - // Standard Property - if (!(this as Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards).AwardDate.Equals(compareTo.AwardDate)) - return false; + private Link CreateLink() + { + var link = new Link + { + Rel = "CourseOffering", + Href = $"/ed-fi/courseOfferings/{ResourceId:n}" + }; + if (string.IsNullOrEmpty(Discriminator)) + return link; - return true; - } + string[] linkParts = Discriminator.Split('.'); - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_courseTranscript != null) - hash.Add(_courseTranscript); + if (linkParts.Length < 2) + return link; - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards).AwardDate); + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - return hash.ToHashCode(); + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } - // ------------------------------------------------------------- + } // Aggregate reference - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + /// + /// A class which represents the edfi.CourseOffering table of the CourseOffering aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class CourseOffering : Entities.Common.EdFi.ICourseOffering, IHasETag, IDateVersionedEntity, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "CourseOffering"); + + // Fluent validator instance (threadsafe) + private static CourseOfferingPutPostRequestValidator _validator = new CourseOfferingPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 // ============================================================= - // Properties + // Constructor // ------------------------------------------------------------- + + public CourseOffering() + { + CourseOfferingCourseLevelCharacteristics = new List(); + CourseOfferingCurriculumUseds = new List(); + CourseOfferingOfferedGradeLevels = new List(); + } - private bool _earnedCreditsExplicitlyAssigned = false; - private decimal _earnedCredits; + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ /// - /// The number of credits a student earned for completing a given course. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="earnedCredits")] - public decimal EarnedCredits - { - get => _earnedCredits; - set - { - _earnedCredits = value; - _earnedCreditsExplicitlyAssigned = true; - } - } - - - /// - /// The indicator of student performance as submitted by the instructor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="letterGradeEarned")] - public string LetterGradeEarned { get; set; } - - /// - /// The method the credits were earned. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="methodCreditEarnedDescriptor")][DescriptorExists("MethodCreditEarnedDescriptor")] - public string MethodCreditEarnedDescriptor { get; set; } - - /// - /// The indicator of student performance as submitted by the instructor. + /// The unique identifier for the CourseOffering resource. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="numericGradeEarned")] - public string NumericGradeEarned { get; set; } - // ------------------------------------------------------------- - - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_earnedCreditsExplicitlyAssigned) - { - yield return "EarnedCredits"; - } - } - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptPartialCourseTranscriptAwards")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize + // References // ------------------------------------------------------------- - // ------------------------------------------------------------ - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) + private bool _courseReferenceExplicitlyAssigned; + private Course.EdFi.CourseReference _courseReference; + private Course.EdFi.CourseReference ImplicitCourseReference { - return Entities.Common.EdFi.CourseTranscriptPartialCourseTranscriptAwardsMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target); - } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_courseReference == null && !_courseReferenceExplicitlyAssigned) + _courseReference = new Course.EdFi.CourseReference(); - void IMappable.Map(object target) - { - Entities.Common.EdFi.CourseTranscriptPartialCourseTranscriptAwardsMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target, null); + return _courseReference; + } } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + [DataMember(Name="courseReference")] + [FullyDefinedReference][RequiredReference("edfi", "CourseOffering")] + public Course.EdFi.CourseReference CourseReference { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try + get { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCourseReference != null + && (_courseReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + return ImplicitCourseReference; - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } + return null; } - finally + set { - // Restore original length - pathBuilder.Length = originalLength; + _courseReferenceExplicitlyAssigned = true; + _courseReference = value; } - // ---------------------------------- } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference { - if (context.InstanceToValidate == null) + get { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); - return false; + return _schoolReference; } + } - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference + { + get { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; - return false; + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; } - - return true; } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.CourseTranscriptSection table of the CourseTranscript aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CourseTranscriptSection : Entities.Common.EdFi.ICourseTranscriptSection, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "CourseTranscriptSection"); - - // Fluent validator instance (threadsafe) - private static CourseTranscriptSectionPutPostRequestValidator _validator = new CourseTranscriptSectionPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - - private bool _sectionReferenceExplicitlyAssigned; - private Section.EdFi.SectionReference _sectionReference; - private Section.EdFi.SectionReference ImplicitSectionReference + private bool _sessionReferenceExplicitlyAssigned; + private Session.EdFi.SessionReference _sessionReference; + private Session.EdFi.SessionReference ImplicitSessionReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) - _sectionReference = new Section.EdFi.SectionReference(); + if (_sessionReference == null && !_sessionReferenceExplicitlyAssigned) + _sessionReference = new Session.EdFi.SessionReference(); - return _sectionReference; + return _sessionReference; } } - [DataMember(Name="sectionReference")] + [DataMember(Name="sessionReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Section.EdFi.SectionReference SectionReference + public Session.EdFi.SessionReference SessionReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSectionReference != null - && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference; + if (ImplicitSessionReference != null + && (_sessionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) + return ImplicitSessionReference; return null; } set { - _sectionReferenceExplicitlyAssigned = true; - _sectionReference = value; + _sessionReferenceExplicitlyAssigned = true; + _sessionReference = value; } } // ------------------------------------------------------------- @@ -43145,67 +41461,27 @@ public Section.EdFi.SectionReference SectionReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - - [IgnoreDataMember] - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptSection.CourseTranscript - { - get { return _courseTranscript; } - set { SetCourseTranscript(value); } - } - - public Entities.Common.EdFi.ICourseTranscript CourseTranscript - { - set { SetCourseTranscript(value); } - } - - private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) - { - _courseTranscript = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_sectionReferenceExplicitlyAssigned) - { - ImplicitSectionReference.SchoolYear = _courseTranscript.SchoolYear; - } - } /// /// The local code assigned by the School that identifies the course offering provided for the instruction of students. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseTranscriptSection.LocalCourseCode - { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.LocalCourseCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.LocalCourseCode = value; - } - } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="localCourseCode")] + public string LocalCourseCode { get; set; } /// /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ICourseTranscriptSection.SchoolId + long Entities.Common.EdFi.ICourseOffering.SchoolId { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SchoolId; + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; return default(long); } @@ -43214,34 +41490,38 @@ long Entities.Common.EdFi.ICourseTranscriptSection.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolId = value; + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + + // Session + _sessionReferenceExplicitlyAssigned = false; + ImplicitSessionReference.SchoolId = value; } } /// - /// The local identifier assigned to a section. + /// The identifier for the school year. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseTranscriptSection.SectionIdentifier + short Entities.Common.EdFi.ICourseOffering.SchoolYear { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SectionIdentifier; + if (ImplicitSessionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) + return ImplicitSessionReference.SchoolYear; - return default(string); + return default(short); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SectionIdentifier = value; + // Session + _sessionReferenceExplicitlyAssigned = false; + ImplicitSessionReference.SchoolYear = value; } } @@ -43249,13 +41529,13 @@ string Entities.Common.EdFi.ICourseTranscriptSection.SectionIdentifier /// The identifier for the calendar for the academic session. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ICourseTranscriptSection.SessionName + string Entities.Common.EdFi.ICourseOffering.SessionName { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SessionName; + if (ImplicitSessionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) + return ImplicitSessionReference.SessionName; return default(string); } @@ -43264,9 +41544,9 @@ string Entities.Common.EdFi.ICourseTranscriptSection.SessionName // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SessionName = value; + // Session + _sessionReferenceExplicitlyAssigned = false; + ImplicitSessionReference.SessionName = value; } } // ------------------------------------------------------------- @@ -43283,7 +41563,7 @@ string Entities.Common.EdFi.ICourseTranscriptSection.SessionName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptSection; + var compareTo = obj as Entities.Common.EdFi.ICourseOffering; if (ReferenceEquals(this, compareTo)) return true; @@ -43291,28 +41571,24 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptSection).LocalCourseCode, compareTo.LocalCourseCode)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseOffering).LocalCourseCode, compareTo.LocalCourseCode)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.ICourseTranscriptSection).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.ICourseOffering).SchoolId.Equals(compareTo.SchoolId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptSection).SectionIdentifier, compareTo.SectionIdentifier)) + if (!(this as Entities.Common.EdFi.ICourseOffering).SchoolYear.Equals(compareTo.SchoolYear)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptSection).SessionName, compareTo.SessionName)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseOffering).SessionName, compareTo.SessionName)) return false; @@ -43328,21 +41604,19 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_courseTranscript != null) - hash.Add(_courseTranscript); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).LocalCourseCode); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICourseOffering).LocalCourseCode); + //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).SchoolId); + hash.Add((this as Entities.Common.EdFi.ICourseOffering).SchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).SectionIdentifier); + hash.Add((this as Entities.Common.EdFi.ICourseOffering).SchoolYear); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).SessionName); + hash.Add((this as Entities.Common.EdFi.ICourseOffering).SessionName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -43355,6 +41629,76 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// A unique alphanumeric code assigned to a course. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseOffering.CourseCode + { + get + { + if (ImplicitCourseReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + { + return ImplicitCourseReference.CourseCode; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Course + _courseReferenceExplicitlyAssigned = false; + ImplicitCourseReference.CourseCode = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ICourseOffering.EducationOrganizationId + { + get + { + if (ImplicitCourseReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + { + return ImplicitCourseReference.EducationOrganizationId; + } + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Course + _courseReferenceExplicitlyAssigned = false; + ImplicitCourseReference.EducationOrganizationId = value; + } + } + + /// + /// The planned total number of clock minutes of instruction for this course offering. Generally, this should be at least as many minutes as is required for completion by the related state- or district-defined course. + /// + // NOT in a reference, NOT a lookup column + [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="instructionalTimePlanned")] + public int? InstructionalTimePlanned { get; set; } + + /// + /// The descriptive name given to a course of study offered in the school, if different from the course title. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="localCourseTitle")] + public string LocalCourseTitle { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43375,18 +41719,115 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptSection")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOffering")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _courseOfferingCourseLevelCharacteristics; + private ICollection _courseOfferingCourseLevelCharacteristicsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="courseLevelCharacteristics")] + public ICollection CourseOfferingCourseLevelCharacteristics + { + get { return _courseOfferingCourseLevelCharacteristics; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)e.Item).CourseOffering = this); + _courseOfferingCourseLevelCharacteristics = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)e.Item).CourseOffering = this; + _courseOfferingCourseLevelCharacteristicsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCourseLevelCharacteristics + { + get { return _courseOfferingCourseLevelCharacteristicsCovariant; } + set { CourseOfferingCourseLevelCharacteristics = new List(value.Cast()); } + } + + private ICollection _courseOfferingCurriculumUseds; + private ICollection _courseOfferingCurriculumUsedsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="curriculumUseds")] + public ICollection CourseOfferingCurriculumUseds + { + get { return _courseOfferingCurriculumUseds; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)e.Item).CourseOffering = this); + _courseOfferingCurriculumUseds = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)e.Item).CourseOffering = this; + _courseOfferingCurriculumUsedsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCurriculumUseds + { + get { return _courseOfferingCurriculumUsedsCovariant; } + set { CourseOfferingCurriculumUseds = new List(value.Cast()); } + } + + private ICollection _courseOfferingOfferedGradeLevels; + private ICollection _courseOfferingOfferedGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="offeredGradeLevels")] + public ICollection CourseOfferingOfferedGradeLevels + { + get { return _courseOfferingOfferedGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)e.Item).CourseOffering = this); + _courseOfferingOfferedGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)e.Item).CourseOffering = this; + _courseOfferingOfferedGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingOfferedGradeLevels + { + get { return _courseOfferingOfferedGradeLevelsCovariant; } + set { CourseOfferingOfferedGradeLevels = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -43397,6 +41838,21 @@ public override int GetHashCode() internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization + if (_courseOfferingCourseLevelCharacteristics != null) foreach (var item in _courseOfferingCourseLevelCharacteristics) + { + item.CourseOffering = this; + } + + if (_courseOfferingCurriculumUseds != null) foreach (var item in _courseOfferingCurriculumUseds) + { + item.CourseOffering = this; + } + + if (_courseOfferingOfferedGradeLevels != null) foreach (var item in _courseOfferingOfferedGradeLevels) + { + item.CourseOffering = this; + } + } // ------------------------------------------------------------ @@ -43405,29 +41861,50 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CourseTranscriptSectionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptSection)target); + return Entities.Common.EdFi.CourseOfferingMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOffering)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CourseTranscriptSectionMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptSection)target, null); + Entities.Common.EdFi.CourseOfferingMapper.MapTo(this, (Entities.Common.EdFi.ICourseOffering)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ICourseTranscriptSection.SectionResourceId + Guid? Entities.Common.EdFi.ICourseOffering.CourseResourceId { get { return null; } - set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } + set { ImplicitCourseReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator + string Entities.Common.EdFi.ICourseOffering.CourseDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitSectionReference.Discriminator = value; } + set { ImplicitCourseReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ICourseOffering.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.ICourseOffering.SessionResourceId + { + get { return null; } + set { ImplicitSessionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitSessionReference.Discriminator = value; } } @@ -43448,12 +41925,47 @@ string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (CourseOfferingCourseLevelCharacteristics.Any() && mappingContract?.IsMemberSupported("CourseOfferingCourseLevelCharacteristics") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseOfferingCourseLevelCharacteristics"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferingCourseLevelCharacteristics, validationContext, validationContext.Items.ForCollection("CourseOfferingCourseLevelCharacteristics")))) + { + yield return result; + } + } + + if (CourseOfferingCurriculumUseds.Any() && mappingContract?.IsMemberSupported("CourseOfferingCurriculumUseds") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseOfferingCurriculumUseds"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferingCurriculumUseds, validationContext, validationContext.Items.ForCollection("CourseOfferingCurriculumUseds")))) + { + yield return result; + } + } + + if (CourseOfferingOfferedGradeLevels.Any() && mappingContract?.IsMemberSupported("CourseOfferingOfferedGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseOfferingOfferedGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseOfferingOfferedGradeLevels, validationContext, validationContext.Items.ForCollection("CourseOfferingOfferedGradeLevels")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -43480,30 +41992,35 @@ string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator pathBuilder.Length = dotLength; string pathPrefix = null; - var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) { pathPrefix ??= pathBuilder.ToString(); - string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); } - IEnumerable<(string path, short value)> GetSchoolYearSources() + IEnumerable<(string path, long value)> GetSchoolIdSources() { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.ICourseTranscriptSection).CourseTranscript.SchoolYear); + // Obtain value from other references + var valueFromSchoolReference = this.SchoolReference?.SchoolId; + + if (valueFromSchoolReference != null) + { + yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); + } // Obtain value from other references - var valueFromSectionReference = this.SectionReference?.SchoolYear; + var valueFromSessionReference = this.SessionReference?.SchoolId; - if (valueFromSectionReference != null) + if (valueFromSessionReference != null) { - yield return ("sectionReference.schoolYear", this.SectionReference.SchoolYear); + yield return ("sessionReference.schoolId", this.SessionReference.SchoolId); } } @@ -43533,9 +42050,16 @@ string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CourseTranscriptSectionPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseOfferingPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_CourseOffering = new FullName("edfi", "CourseOffering"); + + // Declare collection item validators + private CourseOfferingCourseLevelCharacteristicPutPostRequestValidator _courseOfferingCourseLevelCharacteristicsValidator = new (); + private CourseOfferingCurriculumUsedPutPostRequestValidator _courseOfferingCurriculumUsedsValidator = new (); + private CourseOfferingOfferedGradeLevelPutPostRequestValidator _courseOfferingOfferedGradeLevelsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -43548,134 +42072,76 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - if (failures.Any()) + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (CourseOfferingMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_CourseOffering); + + if (mappingContract != null) { - foreach (var failure in failures) + if (mappingContract.IsCourseOfferingCourseLevelCharacteristicIncluded != null) { - result.Errors.Add(failure); + var hasInvalidCourseOfferingCourseLevelCharacteristicsItems = instance.CourseOfferingCourseLevelCharacteristics.Any(x => !mappingContract.IsCourseOfferingCourseLevelCharacteristicIncluded(x)); + + if (hasInvalidCourseOfferingCourseLevelCharacteristicsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseOfferingCourseLevelCharacteristics", $"A supplied 'CourseOfferingCourseLevelCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } } - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: Credential - -namespace EdFi.Ods.Api.Common.Models.Resources.Credential.EdFi -{ - /// - /// Represents a reference to the Credential resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class CredentialReference : IResourceReference - { - [DataMember(Name="credentialIdentifier")] - public string CredentialIdentifier { get; set; } - - [DataMember(Name="stateOfIssueStateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string StateOfIssueStateAbbreviationDescriptor { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; + if (mappingContract.IsCourseOfferingCurriculumUsedIncluded != null) + { + var hasInvalidCourseOfferingCurriculumUsedsItems = instance.CourseOfferingCurriculumUseds.Any(x => !mappingContract.IsCourseOfferingCurriculumUsedIncluded(x)); + + if (hasInvalidCourseOfferingCurriculumUsedsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseOfferingCurriculumUseds", $"A supplied 'CourseOfferingCurriculumUsed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) + if (mappingContract.IsCourseOfferingOfferedGradeLevelIncluded != null) { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); + var hasInvalidCourseOfferingOfferedGradeLevelsItems = instance.CourseOfferingOfferedGradeLevels.Any(x => !mappingContract.IsCourseOfferingOfferedGradeLevelIncluded(x)); + + if (hasInvalidCourseOfferingOfferedGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseOfferingOfferedGradeLevels", $"A supplied 'CourseOfferingOfferedGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } } - return _link; } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return CredentialIdentifier != default(string) && StateOfIssueStateAbbreviationDescriptor != default(string); - } - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (CredentialIdentifier == default) + if (failures.Any()) { - yield return "CredentialIdentifier"; - } + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - if (StateOfIssueStateAbbreviationDescriptor == default) - { - yield return "StateOfIssueStateAbbreviationDescriptor"; + return false; } + return true; } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Credential", - Href = $"/ed-fi/credentials/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.Credential table of the Credential aggregate in the ODS Database. + /// A class which represents the edfi.CourseOfferingCourseLevelCharacteristic table of the CourseOffering aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Credential : Entities.Common.EdFi.ICredential, IHasETag, IDateVersionedEntity, IValidatableObject + public class CourseOfferingCourseLevelCharacteristic : Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Credential"); + private static FullName _fullName = new FullName("edfi", "CourseOfferingCourseLevelCharacteristic"); // Fluent validator instance (threadsafe) - private static CredentialPutPostRequestValidator _validator = new CredentialPutPostRequestValidator(); + private static CourseOfferingCourseLevelCharacteristicPutPostRequestValidator _validator = new CourseOfferingCourseLevelCharacteristicPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -43686,25 +42152,12 @@ public class Credential : Entities.Common.EdFi.ICredential, IHasETag, IDateVersi // Constructor // ------------------------------------------------------------- - public Credential() - { - CredentialAcademicSubjects = new List(); - CredentialEndorsements = new List(); - CredentialGradeLevels = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the Credential resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -43715,24 +42168,33 @@ public Credential() //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseOffering _courseOffering; - /// - /// Identifier or serial number assigned to the credential. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="credentialIdentifier")] - public string CredentialIdentifier { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ICourseOffering ICourseOfferingCourseLevelCharacteristic.CourseOffering + { + get { return _courseOffering; } + set { SetCourseOffering(value); } + } + + public Entities.Common.EdFi.ICourseOffering CourseOffering + { + set { SetCourseOffering(value); } + } + + private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) + { + _courseOffering = value; + } /// - /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which a license/credential was issued. + /// The type of specific program or designation with which the course offering is associated (e.g., AP, IB, Dual Credit, CTE). This collection should only be populated if it differs from the course level characteristics identified at the course level. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="stateOfIssueStateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string StateOfIssueStateAbbreviationDescriptor { get; set; } + [DataMember(Name="courseLevelCharacteristicDescriptor")][DescriptorExists("CourseLevelCharacteristicDescriptor")] + public string CourseLevelCharacteristicDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43747,7 +42209,7 @@ public Credential() /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICredential; + var compareTo = obj as Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic; if (ReferenceEquals(this, compareTo)) return true; @@ -43755,14 +42217,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICredential).CredentialIdentifier, compareTo.CredentialIdentifier)) + // Parent Property + if (_courseOffering == null || !_courseOffering.Equals(compareTo.CourseOffering)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICredential).StateOfIssueStateAbbreviationDescriptor, compareTo.StateOfIssueStateAbbreviationDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor, compareTo.CourseLevelCharacteristicDescriptor)) return false; @@ -43778,13 +42239,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_courseOffering != null) + hash.Add(_courseOffering); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICredential).CredentialIdentifier); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICredential).StateOfIssueStateAbbreviationDescriptor); + hash.Add((this as Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor); return hash.ToHashCode(); } @@ -43798,70 +42258,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The field of certification for the certificate (e.g., Mathematics, Music). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="credentialFieldDescriptor")][DescriptorExists("CredentialFieldDescriptor")] - public string CredentialFieldDescriptor { get; set; } - - /// - /// An indication of the category of credential an individual holds. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="credentialTypeDescriptor")][DescriptorExists("CredentialTypeDescriptor")] - public string CredentialTypeDescriptor { get; set; } - - /// - /// The year, month and day on which an active credential held by an individual was issued. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveDate { get; set; } - - /// - /// The month, day, and year on which an active credential held by an individual will expire. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="expirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? ExpirationDate { get; set; } - - /// - /// The month, day, and year on which an active credential was issued to an individual. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="issuanceDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime IssuanceDate { get; set; } - - /// - /// Namespace for the credential. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// An indication of the pre-determined criteria for granting the teaching credential that an individual holds. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="teachingCredentialBasisDescriptor")][DescriptorExists("TeachingCredentialBasisDescriptor")] - public string TeachingCredentialBasisDescriptor { get; set; } - - /// - /// An indication of the category of a legal document giving authorization to perform teaching assignment services. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="teachingCredentialDescriptor")][DescriptorExists("TeachingCredentialDescriptor")] - public string TeachingCredentialDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43882,154 +42278,36 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "Credential")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOfferingCourseLevelCharacteristic")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _credentialAcademicSubjects; - private ICollection _credentialAcademicSubjectsCovariant; + // ------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="academicSubjects")] - public ICollection CredentialAcademicSubjects - { - get { return _credentialAcademicSubjects; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICredentialAcademicSubject)e.Item).Credential = this); - _credentialAcademicSubjects = list; + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICredentialAcademicSubject)e.Item).Credential = this; - _credentialAcademicSubjectsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialAcademicSubjects - { - get { return _credentialAcademicSubjectsCovariant; } - set { CredentialAcademicSubjects = new List(value.Cast()); } - } - - private ICollection _credentialEndorsements; - private ICollection _credentialEndorsementsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="endorsements")] - public ICollection CredentialEndorsements - { - get { return _credentialEndorsements; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICredentialEndorsement)e.Item).Credential = this); - _credentialEndorsements = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICredentialEndorsement)e.Item).Credential = this; - _credentialEndorsementsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialEndorsements - { - get { return _credentialEndorsementsCovariant; } - set { CredentialEndorsements = new List(value.Cast()); } - } - - private ICollection _credentialGradeLevels; - private ICollection _credentialGradeLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="gradeLevels")] - public ICollection CredentialGradeLevels - { - get { return _credentialGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ICredentialGradeLevel)e.Item).Credential = this); - _credentialGradeLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICredentialGradeLevel)e.Item).Credential = this; - _credentialGradeLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialGradeLevels - { - get { return _credentialGradeLevelsCovariant; } - set { CredentialGradeLevels = new List(value.Cast()); } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_credentialAcademicSubjects != null) foreach (var item in _credentialAcademicSubjects) - { - item.Credential = this; - } - - if (_credentialEndorsements != null) foreach (var item in _credentialEndorsements) - { - item.Credential = this; - } - - if (_credentialGradeLevels != null) foreach (var item in _credentialGradeLevels) - { - item.Credential = this; - } - - } - // ------------------------------------------------------------ + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ // ============================================================ // Data Synchronization // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CredentialMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredential)target); + return Entities.Common.EdFi.CourseOfferingCourseLevelCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CredentialMapper.MapTo(this, (Entities.Common.EdFi.ICredential)target, null); + Entities.Common.EdFi.CourseOfferingCourseLevelCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target, null); } // ------------------------------------------------------------- @@ -44053,47 +42331,12 @@ void IMappable.Map(object target) try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (CredentialAcademicSubjects.Any() && mappingContract?.IsMemberSupported("CredentialAcademicSubjects") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CredentialAcademicSubjects"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CredentialAcademicSubjects, validationContext, validationContext.Items.ForCollection("CredentialAcademicSubjects")))) - { - yield return result; - } - } - - if (CredentialEndorsements.Any() && mappingContract?.IsMemberSupported("CredentialEndorsements") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CredentialEndorsements"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CredentialEndorsements, validationContext, validationContext.Items.ForCollection("CredentialEndorsements")))) - { - yield return result; - } - } - - if (CredentialGradeLevels.Any() && mappingContract?.IsMemberSupported("CredentialGradeLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("CredentialGradeLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CredentialGradeLevels, validationContext, validationContext.Items.ForCollection("CredentialGradeLevels")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -44139,16 +42382,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CredentialPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseOfferingCourseLevelCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Credential = new FullName("edfi", "Credential"); - - // Declare collection item validators - private CredentialAcademicSubjectPutPostRequestValidator _credentialAcademicSubjectsValidator = new (); - private CredentialEndorsementPutPostRequestValidator _credentialEndorsementsValidator = new (); - private CredentialGradeLevelPutPostRequestValidator _credentialGradeLevelsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -44161,50 +42397,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (CredentialMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Credential); - - if (mappingContract != null) - { - if (mappingContract.IsCredentialAcademicSubjectIncluded != null) - { - var hasInvalidCredentialAcademicSubjectsItems = instance.CredentialAcademicSubjects.Any(x => !mappingContract.IsCredentialAcademicSubjectIncluded(x)); - - if (hasInvalidCredentialAcademicSubjectsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CredentialAcademicSubjects", $"A supplied 'CredentialAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCredentialEndorsementIncluded != null) - { - var hasInvalidCredentialEndorsementsItems = instance.CredentialEndorsements.Any(x => !mappingContract.IsCredentialEndorsementIncluded(x)); - - if (hasInvalidCredentialEndorsementsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CredentialEndorsements", $"A supplied 'CredentialEndorsement' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsCredentialGradeLevelIncluded != null) - { - var hasInvalidCredentialGradeLevelsItems = instance.CredentialGradeLevels.Any(x => !mappingContract.IsCredentialGradeLevelIncluded(x)); - - if (hasInvalidCredentialGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("CredentialGradeLevels", $"A supplied 'CredentialGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -44221,16 +42413,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CredentialAcademicSubject table of the Credential aggregate in the ODS Database. + /// A class which represents the edfi.CourseOfferingCurriculumUsed table of the CourseOffering aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CredentialAcademicSubject : Entities.Common.EdFi.ICredentialAcademicSubject, IValidatableObject + public class CourseOfferingCurriculumUsed : Entities.Common.EdFi.ICourseOfferingCurriculumUsed, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CredentialAcademicSubject"); + private static FullName _fullName = new FullName("edfi", "CourseOfferingCurriculumUsed"); // Fluent validator instance (threadsafe) - private static CredentialAcademicSubjectPutPostRequestValidator _validator = new CredentialAcademicSubjectPutPostRequestValidator(); + private static CourseOfferingCurriculumUsedPutPostRequestValidator _validator = new CourseOfferingCurriculumUsedPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -44257,33 +42449,33 @@ public class CredentialAcademicSubject : Entities.Common.EdFi.ICredentialAcademi //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICredential _credential; + private Entities.Common.EdFi.ICourseOffering _courseOffering; [IgnoreDataMember] - Entities.Common.EdFi.ICredential ICredentialAcademicSubject.Credential + Entities.Common.EdFi.ICourseOffering ICourseOfferingCurriculumUsed.CourseOffering { - get { return _credential; } - set { SetCredential(value); } + get { return _courseOffering; } + set { SetCourseOffering(value); } } - public Entities.Common.EdFi.ICredential Credential + public Entities.Common.EdFi.ICourseOffering CourseOffering { - set { SetCredential(value); } + set { SetCourseOffering(value); } } - private void SetCredential(Entities.Common.EdFi.ICredential value) + private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) { - _credential = value; + _courseOffering = value; } /// - /// The academic subjects to which the credential pertains. + /// The type of curriculum used in an early learning classroom or group. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } + [DataMember(Name="curriculumUsedDescriptor")][DescriptorExists("CurriculumUsedDescriptor")] + public string CurriculumUsedDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -44298,7 +42490,7 @@ private void SetCredential(Entities.Common.EdFi.ICredential value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICredentialAcademicSubject; + var compareTo = obj as Entities.Common.EdFi.ICourseOfferingCurriculumUsed; if (ReferenceEquals(this, compareTo)) return true; @@ -44307,12 +42499,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_credential == null || !_credential.Equals(compareTo.Credential)) + if (_courseOffering == null || !_courseOffering.Equals(compareTo.CourseOffering)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICredentialAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferingCurriculumUsed).CurriculumUsedDescriptor, compareTo.CurriculumUsedDescriptor)) return false; @@ -44329,11 +42521,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_credential != null) - hash.Add(_credential); + if (_courseOffering != null) + hash.Add(_courseOffering); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICredentialAcademicSubject).AcademicSubjectDescriptor); + hash.Add((this as Entities.Common.EdFi.ICourseOfferingCurriculumUsed).CurriculumUsedDescriptor); return hash.ToHashCode(); } @@ -44367,7 +42559,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "CredentialAcademicSubject")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOfferingCurriculumUsed")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -44391,12 +42583,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CredentialAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialAcademicSubject)target); + return Entities.Common.EdFi.CourseOfferingCurriculumUsedMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CredentialAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ICredentialAcademicSubject)target, null); + Entities.Common.EdFi.CourseOfferingCurriculumUsedMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target, null); } // ------------------------------------------------------------- @@ -44471,9 +42663,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CredentialAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseOfferingCurriculumUsedPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -44502,16 +42694,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CredentialEndorsement table of the Credential aggregate in the ODS Database. + /// A class which represents the edfi.CourseOfferingOfferedGradeLevel table of the CourseOffering aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CredentialEndorsement : Entities.Common.EdFi.ICredentialEndorsement, IValidatableObject + public class CourseOfferingOfferedGradeLevel : Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CredentialEndorsement"); + private static FullName _fullName = new FullName("edfi", "CourseOfferingOfferedGradeLevel"); // Fluent validator instance (threadsafe) - private static CredentialEndorsementPutPostRequestValidator _validator = new CredentialEndorsementPutPostRequestValidator(); + private static CourseOfferingOfferedGradeLevelPutPostRequestValidator _validator = new CourseOfferingOfferedGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -44538,33 +42730,33 @@ public class CredentialEndorsement : Entities.Common.EdFi.ICredentialEndorsement //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ICredential _credential; + private Entities.Common.EdFi.ICourseOffering _courseOffering; [IgnoreDataMember] - Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential + Entities.Common.EdFi.ICourseOffering ICourseOfferingOfferedGradeLevel.CourseOffering { - get { return _credential; } - set { SetCredential(value); } + get { return _courseOffering; } + set { SetCourseOffering(value); } } - public Entities.Common.EdFi.ICredential Credential + public Entities.Common.EdFi.ICourseOffering CourseOffering { - set { SetCredential(value); } + set { SetCourseOffering(value); } } - private void SetCredential(Entities.Common.EdFi.ICredential value) + private void SetCourseOffering(Entities.Common.EdFi.ICourseOffering value) { - _credential = value; + _courseOffering = value; } /// - /// Endorsements are attachments to teaching certificates and indicate areas of specialization. + /// The grade levels in which the course is offered. This collection should only be populated if it differs from the offered grade levels identified at the course level. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="credentialEndorsement")][Display(Name="CredentialEndorsement")] - public string CredentialEndorsementX { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -44579,7 +42771,7 @@ private void SetCredential(Entities.Common.EdFi.ICredential value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICredentialEndorsement; + var compareTo = obj as Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -44588,12 +42780,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_credential == null || !_credential.Equals(compareTo.Credential)) + if (_courseOffering == null || !_courseOffering.Equals(compareTo.CourseOffering)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICredentialEndorsement).CredentialEndorsementX, compareTo.CredentialEndorsementX)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -44610,11 +42802,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_credential != null) - hash.Add(_credential); + if (_courseOffering != null) + hash.Add(_courseOffering); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICredentialEndorsement).CredentialEndorsementX); + hash.Add((this as Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -44648,7 +42840,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "CredentialEndorsement")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseOffering", "CourseOfferingOfferedGradeLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -44672,12 +42864,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CredentialEndorsementMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialEndorsement)target); + return Entities.Common.EdFi.CourseOfferingOfferedGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CredentialEndorsementMapper.MapTo(this, (Entities.Common.EdFi.ICredentialEndorsement)target, null); + Entities.Common.EdFi.CourseOfferingOfferedGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target, null); } // ------------------------------------------------------------- @@ -44752,290 +42944,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CredentialEndorsementPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.CredentialGradeLevel table of the Credential aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CredentialGradeLevel : Entities.Common.EdFi.ICredentialGradeLevel, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "CredentialGradeLevel"); - - // Fluent validator instance (threadsafe) - private static CredentialGradeLevelPutPostRequestValidator _validator = new CredentialGradeLevelPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.ICredential _credential; - - [IgnoreDataMember] - Entities.Common.EdFi.ICredential ICredentialGradeLevel.Credential - { - get { return _credential; } - set { SetCredential(value); } - } - - public Entities.Common.EdFi.ICredential Credential - { - set { SetCredential(value); } - } - - private void SetCredential(Entities.Common.EdFi.ICredential value) - { - _credential = value; - } - - /// - /// The grade level(s) certified for teaching. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.ICredentialGradeLevel; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_credential == null || !_credential.Equals(compareTo.Credential)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICredentialGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_credential != null) - hash.Add(_credential); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ICredentialGradeLevel).GradeLevelDescriptor); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "CredentialGradeLevel")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.CredentialGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialGradeLevel)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.CredentialGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICredentialGradeLevel)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class CredentialGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseOfferingOfferedGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -45064,21 +42975,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CredentialFieldDescriptor table of the CredentialFieldDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CourseRepeatCodeDescriptor table of the CourseRepeatCodeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CredentialFieldDescriptor : Entities.Common.EdFi.ICredentialFieldDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CourseRepeatCodeDescriptor : Entities.Common.EdFi.ICourseRepeatCodeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "CredentialFieldDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseRepeatCodeDescriptor"); // Fluent validator instance (threadsafe) - private static CredentialFieldDescriptorPutPostRequestValidator _validator = new CredentialFieldDescriptorPutPostRequestValidator(); + private static CourseRepeatCodeDescriptorPutPostRequestValidator _validator = new CourseRepeatCodeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -45097,7 +43008,7 @@ public class CredentialFieldDescriptor : Entities.Common.EdFi.ICredentialFieldDe // ------------------------------------------------------------ /// - /// The unique identifier for the CredentialFieldDescriptor resource. + /// The unique identifier for the CourseRepeatCodeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -45118,12 +43029,12 @@ public class CredentialFieldDescriptor : Entities.Common.EdFi.ICredentialFieldDe /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int CredentialFieldDescriptorId { get; set; } + public int CourseRepeatCodeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return CredentialFieldDescriptorId; } - set { CredentialFieldDescriptorId = value; } + get { return CourseRepeatCodeDescriptorId; } + set { CourseRepeatCodeDescriptorId = value; } } // ------------------------------------------------------------- @@ -45139,7 +43050,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICredentialFieldDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseRepeatCodeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -45149,7 +43060,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ICredentialFieldDescriptor).CredentialFieldDescriptorId.Equals(compareTo.CredentialFieldDescriptorId)) + if (!(this as Entities.Common.EdFi.ICourseRepeatCodeDescriptor).CourseRepeatCodeDescriptorId.Equals(compareTo.CourseRepeatCodeDescriptorId)) return false; @@ -45167,7 +43078,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ICredentialFieldDescriptor).CredentialFieldDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICourseRepeatCodeDescriptor).CourseRepeatCodeDescriptorId); return hash.ToHashCode(); } @@ -45284,12 +43195,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CredentialFieldDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialFieldDescriptor)target); + return Entities.Common.EdFi.CourseRepeatCodeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CredentialFieldDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICredentialFieldDescriptor)target, null); + Entities.Common.EdFi.CourseRepeatCodeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target, null); } // ------------------------------------------------------------- @@ -45304,9 +43215,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CredentialFieldDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseRepeatCodeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -45335,21 +43246,167 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CredentialTypeDescriptor table of the CredentialTypeDescriptor aggregate in the ODS Database. + /// Represents a reference to the CourseTranscript resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class CourseTranscriptReference : IResourceReference + { + [DataMember(Name="courseAttemptResultDescriptor")][DescriptorExists("CourseAttemptResultDescriptor")] + public string CourseAttemptResultDescriptor { get; set; } + + [DataMember(Name="courseCode")] + public string CourseCode { get; set; } + + [DataMember(Name="courseEducationOrganizationId")] + public long CourseEducationOrganizationId { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] + public string TermDescriptor { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return CourseAttemptResultDescriptor != default(string) && CourseCode != default(string) && CourseEducationOrganizationId != default(long) && EducationOrganizationId != default(long) && SchoolYear != default(short) && StudentUniqueId != default(string) && TermDescriptor != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (CourseAttemptResultDescriptor == default) + { + yield return "CourseAttemptResultDescriptor"; + } + + if (CourseCode == default) + { + yield return "CourseCode"; + } + + if (CourseEducationOrganizationId == default) + { + yield return "CourseEducationOrganizationId"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + if (TermDescriptor == default) + { + yield return "TermDescriptor"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "CourseTranscript", + Href = $"/ed-fi/courseTranscripts/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.CourseTranscript table of the CourseTranscript aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CredentialTypeDescriptor : Entities.Common.EdFi.ICredentialTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CourseTranscript : Entities.Common.EdFi.ICourseTranscript, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CredentialTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseTranscript"); // Fluent validator instance (threadsafe) - private static CredentialTypeDescriptorPutPostRequestValidator _validator = new CredentialTypeDescriptorPutPostRequestValidator(); + private static CourseTranscriptPutPostRequestValidator _validator = new CourseTranscriptPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -45360,6 +43417,16 @@ public class CredentialTypeDescriptor : Entities.Common.EdFi.ICredentialTypeDesc // Constructor // ------------------------------------------------------------- + public CourseTranscript() + { + CourseTranscriptAcademicSubjects = new List(); + CourseTranscriptAlternativeCourseIdentificationCodes = new List(); + CourseTranscriptCoursePrograms = new List(); + CourseTranscriptCreditCategories = new List(); + CourseTranscriptEarnedAdditionalCredits = new List(); + CourseTranscriptPartialCourseTranscriptAwards = new List(); + CourseTranscriptSections = new List(); + } // ------------------------------------------------------------ @@ -45368,7 +43435,7 @@ public class CredentialTypeDescriptor : Entities.Common.EdFi.ICredentialTypeDesc // ------------------------------------------------------------ /// - /// The unique identifier for the CredentialTypeDescriptor resource. + /// The unique identifier for the CourseTranscript resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -45378,294 +43445,299 @@ public class CredentialTypeDescriptor : Entities.Common.EdFi.ICredentialTypeDesc // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- + private bool _courseReferenceExplicitlyAssigned; + private Course.EdFi.CourseReference _courseReference; + private Course.EdFi.CourseReference ImplicitCourseReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_courseReference == null && !_courseReferenceExplicitlyAssigned) + _courseReference = new Course.EdFi.CourseReference(); - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CredentialTypeDescriptorId { get; set; } + return _courseReference; + } + } - int IDescriptor.DescriptorId + [DataMember(Name="courseReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Course.EdFi.CourseReference CourseReference { - get { return CredentialTypeDescriptorId; } - set { CredentialTypeDescriptorId = value; } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCourseReference != null + && (_courseReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + return ImplicitCourseReference; + + return null; + } + set + { + _courseReferenceExplicitlyAssigned = true; + _courseReference = value; + } } - // ------------------------------------------------------------- + private bool _externalEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _externalEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitExternalEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_externalEducationOrganizationReference == null && !_externalEducationOrganizationReferenceExplicitlyAssigned) + _externalEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - // ============================================================= - // Equality - // ------------------------------------------------------------- + return _externalEducationOrganizationReference; + } + } - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + [DataMember(Name="externalEducationOrganizationReference")] + [FullyDefinedReference] + public EducationOrganization.EdFi.EducationOrganizationReference ExternalEducationOrganizationReference { - var compareTo = obj as Entities.Common.EdFi.ICredentialTypeDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitExternalEducationOrganizationReference != null + && (_externalEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitExternalEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitExternalEducationOrganizationReference; - if (compareTo == null) - return false; + return null; + } + set + { + _externalEducationOrganizationReferenceExplicitlyAssigned = true; + _externalEducationOrganizationReference = value; + } + } + private bool _responsibleTeacherStaffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _responsibleTeacherStaffReference; + private Staff.EdFi.StaffReference ImplicitResponsibleTeacherStaffReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_responsibleTeacherStaffReference == null && !_responsibleTeacherStaffReferenceExplicitlyAssigned) + _responsibleTeacherStaffReference = new Staff.EdFi.StaffReference(); + return _responsibleTeacherStaffReference; + } + } - // Derived Property - if (!(this as Entities.Common.EdFi.ICredentialTypeDescriptor).CredentialTypeDescriptorId.Equals(compareTo.CredentialTypeDescriptorId)) - return false; + [DataMember(Name="responsibleTeacherStaffReference")] + [FullyDefinedReference] + public Staff.EdFi.StaffReference ResponsibleTeacherStaffReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitResponsibleTeacherStaffReference != null + && (_responsibleTeacherStaffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitResponsibleTeacherStaffReference.IsReferenceFullyDefined())) + return ImplicitResponsibleTeacherStaffReference; + return null; + } + set + { + _responsibleTeacherStaffReferenceExplicitlyAssigned = true; + _responsibleTeacherStaffReference = value; + } + } + private bool _studentAcademicRecordReferenceExplicitlyAssigned; + private StudentAcademicRecord.EdFi.StudentAcademicRecordReference _studentAcademicRecordReference; + private StudentAcademicRecord.EdFi.StudentAcademicRecordReference ImplicitStudentAcademicRecordReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentAcademicRecordReference == null && !_studentAcademicRecordReferenceExplicitlyAssigned) + _studentAcademicRecordReference = new StudentAcademicRecord.EdFi.StudentAcademicRecordReference(); - return true; + return _studentAcademicRecordReference; + } } - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + [DataMember(Name="studentAcademicRecordReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentAcademicRecord.EdFi.StudentAcademicRecordReference StudentAcademicRecordReference { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICredentialTypeDescriptor).CredentialTypeDescriptorId); + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentAcademicRecordReference != null + && (_studentAcademicRecordReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) + return ImplicitStudentAcademicRecordReference; - return hash.ToHashCode(); + return null; + } + set + { + _studentAcademicRecordReferenceExplicitlyAssigned = true; + _studentAcademicRecordReference = value; + } } // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties + //============================================================== + // Primary Key // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The result from the student's attempt to take the course. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="courseAttemptResultDescriptor")][DescriptorExists("CourseAttemptResultDescriptor")] + public string CourseAttemptResultDescriptor { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// A unique alphanumeric code assigned to a course. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseTranscript.CourseCode + { + get + { + if (ImplicitCourseReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + return ImplicitCourseReference.CourseCode; - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // Course + _courseReferenceExplicitlyAssigned = false; + ImplicitCourseReference.CourseCode = value; + } + } /// - /// A shortened description for the descriptor. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ICourseTranscript.CourseEducationOrganizationId + { + get + { + if (ImplicitCourseReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + return ImplicitCourseReference.EducationOrganizationId; - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.CredentialTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialTypeDescriptor)target); + // Course + _courseReferenceExplicitlyAssigned = false; + ImplicitCourseReference.EducationOrganizationId = value; + } } - void IMappable.Map(object target) + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ICourseTranscript.EducationOrganizationId { - Entities.Common.EdFi.CredentialTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICredentialTypeDescriptor)target, null); - } - // ------------------------------------------------------------- + get + { + if (ImplicitStudentAcademicRecordReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) + return ImplicitStudentAcademicRecordReference.EducationOrganizationId; - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - // ================================================================= - // Validators - // ----------------------------------------------------------------- + // StudentAcademicRecord + _studentAcademicRecordReferenceExplicitlyAssigned = false; + ImplicitStudentAcademicRecordReference.EducationOrganizationId = value; + } + } - [ExcludeFromCodeCoverage] - public class CredentialTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.ICourseTranscript.SchoolYear { - if (context.InstanceToValidate == null) + get { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + if (ImplicitStudentAcademicRecordReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) + return ImplicitStudentAcademicRecordReference.SchoolYear; - return false; + return default(short); } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) + set { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - return false; + // StudentAcademicRecord + _studentAcademicRecordReferenceExplicitlyAssigned = false; + ImplicitStudentAcademicRecordReference.SchoolYear = value; } - - return true; } - } - // ----------------------------------------------------------------- - -} -// Aggregate: CreditCategoryDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.CreditCategoryDescriptor.EdFi -{ - /// - /// A class which represents the edfi.CreditCategoryDescriptor table of the CreditCategoryDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CreditCategoryDescriptor : Entities.Common.EdFi.ICreditCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "CreditCategoryDescriptor"); - - // Fluent validator instance (threadsafe) - private static CreditCategoryDescriptorPutPostRequestValidator _validator = new CreditCategoryDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ /// - /// The unique identifier for the CreditCategoryDescriptor resource. + /// A unique alphanumeric code assigned to a student. /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseTranscript.StudentUniqueId + { + get + { + if (ImplicitStudentAcademicRecordReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) + return ImplicitStudentAcademicRecordReference.StudentUniqueId; - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - //============================================================== - // Primary Key - // ------------------------------------------------------------- + // StudentAcademicRecord + _studentAcademicRecordReferenceExplicitlyAssigned = false; + ImplicitStudentAcademicRecordReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The term for the session during the school year. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CreditCategoryDescriptorId { get; set; } - int IDescriptor.DescriptorId + // IS in a reference (CourseTranscript.TermDescriptorId), IS a lookup column + string Entities.Common.EdFi.ICourseTranscript.TermDescriptor { - get { return CreditCategoryDescriptorId; } - set { CreditCategoryDescriptorId = value; } + get + { + if (ImplicitStudentAcademicRecordReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAcademicRecordReference.IsReferenceFullyDefined())) + return ImplicitStudentAcademicRecordReference.TermDescriptor; + + return null; + } + set + { + ImplicitStudentAcademicRecordReference.TermDescriptor = value; + } } // ------------------------------------------------------------- @@ -45681,7 +43753,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICreditCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseTranscript; if (ReferenceEquals(this, compareTo)) return true; @@ -45690,8 +43762,38 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICreditCategoryDescriptor).CreditCategoryDescriptorId.Equals(compareTo.CreditCategoryDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscript).CourseAttemptResultDescriptor, compareTo.CourseAttemptResultDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscript).CourseCode, compareTo.CourseCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICourseTranscript).CourseEducationOrganizationId.Equals(compareTo.CourseEducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICourseTranscript).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICourseTranscript).SchoolYear.Equals(compareTo.SchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscript).StudentUniqueId, compareTo.StudentUniqueId)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscript).TermDescriptor, compareTo.TermDescriptor)) return false; @@ -45708,8 +43810,27 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICreditCategoryDescriptor).CreditCategoryDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscript).CourseAttemptResultDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscript).CourseCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscript).CourseEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscript).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscript).SchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscript).StudentUniqueId); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscript).TermDescriptor); return hash.ToHashCode(); } @@ -45718,60 +43839,194 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The descriptive name given to a course of study offered in the school, if different from the CourseTitle. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="alternativeCourseTitle")] + public string AlternativeCourseTitle { get; set; } + + /// + /// The organization code or name assigning the course identification code. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assigningOrganizationIdentificationCode")] + public string AssigningOrganizationIdentificationCode { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="attemptedCreditConversion")] + public decimal? AttemptedCreditConversion { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The value of credits or units of value awarded for the completion of a course. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="attemptedCredits")] + public decimal? AttemptedCredits { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="attemptedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string AttemptedCreditTypeDescriptor { get; set; } + + /// + /// The URL for the course catalog that defines the course identification code. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="courseCatalogURL")] + public string CourseCatalogURL { get; set; } /// - /// A shortened description for the descriptor. + /// Indicates that an academic course has been repeated by a student and how that repeat is to be computed in the student's academic grade average. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="courseRepeatCodeDescriptor")][DescriptorExists("CourseRepeatCodeDescriptor")] + public string CourseRepeatCodeDescriptor { get; set; } + + /// + /// The descriptive name given to a course of study offered in a school or other institution or organization. In departmentalized classes at the elementary, secondary, and postsecondary levels (and for staff development activities), this refers to the name by which a course is identified (e.g., American History, English III). For elementary and other non-departmentalized classes, it refers to any portion of the instruction for which a grade or report is assigned (e.g., reading, composition, spelling, language arts). + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="courseTitle")] + public string CourseTitle { get; set; } + + /// + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="earnedCreditConversion")] + public decimal? EarnedCreditConversion { get; set; } + + /// + /// The value of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="earnedCredits")] + public decimal? EarnedCredits { get; set; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="earnedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string EarnedCreditTypeDescriptor { get; set; } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationId + { + get + { + if (ImplicitExternalEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitExternalEducationOrganizationReference.IsReferenceFullyDefined())) + { + return ImplicitExternalEducationOrganizationReference.EducationOrganizationId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ExternalEducationOrganization + _externalEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitExternalEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); + } + } + + /// + /// Name of the external institution where the student completed the course; to be used only when the reference external education organization is not available. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [DataMember(Name="externalEducationOrganizationNameOfInstitution")] + public string ExternalEducationOrganizationNameOfInstitution { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// The final indicator of student performance in a class as submitted by the instructor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="finalLetterGradeEarned")] + public string FinalLetterGradeEarned { get; set; } + + /// + /// The final indicator of student performance in a class as submitted by the instructor. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="finalNumericGradeEarned")] + public decimal? FinalNumericGradeEarned { get; set; } + + /// + /// The method the credits were earned. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="methodCreditEarnedDescriptor")][DescriptorExists("MethodCreditEarnedDescriptor")] + public string MethodCreditEarnedDescriptor { get; set; } + + /// + /// A unique alphanumeric code assigned to a responsibleteacherstaff. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffUniqueId + { + get + { + if (ImplicitResponsibleTeacherStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitResponsibleTeacherStaffReference.IsReferenceFullyDefined())) + { + return ImplicitResponsibleTeacherStaffReference.StaffUniqueId; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ResponsibleTeacherStaff + _responsibleTeacherStaffReferenceExplicitlyAssigned = false; + ImplicitResponsibleTeacherStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + + /// + /// Student's grade level at time of course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="whenTakenGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string WhenTakenGradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -45792,16 +44047,223 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscript")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _courseTranscriptAcademicSubjects; + private ICollection _courseTranscriptAcademicSubjectsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="academicSubjects")] + public ICollection CourseTranscriptAcademicSubjects + { + get { return _courseTranscriptAcademicSubjects; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)e.Item).CourseTranscript = this); + _courseTranscriptAcademicSubjects = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)e.Item).CourseTranscript = this; + _courseTranscriptAcademicSubjectsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAcademicSubjects + { + get { return _courseTranscriptAcademicSubjectsCovariant; } + set { CourseTranscriptAcademicSubjects = new List(value.Cast()); } + } + + private ICollection _courseTranscriptAlternativeCourseIdentificationCodes; + private ICollection _courseTranscriptAlternativeCourseIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="alternativeCourseIdentificationCodes")] + public ICollection CourseTranscriptAlternativeCourseIdentificationCodes + { + get { return _courseTranscriptAlternativeCourseIdentificationCodes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)e.Item).CourseTranscript = this); + _courseTranscriptAlternativeCourseIdentificationCodes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)e.Item).CourseTranscript = this; + _courseTranscriptAlternativeCourseIdentificationCodesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAlternativeCourseIdentificationCodes + { + get { return _courseTranscriptAlternativeCourseIdentificationCodesCovariant; } + set { CourseTranscriptAlternativeCourseIdentificationCodes = new List(value.Cast()); } + } + + private ICollection _courseTranscriptCoursePrograms; + private ICollection _courseTranscriptCourseProgramsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="coursePrograms")] + public ICollection CourseTranscriptCoursePrograms + { + get { return _courseTranscriptCoursePrograms; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCourseProgram)e.Item).CourseTranscript = this); + _courseTranscriptCoursePrograms = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCourseProgram)e.Item).CourseTranscript = this; + _courseTranscriptCourseProgramsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCoursePrograms + { + get { return _courseTranscriptCourseProgramsCovariant; } + set { CourseTranscriptCoursePrograms = new List(value.Cast()); } + } + + private ICollection _courseTranscriptCreditCategories; + private ICollection _courseTranscriptCreditCategoriesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="creditCategories")] + public ICollection CourseTranscriptCreditCategories + { + get { return _courseTranscriptCreditCategories; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCreditCategory)e.Item).CourseTranscript = this); + _courseTranscriptCreditCategories = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptCreditCategory)e.Item).CourseTranscript = this; + _courseTranscriptCreditCategoriesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCreditCategories + { + get { return _courseTranscriptCreditCategoriesCovariant; } + set { CourseTranscriptCreditCategories = new List(value.Cast()); } + } + + private ICollection _courseTranscriptEarnedAdditionalCredits; + private ICollection _courseTranscriptEarnedAdditionalCreditsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="earnedAdditionalCredits")] + public ICollection CourseTranscriptEarnedAdditionalCredits + { + get { return _courseTranscriptEarnedAdditionalCredits; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)e.Item).CourseTranscript = this); + _courseTranscriptEarnedAdditionalCredits = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)e.Item).CourseTranscript = this; + _courseTranscriptEarnedAdditionalCreditsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptEarnedAdditionalCredits + { + get { return _courseTranscriptEarnedAdditionalCreditsCovariant; } + set { CourseTranscriptEarnedAdditionalCredits = new List(value.Cast()); } + } + + private ICollection _courseTranscriptPartialCourseTranscriptAwards; + private ICollection _courseTranscriptPartialCourseTranscriptAwardsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="partialCourseTranscriptAwards")] + public ICollection CourseTranscriptPartialCourseTranscriptAwards + { + get { return _courseTranscriptPartialCourseTranscriptAwards; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)e.Item).CourseTranscript = this); + _courseTranscriptPartialCourseTranscriptAwards = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)e.Item).CourseTranscript = this; + _courseTranscriptPartialCourseTranscriptAwardsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptPartialCourseTranscriptAwards + { + get { return _courseTranscriptPartialCourseTranscriptAwardsCovariant; } + set { CourseTranscriptPartialCourseTranscriptAwards = new List(value.Cast()); } + } + + private ICollection _courseTranscriptSections; + private ICollection _courseTranscriptSectionsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="sections")] + public ICollection CourseTranscriptSections + { + get { return _courseTranscriptSections; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICourseTranscriptSection)e.Item).CourseTranscript = this); + _courseTranscriptSections = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICourseTranscriptSection)e.Item).CourseTranscript = this; + _courseTranscriptSectionsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptSections + { + get { return _courseTranscriptSectionsCovariant; } + set { CourseTranscriptSections = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -45819,6 +44281,47 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_courseTranscriptAcademicSubjects != null) foreach (var item in _courseTranscriptAcademicSubjects) + { + item.CourseTranscript = this; + } + + if (_courseTranscriptAlternativeCourseIdentificationCodes != null) foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) + { + item.CourseTranscript = this; + } + + if (_courseTranscriptCoursePrograms != null) foreach (var item in _courseTranscriptCoursePrograms) + { + item.CourseTranscript = this; + } + + if (_courseTranscriptCreditCategories != null) foreach (var item in _courseTranscriptCreditCategories) + { + item.CourseTranscript = this; + } + + if (_courseTranscriptEarnedAdditionalCredits != null) foreach (var item in _courseTranscriptEarnedAdditionalCredits) + { + item.CourseTranscript = this; + } + + if (_courseTranscriptPartialCourseTranscriptAwards != null) foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) + { + item.CourseTranscript = this; + } + + if (_courseTranscriptSections != null) foreach (var item in _courseTranscriptSections) + { + item.CourseTranscript = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -45826,19 +44329,218 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CreditCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICreditCategoryDescriptor)target); + return Entities.Common.EdFi.CourseTranscriptMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscript)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CreditCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICreditCategoryDescriptor)target, null); + Entities.Common.EdFi.CourseTranscriptMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscript)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ICourseTranscript.CourseResourceId + { + get { return null; } + set { ImplicitCourseReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseTranscript.CourseDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitCourseReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationResourceId + { + get { return null; } + set { ImplicitExternalEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitExternalEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffResourceId + { + get { return null; } + set { ImplicitResponsibleTeacherStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitResponsibleTeacherStaffReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordResourceId + { + get { return null; } + set { ImplicitStudentAcademicRecordReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentAcademicRecordReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (CourseTranscriptAcademicSubjects.Any() && mappingContract?.IsMemberSupported("CourseTranscriptAcademicSubjects") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseTranscriptAcademicSubjects"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptAcademicSubjects, validationContext, validationContext.Items.ForCollection("CourseTranscriptAcademicSubjects")))) + { + yield return result; + } + } + + if (CourseTranscriptAlternativeCourseIdentificationCodes.Any() && mappingContract?.IsMemberSupported("CourseTranscriptAlternativeCourseIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseTranscriptAlternativeCourseIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptAlternativeCourseIdentificationCodes, validationContext, validationContext.Items.ForCollection("CourseTranscriptAlternativeCourseIdentificationCodes")))) + { + yield return result; + } + } + + if (CourseTranscriptCoursePrograms.Any() && mappingContract?.IsMemberSupported("CourseTranscriptCoursePrograms") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseTranscriptCoursePrograms"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptCoursePrograms, validationContext, validationContext.Items.ForCollection("CourseTranscriptCoursePrograms")))) + { + yield return result; + } + } + + if (CourseTranscriptCreditCategories.Any() && mappingContract?.IsMemberSupported("CourseTranscriptCreditCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseTranscriptCreditCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptCreditCategories, validationContext, validationContext.Items.ForCollection("CourseTranscriptCreditCategories")))) + { + yield return result; + } + } + + if (CourseTranscriptEarnedAdditionalCredits.Any() && mappingContract?.IsMemberSupported("CourseTranscriptEarnedAdditionalCredits") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseTranscriptEarnedAdditionalCredits"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptEarnedAdditionalCredits, validationContext, validationContext.Items.ForCollection("CourseTranscriptEarnedAdditionalCredits")))) + { + yield return result; + } + } + + if (CourseTranscriptPartialCourseTranscriptAwards.Any() && mappingContract?.IsMemberSupported("CourseTranscriptPartialCourseTranscriptAwards") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseTranscriptPartialCourseTranscriptAwards"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptPartialCourseTranscriptAwards, validationContext, validationContext.Items.ForCollection("CourseTranscriptPartialCourseTranscriptAwards")))) + { + yield return result; + } + } + + if (CourseTranscriptSections.Any() && mappingContract?.IsMemberSupported("CourseTranscriptSections") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CourseTranscriptSections"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CourseTranscriptSections, validationContext, validationContext.Items.ForCollection("CourseTranscriptSections")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -45846,9 +44548,20 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CreditCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseTranscriptPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_CourseTranscript = new FullName("edfi", "CourseTranscript"); + + // Declare collection item validators + private CourseTranscriptAcademicSubjectPutPostRequestValidator _courseTranscriptAcademicSubjectsValidator = new (); + private CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator _courseTranscriptAlternativeCourseIdentificationCodesValidator = new (); + private CourseTranscriptCourseProgramPutPostRequestValidator _courseTranscriptCourseProgramsValidator = new (); + private CourseTranscriptCreditCategoryPutPostRequestValidator _courseTranscriptCreditCategoriesValidator = new (); + private CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator _courseTranscriptEarnedAdditionalCreditsValidator = new (); + private CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator _courseTranscriptPartialCourseTranscriptAwardsValidator = new (); + private CourseTranscriptSectionPutPostRequestValidator _courseTranscriptSectionsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -45861,6 +44574,94 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (CourseTranscriptMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_CourseTranscript); + + if (mappingContract != null) + { + if (mappingContract.IsCourseTranscriptAcademicSubjectIncluded != null) + { + var hasInvalidCourseTranscriptAcademicSubjectsItems = instance.CourseTranscriptAcademicSubjects.Any(x => !mappingContract.IsCourseTranscriptAcademicSubjectIncluded(x)); + + if (hasInvalidCourseTranscriptAcademicSubjectsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseTranscriptAcademicSubjects", $"A supplied 'CourseTranscriptAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseTranscriptAlternativeCourseIdentificationCodeIncluded != null) + { + var hasInvalidCourseTranscriptAlternativeCourseIdentificationCodesItems = instance.CourseTranscriptAlternativeCourseIdentificationCodes.Any(x => !mappingContract.IsCourseTranscriptAlternativeCourseIdentificationCodeIncluded(x)); + + if (hasInvalidCourseTranscriptAlternativeCourseIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseTranscriptAlternativeCourseIdentificationCodes", $"A supplied 'CourseTranscriptAlternativeCourseIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseTranscriptCourseProgramIncluded != null) + { + var hasInvalidCourseTranscriptCourseProgramsItems = instance.CourseTranscriptCoursePrograms.Any(x => !mappingContract.IsCourseTranscriptCourseProgramIncluded(x)); + + if (hasInvalidCourseTranscriptCourseProgramsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseTranscriptCoursePrograms", $"A supplied 'CourseTranscriptCourseProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseTranscriptCreditCategoryIncluded != null) + { + var hasInvalidCourseTranscriptCreditCategoriesItems = instance.CourseTranscriptCreditCategories.Any(x => !mappingContract.IsCourseTranscriptCreditCategoryIncluded(x)); + + if (hasInvalidCourseTranscriptCreditCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseTranscriptCreditCategories", $"A supplied 'CourseTranscriptCreditCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseTranscriptEarnedAdditionalCreditsIncluded != null) + { + var hasInvalidCourseTranscriptEarnedAdditionalCreditsItems = instance.CourseTranscriptEarnedAdditionalCredits.Any(x => !mappingContract.IsCourseTranscriptEarnedAdditionalCreditsIncluded(x)); + + if (hasInvalidCourseTranscriptEarnedAdditionalCreditsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseTranscriptEarnedAdditionalCredits", $"A supplied 'CourseTranscriptEarnedAdditionalCredits' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseTranscriptPartialCourseTranscriptAwardsIncluded != null) + { + var hasInvalidCourseTranscriptPartialCourseTranscriptAwardsItems = instance.CourseTranscriptPartialCourseTranscriptAwards.Any(x => !mappingContract.IsCourseTranscriptPartialCourseTranscriptAwardsIncluded(x)); + + if (hasInvalidCourseTranscriptPartialCourseTranscriptAwardsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseTranscriptPartialCourseTranscriptAwards", $"A supplied 'CourseTranscriptPartialCourseTranscriptAwards' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCourseTranscriptSectionIncluded != null) + { + var hasInvalidCourseTranscriptSectionsItems = instance.CourseTranscriptSections.Any(x => !mappingContract.IsCourseTranscriptSectionIncluded(x)); + + if (hasInvalidCourseTranscriptSectionsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CourseTranscriptSections", $"A supplied 'CourseTranscriptSection' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -45876,22 +44677,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CreditTypeDescriptor table of the CreditTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CourseTranscriptAcademicSubject table of the CourseTranscript aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CreditTypeDescriptor : Entities.Common.EdFi.ICreditTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CourseTranscriptAcademicSubject : Entities.Common.EdFi.ICourseTranscriptAcademicSubject, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CreditTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseTranscriptAcademicSubject"); // Fluent validator instance (threadsafe) - private static CreditTypeDescriptorPutPostRequestValidator _validator = new CreditTypeDescriptorPutPostRequestValidator(); + private static CourseTranscriptAcademicSubjectPutPostRequestValidator _validator = new CourseTranscriptAcademicSubjectPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -45908,13 +44704,6 @@ public class CreditTypeDescriptor : Entities.Common.EdFi.ICreditTypeDescriptor, // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CreditTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -45925,19 +44714,33 @@ public class CreditTypeDescriptor : Entities.Common.EdFi.ICreditTypeDescriptor, //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CreditTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAcademicSubject.CourseTranscript + { + get { return _courseTranscript; } + set { SetCourseTranscript(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ICourseTranscript CourseTranscript { - get { return CreditTypeDescriptorId; } - set { CreditTypeDescriptorId = value; } + set { SetCourseTranscript(value); } + } + + private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + { + _courseTranscript = value; } + + /// + /// The subject area for the course transcript credits awarded in the course transcript. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -45952,7 +44755,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICreditTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptAcademicSubject; if (ReferenceEquals(this, compareTo)) return true; @@ -45960,9 +44763,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ICreditTypeDescriptor).CreditTypeDescriptorId.Equals(compareTo.CreditTypeDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) return false; @@ -45978,9 +44785,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_courseTranscript != null) + hash.Add(_courseTranscript); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICreditTypeDescriptor).CreditTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptAcademicSubject).AcademicSubjectDescriptor); return hash.ToHashCode(); } @@ -45989,55 +44799,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46063,11 +44824,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptAcademicSubject")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46078,13 +44836,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -46097,12 +44848,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CreditTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICreditTypeDescriptor)target); + return Entities.Common.EdFi.CourseTranscriptAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CreditTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICreditTypeDescriptor)target, null); + Entities.Common.EdFi.CourseTranscriptAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target, null); } // ------------------------------------------------------------- @@ -46110,6 +44861,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -46117,9 +44928,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CreditTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseTranscriptAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -46147,153 +44958,70 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the CrisisEvent resource. + /// A class which represents the edfi.CourseTranscriptAlternativeCourseIdentificationCode table of the CourseTranscript aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CrisisEventReference : IResourceReference + public class CourseTranscriptAlternativeCourseIdentificationCode : Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode, IValidatableObject { - [DataMember(Name="crisisEventName")] - public string CrisisEventName { get; set; } + private static FullName _fullName = new FullName("edfi", "CourseTranscriptAlternativeCourseIdentificationCode"); - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } + // Fluent validator instance (threadsafe) + private static CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator _validator = new CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + // ------------------------------------------------------------ - private Link _link; + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _link; - } + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseTranscript _courseTranscript; + + [IgnoreDataMember] + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAlternativeCourseIdentificationCode.CourseTranscript + { + get { return _courseTranscript; } + set { SetCourseTranscript(value); } } - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + public Entities.Common.EdFi.ICourseTranscript CourseTranscript { - return CrisisEventName != default(string); + set { SetCourseTranscript(value); } } - IEnumerable IResourceReference.GetUndefinedProperties() + private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) { - if (CrisisEventName == default) - { - yield return "CrisisEventName"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "CrisisEvent", - Href = $"/ed-fi/crisisEvents/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + _courseTranscript = value; } - } // Aggregate reference - - /// - /// A class which represents the edfi.CrisisEvent table of the CrisisEvent aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class CrisisEvent : Entities.Common.EdFi.ICrisisEvent, IHasETag, IDateVersionedEntity, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "CrisisEvent"); - - // Fluent validator instance (threadsafe) - private static CrisisEventPutPostRequestValidator _validator = new CrisisEventPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the CrisisEvent resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- /// - /// The name of the crisis event that occurred. If there is no generally accepted name for this crisis event, the suggested format: Location + Crisis type + Year. + /// A system that is used to identify the organization of subject matter and related learning experiences provided for the instruction of students. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="crisisEventName")] - public string CrisisEventName { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="courseIdentificationSystemDescriptor")][DescriptorExists("CourseIdentificationSystemDescriptor")] + public string CourseIdentificationSystemDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46308,7 +45036,7 @@ public class CrisisEvent : Entities.Common.EdFi.ICrisisEvent, IHasETag, IDateVer /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICrisisEvent; + var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode; if (ReferenceEquals(this, compareTo)) return true; @@ -46316,9 +45044,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) + return false; + // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICrisisEvent).CrisisEventName, compareTo.CrisisEventName)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode).CourseIdentificationSystemDescriptor, compareTo.CourseIdentificationSystemDescriptor)) return false; @@ -46334,9 +45066,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_courseTranscript != null) + hash.Add(_courseTranscript); // Standard Property - hash.Add((this as Entities.Common.EdFi.ICrisisEvent).CrisisEventName); + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode).CourseIdentificationSystemDescriptor); return hash.ToHashCode(); } @@ -46352,35 +45087,29 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Provides a textual description of the crisis event affecting the student. It may include details such as the nature of the crisis (e.g., natural disaster, conflict, medical emergency), its severity, location, and any other relevant information describing the crisis situation. + /// The organization code or name assigning the Identification Code. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="crisisDescription")] - public string CrisisDescription { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assigningOrganizationIdentificationCode")] + public string AssigningOrganizationIdentificationCode { get; set; } /// - /// The date on which the crisis ceased to affect the student. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The URL for the course catalog that defines the course identification code. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="crisisEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? CrisisEndDate { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="courseCatalogURL")] + public string CourseCatalogURL { get; set; } /// - /// The year, month and day on which the crisis affected the student. This date may not be the same as the date the crisis occurred if evacuation orders are implemented in anticipation of a crisis. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A unique number or alphanumeric code assigned to a course by a school, school system, state, or other agency or entity. For multi-part course codes, concatenate the parts separated by a \"/\". For example, consider the following SCED code- subject = 20 Math course = 272 Geometry level = G General credits = 1.00 course sequence 1 of 1- would be entered as 20/272/G/1.00/1 of 1. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="crisisStartDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? CrisisStartDate { get; set; } - - /// - /// The type or category of crisis. - /// - // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="crisisTypeDescriptor")][DescriptorExists("CrisisTypeDescriptor")] - public string CrisisTypeDescriptor { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46401,7 +45130,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CrisisEvent", "CrisisEvent")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptAlternativeCourseIdentificationCode")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -46413,13 +45142,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -46432,12 +45154,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CrisisEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICrisisEvent)target); + return Entities.Common.EdFi.CourseTranscriptAlternativeCourseIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CrisisEventMapper.MapTo(this, (Entities.Common.EdFi.ICrisisEvent)target, null); + Entities.Common.EdFi.CourseTranscriptAlternativeCourseIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target, null); } // ------------------------------------------------------------- @@ -46461,6 +45183,7 @@ void IMappable.Map(object target) try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -46511,9 +45234,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CrisisEventPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseTranscriptAlternativeCourseIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -46541,22 +45264,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CrisisTypeDescriptor table of the CrisisTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CourseTranscriptCourseProgram table of the CourseTranscript aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CrisisTypeDescriptor : Entities.Common.EdFi.ICrisisTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CourseTranscriptCourseProgram : Entities.Common.EdFi.ICourseTranscriptCourseProgram, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CrisisTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseTranscriptCourseProgram"); // Fluent validator instance (threadsafe) - private static CrisisTypeDescriptorPutPostRequestValidator _validator = new CrisisTypeDescriptorPutPostRequestValidator(); + private static CourseTranscriptCourseProgramPutPostRequestValidator _validator = new CourseTranscriptCourseProgramPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -46573,35 +45291,119 @@ public class CrisisTypeDescriptor : Entities.Common.EdFi.ICrisisTypeDescriptor, // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CrisisTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _courseProgramReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _courseProgramReference; + private Program.EdFi.ProgramReference ImplicitCourseProgramReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_courseProgramReference == null && !_courseProgramReferenceExplicitlyAssigned) + _courseProgramReference = new Program.EdFi.ProgramReference(); + + return _courseProgramReference; + } + } + + [DataMember(Name="courseProgramReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Program.EdFi.ProgramReference CourseProgramReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCourseProgramReference != null + && (_courseProgramReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseProgramReference.IsReferenceFullyDefined())) + return ImplicitCourseProgramReference; + + return null; + } + set + { + _courseProgramReferenceExplicitlyAssigned = true; + _courseProgramReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseTranscript _courseTranscript; + + [IgnoreDataMember] + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCourseProgram.CourseTranscript + { + get { return _courseTranscript; } + set { SetCourseTranscript(value); } + } + + public Entities.Common.EdFi.ICourseTranscript CourseTranscript + { + set { SetCourseTranscript(value); } + } + + private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + { + _courseTranscript = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_courseProgramReferenceExplicitlyAssigned) + { + ImplicitCourseProgramReference.EducationOrganizationId = _courseTranscript.CourseEducationOrganizationId; + } + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CrisisTypeDescriptorId { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramName + { + get + { + if (ImplicitCourseProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseProgramReference.IsReferenceFullyDefined())) + return ImplicitCourseProgramReference.ProgramName; - int IDescriptor.DescriptorId + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CourseProgram + _courseProgramReferenceExplicitlyAssigned = false; + ImplicitCourseProgramReference.ProgramName = value; + } + } + + /// + /// The type of program. + /// + + // IS in a reference (CourseTranscriptCourseProgram.CourseProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramTypeDescriptor { - get { return CrisisTypeDescriptorId; } - set { CrisisTypeDescriptorId = value; } + get + { + if (ImplicitCourseProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseProgramReference.IsReferenceFullyDefined())) + return ImplicitCourseProgramReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitCourseProgramReference.ProgramTypeDescriptor = value; + } } // ------------------------------------------------------------- @@ -46617,7 +45419,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICrisisTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptCourseProgram; if (ReferenceEquals(this, compareTo)) return true; @@ -46625,9 +45427,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ICrisisTypeDescriptor).CrisisTypeDescriptorId.Equals(compareTo.CrisisTypeDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramName, compareTo.CourseProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramTypeDescriptor, compareTo.CourseProgramTypeDescriptor)) return false; @@ -46643,9 +45454,15 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_courseTranscript != null) + hash.Add(_courseTranscript); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICrisisTypeDescriptor).CrisisTypeDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseProgramTypeDescriptor); return hash.ToHashCode(); } @@ -46654,55 +45471,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46728,11 +45496,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptCourseProgram")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46743,18 +45508,17 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -46762,19 +45526,127 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CrisisTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICrisisTypeDescriptor)target); + return Entities.Common.EdFi.CourseTranscriptCourseProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptCourseProgram)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CrisisTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICrisisTypeDescriptor)target, null); + Entities.Common.EdFi.CourseTranscriptCourseProgramMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptCourseProgram)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramResourceId + { + get { return null; } + set { ImplicitCourseProgramReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitCourseProgramReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForCourseEducationOrganizationId = GetCourseEducationOrganizationIdSources().ToArray(); + + if (!sourcesForCourseEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForCourseEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForCourseEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'courseEducationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForCourseEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetCourseEducationOrganizationIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.ICourseTranscriptCourseProgram).CourseTranscript.CourseEducationOrganizationId); + + // Obtain value from other references + var valueFromCourseProgramReference = this.CourseProgramReference?.EducationOrganizationId; + + if (valueFromCourseProgramReference != null) + { + yield return ("courseProgramReference.educationOrganizationId", this.CourseProgramReference.EducationOrganizationId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -46782,9 +45654,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CrisisTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseTranscriptCourseProgramPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -46812,22 +45684,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CTEProgramServiceDescriptor table of the CTEProgramServiceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CourseTranscriptCreditCategory table of the CourseTranscript aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CTEProgramServiceDescriptor : Entities.Common.EdFi.ICTEProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CourseTranscriptCreditCategory : Entities.Common.EdFi.ICourseTranscriptCreditCategory, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CTEProgramServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseTranscriptCreditCategory"); // Fluent validator instance (threadsafe) - private static CTEProgramServiceDescriptorPutPostRequestValidator _validator = new CTEProgramServiceDescriptorPutPostRequestValidator(); + private static CourseTranscriptCreditCategoryPutPostRequestValidator _validator = new CourseTranscriptCreditCategoryPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -46844,13 +45711,6 @@ public class CTEProgramServiceDescriptor : Entities.Common.EdFi.ICTEProgramServi // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CTEProgramServiceDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -46861,19 +45721,33 @@ public class CTEProgramServiceDescriptor : Entities.Common.EdFi.ICTEProgramServi //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CTEProgramServiceDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCreditCategory.CourseTranscript + { + get { return _courseTranscript; } + set { SetCourseTranscript(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ICourseTranscript CourseTranscript { - get { return CTEProgramServiceDescriptorId; } - set { CTEProgramServiceDescriptorId = value; } + set { SetCourseTranscript(value); } + } + + private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + { + _courseTranscript = value; } + + /// + /// A categorization for the course transcript credits awarded in the course transcript. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="creditCategoryDescriptor")][DescriptorExists("CreditCategoryDescriptor")] + public string CreditCategoryDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46888,7 +45762,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICTEProgramServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptCreditCategory; if (ReferenceEquals(this, compareTo)) return true; @@ -46896,9 +45770,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ICTEProgramServiceDescriptor).CTEProgramServiceDescriptorId.Equals(compareTo.CTEProgramServiceDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptCreditCategory).CreditCategoryDescriptor, compareTo.CreditCategoryDescriptor)) return false; @@ -46914,9 +45792,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_courseTranscript != null) + hash.Add(_courseTranscript); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICTEProgramServiceDescriptor).CTEProgramServiceDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptCreditCategory).CreditCategoryDescriptor); return hash.ToHashCode(); } @@ -46925,55 +45806,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -46999,11 +45831,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptCreditCategory")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47014,13 +45843,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -47033,12 +45855,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CTEProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICTEProgramServiceDescriptor)target); + return Entities.Common.EdFi.CourseTranscriptCreditCategoryMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptCreditCategory)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CTEProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICTEProgramServiceDescriptor)target, null); + Entities.Common.EdFi.CourseTranscriptCreditCategoryMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptCreditCategory)target, null); } // ------------------------------------------------------------- @@ -47046,6 +45868,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -47053,9 +45935,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CTEProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseTranscriptCreditCategoryPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -47083,22 +45965,18 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.CurriculumUsedDescriptor table of the CurriculumUsedDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CourseTranscriptEarnedAdditionalCredits table of the CourseTranscript aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class CurriculumUsedDescriptor : Entities.Common.EdFi.ICurriculumUsedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class CourseTranscriptEarnedAdditionalCredits : Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "CurriculumUsedDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseTranscriptEarnedAdditionalCredits"); // Fluent validator instance (threadsafe) - private static CurriculumUsedDescriptorPutPostRequestValidator _validator = new CurriculumUsedDescriptorPutPostRequestValidator(); + private static CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator _validator = new CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -47115,13 +45993,6 @@ public class CurriculumUsedDescriptor : Entities.Common.EdFi.ICurriculumUsedDesc // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the CurriculumUsedDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -47132,19 +46003,33 @@ public class CurriculumUsedDescriptor : Entities.Common.EdFi.ICurriculumUsedDesc //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int CurriculumUsedDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptEarnedAdditionalCredits.CourseTranscript + { + get { return _courseTranscript; } + set { SetCourseTranscript(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ICourseTranscript CourseTranscript { - get { return CurriculumUsedDescriptorId; } - set { CurriculumUsedDescriptorId = value; } + set { SetCourseTranscript(value); } + } + + private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + { + _courseTranscript = value; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="additionalCreditTypeDescriptor")][DescriptorExists("AdditionalCreditTypeDescriptor")] + public string AdditionalCreditTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47159,7 +46044,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ICurriculumUsedDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits; if (ReferenceEquals(this, compareTo)) return true; @@ -47167,9 +46052,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ICurriculumUsedDescriptor).CurriculumUsedDescriptorId.Equals(compareTo.CurriculumUsedDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits).AdditionalCreditTypeDescriptor, compareTo.AdditionalCreditTypeDescriptor)) return false; @@ -47185,9 +46074,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_courseTranscript != null) + hash.Add(_courseTranscript); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ICurriculumUsedDescriptor).CurriculumUsedDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits).AdditionalCreditTypeDescriptor); return hash.ToHashCode(); } @@ -47196,61 +46088,40 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _creditsExplicitlyAssigned = false; + private decimal _credits; /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The value of credits or units of value awarded for the completion of a course /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="credits")] + public decimal Credits + { + get => _credits; + set + { + _credits = value; + _creditsExplicitlyAssigned = true; + } + } - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_creditsExplicitlyAssigned) + { + yield return "Credits"; + } + } // ============================================================= // One-to-one relationships @@ -47270,11 +46141,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptEarnedAdditionalCredits")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47285,13 +46153,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -47304,12 +46165,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.CurriculumUsedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICurriculumUsedDescriptor)target); + return Entities.Common.EdFi.CourseTranscriptEarnedAdditionalCreditsMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.CurriculumUsedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICurriculumUsedDescriptor)target, null); + Entities.Common.EdFi.CourseTranscriptEarnedAdditionalCreditsMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target, null); } // ------------------------------------------------------------- @@ -47317,6 +46178,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -47324,9 +46245,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class CurriculumUsedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseTranscriptEarnedAdditionalCreditsPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -47354,22 +46275,18 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DeliveryMethodDescriptor table of the DeliveryMethodDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CourseTranscriptPartialCourseTranscriptAwards table of the CourseTranscript aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DeliveryMethodDescriptor : Entities.Common.EdFi.IDeliveryMethodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class CourseTranscriptPartialCourseTranscriptAwards : Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DeliveryMethodDescriptor"); + private static FullName _fullName = new FullName("edfi", "CourseTranscriptPartialCourseTranscriptAwards"); // Fluent validator instance (threadsafe) - private static DeliveryMethodDescriptorPutPostRequestValidator _validator = new DeliveryMethodDescriptorPutPostRequestValidator(); + private static CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator _validator = new CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -47386,13 +46303,6 @@ public class DeliveryMethodDescriptor : Entities.Common.EdFi.IDeliveryMethodDesc // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the DeliveryMethodDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -47403,19 +46313,32 @@ public class DeliveryMethodDescriptor : Entities.Common.EdFi.IDeliveryMethodDesc //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseTranscript _courseTranscript; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int DeliveryMethodDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptPartialCourseTranscriptAwards.CourseTranscript + { + get { return _courseTranscript; } + set { SetCourseTranscript(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ICourseTranscript CourseTranscript { - get { return DeliveryMethodDescriptorId; } - set { DeliveryMethodDescriptorId = value; } + set { SetCourseTranscript(value); } + } + + private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + { + _courseTranscript = value; } + + /// + /// The date the partial credits and/or grades were awarded or earned. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="awardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AwardDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47430,7 +46353,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDeliveryMethodDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards; if (ReferenceEquals(this, compareTo)) return true; @@ -47438,9 +46361,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IDeliveryMethodDescriptor).DeliveryMethodDescriptorId.Equals(compareTo.DeliveryMethodDescriptorId)) + // Standard Property + if (!(this as Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards).AwardDate.Equals(compareTo.AwardDate)) return false; @@ -47456,9 +46383,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_courseTranscript != null) + hash.Add(_courseTranscript); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IDeliveryMethodDescriptor).DeliveryMethodDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards).AwardDate); return hash.ToHashCode(); } @@ -47467,61 +46397,64 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _earnedCreditsExplicitlyAssigned = false; + private decimal _earnedCredits; /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The number of credits a student earned for completing a given course. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="earnedCredits")] + public decimal EarnedCredits + { + get => _earnedCredits; + set + { + _earnedCredits = value; + _earnedCreditsExplicitlyAssigned = true; + } + } + /// - /// The description of the descriptor. + /// The indicator of student performance as submitted by the instructor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="letterGradeEarned")] + public string LetterGradeEarned { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The method the credits were earned. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="methodCreditEarnedDescriptor")][DescriptorExists("MethodCreditEarnedDescriptor")] + public string MethodCreditEarnedDescriptor { get; set; } /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. + /// The indicator of student performance as submitted by the instructor. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="numericGradeEarned")] + public string NumericGradeEarned { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_earnedCreditsExplicitlyAssigned) + { + yield return "EarnedCredits"; + } + } // ============================================================= // One-to-one relationships @@ -47541,11 +46474,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptPartialCourseTranscriptAwards")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47556,13 +46486,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -47575,12 +46498,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DeliveryMethodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDeliveryMethodDescriptor)target); + return Entities.Common.EdFi.CourseTranscriptPartialCourseTranscriptAwardsMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DeliveryMethodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDeliveryMethodDescriptor)target, null); + Entities.Common.EdFi.CourseTranscriptPartialCourseTranscriptAwardsMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target, null); } // ------------------------------------------------------------- @@ -47588,6 +46511,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -47595,9 +46578,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DeliveryMethodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CourseTranscriptPartialCourseTranscriptAwardsPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -47625,129 +46608,512 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Descriptor resource. + /// A class which represents the edfi.CourseTranscriptSection table of the CourseTranscript aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DescriptorReference : IResourceReference + public class CourseTranscriptSection : Entities.Common.EdFi.ICourseTranscriptSection, IValidatableObject { - [DataMember(Name="descriptorId")] - public int DescriptorId { get; set; } + private static FullName _fullName = new FullName("edfi", "CourseTranscriptSection"); - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } + // Fluent validator instance (threadsafe) + private static CourseTranscriptSectionPutPostRequestValidator _validator = new CourseTranscriptSectionPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _sectionReferenceExplicitlyAssigned; + private Section.EdFi.SectionReference _sectionReference; + private Section.EdFi.SectionReference ImplicitSectionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) + _sectionReference = new Section.EdFi.SectionReference(); + + return _sectionReference; + } + } + + [DataMember(Name="sectionReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Section.EdFi.SectionReference SectionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSectionReference != null + && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference; + + return null; + } + set + { + _sectionReferenceExplicitlyAssigned = true; + _sectionReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ICourseTranscript _courseTranscript; + + [IgnoreDataMember] + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptSection.CourseTranscript + { + get { return _courseTranscript; } + set { SetCourseTranscript(value); } + } + + public Entities.Common.EdFi.ICourseTranscript CourseTranscript + { + set { SetCourseTranscript(value); } + } + + private void SetCourseTranscript(Entities.Common.EdFi.ICourseTranscript value) + { + _courseTranscript = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_sectionReferenceExplicitlyAssigned) + { + ImplicitSectionReference.SchoolYear = _courseTranscript.SchoolYear; + } + } /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. /// - public string Discriminator { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseTranscriptSection.LocalCourseCode + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.LocalCourseCode; + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - private Link _link; + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.LocalCourseCode = value; + } + } - [DataMember(Name="link")] - public Link Link + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ICourseTranscriptSection.SchoolId { get { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SchoolId; - return _link; + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolId = value; } } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// The local identifier assigned to a section. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseTranscriptSection.SectionIdentifier { - return DescriptorId != default(int); + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SectionIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SectionIdentifier = value; + } } - IEnumerable IResourceReference.GetUndefinedProperties() + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ICourseTranscriptSection.SessionName { - if (DescriptorId == default) + get { - yield return "DescriptorId"; + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SessionName; + + return default(string); } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SessionName = value; + } } + // ------------------------------------------------------------- - private Link CreateLink() + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - var link = new Link + var compareTo = obj as Entities.Common.EdFi.ICourseTranscriptSection; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_courseTranscript == null || !_courseTranscript.Equals(compareTo.CourseTranscript)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptSection).LocalCourseCode, compareTo.LocalCourseCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ICourseTranscriptSection).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptSection).SectionIdentifier, compareTo.SectionIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICourseTranscriptSection).SessionName, compareTo.SessionName)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_courseTranscript != null) + hash.Add(_courseTranscript); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).LocalCourseCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).SchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).SectionIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ICourseTranscriptSection).SessionName); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CourseTranscript", "CourseTranscriptSection")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.CourseTranscriptSectionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICourseTranscriptSection)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.CourseTranscriptSectionMapper.MapTo(this, (Entities.Common.EdFi.ICourseTranscriptSection)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ICourseTranscriptSection.SectionResourceId + { + get { return null; } + set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitSectionReference.Discriminator = value; } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - Rel = "Descriptor", - Href = $"/ed-fi/descriptors/{ResourceId:n}" - }; + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - if (string.IsNullOrEmpty(Discriminator)) - return link; + // ---------------------- + // Validate collections + // ---------------------- - string[] linkParts = Discriminator.Split('.'); + // --------------------------- + // Validate embedded objects + // --------------------------- - if (linkParts.Length < 2) - return link; + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); - return new Link + if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, short value)> GetSchoolYearSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.ICourseTranscriptSection).CourseTranscript.SchoolYear); + + // Obtain value from other references + var valueFromSectionReference = this.SectionReference?.SchoolYear; + + if (valueFromSectionReference != null) + { + yield return ("sectionReference.schoolYear", this.SectionReference.SchoolYear); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- } - } // Aggregate reference - + } // ================================================================= // Validators // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class CourseTranscriptSectionPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } // ----------------------------------------------------------------- } -// Aggregate: DescriptorMapping +// Aggregate: Credential -namespace EdFi.Ods.Api.Common.Models.Resources.DescriptorMapping.EdFi +namespace EdFi.Ods.Api.Common.Models.Resources.Credential.EdFi { /// - /// Represents a reference to the DescriptorMapping resource. + /// Represents a reference to the Credential resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class DescriptorMappingReference : IResourceReference + public class CredentialReference : IResourceReference { - [DataMember(Name="mappedNamespace")] - public string MappedNamespace { get; set; } - - [DataMember(Name="mappedValue")] - public string MappedValue { get; set; } - - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="credentialIdentifier")] + public string CredentialIdentifier { get; set; } - [DataMember(Name="value")] - public string Value { get; set; } + [DataMember(Name="stateOfIssueStateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string StateOfIssueStateAbbreviationDescriptor { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -47785,29 +47151,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return MappedNamespace != default(string) && MappedValue != default(string) && Namespace != default(string) && Value != default(string); + return CredentialIdentifier != default(string) && StateOfIssueStateAbbreviationDescriptor != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (MappedNamespace == default) - { - yield return "MappedNamespace"; - } - - if (MappedValue == default) - { - yield return "MappedValue"; - } - - if (Namespace == default) + if (CredentialIdentifier == default) { - yield return "Namespace"; + yield return "CredentialIdentifier"; } - if (Value == default) + if (StateOfIssueStateAbbreviationDescriptor == default) { - yield return "Value"; + yield return "StateOfIssueStateAbbreviationDescriptor"; } } @@ -47816,8 +47172,8 @@ private Link CreateLink() { var link = new Link { - Rel = "DescriptorMapping", - Href = $"/ed-fi/descriptorMappings/{ResourceId:n}" + Rel = "Credential", + Href = $"/ed-fi/credentials/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -47844,16 +47200,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.DescriptorMapping table of the DescriptorMapping aggregate in the ODS Database. + /// A class which represents the edfi.Credential table of the Credential aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DescriptorMapping : Entities.Common.EdFi.IDescriptorMapping, IHasETag, IDateVersionedEntity, IValidatableObject + public class Credential : Entities.Common.EdFi.ICredential, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DescriptorMapping"); + private static FullName _fullName = new FullName("edfi", "Credential"); // Fluent validator instance (threadsafe) - private static DescriptorMappingPutPostRequestValidator _validator = new DescriptorMappingPutPostRequestValidator(); + private static CredentialPutPostRequestValidator _validator = new CredentialPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -47864,9 +47220,11 @@ public class DescriptorMapping : Entities.Common.EdFi.IDescriptorMapping, IHasET // Constructor // ------------------------------------------------------------- - public DescriptorMapping() + public Credential() { - DescriptorMappingModelEntities = new List(); + CredentialAcademicSubjects = new List(); + CredentialEndorsements = new List(); + CredentialGradeLevels = new List(); } // ------------------------------------------------------------ @@ -47876,7 +47234,7 @@ public DescriptorMapping() // ------------------------------------------------------------ /// - /// The unique identifier for the DescriptorMapping resource. + /// The unique identifier for the Credential resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -47893,40 +47251,22 @@ public DescriptorMapping() // ------------------------------------------------------------- /// - /// The namespace of the descriptor value to which the from descriptor value is mapped to. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="mappedNamespace")] - public string MappedNamespace { get; set; } - - /// - /// The descriptor value to which the from descriptor value is being mapped to. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="mappedValue")] - public string MappedValue { get; set; } - - /// - /// The namespace of the descriptor value that is being mapped to another value. + /// Identifier or serial number assigned to the credential. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="credentialIdentifier")] + public string CredentialIdentifier { get; set; } /// - /// The descriptor value that is being mapped to another value. + /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which a license/credential was issued. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="value")] - public string Value { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="stateOfIssueStateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string StateOfIssueStateAbbreviationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -47941,7 +47281,7 @@ public DescriptorMapping() /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDescriptorMapping; + var compareTo = obj as Entities.Common.EdFi.ICredential; if (ReferenceEquals(this, compareTo)) return true; @@ -47951,22 +47291,12 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).MappedNamespace, compareTo.MappedNamespace)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).MappedValue, compareTo.MappedValue)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).Namespace, compareTo.Namespace)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICredential).CredentialIdentifier, compareTo.CredentialIdentifier)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).Value, compareTo.Value)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICredential).StateOfIssueStateAbbreviationDescriptor, compareTo.StateOfIssueStateAbbreviationDescriptor)) return false; @@ -47984,19 +47314,11 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).MappedNamespace); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).MappedValue); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).Namespace); + hash.Add((this as Entities.Common.EdFi.ICredential).CredentialIdentifier); // Standard Property - hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).Value); + hash.Add((this as Entities.Common.EdFi.ICredential).StateOfIssueStateAbbreviationDescriptor); return hash.ToHashCode(); } @@ -48010,6 +47332,70 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The field of certification for the certificate (e.g., Mathematics, Music). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="credentialFieldDescriptor")][DescriptorExists("CredentialFieldDescriptor")] + public string CredentialFieldDescriptor { get; set; } + + /// + /// An indication of the category of credential an individual holds. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="credentialTypeDescriptor")][DescriptorExists("CredentialTypeDescriptor")] + public string CredentialTypeDescriptor { get; set; } + + /// + /// The year, month and day on which an active credential held by an individual was issued. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveDate { get; set; } + + /// + /// The month, day, and year on which an active credential held by an individual will expire. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="expirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? ExpirationDate { get; set; } + + /// + /// The month, day, and year on which an active credential was issued to an individual. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="issuanceDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime IssuanceDate { get; set; } + + /// + /// Namespace for the credential. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// An indication of the pre-determined criteria for granting the teaching credential that an individual holds. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="teachingCredentialBasisDescriptor")][DescriptorExists("TeachingCredentialBasisDescriptor")] + public string TeachingCredentialBasisDescriptor { get; set; } + + /// + /// An indication of the category of a legal document giving authorization to perform teaching assignment services. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="teachingCredentialDescriptor")][DescriptorExists("TeachingCredentialDescriptor")] + public string TeachingCredentialDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48030,41 +47416,101 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DescriptorMapping", "DescriptorMapping")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "Credential")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _descriptorMappingModelEntities; - private ICollection _descriptorMappingModelEntitiesCovariant; + private ICollection _credentialAcademicSubjects; + private ICollection _credentialAcademicSubjectsCovariant; [NoDuplicateMembers] - [DataMember(Name="modelEntities")] - public ICollection DescriptorMappingModelEntities + [DataMember(Name="academicSubjects")] + public ICollection CredentialAcademicSubjects { - get { return _descriptorMappingModelEntities; } + get { return _credentialAcademicSubjects; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IDescriptorMappingModelEntity)e.Item).DescriptorMapping = this); - _descriptorMappingModelEntities = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICredentialAcademicSubject)e.Item).Credential = this); + _credentialAcademicSubjects = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDescriptorMappingModelEntity)e.Item).DescriptorMapping = this; - _descriptorMappingModelEntitiesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICredentialAcademicSubject)e.Item).Credential = this; + _credentialAcademicSubjectsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDescriptorMapping.DescriptorMappingModelEntities + ICollection Entities.Common.EdFi.ICredential.CredentialAcademicSubjects { - get { return _descriptorMappingModelEntitiesCovariant; } - set { DescriptorMappingModelEntities = new List(value.Cast()); } + get { return _credentialAcademicSubjectsCovariant; } + set { CredentialAcademicSubjects = new List(value.Cast()); } + } + + private ICollection _credentialEndorsements; + private ICollection _credentialEndorsementsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="endorsements")] + public ICollection CredentialEndorsements + { + get { return _credentialEndorsements; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICredentialEndorsement)e.Item).Credential = this); + _credentialEndorsements = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICredentialEndorsement)e.Item).Credential = this; + _credentialEndorsementsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialEndorsements + { + get { return _credentialEndorsementsCovariant; } + set { CredentialEndorsements = new List(value.Cast()); } + } + + private ICollection _credentialGradeLevels; + private ICollection _credentialGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="gradeLevels")] + public ICollection CredentialGradeLevels + { + get { return _credentialGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ICredentialGradeLevel)e.Item).Credential = this); + _credentialGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ICredentialGradeLevel)e.Item).Credential = this; + _credentialGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialGradeLevels + { + get { return _credentialGradeLevelsCovariant; } + set { CredentialGradeLevels = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -48089,9 +47535,19 @@ public ICollection DescriptorMappingModelEntities internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_descriptorMappingModelEntities != null) foreach (var item in _descriptorMappingModelEntities) + if (_credentialAcademicSubjects != null) foreach (var item in _credentialAcademicSubjects) { - item.DescriptorMapping = this; + item.Credential = this; + } + + if (_credentialEndorsements != null) foreach (var item in _credentialEndorsements) + { + item.Credential = this; + } + + if (_credentialGradeLevels != null) foreach (var item in _credentialGradeLevels) + { + item.Credential = this; } } @@ -48102,12 +47558,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DescriptorMappingMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDescriptorMapping)target); + return Entities.Common.EdFi.CredentialMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredential)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DescriptorMappingMapper.MapTo(this, (Entities.Common.EdFi.IDescriptorMapping)target, null); + Entities.Common.EdFi.CredentialMapper.MapTo(this, (Entities.Common.EdFi.ICredential)target, null); } // ------------------------------------------------------------- @@ -48136,13 +47592,37 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (DescriptorMappingModelEntities.Any() && mappingContract?.IsMemberSupported("DescriptorMappingModelEntities") != false) + if (CredentialAcademicSubjects.Any() && mappingContract?.IsMemberSupported("CredentialAcademicSubjects") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("DescriptorMappingModelEntities"); + pathBuilder.Append("CredentialAcademicSubjects"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DescriptorMappingModelEntities, validationContext, validationContext.Items.ForCollection("DescriptorMappingModelEntities")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CredentialAcademicSubjects, validationContext, validationContext.Items.ForCollection("CredentialAcademicSubjects")))) + { + yield return result; + } + } + + if (CredentialEndorsements.Any() && mappingContract?.IsMemberSupported("CredentialEndorsements") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CredentialEndorsements"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CredentialEndorsements, validationContext, validationContext.Items.ForCollection("CredentialEndorsements")))) + { + yield return result; + } + } + + if (CredentialGradeLevels.Any() && mappingContract?.IsMemberSupported("CredentialGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("CredentialGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(CredentialGradeLevels, validationContext, validationContext.Items.ForCollection("CredentialGradeLevels")))) { yield return result; } @@ -48193,14 +47673,16 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DescriptorMappingPutPostRequestValidator : FluentValidation.AbstractValidator + public class CredentialPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_DescriptorMapping = new FullName("edfi", "DescriptorMapping"); + private static readonly FullName _fullName_edfi_Credential = new FullName("edfi", "Credential"); // Declare collection item validators - private DescriptorMappingModelEntityPutPostRequestValidator _descriptorMappingModelEntitiesValidator = new (); + private CredentialAcademicSubjectPutPostRequestValidator _credentialAcademicSubjectsValidator = new (); + private CredentialEndorsementPutPostRequestValidator _credentialEndorsementsValidator = new (); + private CredentialGradeLevelPutPostRequestValidator _credentialGradeLevelsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -48217,19 +47699,41 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsDescriptorMappingModelEntityIncluded(x)); + var hasInvalidCredentialAcademicSubjectsItems = instance.CredentialAcademicSubjects.Any(x => !mappingContract.IsCredentialAcademicSubjectIncluded(x)); - if (hasInvalidDescriptorMappingModelEntitiesItems) + if (hasInvalidCredentialAcademicSubjectsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("DescriptorMappingModelEntities", $"A supplied 'DescriptorMappingModelEntity' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("CredentialAcademicSubjects", $"A supplied 'CredentialAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCredentialEndorsementIncluded != null) + { + var hasInvalidCredentialEndorsementsItems = instance.CredentialEndorsements.Any(x => !mappingContract.IsCredentialEndorsementIncluded(x)); + + if (hasInvalidCredentialEndorsementsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CredentialEndorsements", $"A supplied 'CredentialEndorsement' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsCredentialGradeLevelIncluded != null) + { + var hasInvalidCredentialGradeLevelsItems = instance.CredentialGradeLevels.Any(x => !mappingContract.IsCredentialGradeLevelIncluded(x)); + + if (hasInvalidCredentialGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("CredentialGradeLevels", $"A supplied 'CredentialGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -48251,16 +47755,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DescriptorMappingModelEntity table of the DescriptorMapping aggregate in the ODS Database. + /// A class which represents the edfi.CredentialAcademicSubject table of the Credential aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DescriptorMappingModelEntity : Entities.Common.EdFi.IDescriptorMappingModelEntity, IValidatableObject + public class CredentialAcademicSubject : Entities.Common.EdFi.ICredentialAcademicSubject, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DescriptorMappingModelEntity"); + private static FullName _fullName = new FullName("edfi", "CredentialAcademicSubject"); // Fluent validator instance (threadsafe) - private static DescriptorMappingModelEntityPutPostRequestValidator _validator = new DescriptorMappingModelEntityPutPostRequestValidator(); + private static CredentialAcademicSubjectPutPostRequestValidator _validator = new CredentialAcademicSubjectPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -48287,33 +47791,33 @@ public class DescriptorMappingModelEntity : Entities.Common.EdFi.IDescriptorMapp //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IDescriptorMapping _descriptorMapping; + private Entities.Common.EdFi.ICredential _credential; [IgnoreDataMember] - Entities.Common.EdFi.IDescriptorMapping IDescriptorMappingModelEntity.DescriptorMapping + Entities.Common.EdFi.ICredential ICredentialAcademicSubject.Credential { - get { return _descriptorMapping; } - set { SetDescriptorMapping(value); } + get { return _credential; } + set { SetCredential(value); } } - public Entities.Common.EdFi.IDescriptorMapping DescriptorMapping + public Entities.Common.EdFi.ICredential Credential { - set { SetDescriptorMapping(value); } + set { SetCredential(value); } } - private void SetDescriptorMapping(Entities.Common.EdFi.IDescriptorMapping value) + private void SetCredential(Entities.Common.EdFi.ICredential value) { - _descriptorMapping = value; + _credential = value; } /// - /// The resources for which the descriptor mapping applies. If empty, the mapping is assumed to be applicable to all resources in which the descriptor appears. + /// The academic subjects to which the credential pertains. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="modelEntityDescriptor")][DescriptorExists("ModelEntityDescriptor")] - public string ModelEntityDescriptor { get; set; } + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48328,7 +47832,7 @@ private void SetDescriptorMapping(Entities.Common.EdFi.IDescriptorMapping value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDescriptorMappingModelEntity; + var compareTo = obj as Entities.Common.EdFi.ICredentialAcademicSubject; if (ReferenceEquals(this, compareTo)) return true; @@ -48337,12 +47841,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_descriptorMapping == null || !_descriptorMapping.Equals(compareTo.DescriptorMapping)) + if (_credential == null || !_credential.Equals(compareTo.Credential)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDescriptorMappingModelEntity).ModelEntityDescriptor, compareTo.ModelEntityDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICredentialAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) return false; @@ -48359,11 +47863,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_descriptorMapping != null) - hash.Add(_descriptorMapping); + if (_credential != null) + hash.Add(_credential); // Standard Property - hash.Add((this as Entities.Common.EdFi.IDescriptorMappingModelEntity).ModelEntityDescriptor); + hash.Add((this as Entities.Common.EdFi.ICredentialAcademicSubject).AcademicSubjectDescriptor); return hash.ToHashCode(); } @@ -48397,7 +47901,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DescriptorMapping", "DescriptorMappingModelEntity")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "CredentialAcademicSubject")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -48421,12 +47925,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DescriptorMappingModelEntityMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDescriptorMappingModelEntity)target); + return Entities.Common.EdFi.CredentialAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialAcademicSubject)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DescriptorMappingModelEntityMapper.MapTo(this, (Entities.Common.EdFi.IDescriptorMappingModelEntity)target, null); + Entities.Common.EdFi.CredentialAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ICredentialAcademicSubject)target, null); } // ------------------------------------------------------------- @@ -48501,9 +48005,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DescriptorMappingModelEntityPutPostRequestValidator : FluentValidation.AbstractValidator + public class CredentialAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -48531,22 +48035,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DiagnosisDescriptor table of the DiagnosisDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CredentialEndorsement table of the Credential aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DiagnosisDescriptor : Entities.Common.EdFi.IDiagnosisDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CredentialEndorsement : Entities.Common.EdFi.ICredentialEndorsement, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DiagnosisDescriptor"); + private static FullName _fullName = new FullName("edfi", "CredentialEndorsement"); // Fluent validator instance (threadsafe) - private static DiagnosisDescriptorPutPostRequestValidator _validator = new DiagnosisDescriptorPutPostRequestValidator(); + private static CredentialEndorsementPutPostRequestValidator _validator = new CredentialEndorsementPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -48563,13 +48062,6 @@ public class DiagnosisDescriptor : Entities.Common.EdFi.IDiagnosisDescriptor, En // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the DiagnosisDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -48580,19 +48072,33 @@ public class DiagnosisDescriptor : Entities.Common.EdFi.IDiagnosisDescriptor, En //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICredential _credential; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int DiagnosisDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential + { + get { return _credential; } + set { SetCredential(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ICredential Credential { - get { return DiagnosisDescriptorId; } - set { DiagnosisDescriptorId = value; } + set { SetCredential(value); } } + + private void SetCredential(Entities.Common.EdFi.ICredential value) + { + _credential = value; + } + + /// + /// Endorsements are attachments to teaching certificates and indicate areas of specialization. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="credentialEndorsement")][Display(Name="CredentialEndorsement")] + public string CredentialEndorsementX { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48607,7 +48113,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDiagnosisDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICredentialEndorsement; if (ReferenceEquals(this, compareTo)) return true; @@ -48615,9 +48121,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_credential == null || !_credential.Equals(compareTo.Credential)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IDiagnosisDescriptor).DiagnosisDescriptorId.Equals(compareTo.DiagnosisDescriptorId)) + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICredentialEndorsement).CredentialEndorsementX, compareTo.CredentialEndorsementX)) return false; @@ -48633,9 +48143,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_credential != null) + hash.Add(_credential); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IDiagnosisDescriptor).DiagnosisDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICredentialEndorsement).CredentialEndorsementX); return hash.ToHashCode(); } @@ -48644,55 +48157,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48718,11 +48182,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "CredentialEndorsement")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48733,13 +48194,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -48752,12 +48206,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DiagnosisDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDiagnosisDescriptor)target); + return Entities.Common.EdFi.CredentialEndorsementMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialEndorsement)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DiagnosisDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDiagnosisDescriptor)target, null); + Entities.Common.EdFi.CredentialEndorsementMapper.MapTo(this, (Entities.Common.EdFi.ICredentialEndorsement)target, null); } // ------------------------------------------------------------- @@ -48765,6 +48219,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -48772,9 +48286,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DiagnosisDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CredentialEndorsementPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -48802,22 +48316,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DiplomaLevelDescriptor table of the DiplomaLevelDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CredentialGradeLevel table of the Credential aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DiplomaLevelDescriptor : Entities.Common.EdFi.IDiplomaLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CredentialGradeLevel : Entities.Common.EdFi.ICredentialGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DiplomaLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "CredentialGradeLevel"); // Fluent validator instance (threadsafe) - private static DiplomaLevelDescriptorPutPostRequestValidator _validator = new DiplomaLevelDescriptorPutPostRequestValidator(); + private static CredentialGradeLevelPutPostRequestValidator _validator = new CredentialGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -48834,13 +48343,6 @@ public class DiplomaLevelDescriptor : Entities.Common.EdFi.IDiplomaLevelDescript // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the DiplomaLevelDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -48851,19 +48353,33 @@ public class DiplomaLevelDescriptor : Entities.Common.EdFi.IDiplomaLevelDescript //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ICredential _credential; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int DiplomaLevelDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ICredential ICredentialGradeLevel.Credential + { + get { return _credential; } + set { SetCredential(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ICredential Credential { - get { return DiplomaLevelDescriptorId; } - set { DiplomaLevelDescriptorId = value; } + set { SetCredential(value); } + } + + private void SetCredential(Entities.Common.EdFi.ICredential value) + { + _credential = value; } + + /// + /// The grade level(s) certified for teaching. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48878,7 +48394,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDiplomaLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICredentialGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -48886,9 +48402,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_credential == null || !_credential.Equals(compareTo.Credential)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IDiplomaLevelDescriptor).DiplomaLevelDescriptorId.Equals(compareTo.DiplomaLevelDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ICredentialGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -48904,9 +48424,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_credential != null) + hash.Add(_credential); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IDiplomaLevelDescriptor).DiplomaLevelDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ICredentialGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -48915,55 +48438,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -48989,11 +48463,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Credential", "CredentialGradeLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -49004,13 +48475,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -49023,12 +48487,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DiplomaLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDiplomaLevelDescriptor)target); + return Entities.Common.EdFi.CredentialGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DiplomaLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDiplomaLevelDescriptor)target, null); + Entities.Common.EdFi.CredentialGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ICredentialGradeLevel)target, null); } // ------------------------------------------------------------- @@ -49036,6 +48500,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -49043,9 +48567,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DiplomaLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CredentialGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -49074,21 +48598,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DiplomaTypeDescriptor table of the DiplomaTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CredentialFieldDescriptor table of the CredentialFieldDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DiplomaTypeDescriptor : Entities.Common.EdFi.IDiplomaTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CredentialFieldDescriptor : Entities.Common.EdFi.ICredentialFieldDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DiplomaTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CredentialFieldDescriptor"); // Fluent validator instance (threadsafe) - private static DiplomaTypeDescriptorPutPostRequestValidator _validator = new DiplomaTypeDescriptorPutPostRequestValidator(); + private static CredentialFieldDescriptorPutPostRequestValidator _validator = new CredentialFieldDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -49107,7 +48631,7 @@ public class DiplomaTypeDescriptor : Entities.Common.EdFi.IDiplomaTypeDescriptor // ------------------------------------------------------------ /// - /// The unique identifier for the DiplomaTypeDescriptor resource. + /// The unique identifier for the CredentialFieldDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -49128,12 +48652,12 @@ public class DiplomaTypeDescriptor : Entities.Common.EdFi.IDiplomaTypeDescriptor /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int DiplomaTypeDescriptorId { get; set; } + public int CredentialFieldDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return DiplomaTypeDescriptorId; } - set { DiplomaTypeDescriptorId = value; } + get { return CredentialFieldDescriptorId; } + set { CredentialFieldDescriptorId = value; } } // ------------------------------------------------------------- @@ -49149,7 +48673,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDiplomaTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICredentialFieldDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -49159,7 +48683,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IDiplomaTypeDescriptor).DiplomaTypeDescriptorId.Equals(compareTo.DiplomaTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.ICredentialFieldDescriptor).CredentialFieldDescriptorId.Equals(compareTo.CredentialFieldDescriptorId)) return false; @@ -49177,7 +48701,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IDiplomaTypeDescriptor).DiplomaTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICredentialFieldDescriptor).CredentialFieldDescriptorId); return hash.ToHashCode(); } @@ -49294,12 +48818,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DiplomaTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDiplomaTypeDescriptor)target); + return Entities.Common.EdFi.CredentialFieldDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialFieldDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DiplomaTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDiplomaTypeDescriptor)target, null); + Entities.Common.EdFi.CredentialFieldDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICredentialFieldDescriptor)target, null); } // ------------------------------------------------------------- @@ -49314,9 +48838,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DiplomaTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CredentialFieldDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -49345,21 +48869,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisabilityDescriptor table of the DisabilityDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CredentialTypeDescriptor table of the CredentialTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisabilityDescriptor : Entities.Common.EdFi.IDisabilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CredentialTypeDescriptor : Entities.Common.EdFi.ICredentialTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisabilityDescriptor"); + private static FullName _fullName = new FullName("edfi", "CredentialTypeDescriptor"); // Fluent validator instance (threadsafe) - private static DisabilityDescriptorPutPostRequestValidator _validator = new DisabilityDescriptorPutPostRequestValidator(); + private static CredentialTypeDescriptorPutPostRequestValidator _validator = new CredentialTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -49378,7 +48902,7 @@ public class DisabilityDescriptor : Entities.Common.EdFi.IDisabilityDescriptor, // ------------------------------------------------------------ /// - /// The unique identifier for the DisabilityDescriptor resource. + /// The unique identifier for the CredentialTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -49399,12 +48923,12 @@ public class DisabilityDescriptor : Entities.Common.EdFi.IDisabilityDescriptor, /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int DisabilityDescriptorId { get; set; } + public int CredentialTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return DisabilityDescriptorId; } - set { DisabilityDescriptorId = value; } + get { return CredentialTypeDescriptorId; } + set { CredentialTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -49420,7 +48944,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisabilityDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICredentialTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -49430,7 +48954,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IDisabilityDescriptor).DisabilityDescriptorId.Equals(compareTo.DisabilityDescriptorId)) + if (!(this as Entities.Common.EdFi.ICredentialTypeDescriptor).CredentialTypeDescriptorId.Equals(compareTo.CredentialTypeDescriptorId)) return false; @@ -49448,7 +48972,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IDisabilityDescriptor).DisabilityDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICredentialTypeDescriptor).CredentialTypeDescriptorId); return hash.ToHashCode(); } @@ -49565,12 +49089,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisabilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisabilityDescriptor)target); + return Entities.Common.EdFi.CredentialTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICredentialTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisabilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisabilityDescriptor)target, null); + Entities.Common.EdFi.CredentialTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICredentialTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -49585,9 +49109,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisabilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CredentialTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -49616,21 +49140,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisabilityDesignationDescriptor table of the DisabilityDesignationDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CreditCategoryDescriptor table of the CreditCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisabilityDesignationDescriptor : Entities.Common.EdFi.IDisabilityDesignationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CreditCategoryDescriptor : Entities.Common.EdFi.ICreditCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisabilityDesignationDescriptor"); + private static FullName _fullName = new FullName("edfi", "CreditCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static DisabilityDesignationDescriptorPutPostRequestValidator _validator = new DisabilityDesignationDescriptorPutPostRequestValidator(); + private static CreditCategoryDescriptorPutPostRequestValidator _validator = new CreditCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -49649,7 +49173,7 @@ public class DisabilityDesignationDescriptor : Entities.Common.EdFi.IDisabilityD // ------------------------------------------------------------ /// - /// The unique identifier for the DisabilityDesignationDescriptor resource. + /// The unique identifier for the CreditCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -49670,12 +49194,12 @@ public class DisabilityDesignationDescriptor : Entities.Common.EdFi.IDisabilityD /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int DisabilityDesignationDescriptorId { get; set; } + public int CreditCategoryDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return DisabilityDesignationDescriptorId; } - set { DisabilityDesignationDescriptorId = value; } + get { return CreditCategoryDescriptorId; } + set { CreditCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -49691,7 +49215,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisabilityDesignationDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICreditCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -49701,7 +49225,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IDisabilityDesignationDescriptor).DisabilityDesignationDescriptorId.Equals(compareTo.DisabilityDesignationDescriptorId)) + if (!(this as Entities.Common.EdFi.ICreditCategoryDescriptor).CreditCategoryDescriptorId.Equals(compareTo.CreditCategoryDescriptorId)) return false; @@ -49719,7 +49243,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IDisabilityDesignationDescriptor).DisabilityDesignationDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICreditCategoryDescriptor).CreditCategoryDescriptorId); return hash.ToHashCode(); } @@ -49836,12 +49360,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisabilityDesignationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisabilityDesignationDescriptor)target); + return Entities.Common.EdFi.CreditCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICreditCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisabilityDesignationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisabilityDesignationDescriptor)target, null); + Entities.Common.EdFi.CreditCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICreditCategoryDescriptor)target, null); } // ------------------------------------------------------------- @@ -49856,9 +49380,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisabilityDesignationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CreditCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -49887,21 +49411,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisabilityDeterminationSourceTypeDescriptor table of the DisabilityDeterminationSourceTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.CreditTypeDescriptor table of the CreditTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisabilityDeterminationSourceTypeDescriptor : Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class CreditTypeDescriptor : Entities.Common.EdFi.ICreditTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisabilityDeterminationSourceTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "CreditTypeDescriptor"); // Fluent validator instance (threadsafe) - private static DisabilityDeterminationSourceTypeDescriptorPutPostRequestValidator _validator = new DisabilityDeterminationSourceTypeDescriptorPutPostRequestValidator(); + private static CreditTypeDescriptorPutPostRequestValidator _validator = new CreditTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -49920,7 +49444,7 @@ public class DisabilityDeterminationSourceTypeDescriptor : Entities.Common.EdFi. // ------------------------------------------------------------ /// - /// The unique identifier for the DisabilityDeterminationSourceTypeDescriptor resource. + /// The unique identifier for the CreditTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -49941,12 +49465,12 @@ public class DisabilityDeterminationSourceTypeDescriptor : Entities.Common.EdFi. /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int DisabilityDeterminationSourceTypeDescriptorId { get; set; } + public int CreditTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return DisabilityDeterminationSourceTypeDescriptorId; } - set { DisabilityDeterminationSourceTypeDescriptorId = value; } + get { return CreditTypeDescriptorId; } + set { CreditTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -49962,7 +49486,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ICreditTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -49972,7 +49496,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor).DisabilityDeterminationSourceTypeDescriptorId.Equals(compareTo.DisabilityDeterminationSourceTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.ICreditTypeDescriptor).CreditTypeDescriptorId.Equals(compareTo.CreditTypeDescriptorId)) return false; @@ -49990,7 +49514,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor).DisabilityDeterminationSourceTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.ICreditTypeDescriptor).CreditTypeDescriptorId); return hash.ToHashCode(); } @@ -50107,12 +49631,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisabilityDeterminationSourceTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target); + return Entities.Common.EdFi.CreditTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICreditTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisabilityDeterminationSourceTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target, null); + Entities.Common.EdFi.CreditTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICreditTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -50127,9 +49651,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisabilityDeterminationSourceTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class CreditTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -50158,34 +49682,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the DisciplineAction resource. + /// Represents a reference to the CrisisEvent resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class DisciplineActionReference : IResourceReference + public class CrisisEventReference : IResourceReference { - [DataMember(Name="disciplineActionIdentifier")] - public string DisciplineActionIdentifier { get; set; } - - [DataMember(Name="disciplineDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime DisciplineDate { get; set; } - - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; + [DataMember(Name="crisisEventName")] + public string CrisisEventName { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -50223,24 +49732,14 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return DisciplineActionIdentifier != default(string) && DisciplineDate != default(DateTime) && StudentUniqueId != default(string); + return CrisisEventName != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (DisciplineActionIdentifier == default) - { - yield return "DisciplineActionIdentifier"; - } - - if (DisciplineDate == default) - { - yield return "DisciplineDate"; - } - - if (StudentUniqueId == default) + if (CrisisEventName == default) { - yield return "StudentUniqueId"; + yield return "CrisisEventName"; } } @@ -50249,8 +49748,8 @@ private Link CreateLink() { var link = new Link { - Rel = "DisciplineAction", - Href = $"/ed-fi/disciplineActions/{ResourceId:n}" + Rel = "CrisisEvent", + Href = $"/ed-fi/crisisEvents/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -50277,16 +49776,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.DisciplineAction table of the DisciplineAction aggregate in the ODS Database. + /// A class which represents the edfi.CrisisEvent table of the CrisisEvent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineAction : Entities.Common.EdFi.IDisciplineAction, IHasETag, IDateVersionedEntity, IValidatableObject + public class CrisisEvent : Entities.Common.EdFi.ICrisisEvent, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DisciplineAction"); + private static FullName _fullName = new FullName("edfi", "CrisisEvent"); // Fluent validator instance (threadsafe) - private static DisciplineActionPutPostRequestValidator _validator = new DisciplineActionPutPostRequestValidator(); + private static CrisisEventPutPostRequestValidator _validator = new CrisisEventPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -50297,12 +49796,6 @@ public class DisciplineAction : Entities.Common.EdFi.IDisciplineAction, IHasETag // Constructor // ------------------------------------------------------------- - public DisciplineAction() - { - DisciplineActionDisciplines = new List(); - DisciplineActionStaffs = new List(); - DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new List(); - } // ------------------------------------------------------------ @@ -50311,7 +49804,7 @@ public DisciplineAction() // ------------------------------------------------------------ /// - /// The unique identifier for the DisciplineAction resource. + /// The unique identifier for the CrisisEvent resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -50321,106 +49814,6 @@ public DisciplineAction() // ============================================================= // References // ------------------------------------------------------------- - - private bool _assignmentSchoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _assignmentSchoolReference; - private School.EdFi.SchoolReference ImplicitAssignmentSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_assignmentSchoolReference == null && !_assignmentSchoolReferenceExplicitlyAssigned) - _assignmentSchoolReference = new School.EdFi.SchoolReference(); - - return _assignmentSchoolReference; - } - } - - [DataMember(Name="assignmentSchoolReference")] - [FullyDefinedReference] - public School.EdFi.SchoolReference AssignmentSchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitAssignmentSchoolReference != null - && (_assignmentSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssignmentSchoolReference.IsReferenceFullyDefined())) - return ImplicitAssignmentSchoolReference; - - return null; - } - set - { - _assignmentSchoolReferenceExplicitlyAssigned = true; - _assignmentSchoolReference = value; - } - } - private bool _responsibilitySchoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _responsibilitySchoolReference; - private School.EdFi.SchoolReference ImplicitResponsibilitySchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_responsibilitySchoolReference == null && !_responsibilitySchoolReferenceExplicitlyAssigned) - _responsibilitySchoolReference = new School.EdFi.SchoolReference(); - - return _responsibilitySchoolReference; - } - } - - [DataMember(Name="responsibilitySchoolReference")] - [FullyDefinedReference][RequiredReference("edfi", "DisciplineAction")] - public School.EdFi.SchoolReference ResponsibilitySchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitResponsibilitySchoolReference != null - && (_responsibilitySchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitResponsibilitySchoolReference.IsReferenceFullyDefined())) - return ImplicitResponsibilitySchoolReference; - - return null; - } - set - { - _responsibilitySchoolReferenceExplicitlyAssigned = true; - _responsibilitySchoolReference = value; - } - } - private bool _studentReferenceExplicitlyAssigned; - private Student.EdFi.StudentReference _studentReference; - private Student.EdFi.StudentReference ImplicitStudentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentReference == null && !_studentReferenceExplicitlyAssigned) - _studentReference = new Student.EdFi.StudentReference(); - - return _studentReference; - } - } - - [DataMember(Name="studentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Student.EdFi.StudentReference StudentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentReference != null - && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference; - - return null; - } - set - { - _studentReferenceExplicitlyAssigned = true; - _studentReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -50428,47 +49821,13 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// Identifier assigned by the education organization to the discipline action. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="disciplineActionIdentifier")] - public string DisciplineActionIdentifier { get; set; } - - /// - /// The date of the discipline action. + /// The name of the crisis event that occurred. If there is no generally accepted name for this crisis event, the suggested format: Location + Crisis type + Year. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="disciplineDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime DisciplineDate { get; set; } - - /// - /// A unique alphanumeric code assigned to a student. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IDisciplineAction.StudentUniqueId - { - get - { - if (ImplicitStudentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Student - _studentReferenceExplicitlyAssigned = false; - ImplicitStudentReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="crisisEventName")] + public string CrisisEventName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -50483,7 +49842,7 @@ string Entities.Common.EdFi.IDisciplineAction.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineAction; + var compareTo = obj as Entities.Common.EdFi.ICrisisEvent; if (ReferenceEquals(this, compareTo)) return true; @@ -50493,17 +49852,7 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineAction).DisciplineActionIdentifier, compareTo.DisciplineActionIdentifier)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IDisciplineAction).DisciplineDate.Equals(compareTo.DisciplineDate)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineAction).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ICrisisEvent).CrisisEventName, compareTo.CrisisEventName)) return false; @@ -50521,15 +49870,8 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineAction).DisciplineActionIdentifier); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineAction).DisciplineDate); - + hash.Add((this as Entities.Common.EdFi.ICrisisEvent).CrisisEventName); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IDisciplineAction).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -50544,96 +49886,35 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Indicates the actual length in school days of a student's disciplinary assignment. + /// Provides a textual description of the crisis event affecting the student. It may include details such as the nature of the crisis (e.g., natural disaster, conflict, medical emergency), its severity, location, and any other relevant information describing the crisis situation. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="actualDisciplineActionLength")] - public decimal? ActualDisciplineActionLength { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="crisisDescription")] + public string CrisisDescription { get; set; } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The date on which the crisis ceased to affect the student. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolId - { - get - { - if (ImplicitAssignmentSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssignmentSchoolReference.IsReferenceFullyDefined())) - { - return ImplicitAssignmentSchoolReference.SchoolId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // AssignmentSchool - _assignmentSchoolReferenceExplicitlyAssigned = false; - ImplicitAssignmentSchoolReference.SchoolId = value.GetValueOrDefault(); - } - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="crisisEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? CrisisEndDate { get; set; } /// - /// The length of time in school days for the discipline action (e.g. removal, detention), if applicable. + /// The year, month and day on which the crisis affected the student. This date may not be the same as the date the crisis occurred if evacuation orders are implemented in anticipation of a crisis. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="disciplineActionLength")] - public decimal? DisciplineActionLength { get; set; } + [DataMember(Name="crisisStartDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? CrisisStartDate { get; set; } /// - /// Indicates the reason for the difference, if any, between the official and actual lengths of a student's disciplinary assignment. + /// The type or category of crisis. /// // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="disciplineActionLengthDifferenceReasonDescriptor")][DescriptorExists("DisciplineActionLengthDifferenceReasonDescriptor")] - public string DisciplineActionLengthDifferenceReasonDescriptor { get; set; } - - /// - /// An indication as to whether an offense and/or disciplinary action resulted in a meeting of a student's Individualized Education Program (IEP) team to determine appropriate placement. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="iepPlacementMeetingIndicator")] - public bool? IEPPlacementMeetingIndicator { get; set; } - - /// - /// An indication of whether or not this disciplinary action taken against a student was imposed as a consequence of state or local zero tolerance policies. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="relatedToZeroTolerancePolicy")] - public bool? RelatedToZeroTolerancePolicy { get; set; } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolId - { - get - { - if (ImplicitResponsibilitySchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitResponsibilitySchoolReference.IsReferenceFullyDefined())) - { - return ImplicitResponsibilitySchoolReference.SchoolId; - } - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ResponsibilitySchool - _responsibilitySchoolReferenceExplicitlyAssigned = false; - ImplicitResponsibilitySchoolReference.SchoolId = value; - } - } + [DataMember(Name="crisisTypeDescriptor")][DescriptorExists("CrisisTypeDescriptor")] + public string CrisisTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -50654,103 +49935,13 @@ long Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolId // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineAction")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "CrisisEvent", "CrisisEvent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _disciplineActionDisciplines; - private ICollection _disciplineActionDisciplinesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="disciplines")] - public ICollection DisciplineActionDisciplines - { - get { return _disciplineActionDisciplines; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IDisciplineActionDiscipline)e.Item).DisciplineAction = this); - _disciplineActionDisciplines = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineActionDiscipline)e.Item).DisciplineAction = this; - _disciplineActionDisciplinesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionDisciplines - { - get { return _disciplineActionDisciplinesCovariant; } - set { DisciplineActionDisciplines = new List(value.Cast()); } - } - - private ICollection _disciplineActionStaffs; - private ICollection _disciplineActionStaffsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="staffs")] - public ICollection DisciplineActionStaffs - { - get { return _disciplineActionStaffs; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IDisciplineActionStaff)e.Item).DisciplineAction = this); - _disciplineActionStaffs = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineActionStaff)e.Item).DisciplineAction = this; - _disciplineActionStaffsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStaffs - { - get { return _disciplineActionStaffsCovariant; } - set { DisciplineActionStaffs = new List(value.Cast()); } - } - - private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociations; - private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="studentDisciplineIncidentBehaviorAssociations")] - public ICollection DisciplineActionStudentDisciplineIncidentBehaviorAssociations - { - get { return _disciplineActionStudentDisciplineIncidentBehaviorAssociations; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)e.Item).DisciplineAction = this); - _disciplineActionStudentDisciplineIncidentBehaviorAssociations = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)e.Item).DisciplineAction = this; - _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStudentDisciplineIncidentBehaviorAssociations - { - get { return _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; } - set { DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -50768,27 +49959,6 @@ public ICollection // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_disciplineActionDisciplines != null) foreach (var item in _disciplineActionDisciplines) - { - item.DisciplineAction = this; - } - - if (_disciplineActionStaffs != null) foreach (var item in _disciplineActionStaffs) - { - item.DisciplineAction = this; - } - - if (_disciplineActionStudentDisciplineIncidentBehaviorAssociations != null) foreach (var item in _disciplineActionStudentDisciplineIncidentBehaviorAssociations) - { - item.DisciplineAction = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -50796,46 +49966,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineActionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineAction)target); + return Entities.Common.EdFi.CrisisEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICrisisEvent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineActionMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineAction)target, null); + Entities.Common.EdFi.CrisisEventMapper.MapTo(this, (Entities.Common.EdFi.ICrisisEvent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolResourceId - { - get { return null; } - set { ImplicitAssignmentSchoolReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolResourceId - { - get { return null; } - set { ImplicitResponsibilitySchoolReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IDisciplineAction.StudentResourceId - { - get { return null; } - set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -50858,42 +50000,6 @@ string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator // ---------------------- // Validate collections // ---------------------- - if (DisciplineActionDisciplines.Any() && mappingContract?.IsMemberSupported("DisciplineActionDisciplines") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("DisciplineActionDisciplines"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineActionDisciplines, validationContext, validationContext.Items.ForCollection("DisciplineActionDisciplines")))) - { - yield return result; - } - } - - if (DisciplineActionStaffs.Any() && mappingContract?.IsMemberSupported("DisciplineActionStaffs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("DisciplineActionStaffs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineActionStaffs, validationContext, validationContext.Items.ForCollection("DisciplineActionStaffs")))) - { - yield return result; - } - } - - if (DisciplineActionStudentDisciplineIncidentBehaviorAssociations.Any() && mappingContract?.IsMemberSupported("DisciplineActionStudentDisciplineIncidentBehaviorAssociations") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("DisciplineActionStudentDisciplineIncidentBehaviorAssociations"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineActionStudentDisciplineIncidentBehaviorAssociations, validationContext, validationContext.Items.ForCollection("DisciplineActionStudentDisciplineIncidentBehaviorAssociations")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -50939,16 +50045,9 @@ string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineActionPutPostRequestValidator : FluentValidation.AbstractValidator + public class CrisisEventPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_DisciplineAction = new FullName("edfi", "DisciplineAction"); - - // Declare collection item validators - private DisciplineActionDisciplinePutPostRequestValidator _disciplineActionDisciplinesValidator = new (); - private DisciplineActionStaffPutPostRequestValidator _disciplineActionStaffsValidator = new (); - private DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator _disciplineActionStudentDisciplineIncidentBehaviorAssociationsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -50961,50 +50060,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (DisciplineActionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_DisciplineAction); - - if (mappingContract != null) - { - if (mappingContract.IsDisciplineActionDisciplineIncluded != null) - { - var hasInvalidDisciplineActionDisciplinesItems = instance.DisciplineActionDisciplines.Any(x => !mappingContract.IsDisciplineActionDisciplineIncluded(x)); - - if (hasInvalidDisciplineActionDisciplinesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("DisciplineActionDisciplines", $"A supplied 'DisciplineActionDiscipline' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsDisciplineActionStaffIncluded != null) - { - var hasInvalidDisciplineActionStaffsItems = instance.DisciplineActionStaffs.Any(x => !mappingContract.IsDisciplineActionStaffIncluded(x)); - - if (hasInvalidDisciplineActionStaffsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("DisciplineActionStaffs", $"A supplied 'DisciplineActionStaff' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsDisciplineActionStudentDisciplineIncidentBehaviorAssociationIncluded != null) - { - var hasInvalidDisciplineActionStudentDisciplineIncidentBehaviorAssociationsItems = instance.DisciplineActionStudentDisciplineIncidentBehaviorAssociations.Any(x => !mappingContract.IsDisciplineActionStudentDisciplineIncidentBehaviorAssociationIncluded(x)); - - if (hasInvalidDisciplineActionStudentDisciplineIncidentBehaviorAssociationsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("DisciplineActionStudentDisciplineIncidentBehaviorAssociations", $"A supplied 'DisciplineActionStudentDisciplineIncidentBehaviorAssociation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -51020,17 +50075,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineActionDiscipline table of the DisciplineAction aggregate in the ODS Database. + /// A class which represents the edfi.CrisisTypeDescriptor table of the CrisisTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineActionDiscipline : Entities.Common.EdFi.IDisciplineActionDiscipline, IValidatableObject + public class CrisisTypeDescriptor : Entities.Common.EdFi.ICrisisTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisciplineActionDiscipline"); + private static FullName _fullName = new FullName("edfi", "CrisisTypeDescriptor"); // Fluent validator instance (threadsafe) - private static DisciplineActionDisciplinePutPostRequestValidator _validator = new DisciplineActionDisciplinePutPostRequestValidator(); + private static CrisisTypeDescriptorPutPostRequestValidator _validator = new CrisisTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -51047,6 +50107,13 @@ public class DisciplineActionDiscipline : Entities.Common.EdFi.IDisciplineAction // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CrisisTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -51057,33 +50124,19 @@ public class DisciplineActionDiscipline : Entities.Common.EdFi.IDisciplineAction //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IDisciplineAction _disciplineAction; - [IgnoreDataMember] - Entities.Common.EdFi.IDisciplineAction IDisciplineActionDiscipline.DisciplineAction - { - get { return _disciplineAction; } - set { SetDisciplineAction(value); } - } - - public Entities.Common.EdFi.IDisciplineAction DisciplineAction - { - set { SetDisciplineAction(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CrisisTypeDescriptorId { get; set; } - private void SetDisciplineAction(Entities.Common.EdFi.IDisciplineAction value) + int IDescriptor.DescriptorId { - _disciplineAction = value; + get { return CrisisTypeDescriptorId; } + set { CrisisTypeDescriptorId = value; } } - - /// - /// Type of action, such as removal from the classroom, used to discipline the student involved as a perpetrator in a discipline incident. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="disciplineDescriptor")][DescriptorExists("DisciplineDescriptor")] - public string DisciplineDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -51098,7 +50151,7 @@ private void SetDisciplineAction(Entities.Common.EdFi.IDisciplineAction value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineActionDiscipline; + var compareTo = obj as Entities.Common.EdFi.ICrisisTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -51106,13 +50159,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_disciplineAction == null || !_disciplineAction.Equals(compareTo.DisciplineAction)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineActionDiscipline).DisciplineDescriptor, compareTo.DisciplineDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICrisisTypeDescriptor).CrisisTypeDescriptorId.Equals(compareTo.CrisisTypeDescriptorId)) return false; @@ -51128,12 +50177,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_disciplineAction != null) - hash.Add(_disciplineAction); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineActionDiscipline).DisciplineDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICrisisTypeDescriptor).CrisisTypeDescriptorId); return hash.ToHashCode(); } @@ -51142,6 +50188,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -51167,8 +50262,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineActionDiscipline")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -51179,6 +50277,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -51191,12 +50296,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineActionDisciplineMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionDiscipline)target); + return Entities.Common.EdFi.CrisisTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICrisisTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineActionDisciplineMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionDiscipline)target, null); + Entities.Common.EdFi.CrisisTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICrisisTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -51204,66 +50309,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -51271,9 +50316,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineActionDisciplinePutPostRequestValidator : FluentValidation.AbstractValidator + public class CrisisTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -51301,17 +50346,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineActionStaff table of the DisciplineAction aggregate in the ODS Database. + /// A class which represents the edfi.CTEProgramServiceDescriptor table of the CTEProgramServiceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineActionStaff : Entities.Common.EdFi.IDisciplineActionStaff, IValidatableObject + public class CTEProgramServiceDescriptor : Entities.Common.EdFi.ICTEProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisciplineActionStaff"); + private static FullName _fullName = new FullName("edfi", "CTEProgramServiceDescriptor"); // Fluent validator instance (threadsafe) - private static DisciplineActionStaffPutPostRequestValidator _validator = new DisciplineActionStaffPutPostRequestValidator(); + private static CTEProgramServiceDescriptorPutPostRequestValidator _validator = new CTEProgramServiceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -51328,93 +50378,35 @@ public class DisciplineActionStaff : Entities.Common.EdFi.IDisciplineActionStaff // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CTEProgramServiceDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); - - return _staffReference; - } - } - - [DataMember(Name="staffReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; - - return null; - } - set - { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IDisciplineAction _disciplineAction; - - [IgnoreDataMember] - Entities.Common.EdFi.IDisciplineAction IDisciplineActionStaff.DisciplineAction - { - get { return _disciplineAction; } - set { SetDisciplineAction(value); } - } - - public Entities.Common.EdFi.IDisciplineAction DisciplineAction - { - set { SetDisciplineAction(value); } - } - - private void SetDisciplineAction(Entities.Common.EdFi.IDisciplineAction value) - { - _disciplineAction = value; - } /// - /// A unique alphanumeric code assigned to a staff. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IDisciplineActionStaff.StaffUniqueId - { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CTEProgramServiceDescriptorId { get; set; } - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } + int IDescriptor.DescriptorId + { + get { return CTEProgramServiceDescriptorId; } + set { CTEProgramServiceDescriptorId = value; } } // ------------------------------------------------------------- @@ -51430,7 +50422,7 @@ string Entities.Common.EdFi.IDisciplineActionStaff.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineActionStaff; + var compareTo = obj as Entities.Common.EdFi.ICTEProgramServiceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -51438,13 +50430,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_disciplineAction == null || !_disciplineAction.Equals(compareTo.DisciplineAction)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineActionStaff).StaffUniqueId, compareTo.StaffUniqueId)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICTEProgramServiceDescriptor).CTEProgramServiceDescriptorId.Equals(compareTo.CTEProgramServiceDescriptorId)) return false; @@ -51460,12 +50448,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_disciplineAction != null) - hash.Add(_disciplineAction); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IDisciplineActionStaff).StaffUniqueId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICTEProgramServiceDescriptor).CTEProgramServiceDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -51473,6 +50459,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -51498,8 +50533,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineActionStaff")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -51510,6 +50548,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -51522,93 +50567,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineActionStaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionStaff)target); + return Entities.Common.EdFi.CTEProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICTEProgramServiceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineActionStaffMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionStaff)target, null); + Entities.Common.EdFi.CTEProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICTEProgramServiceDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IDisciplineActionStaff.StaffResourceId - { - get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IDisciplineActionStaff.StaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStaffReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -51616,9 +50587,9 @@ string Entities.Common.EdFi.IDisciplineActionStaff.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineActionStaffPutPostRequestValidator : FluentValidation.AbstractValidator + public class CTEProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -51646,17 +50617,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineActionStudentDisciplineIncidentBehaviorAssociation table of the DisciplineAction aggregate in the ODS Database. + /// A class which represents the edfi.CurriculumUsedDescriptor table of the CurriculumUsedDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineActionStudentDisciplineIncidentBehaviorAssociation : Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation, IValidatableObject + public class CurriculumUsedDescriptor : Entities.Common.EdFi.ICurriculumUsedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisciplineActionStudentDisciplineIncidentBehaviorAssociation"); + private static FullName _fullName = new FullName("edfi", "CurriculumUsedDescriptor"); // Fluent validator instance (threadsafe) - private static DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator _validator = new DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator(); + private static CurriculumUsedDescriptorPutPostRequestValidator _validator = new CurriculumUsedDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -51673,144 +50649,35 @@ public class DisciplineActionStudentDisciplineIncidentBehaviorAssociation : Enti // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the CurriculumUsedDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned; - private StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference _studentDisciplineIncidentBehaviorAssociationReference; - private StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference ImplicitStudentDisciplineIncidentBehaviorAssociationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentDisciplineIncidentBehaviorAssociationReference == null && !_studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned) - _studentDisciplineIncidentBehaviorAssociationReference = new StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference(); - - return _studentDisciplineIncidentBehaviorAssociationReference; - } - } - - [DataMember(Name="studentDisciplineIncidentBehaviorAssociationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference StudentDisciplineIncidentBehaviorAssociationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null - && (_studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentDisciplineIncidentBehaviorAssociationReference; - - return null; - } - set - { - _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned = true; - _studentDisciplineIncidentBehaviorAssociationReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IDisciplineAction _disciplineAction; - - [IgnoreDataMember] - Entities.Common.EdFi.IDisciplineAction IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.DisciplineAction - { - get { return _disciplineAction; } - set { SetDisciplineAction(value); } - } - - public Entities.Common.EdFi.IDisciplineAction DisciplineAction - { - set { SetDisciplineAction(value); } - } - - private void SetDisciplineAction(Entities.Common.EdFi.IDisciplineAction value) - { - _disciplineAction = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned) - { - ImplicitStudentDisciplineIncidentBehaviorAssociationReference.StudentUniqueId = _disciplineAction.StudentUniqueId; - } - } - - /// - /// Describes behavior by category. - /// - - // IS in a reference (DisciplineActionStudentDisciplineIncidentBehaviorAssociation.BehaviorDescriptorId), IS a lookup column - string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.BehaviorDescriptor - { - get - { - if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentDisciplineIncidentBehaviorAssociationReference.BehaviorDescriptor; - - return null; - } - set - { - ImplicitStudentDisciplineIncidentBehaviorAssociationReference.BehaviorDescriptor = value; - } - } /// - /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.IncidentIdentifier - { - get - { - if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IncidentIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentDisciplineIncidentBehaviorAssociation - _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IncidentIdentifier = value; - } - } + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int CurriculumUsedDescriptorId { get; set; } - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.SchoolId + int IDescriptor.DescriptorId { - get - { - if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentDisciplineIncidentBehaviorAssociationReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentDisciplineIncidentBehaviorAssociation - _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentDisciplineIncidentBehaviorAssociationReference.SchoolId = value; - } + get { return CurriculumUsedDescriptorId; } + set { CurriculumUsedDescriptorId = value; } } // ------------------------------------------------------------- @@ -51826,7 +50693,7 @@ long Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAsso /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation; + var compareTo = obj as Entities.Common.EdFi.ICurriculumUsedDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -51834,23 +50701,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_disciplineAction == null || !_disciplineAction.Equals(compareTo.DisciplineAction)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor, compareTo.BehaviorDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) - return false; - - // Referenced Property - if (!(this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).SchoolId.Equals(compareTo.SchoolId)) + // Derived Property + if (!(this as Entities.Common.EdFi.ICurriculumUsedDescriptor).CurriculumUsedDescriptorId.Equals(compareTo.CurriculumUsedDescriptorId)) return false; @@ -51866,19 +50719,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_disciplineAction != null) - hash.Add(_disciplineAction); - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ICurriculumUsedDescriptor).CurriculumUsedDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).SchoolId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -51886,6 +50730,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -51911,8 +50804,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineActionStudentDisciplineIncidentBehaviorAssociation")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -51923,17 +50819,18 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -51941,127 +50838,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineActionStudentDisciplineIncidentBehaviorAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target); + return Entities.Common.EdFi.CurriculumUsedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ICurriculumUsedDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineActionStudentDisciplineIncidentBehaviorAssociationMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target, null); + Entities.Common.EdFi.CurriculumUsedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ICurriculumUsedDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationResourceId - { - get { return null; } - set { ImplicitStudentDisciplineIncidentBehaviorAssociationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentDisciplineIncidentBehaviorAssociationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); - - if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetStudentUniqueIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).DisciplineAction.StudentUniqueId); - - // Obtain value from other references - var valueFromStudentDisciplineIncidentBehaviorAssociationReference = this.StudentDisciplineIncidentBehaviorAssociationReference?.StudentUniqueId; - - if (valueFromStudentDisciplineIncidentBehaviorAssociationReference != null) - { - yield return ("studentDisciplineIncidentBehaviorAssociationReference.studentUniqueId", this.StudentDisciplineIncidentBehaviorAssociationReference.StudentUniqueId); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -52069,9 +50858,9 @@ string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAs // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class CurriculumUsedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -52100,21 +50889,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineActionLengthDifferenceReasonDescriptor table of the DisciplineActionLengthDifferenceReasonDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.DeliveryMethodDescriptor table of the DeliveryMethodDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineActionLengthDifferenceReasonDescriptor : Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class DeliveryMethodDescriptor : Entities.Common.EdFi.IDeliveryMethodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisciplineActionLengthDifferenceReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "DeliveryMethodDescriptor"); // Fluent validator instance (threadsafe) - private static DisciplineActionLengthDifferenceReasonDescriptorPutPostRequestValidator _validator = new DisciplineActionLengthDifferenceReasonDescriptorPutPostRequestValidator(); + private static DeliveryMethodDescriptorPutPostRequestValidator _validator = new DeliveryMethodDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -52133,7 +50922,7 @@ public class DisciplineActionLengthDifferenceReasonDescriptor : Entities.Common. // ------------------------------------------------------------ /// - /// The unique identifier for the DisciplineActionLengthDifferenceReasonDescriptor resource. + /// The unique identifier for the DeliveryMethodDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -52154,12 +50943,12 @@ public class DisciplineActionLengthDifferenceReasonDescriptor : Entities.Common. /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int DisciplineActionLengthDifferenceReasonDescriptorId { get; set; } + public int DeliveryMethodDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return DisciplineActionLengthDifferenceReasonDescriptorId; } - set { DisciplineActionLengthDifferenceReasonDescriptorId = value; } + get { return DeliveryMethodDescriptorId; } + set { DeliveryMethodDescriptorId = value; } } // ------------------------------------------------------------- @@ -52175,7 +50964,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor; + var compareTo = obj as Entities.Common.EdFi.IDeliveryMethodDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -52185,7 +50974,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor).DisciplineActionLengthDifferenceReasonDescriptorId.Equals(compareTo.DisciplineActionLengthDifferenceReasonDescriptorId)) + if (!(this as Entities.Common.EdFi.IDeliveryMethodDescriptor).DeliveryMethodDescriptorId.Equals(compareTo.DeliveryMethodDescriptorId)) return false; @@ -52203,7 +50992,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor).DisciplineActionLengthDifferenceReasonDescriptorId); + hash.Add((this as Entities.Common.EdFi.IDeliveryMethodDescriptor).DeliveryMethodDescriptorId); return hash.ToHashCode(); } @@ -52320,12 +51109,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineActionLengthDifferenceReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target); + return Entities.Common.EdFi.DeliveryMethodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDeliveryMethodDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineActionLengthDifferenceReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target, null); + Entities.Common.EdFi.DeliveryMethodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDeliveryMethodDescriptor)target, null); } // ------------------------------------------------------------- @@ -52340,9 +51129,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineActionLengthDifferenceReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class DeliveryMethodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -52371,293 +51160,128 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineDescriptor table of the DisciplineDescriptor aggregate in the ODS Database. + /// Represents a reference to the Descriptor resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class DisciplineDescriptor : Entities.Common.EdFi.IDisciplineDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class DescriptorReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "DisciplineDescriptor"); - - // Fluent validator instance (threadsafe) - private static DisciplineDescriptorPutPostRequestValidator _validator = new DisciplineDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ + [DataMember(Name="descriptorId")] + public int DescriptorId { get; set; } /// - /// The unique identifier for the DisciplineDescriptor resource. + /// Gets or sets the resource identifier of the referenced resource. /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- + public Guid ResourceId { get; set; } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int DisciplineDescriptorId { get; set; } + public string Discriminator { get; set; } - int IDescriptor.DescriptorId - { - get { return DisciplineDescriptorId; } - set { DisciplineDescriptorId = value; } - } - // ------------------------------------------------------------- - // ============================================================= - // Equality - // ------------------------------------------------------------- + private Link _link; - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + [DataMember(Name="link")] + public Link Link { - var compareTo = obj as Entities.Common.EdFi.IDisciplineDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IDisciplineDescriptor).DisciplineDescriptorId.Equals(compareTo.DisciplineDescriptorId)) - return false; - + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } - return true; + return _link; + } } /// - /// Builds the hash code based on the unique identifying values. + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IDisciplineDescriptor).DisciplineDescriptorId); - - return hash.ToHashCode(); + return DescriptorId != default(int); } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (DescriptorId == default) + { + yield return "DescriptorId"; + } - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } } - // ------------------------------------------------------------- - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private Link CreateLink() + { + var link = new Link + { + Rel = "Descriptor", + Href = $"/ed-fi/descriptors/{ResourceId:n}" + }; - // ============================================================= - // Versioning - // ------------------------------------------------------------- + if (string.IsNullOrEmpty(Discriminator)) + return link; - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } + string[] linkParts = Discriminator.Split('.'); - // ------------------------------------------------------------- + if (linkParts.Length < 2) + return link; - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.DisciplineDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineDescriptor)target); - } + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; - void IMappable.Map(object target) - { - Entities.Common.EdFi.DisciplineDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineDescriptor)target, null); + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } - // ------------------------------------------------------------- + } // Aggregate reference - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } // ================================================================= // Validators // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class DisciplineDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } // ----------------------------------------------------------------- } -// Aggregate: DisciplineIncident +// Aggregate: DescriptorMapping -namespace EdFi.Ods.Api.Common.Models.Resources.DisciplineIncident.EdFi +namespace EdFi.Ods.Api.Common.Models.Resources.DescriptorMapping.EdFi { /// - /// Represents a reference to the DisciplineIncident resource. + /// Represents a reference to the DescriptorMapping resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class DisciplineIncidentReference : IResourceReference + public class DescriptorMappingReference : IResourceReference { - [DataMember(Name="incidentIdentifier")] - public string IncidentIdentifier { get; set; } + [DataMember(Name="mappedNamespace")] + public string MappedNamespace { get; set; } - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + [DataMember(Name="mappedValue")] + public string MappedValue { get; set; } + + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + [DataMember(Name="value")] + public string Value { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -52695,19 +51319,29 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return IncidentIdentifier != default(string) && SchoolId != default(long); + return MappedNamespace != default(string) && MappedValue != default(string) && Namespace != default(string) && Value != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (IncidentIdentifier == default) + if (MappedNamespace == default) { - yield return "IncidentIdentifier"; + yield return "MappedNamespace"; } - if (SchoolId == default) + if (MappedValue == default) { - yield return "SchoolId"; + yield return "MappedValue"; + } + + if (Namespace == default) + { + yield return "Namespace"; + } + + if (Value == default) + { + yield return "Value"; } } @@ -52716,8 +51350,8 @@ private Link CreateLink() { var link = new Link { - Rel = "DisciplineIncident", - Href = $"/ed-fi/disciplineIncidents/{ResourceId:n}" + Rel = "DescriptorMapping", + Href = $"/ed-fi/descriptorMappings/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -52744,16 +51378,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.DisciplineIncident table of the DisciplineIncident aggregate in the ODS Database. + /// A class which represents the edfi.DescriptorMapping table of the DescriptorMapping aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineIncident : Entities.Common.EdFi.IDisciplineIncident, IHasETag, IDateVersionedEntity, IValidatableObject + public class DescriptorMapping : Entities.Common.EdFi.IDescriptorMapping, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DisciplineIncident"); + private static FullName _fullName = new FullName("edfi", "DescriptorMapping"); // Fluent validator instance (threadsafe) - private static DisciplineIncidentPutPostRequestValidator _validator = new DisciplineIncidentPutPostRequestValidator(); + private static DescriptorMappingPutPostRequestValidator _validator = new DescriptorMappingPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -52764,11 +51398,9 @@ public class DisciplineIncident : Entities.Common.EdFi.IDisciplineIncident, IHas // Constructor // ------------------------------------------------------------- - public DisciplineIncident() + public DescriptorMapping() { - DisciplineIncidentBehaviors = new List(); - DisciplineIncidentExternalParticipants = new List(); - DisciplineIncidentWeapons = new List(); + DescriptorMappingModelEntities = new List(); } // ------------------------------------------------------------ @@ -52778,7 +51410,7 @@ public DisciplineIncident() // ------------------------------------------------------------ /// - /// The unique identifier for the DisciplineIncident resource. + /// The unique identifier for the DescriptorMapping resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -52788,40 +51420,6 @@ public DisciplineIncident() // ============================================================= // References // ------------------------------------------------------------- - - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); - - return _schoolReference; - } - } - - [DataMember(Name="schoolReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; - - return null; - } - set - { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -52829,38 +51427,40 @@ public School.EdFi.SchoolReference SchoolReference // ------------------------------------------------------------- /// - /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. + /// The namespace of the descriptor value to which the from descriptor value is mapped to. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="incidentIdentifier")] - public string IncidentIdentifier { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="mappedNamespace")] + public string MappedNamespace { get; set; } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The descriptor value to which the from descriptor value is being mapped to. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IDisciplineIncident.SchoolId - { - get - { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="mappedValue")] + public string MappedValue { get; set; } - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + /// + /// The namespace of the descriptor value that is being mapped to another value. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="namespace")] + public string Namespace { get; set; } - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; - } - } + /// + /// The descriptor value that is being mapped to another value. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="value")] + public string Value { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -52875,7 +51475,7 @@ long Entities.Common.EdFi.IDisciplineIncident.SchoolId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineIncident; + var compareTo = obj as Entities.Common.EdFi.IDescriptorMapping; if (ReferenceEquals(this, compareTo)) return true; @@ -52885,12 +51485,22 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineIncident).IncidentIdentifier, compareTo.IncidentIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).MappedNamespace, compareTo.MappedNamespace)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IDisciplineIncident).SchoolId.Equals(compareTo.SchoolId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).MappedValue, compareTo.MappedValue)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).Namespace, compareTo.Namespace)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDescriptorMapping).Value, compareTo.Value)) return false; @@ -52908,11 +51518,20 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncident).IncidentIdentifier); + hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).MappedNamespace); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncident).SchoolId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).MappedValue); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).Namespace); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IDescriptorMapping).Value); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -52925,76 +51544,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The case number assigned to the DisciplineIncident by law enforcement or other organization. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="caseNumber")] - public string CaseNumber { get; set; } - - /// - /// The value of any quantifiable monetary loss directly resulting from the discipline incident. Examples include the value of repairs necessitated by vandalism of a school facility, or the value of personnel resources used for repairs or consumed by the incident. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="incidentCost")] - public decimal? IncidentCost { get; set; } - - /// - /// The month, day, and year on which the discipline incident occurred. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="incidentDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime IncidentDate { get; set; } - - /// - /// The description for an incident. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="incidentDescription")] - public string IncidentDescription { get; set; } - - /// - /// Identifies where the discipline incident occurred and whether or not it occurred on school. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="incidentLocationDescriptor")][DescriptorExists("IncidentLocationDescriptor")] - public string IncidentLocationDescriptor { get; set; } - - /// - /// An indication of the time of day the incident took place. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="incidentTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan? IncidentTime { get; set; } - - /// - /// Indicator of whether the incident was reported to law enforcement. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="reportedToLawEnforcement")] - public bool? ReportedToLawEnforcement { get; set; } - - /// - /// Information on the type of individual who reported the discipline incident. When known and/or if useful, use a more specific option code (e.g., \"Counselor\" rather than \"Professional Staff\"). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="reporterDescriptionDescriptor")][DescriptorExists("ReporterDescriptionDescriptor")] - public string ReporterDescriptionDescriptor { get; set; } - - /// - /// Identifies the reporter of the discipline incident by name. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="reporterName")] - public string ReporterName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -53015,101 +51564,41 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncident")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DescriptorMapping", "DescriptorMapping")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _disciplineIncidentBehaviors; - private ICollection _disciplineIncidentBehaviorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="behaviors")] - public ICollection DisciplineIncidentBehaviors - { - get { return _disciplineIncidentBehaviors; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentBehavior)e.Item).DisciplineIncident = this); - _disciplineIncidentBehaviors = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentBehavior)e.Item).DisciplineIncident = this; - _disciplineIncidentBehaviorsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentBehaviors - { - get { return _disciplineIncidentBehaviorsCovariant; } - set { DisciplineIncidentBehaviors = new List(value.Cast()); } - } - - private ICollection _disciplineIncidentExternalParticipants; - private ICollection _disciplineIncidentExternalParticipantsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="externalParticipants")] - public ICollection DisciplineIncidentExternalParticipants - { - get { return _disciplineIncidentExternalParticipants; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)e.Item).DisciplineIncident = this); - _disciplineIncidentExternalParticipants = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)e.Item).DisciplineIncident = this; - _disciplineIncidentExternalParticipantsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentExternalParticipants - { - get { return _disciplineIncidentExternalParticipantsCovariant; } - set { DisciplineIncidentExternalParticipants = new List(value.Cast()); } - } - - private ICollection _disciplineIncidentWeapons; - private ICollection _disciplineIncidentWeaponsCovariant; + private ICollection _descriptorMappingModelEntities; + private ICollection _descriptorMappingModelEntitiesCovariant; [NoDuplicateMembers] - [DataMember(Name="weapons")] - public ICollection DisciplineIncidentWeapons + [DataMember(Name="modelEntities")] + public ICollection DescriptorMappingModelEntities { - get { return _disciplineIncidentWeapons; } + get { return _descriptorMappingModelEntities; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentWeapon)e.Item).DisciplineIncident = this); - _disciplineIncidentWeapons = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IDescriptorMappingModelEntity)e.Item).DescriptorMapping = this); + _descriptorMappingModelEntities = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentWeapon)e.Item).DisciplineIncident = this; - _disciplineIncidentWeaponsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDescriptorMappingModelEntity)e.Item).DescriptorMapping = this; + _descriptorMappingModelEntitiesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentWeapons + ICollection Entities.Common.EdFi.IDescriptorMapping.DescriptorMappingModelEntities { - get { return _disciplineIncidentWeaponsCovariant; } - set { DisciplineIncidentWeapons = new List(value.Cast()); } + get { return _descriptorMappingModelEntitiesCovariant; } + set { DescriptorMappingModelEntities = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -53134,19 +51623,9 @@ public ICollection DisciplineIncidentWeapons internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_disciplineIncidentBehaviors != null) foreach (var item in _disciplineIncidentBehaviors) - { - item.DisciplineIncident = this; - } - - if (_disciplineIncidentExternalParticipants != null) foreach (var item in _disciplineIncidentExternalParticipants) - { - item.DisciplineIncident = this; - } - - if (_disciplineIncidentWeapons != null) foreach (var item in _disciplineIncidentWeapons) + if (_descriptorMappingModelEntities != null) foreach (var item in _descriptorMappingModelEntities) { - item.DisciplineIncident = this; + item.DescriptorMapping = this; } } @@ -53157,25 +51636,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineIncidentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncident)target); + return Entities.Common.EdFi.DescriptorMappingMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDescriptorMapping)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineIncidentMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncident)target, null); + Entities.Common.EdFi.DescriptorMappingMapper.MapTo(this, (Entities.Common.EdFi.IDescriptorMapping)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IDisciplineIncident.SchoolResourceId - { - get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- // ================================== @@ -53198,37 +51670,13 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (DisciplineIncidentBehaviors.Any() && mappingContract?.IsMemberSupported("DisciplineIncidentBehaviors") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("DisciplineIncidentBehaviors"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineIncidentBehaviors, validationContext, validationContext.Items.ForCollection("DisciplineIncidentBehaviors")))) - { - yield return result; - } - } - - if (DisciplineIncidentExternalParticipants.Any() && mappingContract?.IsMemberSupported("DisciplineIncidentExternalParticipants") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("DisciplineIncidentExternalParticipants"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineIncidentExternalParticipants, validationContext, validationContext.Items.ForCollection("DisciplineIncidentExternalParticipants")))) - { - yield return result; - } - } - - if (DisciplineIncidentWeapons.Any() && mappingContract?.IsMemberSupported("DisciplineIncidentWeapons") != false) + if (DescriptorMappingModelEntities.Any() && mappingContract?.IsMemberSupported("DescriptorMappingModelEntities") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("DisciplineIncidentWeapons"); + pathBuilder.Append("DescriptorMappingModelEntities"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineIncidentWeapons, validationContext, validationContext.Items.ForCollection("DisciplineIncidentWeapons")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DescriptorMappingModelEntities, validationContext, validationContext.Items.ForCollection("DescriptorMappingModelEntities")))) { yield return result; } @@ -53279,16 +51727,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineIncidentPutPostRequestValidator : FluentValidation.AbstractValidator + public class DescriptorMappingPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_DisciplineIncident = new FullName("edfi", "DisciplineIncident"); + private static readonly FullName _fullName_edfi_DescriptorMapping = new FullName("edfi", "DescriptorMapping"); // Declare collection item validators - private DisciplineIncidentBehaviorPutPostRequestValidator _disciplineIncidentBehaviorsValidator = new (); - private DisciplineIncidentExternalParticipantPutPostRequestValidator _disciplineIncidentExternalParticipantsValidator = new (); - private DisciplineIncidentWeaponPutPostRequestValidator _disciplineIncidentWeaponsValidator = new (); + private DescriptorMappingModelEntityPutPostRequestValidator _descriptorMappingModelEntitiesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -53305,41 +51751,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsDisciplineIncidentBehaviorIncluded(x)); - - if (hasInvalidDisciplineIncidentBehaviorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("DisciplineIncidentBehaviors", $"A supplied 'DisciplineIncidentBehavior' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsDisciplineIncidentExternalParticipantIncluded != null) - { - var hasInvalidDisciplineIncidentExternalParticipantsItems = instance.DisciplineIncidentExternalParticipants.Any(x => !mappingContract.IsDisciplineIncidentExternalParticipantIncluded(x)); - - if (hasInvalidDisciplineIncidentExternalParticipantsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("DisciplineIncidentExternalParticipants", $"A supplied 'DisciplineIncidentExternalParticipant' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsDisciplineIncidentWeaponIncluded != null) + if (mappingContract.IsDescriptorMappingModelEntityIncluded != null) { - var hasInvalidDisciplineIncidentWeaponsItems = instance.DisciplineIncidentWeapons.Any(x => !mappingContract.IsDisciplineIncidentWeaponIncluded(x)); + var hasInvalidDescriptorMappingModelEntitiesItems = instance.DescriptorMappingModelEntities.Any(x => !mappingContract.IsDescriptorMappingModelEntityIncluded(x)); - if (hasInvalidDisciplineIncidentWeaponsItems) + if (hasInvalidDescriptorMappingModelEntitiesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("DisciplineIncidentWeapons", $"A supplied 'DisciplineIncidentWeapon' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("DescriptorMappingModelEntities", $"A supplied 'DescriptorMappingModelEntity' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -53361,16 +51785,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineIncidentBehavior table of the DisciplineIncident aggregate in the ODS Database. + /// A class which represents the edfi.DescriptorMappingModelEntity table of the DescriptorMapping aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineIncidentBehavior : Entities.Common.EdFi.IDisciplineIncidentBehavior, IValidatableObject + public class DescriptorMappingModelEntity : Entities.Common.EdFi.IDescriptorMappingModelEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "DisciplineIncidentBehavior"); + private static FullName _fullName = new FullName("edfi", "DescriptorMappingModelEntity"); // Fluent validator instance (threadsafe) - private static DisciplineIncidentBehaviorPutPostRequestValidator _validator = new DisciplineIncidentBehaviorPutPostRequestValidator(); + private static DescriptorMappingModelEntityPutPostRequestValidator _validator = new DescriptorMappingModelEntityPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -53397,33 +51821,33 @@ public class DisciplineIncidentBehavior : Entities.Common.EdFi.IDisciplineIncide //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IDisciplineIncident _disciplineIncident; + private Entities.Common.EdFi.IDescriptorMapping _descriptorMapping; [IgnoreDataMember] - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentBehavior.DisciplineIncident + Entities.Common.EdFi.IDescriptorMapping IDescriptorMappingModelEntity.DescriptorMapping { - get { return _disciplineIncident; } - set { SetDisciplineIncident(value); } + get { return _descriptorMapping; } + set { SetDescriptorMapping(value); } } - public Entities.Common.EdFi.IDisciplineIncident DisciplineIncident + public Entities.Common.EdFi.IDescriptorMapping DescriptorMapping { - set { SetDisciplineIncident(value); } + set { SetDescriptorMapping(value); } } - private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident value) + private void SetDescriptorMapping(Entities.Common.EdFi.IDescriptorMapping value) { - _disciplineIncident = value; + _descriptorMapping = value; } /// - /// Describes behavior by category and provides a detailed description. + /// The resources for which the descriptor mapping applies. If empty, the mapping is assumed to be applicable to all resources in which the descriptor appears. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="behaviorDescriptor")][DescriptorExists("BehaviorDescriptor")] - public string BehaviorDescriptor { get; set; } + [DataMember(Name="modelEntityDescriptor")][DescriptorExists("ModelEntityDescriptor")] + public string ModelEntityDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -53438,7 +51862,7 @@ private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident valu /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentBehavior; + var compareTo = obj as Entities.Common.EdFi.IDescriptorMappingModelEntity; if (ReferenceEquals(this, compareTo)) return true; @@ -53447,12 +51871,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_disciplineIncident == null || !_disciplineIncident.Equals(compareTo.DisciplineIncident)) + if (_descriptorMapping == null || !_descriptorMapping.Equals(compareTo.DescriptorMapping)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineIncidentBehavior).BehaviorDescriptor, compareTo.BehaviorDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDescriptorMappingModelEntity).ModelEntityDescriptor, compareTo.ModelEntityDescriptor)) return false; @@ -53469,11 +51893,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_disciplineIncident != null) - hash.Add(_disciplineIncident); + if (_descriptorMapping != null) + hash.Add(_descriptorMapping); // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentBehavior).BehaviorDescriptor); + hash.Add((this as Entities.Common.EdFi.IDescriptorMappingModelEntity).ModelEntityDescriptor); return hash.ToHashCode(); } @@ -53487,14 +51911,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Specifies a more granular level of detail of a behavior involved in the incident. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="behaviorDetailedDescription")] - public string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -53515,7 +51931,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncidentBehavior")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DescriptorMapping", "DescriptorMappingModelEntity")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -53539,12 +51955,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineIncidentBehaviorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentBehavior)target); + return Entities.Common.EdFi.DescriptorMappingModelEntityMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDescriptorMappingModelEntity)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineIncidentBehaviorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentBehavior)target, null); + Entities.Common.EdFi.DescriptorMappingModelEntityMapper.MapTo(this, (Entities.Common.EdFi.IDescriptorMappingModelEntity)target, null); } // ------------------------------------------------------------- @@ -53619,9 +52035,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineIncidentBehaviorPutPostRequestValidator : FluentValidation.AbstractValidator + public class DescriptorMappingModelEntityPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -53649,17 +52065,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineIncidentExternalParticipant table of the DisciplineIncident aggregate in the ODS Database. + /// A class which represents the edfi.DiagnosisDescriptor table of the DiagnosisDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineIncidentExternalParticipant : Entities.Common.EdFi.IDisciplineIncidentExternalParticipant, IValidatableObject + public class DiagnosisDescriptor : Entities.Common.EdFi.IDiagnosisDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisciplineIncidentExternalParticipant"); + private static FullName _fullName = new FullName("edfi", "DiagnosisDescriptor"); // Fluent validator instance (threadsafe) - private static DisciplineIncidentExternalParticipantPutPostRequestValidator _validator = new DisciplineIncidentExternalParticipantPutPostRequestValidator(); + private static DiagnosisDescriptorPutPostRequestValidator _validator = new DiagnosisDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -53676,6 +52097,13 @@ public class DisciplineIncidentExternalParticipant : Entities.Common.EdFi.IDisci // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DiagnosisDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -53686,51 +52114,19 @@ public class DisciplineIncidentExternalParticipant : Entities.Common.EdFi.IDisci //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IDisciplineIncident _disciplineIncident; - - [IgnoreDataMember] - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentExternalParticipant.DisciplineIncident - { - get { return _disciplineIncident; } - set { SetDisciplineIncident(value); } - } - - public Entities.Common.EdFi.IDisciplineIncident DisciplineIncident - { - set { SetDisciplineIncident(value); } - } - - private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident value) - { - _disciplineIncident = value; - } - - /// - /// The role or type of participation of an individual in the discipline incident. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="disciplineIncidentParticipationCodeDescriptor")][DescriptorExists("DisciplineIncidentParticipationCodeDescriptor")] - public string DisciplineIncidentParticipationCodeDescriptor { get; set; } /// - /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="firstName")] - public string FirstName { get; set; } + [JsonIgnore] + public int DiagnosisDescriptorId { get; set; } - /// - /// The name borne in common by members of a family. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="lastSurname")] - public string LastSurname { get; set; } + int IDescriptor.DescriptorId + { + get { return DiagnosisDescriptorId; } + set { DiagnosisDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -53745,7 +52141,7 @@ private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident valu /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant; + var compareTo = obj as Entities.Common.EdFi.IDiagnosisDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -53753,23 +52149,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_disciplineIncident == null || !_disciplineIncident.Equals(compareTo.DisciplineIncident)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).FirstName, compareTo.FirstName)) - return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).LastSurname, compareTo.LastSurname)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDiagnosisDescriptor).DiagnosisDescriptorId.Equals(compareTo.DiagnosisDescriptorId)) return false; @@ -53785,20 +52167,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_disciplineIncident != null) - hash.Add(_disciplineIncident); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).DisciplineIncidentParticipationCodeDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).FirstName); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).LastSurname); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDiagnosisDescriptor).DiagnosisDescriptorId); return hash.ToHashCode(); } @@ -53807,6 +52178,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -53832,8 +52252,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncidentExternalParticipant")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -53844,6 +52267,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -53856,12 +52286,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineIncidentExternalParticipantMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target); + return Entities.Common.EdFi.DiagnosisDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDiagnosisDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineIncidentExternalParticipantMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target, null); + Entities.Common.EdFi.DiagnosisDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDiagnosisDescriptor)target, null); } // ------------------------------------------------------------- @@ -53869,66 +52299,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -53936,9 +52306,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineIncidentExternalParticipantPutPostRequestValidator : FluentValidation.AbstractValidator + public class DiagnosisDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -53966,17 +52336,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisciplineIncidentWeapon table of the DisciplineIncident aggregate in the ODS Database. + /// A class which represents the edfi.DiplomaLevelDescriptor table of the DiplomaLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisciplineIncidentWeapon : Entities.Common.EdFi.IDisciplineIncidentWeapon, IValidatableObject + public class DiplomaLevelDescriptor : Entities.Common.EdFi.IDiplomaLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisciplineIncidentWeapon"); + private static FullName _fullName = new FullName("edfi", "DiplomaLevelDescriptor"); // Fluent validator instance (threadsafe) - private static DisciplineIncidentWeaponPutPostRequestValidator _validator = new DisciplineIncidentWeaponPutPostRequestValidator(); + private static DiplomaLevelDescriptorPutPostRequestValidator _validator = new DiplomaLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -53993,6 +52368,13 @@ public class DisciplineIncidentWeapon : Entities.Common.EdFi.IDisciplineIncident // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DiplomaLevelDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -54003,33 +52385,19 @@ public class DisciplineIncidentWeapon : Entities.Common.EdFi.IDisciplineIncident //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IDisciplineIncident _disciplineIncident; - - [IgnoreDataMember] - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentWeapon.DisciplineIncident - { - get { return _disciplineIncident; } - set { SetDisciplineIncident(value); } - } - public Entities.Common.EdFi.IDisciplineIncident DisciplineIncident - { - set { SetDisciplineIncident(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int DiplomaLevelDescriptorId { get; set; } - private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident value) + int IDescriptor.DescriptorId { - _disciplineIncident = value; + get { return DiplomaLevelDescriptorId; } + set { DiplomaLevelDescriptorId = value; } } - - /// - /// Identifies the type of weapon used during an incident. The Federal Gun-Free Schools Act requires states to report the number of students expelled for bringing firearms to school by type of firearm. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="weaponDescriptor")][DescriptorExists("WeaponDescriptor")] - public string WeaponDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -54044,7 +52412,7 @@ private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident valu /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentWeapon; + var compareTo = obj as Entities.Common.EdFi.IDiplomaLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -54052,13 +52420,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_disciplineIncident == null || !_disciplineIncident.Equals(compareTo.DisciplineIncident)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineIncidentWeapon).WeaponDescriptor, compareTo.WeaponDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDiplomaLevelDescriptor).DiplomaLevelDescriptorId.Equals(compareTo.DiplomaLevelDescriptorId)) return false; @@ -54074,284 +52438,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_disciplineIncident != null) - hash.Add(_disciplineIncident); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentWeapon).WeaponDescriptor); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncidentWeapon")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.DisciplineIncidentWeaponMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentWeapon)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.DisciplineIncidentWeaponMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentWeapon)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class DisciplineIncidentWeaponPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: DisciplineIncidentParticipationCodeDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.DisciplineIncidentParticipationCodeDescriptor.EdFi -{ - /// - /// A class which represents the edfi.DisciplineIncidentParticipationCodeDescriptor table of the DisciplineIncidentParticipationCodeDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class DisciplineIncidentParticipationCodeDescriptor : Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "DisciplineIncidentParticipationCodeDescriptor"); - - // Fluent validator instance (threadsafe) - private static DisciplineIncidentParticipationCodeDescriptorPutPostRequestValidator _validator = new DisciplineIncidentParticipationCodeDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the DisciplineIncidentParticipationCodeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int DisciplineIncidentParticipationCodeDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return DisciplineIncidentParticipationCodeDescriptorId; } - set { DisciplineIncidentParticipationCodeDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor).DisciplineIncidentParticipationCodeDescriptorId.Equals(compareTo.DisciplineIncidentParticipationCodeDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor).DisciplineIncidentParticipationCodeDescriptorId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDiplomaLevelDescriptor).DiplomaLevelDescriptorId); return hash.ToHashCode(); } @@ -54468,12 +52557,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisciplineIncidentParticipationCodeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target); + return Entities.Common.EdFi.DiplomaLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDiplomaLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisciplineIncidentParticipationCodeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target, null); + Entities.Common.EdFi.DiplomaLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDiplomaLevelDescriptor)target, null); } // ------------------------------------------------------------- @@ -54488,9 +52577,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisciplineIncidentParticipationCodeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class DiplomaLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -54519,21 +52608,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.DisplacedStudentStatusDescriptor table of the DisplacedStudentStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.DiplomaTypeDescriptor table of the DiplomaTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class DisplacedStudentStatusDescriptor : Entities.Common.EdFi.IDisplacedStudentStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class DiplomaTypeDescriptor : Entities.Common.EdFi.IDiplomaTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "DisplacedStudentStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "DiplomaTypeDescriptor"); // Fluent validator instance (threadsafe) - private static DisplacedStudentStatusDescriptorPutPostRequestValidator _validator = new DisplacedStudentStatusDescriptorPutPostRequestValidator(); + private static DiplomaTypeDescriptorPutPostRequestValidator _validator = new DiplomaTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -54552,7 +52641,7 @@ public class DisplacedStudentStatusDescriptor : Entities.Common.EdFi.IDisplacedS // ------------------------------------------------------------ /// - /// The unique identifier for the DisplacedStudentStatusDescriptor resource. + /// The unique identifier for the DiplomaTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -54573,12 +52662,12 @@ public class DisplacedStudentStatusDescriptor : Entities.Common.EdFi.IDisplacedS /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int DisplacedStudentStatusDescriptorId { get; set; } + public int DiplomaTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return DisplacedStudentStatusDescriptorId; } - set { DisplacedStudentStatusDescriptorId = value; } + get { return DiplomaTypeDescriptorId; } + set { DiplomaTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -54594,7 +52683,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IDisplacedStudentStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IDiplomaTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -54604,7 +52693,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IDisplacedStudentStatusDescriptor).DisplacedStudentStatusDescriptorId.Equals(compareTo.DisplacedStudentStatusDescriptorId)) + if (!(this as Entities.Common.EdFi.IDiplomaTypeDescriptor).DiplomaTypeDescriptorId.Equals(compareTo.DiplomaTypeDescriptorId)) return false; @@ -54622,7 +52711,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IDisplacedStudentStatusDescriptor).DisplacedStudentStatusDescriptorId); + hash.Add((this as Entities.Common.EdFi.IDiplomaTypeDescriptor).DiplomaTypeDescriptorId); return hash.ToHashCode(); } @@ -54739,12 +52828,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.DisplacedStudentStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target); + return Entities.Common.EdFi.DiplomaTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDiplomaTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.DisplacedStudentStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target, null); + Entities.Common.EdFi.DiplomaTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDiplomaTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -54759,9 +52848,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class DisplacedStudentStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class DiplomaTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -54790,21 +52879,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationalEnvironmentDescriptor table of the EducationalEnvironmentDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.DisabilityDescriptor table of the DisabilityDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationalEnvironmentDescriptor : Entities.Common.EdFi.IEducationalEnvironmentDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class DisabilityDescriptor : Entities.Common.EdFi.IDisabilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationalEnvironmentDescriptor"); + private static FullName _fullName = new FullName("edfi", "DisabilityDescriptor"); // Fluent validator instance (threadsafe) - private static EducationalEnvironmentDescriptorPutPostRequestValidator _validator = new EducationalEnvironmentDescriptorPutPostRequestValidator(); + private static DisabilityDescriptorPutPostRequestValidator _validator = new DisabilityDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -54823,7 +52912,7 @@ public class EducationalEnvironmentDescriptor : Entities.Common.EdFi.IEducationa // ------------------------------------------------------------ /// - /// The unique identifier for the EducationalEnvironmentDescriptor resource. + /// The unique identifier for the DisabilityDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -54844,12 +52933,12 @@ public class EducationalEnvironmentDescriptor : Entities.Common.EdFi.IEducationa /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int EducationalEnvironmentDescriptorId { get; set; } + public int DisabilityDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return EducationalEnvironmentDescriptorId; } - set { EducationalEnvironmentDescriptorId = value; } + get { return DisabilityDescriptorId; } + set { DisabilityDescriptorId = value; } } // ------------------------------------------------------------- @@ -54865,7 +52954,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationalEnvironmentDescriptor; + var compareTo = obj as Entities.Common.EdFi.IDisabilityDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -54875,7 +52964,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IEducationalEnvironmentDescriptor).EducationalEnvironmentDescriptorId.Equals(compareTo.EducationalEnvironmentDescriptorId)) + if (!(this as Entities.Common.EdFi.IDisabilityDescriptor).DisabilityDescriptorId.Equals(compareTo.DisabilityDescriptorId)) return false; @@ -54893,7 +52982,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IEducationalEnvironmentDescriptor).EducationalEnvironmentDescriptorId); + hash.Add((this as Entities.Common.EdFi.IDisabilityDescriptor).DisabilityDescriptorId); return hash.ToHashCode(); } @@ -55010,12 +53099,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationalEnvironmentDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target); + return Entities.Common.EdFi.DisabilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisabilityDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationalEnvironmentDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target, null); + Entities.Common.EdFi.DisabilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisabilityDescriptor)target, null); } // ------------------------------------------------------------- @@ -55030,9 +53119,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationalEnvironmentDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisabilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -55061,110 +53150,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the EducationContent resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class EducationContentReference : IResourceReference - { - [DataMember(Name="contentIdentifier")] - public string ContentIdentifier { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return ContentIdentifier != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (ContentIdentifier == default) - { - yield return "ContentIdentifier"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "EducationContent", - Href = $"/ed-fi/educationContents/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.EducationContent table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisabilityDesignationDescriptor table of the DisabilityDesignationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContent : Entities.Common.EdFi.IEducationContent, IHasETag, IDateVersionedEntity, IValidatableObject + public class DisabilityDesignationDescriptor : Entities.Common.EdFi.IDisabilityDesignationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationContent"); + private static FullName _fullName = new FullName("edfi", "DisabilityDesignationDescriptor"); // Fluent validator instance (threadsafe) - private static EducationContentPutPostRequestValidator _validator = new EducationContentPutPostRequestValidator(); + private static DisabilityDesignationDescriptorPutPostRequestValidator _validator = new DisabilityDesignationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -55175,16 +53175,6 @@ public class EducationContent : Entities.Common.EdFi.IEducationContent, IHasETag // Constructor // ------------------------------------------------------------- - public EducationContent() - { - EducationContentAppropriateGradeLevels = new List(); - EducationContentAppropriateSexes = new List(); - EducationContentAuthors = new List(); - EducationContentDerivativeSourceEducationContents = new List(); - EducationContentDerivativeSourceLearningResourceMetadataURIs = new List(); - EducationContentDerivativeSourceURIs = new List(); - EducationContentLanguages = new List(); - } // ------------------------------------------------------------ @@ -55193,7 +53183,7 @@ public EducationContent() // ------------------------------------------------------------ /// - /// The unique identifier for the EducationContent resource. + /// The unique identifier for the DisabilityDesignationDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -55203,40 +53193,6 @@ public EducationContent() // ============================================================= // References // ------------------------------------------------------------- - - private bool _learningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) - _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _learningStandardReference; - } - } - - [DataMember(Name="learningStandardReference")] - [FullyDefinedReference] - public LearningStandard.EdFi.LearningStandardReference LearningStandardReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLearningStandardReference != null - && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference; - - return null; - } - set - { - _learningStandardReferenceExplicitlyAssigned = true; - _learningStandardReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -55244,13 +53200,17 @@ public LearningStandard.EdFi.LearningStandardReference LearningStandardReference // ------------------------------------------------------------- /// - /// A unique identifier for the education content. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(225, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="contentIdentifier")] - public string ContentIdentifier { get; set; } + [JsonIgnore] + public int DisabilityDesignationDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return DisabilityDesignationDescriptorId; } + set { DisabilityDesignationDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -55265,7 +53225,7 @@ public LearningStandard.EdFi.LearningStandardReference LearningStandardReference /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContent; + var compareTo = obj as Entities.Common.EdFi.IDisabilityDesignationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -55274,8 +53234,8 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDisabilityDesignationDescriptor).DisabilityDesignationDescriptorId.Equals(compareTo.DisabilityDesignationDescriptorId)) return false; @@ -55292,8 +53252,8 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationContent).ContentIdentifier); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDisabilityDesignationDescriptor).DisabilityDesignationDescriptorId); return hash.ToHashCode(); } @@ -55302,45 +53262,18 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// Indicates whether there are additional un-named authors. In a research report, this is often marked by the abbreviation \"et al\". - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="additionalAuthorsIndicator")] - public bool? AdditionalAuthorsIndicator { get; set; } - - /// - /// The predominate type or kind characterizing the learning resource. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="contentClassDescriptor")][DescriptorExists("ContentClassDescriptor")] - public string ContentClassDescriptor { get; set; } - - /// - /// An amount that has to be paid or spent to buy or obtain the education content. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="cost")] - public decimal? Cost { get; set; } - - /// - /// The rate by which the cost applies. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="costRateDescriptor")][DescriptorExists("CostRateDescriptor")] - public string CostRateDescriptor { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// An extended written representation of the education content. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] @@ -55348,110 +53281,41 @@ public override int GetHashCode() public string Description { get; set; } /// - /// The predominate mode of learning supported by the learning resource. Acceptable values are active, expositive, or mixed. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="interactivityStyleDescriptor")][DescriptorExists("InteractivityStyleDescriptor")] - public string InteractivityStyleDescriptor { get; set; } - - /// - /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="learningResourceMetadataURI")] - public string LearningResourceMetadataURI { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// The end date of the period when the descriptor is in effect. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IEducationContent.LearningStandardId - { - get - { - if (ImplicitLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - { - return ImplicitLearningStandardReference.LearningStandardId; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LearningStandard - _learningStandardReferenceExplicitlyAssigned = false; - ImplicitLearningStandardReference.LearningStandardId = value; - } - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// Namespace for the education content. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] [DataMember(Name="namespace")] public string Namespace { get; set; } /// - /// The date on which this content was first published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="publicationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? PublicationDate { get; set; } - - /// - /// The year at which this content was first published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="publicationYear")] - public short? PublicationYear { get; set; } - - /// - /// The organization credited with publishing the resource. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="publisher")] - public string Publisher { get; set; } - - /// - /// A short description or name of the entity. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] [DataMember(Name="shortDescription")] public string ShortDescription { get; set; } + // ------------------------------------------------------------- - /// - /// Approximate or typical time that it takes to work with or through this learning resource for the typical intended target audience expressed in minutes. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="timeRequired")] - public string TimeRequired { get; set; } - - /// - /// The URL where the owner specifies permissions for using the resource. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="useRightsURL")] - public string UseRightsURL { get; set; } - - /// - /// The version identifier for the content. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="version")] - public string Version { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -55472,223 +53336,16 @@ string Entities.Common.EdFi.IEducationContent.LearningStandardId // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContent")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _educationContentAppropriateGradeLevels; - private ICollection _educationContentAppropriateGradeLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="appropriateGradeLevels")] - public ICollection EducationContentAppropriateGradeLevels - { - get { return _educationContentAppropriateGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)e.Item).EducationContent = this); - _educationContentAppropriateGradeLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)e.Item).EducationContent = this; - _educationContentAppropriateGradeLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateGradeLevels - { - get { return _educationContentAppropriateGradeLevelsCovariant; } - set { EducationContentAppropriateGradeLevels = new List(value.Cast()); } - } - - private ICollection _educationContentAppropriateSexes; - private ICollection _educationContentAppropriateSexesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="appropriateSexes")] - public ICollection EducationContentAppropriateSexes - { - get { return _educationContentAppropriateSexes; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateSex)e.Item).EducationContent = this); - _educationContentAppropriateSexes = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateSex)e.Item).EducationContent = this; - _educationContentAppropriateSexesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateSexes - { - get { return _educationContentAppropriateSexesCovariant; } - set { EducationContentAppropriateSexes = new List(value.Cast()); } - } - - private ICollection _educationContentAuthors; - private ICollection _educationContentAuthorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="authors")] - public ICollection EducationContentAuthors - { - get { return _educationContentAuthors; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationContentAuthor)e.Item).EducationContent = this); - _educationContentAuthors = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentAuthor)e.Item).EducationContent = this; - _educationContentAuthorsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAuthors - { - get { return _educationContentAuthorsCovariant; } - set { EducationContentAuthors = new List(value.Cast()); } - } - - private ICollection _educationContentDerivativeSourceEducationContents; - private ICollection _educationContentDerivativeSourceEducationContentsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="derivativeSourceEducationContents")] - public ICollection EducationContentDerivativeSourceEducationContents - { - get { return _educationContentDerivativeSourceEducationContents; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)e.Item).EducationContent = this); - _educationContentDerivativeSourceEducationContents = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)e.Item).EducationContent = this; - _educationContentDerivativeSourceEducationContentsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceEducationContents - { - get { return _educationContentDerivativeSourceEducationContentsCovariant; } - set { EducationContentDerivativeSourceEducationContents = new List(value.Cast()); } - } - - private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIs; - private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="derivativeSourceLearningResourceMetadataURIs")] - public ICollection EducationContentDerivativeSourceLearningResourceMetadataURIs - { - get { return _educationContentDerivativeSourceLearningResourceMetadataURIs; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)e.Item).EducationContent = this); - _educationContentDerivativeSourceLearningResourceMetadataURIs = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)e.Item).EducationContent = this; - _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceLearningResourceMetadataURIs - { - get { return _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; } - set { EducationContentDerivativeSourceLearningResourceMetadataURIs = new List(value.Cast()); } - } - - private ICollection _educationContentDerivativeSourceURIs; - private ICollection _educationContentDerivativeSourceURIsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="derivativeSourceURIs")] - public ICollection EducationContentDerivativeSourceURIs - { - get { return _educationContentDerivativeSourceURIs; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)e.Item).EducationContent = this); - _educationContentDerivativeSourceURIs = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)e.Item).EducationContent = this; - _educationContentDerivativeSourceURIsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceURIs - { - get { return _educationContentDerivativeSourceURIsCovariant; } - set { EducationContentDerivativeSourceURIs = new List(value.Cast()); } - } - - private ICollection _educationContentLanguages; - private ICollection _educationContentLanguagesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="languages")] - public ICollection EducationContentLanguages - { - get { return _educationContentLanguages; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationContentLanguage)e.Item).EducationContent = this); - _educationContentLanguages = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentLanguage)e.Item).EducationContent = this; - _educationContentLanguagesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentLanguages - { - get { return _educationContentLanguagesCovariant; } - set { EducationContentLanguages = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -55706,47 +53363,6 @@ public ICollection EducationContentLanguages // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_educationContentAppropriateGradeLevels != null) foreach (var item in _educationContentAppropriateGradeLevels) - { - item.EducationContent = this; - } - - if (_educationContentAppropriateSexes != null) foreach (var item in _educationContentAppropriateSexes) - { - item.EducationContent = this; - } - - if (_educationContentAuthors != null) foreach (var item in _educationContentAuthors) - { - item.EducationContent = this; - } - - if (_educationContentDerivativeSourceEducationContents != null) foreach (var item in _educationContentDerivativeSourceEducationContents) - { - item.EducationContent = this; - } - - if (_educationContentDerivativeSourceLearningResourceMetadataURIs != null) foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) - { - item.EducationContent = this; - } - - if (_educationContentDerivativeSourceURIs != null) foreach (var item in _educationContentDerivativeSourceURIs) - { - item.EducationContent = this; - } - - if (_educationContentLanguages != null) foreach (var item in _educationContentLanguages) - { - item.EducationContent = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -55754,176 +53370,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContent)target); + return Entities.Common.EdFi.DisabilityDesignationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisabilityDesignationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentMapper.MapTo(this, (Entities.Common.EdFi.IEducationContent)target, null); + Entities.Common.EdFi.DisabilityDesignationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisabilityDesignationDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IEducationContent.LearningStandardResourceId - { - get { return null; } - set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLearningStandardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (EducationContentAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("EducationContentAppropriateGradeLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationContentAppropriateGradeLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("EducationContentAppropriateGradeLevels")))) - { - yield return result; - } - } - - if (EducationContentAppropriateSexes.Any() && mappingContract?.IsMemberSupported("EducationContentAppropriateSexes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationContentAppropriateSexes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentAppropriateSexes, validationContext, validationContext.Items.ForCollection("EducationContentAppropriateSexes")))) - { - yield return result; - } - } - - if (EducationContentAuthors.Any() && mappingContract?.IsMemberSupported("EducationContentAuthors") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationContentAuthors"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentAuthors, validationContext, validationContext.Items.ForCollection("EducationContentAuthors")))) - { - yield return result; - } - } - - if (EducationContentDerivativeSourceEducationContents.Any() && mappingContract?.IsMemberSupported("EducationContentDerivativeSourceEducationContents") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationContentDerivativeSourceEducationContents"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentDerivativeSourceEducationContents, validationContext, validationContext.Items.ForCollection("EducationContentDerivativeSourceEducationContents")))) - { - yield return result; - } - } - - if (EducationContentDerivativeSourceLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("EducationContentDerivativeSourceLearningResourceMetadataURIs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationContentDerivativeSourceLearningResourceMetadataURIs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentDerivativeSourceLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("EducationContentDerivativeSourceLearningResourceMetadataURIs")))) - { - yield return result; - } - } - - if (EducationContentDerivativeSourceURIs.Any() && mappingContract?.IsMemberSupported("EducationContentDerivativeSourceURIs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationContentDerivativeSourceURIs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentDerivativeSourceURIs, validationContext, validationContext.Items.ForCollection("EducationContentDerivativeSourceURIs")))) - { - yield return result; - } - } - - if (EducationContentLanguages.Any() && mappingContract?.IsMemberSupported("EducationContentLanguages") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationContentLanguages"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentLanguages, validationContext, validationContext.Items.ForCollection("EducationContentLanguages")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -55931,20 +53390,9 @@ string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationContentPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisabilityDesignationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_EducationContent = new FullName("edfi", "EducationContent"); - - // Declare collection item validators - private EducationContentAppropriateGradeLevelPutPostRequestValidator _educationContentAppropriateGradeLevelsValidator = new (); - private EducationContentAppropriateSexPutPostRequestValidator _educationContentAppropriateSexesValidator = new (); - private EducationContentAuthorPutPostRequestValidator _educationContentAuthorsValidator = new (); - private EducationContentDerivativeSourceEducationContentPutPostRequestValidator _educationContentDerivativeSourceEducationContentsValidator = new (); - private EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator _educationContentDerivativeSourceLearningResourceMetadataURIsValidator = new (); - private EducationContentDerivativeSourceURIPutPostRequestValidator _educationContentDerivativeSourceURIsValidator = new (); - private EducationContentLanguagePutPostRequestValidator _educationContentLanguagesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -55957,94 +53405,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (EducationContentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_EducationContent); - - if (mappingContract != null) - { - if (mappingContract.IsEducationContentAppropriateGradeLevelIncluded != null) - { - var hasInvalidEducationContentAppropriateGradeLevelsItems = instance.EducationContentAppropriateGradeLevels.Any(x => !mappingContract.IsEducationContentAppropriateGradeLevelIncluded(x)); - - if (hasInvalidEducationContentAppropriateGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationContentAppropriateGradeLevels", $"A supplied 'EducationContentAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationContentAppropriateSexIncluded != null) - { - var hasInvalidEducationContentAppropriateSexesItems = instance.EducationContentAppropriateSexes.Any(x => !mappingContract.IsEducationContentAppropriateSexIncluded(x)); - - if (hasInvalidEducationContentAppropriateSexesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationContentAppropriateSexes", $"A supplied 'EducationContentAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationContentAuthorIncluded != null) - { - var hasInvalidEducationContentAuthorsItems = instance.EducationContentAuthors.Any(x => !mappingContract.IsEducationContentAuthorIncluded(x)); - - if (hasInvalidEducationContentAuthorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationContentAuthors", $"A supplied 'EducationContentAuthor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationContentDerivativeSourceEducationContentIncluded != null) - { - var hasInvalidEducationContentDerivativeSourceEducationContentsItems = instance.EducationContentDerivativeSourceEducationContents.Any(x => !mappingContract.IsEducationContentDerivativeSourceEducationContentIncluded(x)); - - if (hasInvalidEducationContentDerivativeSourceEducationContentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationContentDerivativeSourceEducationContents", $"A supplied 'EducationContentDerivativeSourceEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationContentDerivativeSourceLearningResourceMetadataURIIncluded != null) - { - var hasInvalidEducationContentDerivativeSourceLearningResourceMetadataURIsItems = instance.EducationContentDerivativeSourceLearningResourceMetadataURIs.Any(x => !mappingContract.IsEducationContentDerivativeSourceLearningResourceMetadataURIIncluded(x)); - - if (hasInvalidEducationContentDerivativeSourceLearningResourceMetadataURIsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationContentDerivativeSourceLearningResourceMetadataURIs", $"A supplied 'EducationContentDerivativeSourceLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationContentDerivativeSourceURIIncluded != null) - { - var hasInvalidEducationContentDerivativeSourceURIsItems = instance.EducationContentDerivativeSourceURIs.Any(x => !mappingContract.IsEducationContentDerivativeSourceURIIncluded(x)); - - if (hasInvalidEducationContentDerivativeSourceURIsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationContentDerivativeSourceURIs", $"A supplied 'EducationContentDerivativeSourceURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationContentLanguageIncluded != null) - { - var hasInvalidEducationContentLanguagesItems = instance.EducationContentLanguages.Any(x => !mappingContract.IsEducationContentLanguageIncluded(x)); - - if (hasInvalidEducationContentLanguagesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationContentLanguages", $"A supplied 'EducationContentLanguage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -56060,17 +53420,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationContentAppropriateGradeLevel table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisabilityDeterminationSourceTypeDescriptor table of the DisabilityDeterminationSourceTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContentAppropriateGradeLevel : Entities.Common.EdFi.IEducationContentAppropriateGradeLevel, IValidatableObject + public class DisabilityDeterminationSourceTypeDescriptor : Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationContentAppropriateGradeLevel"); + private static FullName _fullName = new FullName("edfi", "DisabilityDeterminationSourceTypeDescriptor"); // Fluent validator instance (threadsafe) - private static EducationContentAppropriateGradeLevelPutPostRequestValidator _validator = new EducationContentAppropriateGradeLevelPutPostRequestValidator(); + private static DisabilityDeterminationSourceTypeDescriptorPutPostRequestValidator _validator = new DisabilityDeterminationSourceTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -56087,6 +53452,13 @@ public class EducationContentAppropriateGradeLevel : Entities.Common.EdFi.IEduca // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DisabilityDeterminationSourceTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -56097,33 +53469,19 @@ public class EducationContentAppropriateGradeLevel : Entities.Common.EdFi.IEduca //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationContent _educationContent; - - [IgnoreDataMember] - Entities.Common.EdFi.IEducationContent IEducationContentAppropriateGradeLevel.EducationContent - { - get { return _educationContent; } - set { SetEducationContent(value); } - } - public Entities.Common.EdFi.IEducationContent EducationContent - { - set { SetEducationContent(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int DisabilityDeterminationSourceTypeDescriptorId { get; set; } - private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + int IDescriptor.DescriptorId { - _educationContent = value; + get { return DisabilityDeterminationSourceTypeDescriptorId; } + set { DisabilityDeterminationSourceTypeDescriptorId = value; } } - - /// - /// Grade levels for which this education content is applicable. If omitted, considered generally applicable. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -56138,7 +53496,7 @@ private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContentAppropriateGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -56146,13 +53504,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationContentAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor).DisabilityDeterminationSourceTypeDescriptorId.Equals(compareTo.DisabilityDeterminationSourceTypeDescriptorId)) return false; @@ -56168,12 +53522,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationContent != null) - hash.Add(_educationContent); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationContentAppropriateGradeLevel).GradeLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor).DisabilityDeterminationSourceTypeDescriptorId); return hash.ToHashCode(); } @@ -56182,6 +53533,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -56207,8 +53607,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentAppropriateGradeLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -56219,6 +53622,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -56231,12 +53641,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target); + return Entities.Common.EdFi.DisabilityDeterminationSourceTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target, null); + Entities.Common.EdFi.DisabilityDeterminationSourceTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -56244,114 +53654,173 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + } - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; + // ================================================================= + // Validators + // ----------------------------------------------------------------- - try + [ExcludeFromCodeCoverage] + public class DisabilityDeterminationSourceTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // ---------------------- - // Validate collections - // ---------------------- + return false; + } - // --------------------------- - // Validate embedded objects - // --------------------------- + var instance = context.InstanceToValidate; - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } + result.Errors.Add(failure); } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; + return false; } - // ---------------------------------- + + return true; } } - - // ================================================================= - // Validators // ----------------------------------------------------------------- +} +// Aggregate: DisciplineAction + +namespace EdFi.Ods.Api.Common.Models.Resources.DisciplineAction.EdFi +{ + /// + /// Represents a reference to the DisciplineAction resource. + /// + [DataContract] [ExcludeFromCodeCoverage] - public class EducationContentAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineActionReference : IResourceReference { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + [DataMember(Name="disciplineActionIdentifier")] + public string DisciplineActionIdentifier { get; set; } + + [DataMember(Name="disciplineDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime DisciplineDate { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId { - if (context.InstanceToValidate == null) + get => _studentUniqueId; + set { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } + } + private string _studentUniqueId; - var instance = context.InstanceToValidate; + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } - var failures = new List(); + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } - if (failures.Any()) + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get { - foreach (var failure in failures) + if (_link == null) { - result.Errors.Add(failure); + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); } - return false; + return _link; } + } - return true; + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return DisciplineActionIdentifier != default(string) && DisciplineDate != default(DateTime) && StudentUniqueId != default(string); } - } - // ----------------------------------------------------------------- + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (DisciplineActionIdentifier == default) + { + yield return "DisciplineActionIdentifier"; + } + + if (DisciplineDate == default) + { + yield return "DisciplineDate"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "DisciplineAction", + Href = $"/ed-fi/disciplineActions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference /// - /// A class which represents the edfi.EducationContentAppropriateSex table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineAction table of the DisciplineAction aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContentAppropriateSex : Entities.Common.EdFi.IEducationContentAppropriateSex, IValidatableObject + public class DisciplineAction : Entities.Common.EdFi.IDisciplineAction, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationContentAppropriateSex"); + private static FullName _fullName = new FullName("edfi", "DisciplineAction"); // Fluent validator instance (threadsafe) - private static EducationContentAppropriateSexPutPostRequestValidator _validator = new EducationContentAppropriateSexPutPostRequestValidator(); + private static DisciplineActionPutPostRequestValidator _validator = new DisciplineActionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -56362,49 +53831,178 @@ public class EducationContentAppropriateSex : Entities.Common.EdFi.IEducationCon // Constructor // ------------------------------------------------------------- + public DisciplineAction() + { + DisciplineActionDisciplines = new List(); + DisciplineActionStaffs = new List(); + DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DisciplineAction resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationContent _educationContent; + private bool _assignmentSchoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _assignmentSchoolReference; + private School.EdFi.SchoolReference ImplicitAssignmentSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assignmentSchoolReference == null && !_assignmentSchoolReferenceExplicitlyAssigned) + _assignmentSchoolReference = new School.EdFi.SchoolReference(); - [IgnoreDataMember] - Entities.Common.EdFi.IEducationContent IEducationContentAppropriateSex.EducationContent + return _assignmentSchoolReference; + } + } + + [DataMember(Name="assignmentSchoolReference")] + [FullyDefinedReference] + public School.EdFi.SchoolReference AssignmentSchoolReference { - get { return _educationContent; } - set { SetEducationContent(value); } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssignmentSchoolReference != null + && (_assignmentSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssignmentSchoolReference.IsReferenceFullyDefined())) + return ImplicitAssignmentSchoolReference; + + return null; + } + set + { + _assignmentSchoolReferenceExplicitlyAssigned = true; + _assignmentSchoolReference = value; + } } + private bool _responsibilitySchoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _responsibilitySchoolReference; + private School.EdFi.SchoolReference ImplicitResponsibilitySchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_responsibilitySchoolReference == null && !_responsibilitySchoolReferenceExplicitlyAssigned) + _responsibilitySchoolReference = new School.EdFi.SchoolReference(); - public Entities.Common.EdFi.IEducationContent EducationContent + return _responsibilitySchoolReference; + } + } + + [DataMember(Name="responsibilitySchoolReference")] + [FullyDefinedReference][RequiredReference("edfi", "DisciplineAction")] + public School.EdFi.SchoolReference ResponsibilitySchoolReference { - set { SetEducationContent(value); } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitResponsibilitySchoolReference != null + && (_responsibilitySchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitResponsibilitySchoolReference.IsReferenceFullyDefined())) + return ImplicitResponsibilitySchoolReference; + + return null; + } + set + { + _responsibilitySchoolReferenceExplicitlyAssigned = true; + _responsibilitySchoolReference = value; + } } + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); - private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + return _studentReference; + } + } + + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference { - _educationContent = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; + + return null; + } + set + { + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// Sexes for which this education content is applicable. If omitted, considered generally applicable. + /// Identifier assigned by the education organization to the discipline action. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] - public string SexDescriptor { get; set; } + [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="disciplineActionIdentifier")] + public string DisciplineActionIdentifier { get; set; } + + /// + /// The date of the discipline action. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="disciplineDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime DisciplineDate { get; set; } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IDisciplineAction.StudentUniqueId + { + get + { + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } // ------------------------------------------------------------- // ============================================================= @@ -56419,7 +54017,7 @@ private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContentAppropriateSex; + var compareTo = obj as Entities.Common.EdFi.IDisciplineAction; if (ReferenceEquals(this, compareTo)) return true; @@ -56427,13 +54025,19 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineAction).DisciplineActionIdentifier, compareTo.DisciplineActionIdentifier)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationContentAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) + if (!(this as Entities.Common.EdFi.IDisciplineAction).DisciplineDate.Equals(compareTo.DisciplineDate)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineAction).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -56449,13 +54053,17 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationContent != null) - hash.Add(_educationContent); // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationContentAppropriateSex).SexDescriptor); + hash.Add((this as Entities.Common.EdFi.IDisciplineAction).DisciplineActionIdentifier); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IDisciplineAction).DisciplineDate); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IDisciplineAction).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -56468,6 +54076,98 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// Indicates the actual length in school days of a student's disciplinary assignment. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="actualDisciplineActionLength")] + public decimal? ActualDisciplineActionLength { get; set; } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolId + { + get + { + if (ImplicitAssignmentSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssignmentSchoolReference.IsReferenceFullyDefined())) + { + return ImplicitAssignmentSchoolReference.SchoolId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssignmentSchool + _assignmentSchoolReferenceExplicitlyAssigned = false; + ImplicitAssignmentSchoolReference.SchoolId = value.GetValueOrDefault(); + } + } + + /// + /// The length of time in school days for the discipline action (e.g. removal, detention), if applicable. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="disciplineActionLength")] + public decimal? DisciplineActionLength { get; set; } + + /// + /// Indicates the reason for the difference, if any, between the official and actual lengths of a student's disciplinary assignment. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="disciplineActionLengthDifferenceReasonDescriptor")][DescriptorExists("DisciplineActionLengthDifferenceReasonDescriptor")] + public string DisciplineActionLengthDifferenceReasonDescriptor { get; set; } + + /// + /// An indication as to whether an offense and/or disciplinary action resulted in a meeting of a student's Individualized Education Program (IEP) team to determine appropriate placement. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="iepPlacementMeetingIndicator")] + public bool? IEPPlacementMeetingIndicator { get; set; } + + /// + /// An indication of whether or not this disciplinary action taken against a student was imposed as a consequence of state or local zero tolerance policies. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="relatedToZeroTolerancePolicy")] + public bool? RelatedToZeroTolerancePolicy { get; set; } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolId + { + get + { + if (ImplicitResponsibilitySchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitResponsibilitySchoolReference.IsReferenceFullyDefined())) + { + return ImplicitResponsibilitySchoolReference.SchoolId; + } + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ResponsibilitySchool + _responsibilitySchoolReferenceExplicitlyAssigned = false; + ImplicitResponsibilitySchoolReference.SchoolId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -56488,23 +54188,141 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentAppropriateSex")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineAction")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _disciplineActionDisciplines; + private ICollection _disciplineActionDisciplinesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="disciplines")] + public ICollection DisciplineActionDisciplines + { + get { return _disciplineActionDisciplines; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IDisciplineActionDiscipline)e.Item).DisciplineAction = this); + _disciplineActionDisciplines = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineActionDiscipline)e.Item).DisciplineAction = this; + _disciplineActionDisciplinesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionDisciplines + { + get { return _disciplineActionDisciplinesCovariant; } + set { DisciplineActionDisciplines = new List(value.Cast()); } + } + + private ICollection _disciplineActionStaffs; + private ICollection _disciplineActionStaffsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="staffs")] + public ICollection DisciplineActionStaffs + { + get { return _disciplineActionStaffs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IDisciplineActionStaff)e.Item).DisciplineAction = this); + _disciplineActionStaffs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineActionStaff)e.Item).DisciplineAction = this; + _disciplineActionStaffsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStaffs + { + get { return _disciplineActionStaffsCovariant; } + set { DisciplineActionStaffs = new List(value.Cast()); } + } + + private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociations; + private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="studentDisciplineIncidentBehaviorAssociations")] + public ICollection DisciplineActionStudentDisciplineIncidentBehaviorAssociations + { + get { return _disciplineActionStudentDisciplineIncidentBehaviorAssociations; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)e.Item).DisciplineAction = this); + _disciplineActionStudentDisciplineIncidentBehaviorAssociations = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)e.Item).DisciplineAction = this; + _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStudentDisciplineIncidentBehaviorAssociations + { + get { return _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; } + set { DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_disciplineActionDisciplines != null) foreach (var item in _disciplineActionDisciplines) + { + item.DisciplineAction = this; + } + + if (_disciplineActionStaffs != null) foreach (var item in _disciplineActionStaffs) + { + item.DisciplineAction = this; + } + + if (_disciplineActionStudentDisciplineIncidentBehaviorAssociations != null) foreach (var item in _disciplineActionStudentDisciplineIncidentBehaviorAssociations) + { + item.DisciplineAction = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -56512,18 +54330,46 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentAppropriateSex)target); + return Entities.Common.EdFi.DisciplineActionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineAction)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentAppropriateSex)target, null); + Entities.Common.EdFi.DisciplineActionMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineAction)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolResourceId + { + get { return null; } + set { ImplicitAssignmentSchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolResourceId + { + get { return null; } + set { ImplicitResponsibilitySchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IDisciplineAction.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -56541,12 +54387,47 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (DisciplineActionDisciplines.Any() && mappingContract?.IsMemberSupported("DisciplineActionDisciplines") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("DisciplineActionDisciplines"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineActionDisciplines, validationContext, validationContext.Items.ForCollection("DisciplineActionDisciplines")))) + { + yield return result; + } + } + + if (DisciplineActionStaffs.Any() && mappingContract?.IsMemberSupported("DisciplineActionStaffs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("DisciplineActionStaffs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineActionStaffs, validationContext, validationContext.Items.ForCollection("DisciplineActionStaffs")))) + { + yield return result; + } + } + + if (DisciplineActionStudentDisciplineIncidentBehaviorAssociations.Any() && mappingContract?.IsMemberSupported("DisciplineActionStudentDisciplineIncidentBehaviorAssociations") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("DisciplineActionStudentDisciplineIncidentBehaviorAssociations"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineActionStudentDisciplineIncidentBehaviorAssociations, validationContext, validationContext.Items.ForCollection("DisciplineActionStudentDisciplineIncidentBehaviorAssociations")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -56592,9 +54473,16 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationContentAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineActionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_DisciplineAction = new FullName("edfi", "DisciplineAction"); + + // Declare collection item validators + private DisciplineActionDisciplinePutPostRequestValidator _disciplineActionDisciplinesValidator = new (); + private DisciplineActionStaffPutPostRequestValidator _disciplineActionStaffsValidator = new (); + private DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator _disciplineActionStudentDisciplineIncidentBehaviorAssociationsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -56607,6 +54495,50 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (DisciplineActionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_DisciplineAction); + + if (mappingContract != null) + { + if (mappingContract.IsDisciplineActionDisciplineIncluded != null) + { + var hasInvalidDisciplineActionDisciplinesItems = instance.DisciplineActionDisciplines.Any(x => !mappingContract.IsDisciplineActionDisciplineIncluded(x)); + + if (hasInvalidDisciplineActionDisciplinesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("DisciplineActionDisciplines", $"A supplied 'DisciplineActionDiscipline' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsDisciplineActionStaffIncluded != null) + { + var hasInvalidDisciplineActionStaffsItems = instance.DisciplineActionStaffs.Any(x => !mappingContract.IsDisciplineActionStaffIncluded(x)); + + if (hasInvalidDisciplineActionStaffsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("DisciplineActionStaffs", $"A supplied 'DisciplineActionStaff' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsDisciplineActionStudentDisciplineIncidentBehaviorAssociationIncluded != null) + { + var hasInvalidDisciplineActionStudentDisciplineIncidentBehaviorAssociationsItems = instance.DisciplineActionStudentDisciplineIncidentBehaviorAssociations.Any(x => !mappingContract.IsDisciplineActionStudentDisciplineIncidentBehaviorAssociationIncluded(x)); + + if (hasInvalidDisciplineActionStudentDisciplineIncidentBehaviorAssociationsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("DisciplineActionStudentDisciplineIncidentBehaviorAssociations", $"A supplied 'DisciplineActionStudentDisciplineIncidentBehaviorAssociation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -56623,16 +54555,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationContentAuthor table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineActionDiscipline table of the DisciplineAction aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContentAuthor : Entities.Common.EdFi.IEducationContentAuthor, IValidatableObject + public class DisciplineActionDiscipline : Entities.Common.EdFi.IDisciplineActionDiscipline, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationContentAuthor"); + private static FullName _fullName = new FullName("edfi", "DisciplineActionDiscipline"); // Fluent validator instance (threadsafe) - private static EducationContentAuthorPutPostRequestValidator _validator = new EducationContentAuthorPutPostRequestValidator(); + private static DisciplineActionDisciplinePutPostRequestValidator _validator = new DisciplineActionDisciplinePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -56659,33 +54591,33 @@ public class EducationContentAuthor : Entities.Common.EdFi.IEducationContentAuth //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationContent _educationContent; + private Entities.Common.EdFi.IDisciplineAction _disciplineAction; [IgnoreDataMember] - Entities.Common.EdFi.IEducationContent IEducationContentAuthor.EducationContent + Entities.Common.EdFi.IDisciplineAction IDisciplineActionDiscipline.DisciplineAction { - get { return _educationContent; } - set { SetEducationContent(value); } + get { return _disciplineAction; } + set { SetDisciplineAction(value); } } - public Entities.Common.EdFi.IEducationContent EducationContent + public Entities.Common.EdFi.IDisciplineAction DisciplineAction { - set { SetEducationContent(value); } + set { SetDisciplineAction(value); } } - private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + private void SetDisciplineAction(Entities.Common.EdFi.IDisciplineAction value) { - _educationContent = value; + _disciplineAction = value; } /// - /// The individual credited with the creation of the resource. + /// Type of action, such as removal from the classroom, used to discipline the student involved as a perpetrator in a discipline incident. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="author")] - public string Author { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="disciplineDescriptor")][DescriptorExists("DisciplineDescriptor")] + public string DisciplineDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -56700,7 +54632,7 @@ private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContentAuthor; + var compareTo = obj as Entities.Common.EdFi.IDisciplineActionDiscipline; if (ReferenceEquals(this, compareTo)) return true; @@ -56709,12 +54641,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + if (_disciplineAction == null || !_disciplineAction.Equals(compareTo.DisciplineAction)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentAuthor).Author, compareTo.Author)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineActionDiscipline).DisciplineDescriptor, compareTo.DisciplineDescriptor)) return false; @@ -56731,11 +54663,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_educationContent != null) - hash.Add(_educationContent); + if (_disciplineAction != null) + hash.Add(_disciplineAction); // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationContentAuthor).Author); + hash.Add((this as Entities.Common.EdFi.IDisciplineActionDiscipline).DisciplineDescriptor); return hash.ToHashCode(); } @@ -56769,7 +54701,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentAuthor")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineActionDiscipline")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -56793,12 +54725,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentAuthorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentAuthor)target); + return Entities.Common.EdFi.DisciplineActionDisciplineMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionDiscipline)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentAuthorMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentAuthor)target, null); + Entities.Common.EdFi.DisciplineActionDisciplineMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionDiscipline)target, null); } // ------------------------------------------------------------- @@ -56873,9 +54805,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationContentAuthorPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineActionDisciplinePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -56904,16 +54836,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationContentDerivativeSourceEducationContent table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineActionStaff table of the DisciplineAction aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceEducationContent : Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent, IValidatableObject + public class DisciplineActionStaff : Entities.Common.EdFi.IDisciplineActionStaff, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationContentDerivativeSourceEducationContent"); + private static FullName _fullName = new FullName("edfi", "DisciplineActionStaff"); // Fluent validator instance (threadsafe) - private static EducationContentDerivativeSourceEducationContentPutPostRequestValidator _validator = new EducationContentDerivativeSourceEducationContentPutPostRequestValidator(); + private static DisciplineActionStaffPutPostRequestValidator _validator = new DisciplineActionStaffPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -56936,37 +54868,37 @@ public class EducationContentDerivativeSourceEducationContent : Entities.Common. // References // ------------------------------------------------------------- - private bool _derivativeSourceEducationContentReferenceExplicitlyAssigned; - private EducationContentReference _derivativeSourceEducationContentReference; - private EducationContentReference ImplicitDerivativeSourceEducationContentReference + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_derivativeSourceEducationContentReference == null && !_derivativeSourceEducationContentReferenceExplicitlyAssigned) - _derivativeSourceEducationContentReference = new EducationContentReference(); + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); - return _derivativeSourceEducationContentReference; + return _staffReference; } } - [DataMember(Name="derivativeSourceEducationContentReference")] + [DataMember(Name="staffReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationContentReference DerivativeSourceEducationContentReference + public Staff.EdFi.StaffReference StaffReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitDerivativeSourceEducationContentReference != null - && (_derivativeSourceEducationContentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDerivativeSourceEducationContentReference.IsReferenceFullyDefined())) - return ImplicitDerivativeSourceEducationContentReference; + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; return null; } set { - _derivativeSourceEducationContentReferenceExplicitlyAssigned = true; - _derivativeSourceEducationContentReference = value; + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; } } // ------------------------------------------------------------- @@ -56974,36 +54906,36 @@ public EducationContentReference DerivativeSourceEducationContentReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationContent _educationContent; + private Entities.Common.EdFi.IDisciplineAction _disciplineAction; [IgnoreDataMember] - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducationContent.EducationContent + Entities.Common.EdFi.IDisciplineAction IDisciplineActionStaff.DisciplineAction { - get { return _educationContent; } - set { SetEducationContent(value); } + get { return _disciplineAction; } + set { SetDisciplineAction(value); } } - public Entities.Common.EdFi.IEducationContent EducationContent + public Entities.Common.EdFi.IDisciplineAction DisciplineAction { - set { SetEducationContent(value); } + set { SetDisciplineAction(value); } } - private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + private void SetDisciplineAction(Entities.Common.EdFi.IDisciplineAction value) { - _educationContent = value; + _disciplineAction = value; } /// - /// A unique identifier for the education content. + /// A unique alphanumeric code assigned to a staff. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceContentIdentifier + string Entities.Common.EdFi.IDisciplineActionStaff.StaffUniqueId { get { - if (ImplicitDerivativeSourceEducationContentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitDerivativeSourceEducationContentReference.IsReferenceFullyDefined())) - return ImplicitDerivativeSourceEducationContentReference.ContentIdentifier; + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; return default(string); } @@ -57012,9 +54944,10 @@ string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.De // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // DerivativeSourceEducationContent - _derivativeSourceEducationContentReferenceExplicitlyAssigned = false; - ImplicitDerivativeSourceEducationContentReference.ContentIdentifier = value; + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); } } // ------------------------------------------------------------- @@ -57031,7 +54964,7 @@ string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.De /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent; + var compareTo = obj as Entities.Common.EdFi.IDisciplineActionStaff; if (ReferenceEquals(this, compareTo)) return true; @@ -57040,12 +54973,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + if (_disciplineAction == null || !_disciplineAction.Equals(compareTo.DisciplineAction)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent).DerivativeSourceContentIdentifier, compareTo.DerivativeSourceContentIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineActionStaff).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -57062,11 +54995,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_educationContent != null) - hash.Add(_educationContent); + if (_disciplineAction != null) + hash.Add(_disciplineAction); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent).DerivativeSourceContentIdentifier); + hash.Add((this as Entities.Common.EdFi.IDisciplineActionStaff).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -57099,7 +55032,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentDerivativeSourceEducationContent")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineActionStaff")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -57123,29 +55056,29 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentDerivativeSourceEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target); + return Entities.Common.EdFi.DisciplineActionStaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionStaff)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentDerivativeSourceEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target, null); + Entities.Common.EdFi.DisciplineActionStaffMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionStaff)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentResourceId + Guid? Entities.Common.EdFi.IDisciplineActionStaff.StaffResourceId { get { return null; } - set { ImplicitDerivativeSourceEducationContentReference.ResourceId = value ?? default(Guid); } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentDiscriminator + string Entities.Common.EdFi.IDisciplineActionStaff.StaffDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitDerivativeSourceEducationContentReference.Discriminator = value; } + set { ImplicitStaffReference.Discriminator = value; } } @@ -57217,9 +55150,9 @@ string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.De // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineActionStaffPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -57248,16 +55181,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationContentDerivativeSourceLearningResourceMetadataURI table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineActionStudentDisciplineIncidentBehaviorAssociation table of the DisciplineAction aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceLearningResourceMetadataURI : Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI, IValidatableObject + public class DisciplineActionStudentDisciplineIncidentBehaviorAssociation : Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationContentDerivativeSourceLearningResourceMetadataURI"); + private static FullName _fullName = new FullName("edfi", "DisciplineActionStudentDisciplineIncidentBehaviorAssociation"); // Fluent validator instance (threadsafe) - private static EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator _validator = new EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator(); + private static DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator _validator = new DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -57279,38 +55212,140 @@ public class EducationContentDerivativeSourceLearningResourceMetadataURI : Entit // ============================================================= // References // ------------------------------------------------------------- + + private bool _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned; + private StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference _studentDisciplineIncidentBehaviorAssociationReference; + private StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference ImplicitStudentDisciplineIncidentBehaviorAssociationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentDisciplineIncidentBehaviorAssociationReference == null && !_studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned) + _studentDisciplineIncidentBehaviorAssociationReference = new StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference(); + + return _studentDisciplineIncidentBehaviorAssociationReference; + } + } + + [DataMember(Name="studentDisciplineIncidentBehaviorAssociationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentDisciplineIncidentBehaviorAssociation.EdFi.StudentDisciplineIncidentBehaviorAssociationReference StudentDisciplineIncidentBehaviorAssociationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null + && (_studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentDisciplineIncidentBehaviorAssociationReference; + + return null; + } + set + { + _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned = true; + _studentDisciplineIncidentBehaviorAssociationReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationContent _educationContent; + private Entities.Common.EdFi.IDisciplineAction _disciplineAction; [IgnoreDataMember] - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceLearningResourceMetadataURI.EducationContent + Entities.Common.EdFi.IDisciplineAction IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.DisciplineAction { - get { return _educationContent; } - set { SetEducationContent(value); } + get { return _disciplineAction; } + set { SetDisciplineAction(value); } } - public Entities.Common.EdFi.IEducationContent EducationContent + public Entities.Common.EdFi.IDisciplineAction DisciplineAction { - set { SetEducationContent(value); } + set { SetDisciplineAction(value); } } - private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + private void SetDisciplineAction(Entities.Common.EdFi.IDisciplineAction value) { - _educationContent = value; + _disciplineAction = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned) + { + ImplicitStudentDisciplineIncidentBehaviorAssociationReference.StudentUniqueId = _disciplineAction.StudentUniqueId; + } } /// - /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. + /// Describes behavior by category. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="derivativeSourceLearningResourceMetadataURI")] - public string DerivativeSourceLearningResourceMetadataURI { get; set; } + + // IS in a reference (DisciplineActionStudentDisciplineIncidentBehaviorAssociation.BehaviorDescriptorId), IS a lookup column + string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.BehaviorDescriptor + { + get + { + if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentDisciplineIncidentBehaviorAssociationReference.BehaviorDescriptor; + + return null; + } + set + { + ImplicitStudentDisciplineIncidentBehaviorAssociationReference.BehaviorDescriptor = value; + } + } + + /// + /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.IncidentIdentifier + { + get + { + if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IncidentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentDisciplineIncidentBehaviorAssociation + _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IncidentIdentifier = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.SchoolId + { + get + { + if (ImplicitStudentDisciplineIncidentBehaviorAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentDisciplineIncidentBehaviorAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentDisciplineIncidentBehaviorAssociationReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentDisciplineIncidentBehaviorAssociation + _studentDisciplineIncidentBehaviorAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentDisciplineIncidentBehaviorAssociationReference.SchoolId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -57325,7 +55360,7 @@ private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI; + var compareTo = obj as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -57334,12 +55369,22 @@ public override bool Equals(object obj) return false; // Parent Property - if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + if (_disciplineAction == null || !_disciplineAction.Equals(compareTo.DisciplineAction)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI).DerivativeSourceLearningResourceMetadataURI, compareTo.DerivativeSourceLearningResourceMetadataURI)) + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor, compareTo.BehaviorDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).SchoolId.Equals(compareTo.SchoolId)) return false; @@ -57356,12 +55401,18 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_educationContent != null) - hash.Add(_educationContent); + if (_disciplineAction != null) + hash.Add(_disciplineAction); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI).DerivativeSourceLearningResourceMetadataURI); + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).SchoolId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -57394,7 +55445,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentDerivativeSourceLearningResourceMetadataURI")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineAction", "DisciplineActionStudentDisciplineIncidentBehaviorAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -57411,6 +55462,12 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -57418,18 +55475,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentDerivativeSourceLearningResourceMetadataURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)target); + return Entities.Common.EdFi.DisciplineActionStudentDisciplineIncidentBehaviorAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentDerivativeSourceLearningResourceMetadataURIMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)target, null); + Entities.Common.EdFi.DisciplineActionStudentDisciplineIncidentBehaviorAssociationMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationResourceId + { + get { return null; } + set { ImplicitStudentDisciplineIncidentBehaviorAssociationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentDisciplineIncidentBehaviorAssociationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -57472,11 +55543,45 @@ void IMappable.Map(object target) yield return result; } } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - if (!fluentValidationResult.IsValid) + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); + + if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetStudentUniqueIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation).DisciplineAction.StudentUniqueId); + + // Obtain value from other references + var valueFromStudentDisciplineIncidentBehaviorAssociationReference = this.StudentDisciplineIncidentBehaviorAssociationReference?.StudentUniqueId; + + if (valueFromStudentDisciplineIncidentBehaviorAssociationReference != null) + { + yield return ("studentDisciplineIncidentBehaviorAssociationReference.studentUniqueId", this.StudentDisciplineIncidentBehaviorAssociationReference.StudentUniqueId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) { foreach (var error in fluentValidationResult.Errors) { @@ -57498,9 +55603,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineActionStudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -57528,17 +55633,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationContentDerivativeSourceURI table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineActionLengthDifferenceReasonDescriptor table of the DisciplineActionLengthDifferenceReasonDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceURI : Entities.Common.EdFi.IEducationContentDerivativeSourceURI, IValidatableObject + public class DisciplineActionLengthDifferenceReasonDescriptor : Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationContentDerivativeSourceURI"); + private static FullName _fullName = new FullName("edfi", "DisciplineActionLengthDifferenceReasonDescriptor"); // Fluent validator instance (threadsafe) - private static EducationContentDerivativeSourceURIPutPostRequestValidator _validator = new EducationContentDerivativeSourceURIPutPostRequestValidator(); + private static DisciplineActionLengthDifferenceReasonDescriptorPutPostRequestValidator _validator = new DisciplineActionLengthDifferenceReasonDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -57555,6 +55665,13 @@ public class EducationContentDerivativeSourceURI : Entities.Common.EdFi.IEducati // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DisciplineActionLengthDifferenceReasonDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -57565,33 +55682,19 @@ public class EducationContentDerivativeSourceURI : Entities.Common.EdFi.IEducati //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationContent _educationContent; - - [IgnoreDataMember] - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.EducationContent - { - get { return _educationContent; } - set { SetEducationContent(value); } - } - - public Entities.Common.EdFi.IEducationContent EducationContent - { - set { SetEducationContent(value); } - } - - private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) - { - _educationContent = value; - } /// - /// The URI (typical a URL) pointing to an education content item. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="derivativeSourceURI")] - public string DerivativeSourceURI { get; set; } + [JsonIgnore] + public int DisciplineActionLengthDifferenceReasonDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return DisciplineActionLengthDifferenceReasonDescriptorId; } + set { DisciplineActionLengthDifferenceReasonDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -57606,7 +55709,7 @@ private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContentDerivativeSourceURI; + var compareTo = obj as Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -57614,13 +55717,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) - return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentDerivativeSourceURI).DerivativeSourceURI, compareTo.DerivativeSourceURI)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor).DisciplineActionLengthDifferenceReasonDescriptorId.Equals(compareTo.DisciplineActionLengthDifferenceReasonDescriptorId)) return false; @@ -57636,12 +55735,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationContent != null) - hash.Add(_educationContent); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationContentDerivativeSourceURI).DerivativeSourceURI); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor).DisciplineActionLengthDifferenceReasonDescriptorId); return hash.ToHashCode(); } @@ -57650,6 +55746,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -57675,8 +55820,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentDerivativeSourceURI")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -57687,6 +55835,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -57699,12 +55854,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentDerivativeSourceURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target); + return Entities.Common.EdFi.DisciplineActionLengthDifferenceReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentDerivativeSourceURIMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target, null); + Entities.Common.EdFi.DisciplineActionLengthDifferenceReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target, null); } // ------------------------------------------------------------- @@ -57712,66 +55867,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -57779,9 +55874,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineActionLengthDifferenceReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -57809,17 +55904,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationContentLanguage table of the EducationContent aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineDescriptor table of the DisciplineDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationContentLanguage : Entities.Common.EdFi.IEducationContentLanguage, IValidatableObject + public class DisciplineDescriptor : Entities.Common.EdFi.IDisciplineDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationContentLanguage"); + private static FullName _fullName = new FullName("edfi", "DisciplineDescriptor"); // Fluent validator instance (threadsafe) - private static EducationContentLanguagePutPostRequestValidator _validator = new EducationContentLanguagePutPostRequestValidator(); + private static DisciplineDescriptorPutPostRequestValidator _validator = new DisciplineDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -57836,6 +55936,13 @@ public class EducationContentLanguage : Entities.Common.EdFi.IEducationContentLa // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DisciplineDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -57846,33 +55953,19 @@ public class EducationContentLanguage : Entities.Common.EdFi.IEducationContentLa //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationContent _educationContent; - - [IgnoreDataMember] - Entities.Common.EdFi.IEducationContent IEducationContentLanguage.EducationContent - { - get { return _educationContent; } - set { SetEducationContent(value); } - } - public Entities.Common.EdFi.IEducationContent EducationContent - { - set { SetEducationContent(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int DisciplineDescriptorId { get; set; } - private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + int IDescriptor.DescriptorId { - _educationContent = value; + get { return DisciplineDescriptorId; } + set { DisciplineDescriptorId = value; } } - - /// - /// An indication of the languages in which the Education Content is designed. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="languageDescriptor")][DescriptorExists("LanguageDescriptor")] - public string LanguageDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -57887,7 +55980,7 @@ private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationContentLanguage; + var compareTo = obj as Entities.Common.EdFi.IDisciplineDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -57895,13 +55988,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationContentLanguage).LanguageDescriptor, compareTo.LanguageDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDisciplineDescriptor).DisciplineDescriptorId.Equals(compareTo.DisciplineDescriptorId)) return false; @@ -57917,12 +56006,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationContent != null) - hash.Add(_educationContent); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationContentLanguage).LanguageDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDisciplineDescriptor).DisciplineDescriptorId); return hash.ToHashCode(); } @@ -57931,6 +56017,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -57956,8 +56091,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentLanguage")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -57968,6 +56106,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -57980,12 +56125,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationContentLanguageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentLanguage)target); + return Entities.Common.EdFi.DisciplineDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationContentLanguageMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentLanguage)target, null); + Entities.Common.EdFi.DisciplineDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineDescriptor)target, null); } // ------------------------------------------------------------- @@ -57993,66 +56138,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -58060,9 +56145,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationContentLanguagePutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -58091,19 +56176,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the EducationOrganization resource. + /// Represents a reference to the DisciplineIncident resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationReference : IResourceReference + public class DisciplineIncidentReference : IResourceReference { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + [DataMember(Name="incidentIdentifier")] + public string IncidentIdentifier { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -58141,14 +56229,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EducationOrganizationId != default(long); + return IncidentIdentifier != default(string) && SchoolId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (EducationOrganizationId == default) + if (IncidentIdentifier == default) { - yield return "EducationOrganizationId"; + yield return "IncidentIdentifier"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; } } @@ -58157,8 +56250,8 @@ private Link CreateLink() { var link = new Link { - Rel = "EducationOrganization", - Href = $"/ed-fi/educationOrganizations/{ResourceId:n}" + Rel = "DisciplineIncident", + Href = $"/ed-fi/disciplineIncidents/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -58184,23 +56277,17 @@ private Link CreateLink() } } // Aggregate reference - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - /// - /// A class which represents the edfi.EducationOrganizationAddress table of the EducationOrganization aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineIncident table of the DisciplineIncident aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationAddress : Entities.Common.EdFi.IEducationOrganizationAddress, IValidatableObject + public class DisciplineIncident : Entities.Common.EdFi.IDisciplineIncident, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationAddress"); + private static FullName _fullName = new FullName("edfi", "DisciplineIncident"); // Fluent validator instance (threadsafe) - private static EducationOrganizationAddressPutPostRequestValidator _validator = new EducationOrganizationAddressPutPostRequestValidator(); + private static DisciplineIncidentPutPostRequestValidator _validator = new DisciplineIncidentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -58211,9 +56298,11 @@ public class EducationOrganizationAddress : Entities.Common.EdFi.IEducationOrgan // Constructor // ------------------------------------------------------------- - public EducationOrganizationAddress() + public DisciplineIncident() { - EducationOrganizationAddressPeriods = new List(); + DisciplineIncidentBehaviors = new List(); + DisciplineIncidentExternalParticipants = new List(); + DisciplineIncidentWeapons = new List(); } // ------------------------------------------------------------ @@ -58221,79 +56310,91 @@ public EducationOrganizationAddress() // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DisciplineIncident resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationAddress.EducationOrganization + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference { - get { return _educationOrganization; } - set { SetEducationOrganization(value); } - } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); - public Entities.Common.EdFi.IEducationOrganization EducationOrganization - { - set { SetEducationOrganization(value); } + return _schoolReference; + } } - private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference { - _educationOrganization = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; + + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } } + // ------------------------------------------------------------- - /// - /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] - public string AddressTypeDescriptor { get; set; } + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The name of the city in which an address is located. + /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="city")] - public string City { get; set; } + [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="incidentIdentifier")] + public string IncidentIdentifier { get; set; } /// - /// The five or nine digit zip code or overseas postal code portion of an address. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="postalCode")] - public string PostalCode { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IDisciplineIncident.SchoolId + { + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; - /// - /// The abbreviation for the state (within the United States) or outlying area in which an address is located. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string StateAbbreviationDescriptor { get; set; } + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - /// - /// The street number and street name or post office box number of an address. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="streetNumberName")] - public string StreetNumberName { get; set; } + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -58308,7 +56409,7 @@ private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganizatio /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationAddress; + var compareTo = obj as Entities.Common.EdFi.IDisciplineIncident; if (ReferenceEquals(this, compareTo)) return true; @@ -58316,33 +56417,14 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).City, compareTo.City)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).PostalCode, compareTo.PostalCode)) - return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineIncident).IncidentIdentifier, compareTo.IncidentIdentifier)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).StreetNumberName, compareTo.StreetNumberName)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IDisciplineIncident).SchoolId.Equals(compareTo.SchoolId)) return false; @@ -58358,29 +56440,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationOrganization != null) - hash.Add(_educationOrganization); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).AddressTypeDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).City); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).PostalCode); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).StateAbbreviationDescriptor); - + hash.Add((this as Entities.Common.EdFi.IDisciplineIncident).IncidentIdentifier); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).StreetNumberName); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IDisciplineIncident).SchoolId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -58395,75 +56461,74 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The apartment, room, or suite number of an address. + /// The case number assigned to the DisciplineIncident by law enforcement or other organization. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="apartmentRoomSuiteNumber")] - public string ApartmentRoomSuiteNumber { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="caseNumber")] + public string CaseNumber { get; set; } /// - /// The number of the building on the site, if more than one building shares the same address. + /// The value of any quantifiable monetary loss directly resulting from the discipline incident. Examples include the value of repairs necessitated by vandalism of a school facility, or the value of personnel resources used for repairs or consumed by the incident. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="buildingSiteNumber")] - public string BuildingSiteNumber { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="incidentCost")] + public decimal? IncidentCost { get; set; } /// - /// The congressional district in which an address is located. + /// The month, day, and year on which the discipline incident occurred. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="congressionalDistrict")] - public string CongressionalDistrict { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="incidentDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime IncidentDate { get; set; } /// - /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. + /// The description for an incident. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="countyFIPSCode")] - public string CountyFIPSCode { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="incidentDescription")] + public string IncidentDescription { get; set; } /// - /// An indication that the address should not be published. + /// Identifies where the discipline incident occurred and whether or not it occurred on school. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="incidentLocationDescriptor")][DescriptorExists("IncidentLocationDescriptor")] + public string IncidentLocationDescriptor { get; set; } /// - /// The geographic latitude of the physical address. + /// An indication of the time of day the incident took place. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="latitude")] - public string Latitude { get; set; } + [DataMember(Name="incidentTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan? IncidentTime { get; set; } /// - /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). + /// Indicator of whether the incident was reported to law enforcement. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] - public string LocaleDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="reportedToLawEnforcement")] + public bool? ReportedToLawEnforcement { get; set; } /// - /// The geographic longitude of the physical address. + /// Information on the type of individual who reported the discipline incident. When known and/or if useful, use a more specific option code (e.g., \"Counselor\" rather than \"Professional Staff\"). /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="longitude")] - public string Longitude { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="reporterDescriptionDescriptor")][DescriptorExists("ReporterDescriptionDescriptor")] + public string ReporterDescriptionDescriptor { get; set; } /// - /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. + /// Identifies the reporter of the discipline incident by name. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfCounty")] - public string NameOfCounty { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="reporterName")] + public string ReporterName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -58484,41 +56549,101 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationAddress")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncident")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddressPeriods; - private ICollection _educationOrganizationAddressPeriodsCovariant; + private ICollection _disciplineIncidentBehaviors; + private ICollection _disciplineIncidentBehaviorsCovariant; [NoDuplicateMembers] - [DataMember(Name="periods")] - public ICollection EducationOrganizationAddressPeriods + [DataMember(Name="behaviors")] + public ICollection DisciplineIncidentBehaviors { - get { return _educationOrganizationAddressPeriods; } + get { return _disciplineIncidentBehaviors; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)e.Item).EducationOrganizationAddress = this); - _educationOrganizationAddressPeriods = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentBehavior)e.Item).DisciplineIncident = this); + _disciplineIncidentBehaviors = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)e.Item).EducationOrganizationAddress = this; - _educationOrganizationAddressPeriodsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentBehavior)e.Item).DisciplineIncident = this; + _disciplineIncidentBehaviorsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganizationAddress.EducationOrganizationAddressPeriods + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentBehaviors { - get { return _educationOrganizationAddressPeriodsCovariant; } - set { EducationOrganizationAddressPeriods = new List(value.Cast()); } + get { return _disciplineIncidentBehaviorsCovariant; } + set { DisciplineIncidentBehaviors = new List(value.Cast()); } + } + + private ICollection _disciplineIncidentExternalParticipants; + private ICollection _disciplineIncidentExternalParticipantsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="externalParticipants")] + public ICollection DisciplineIncidentExternalParticipants + { + get { return _disciplineIncidentExternalParticipants; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)e.Item).DisciplineIncident = this); + _disciplineIncidentExternalParticipants = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)e.Item).DisciplineIncident = this; + _disciplineIncidentExternalParticipantsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentExternalParticipants + { + get { return _disciplineIncidentExternalParticipantsCovariant; } + set { DisciplineIncidentExternalParticipants = new List(value.Cast()); } + } + + private ICollection _disciplineIncidentWeapons; + private ICollection _disciplineIncidentWeaponsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="weapons")] + public ICollection DisciplineIncidentWeapons + { + get { return _disciplineIncidentWeapons; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentWeapon)e.Item).DisciplineIncident = this); + _disciplineIncidentWeapons = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IDisciplineIncidentWeapon)e.Item).DisciplineIncident = this; + _disciplineIncidentWeaponsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentWeapons + { + get { return _disciplineIncidentWeaponsCovariant; } + set { DisciplineIncidentWeapons = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -58526,6 +56651,13 @@ public ICollection EducationOrganizationAddr // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -58536,9 +56668,19 @@ public ICollection EducationOrganizationAddr internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_educationOrganizationAddressPeriods != null) foreach (var item in _educationOrganizationAddressPeriods) + if (_disciplineIncidentBehaviors != null) foreach (var item in _disciplineIncidentBehaviors) { - item.EducationOrganizationAddress = this; + item.DisciplineIncident = this; + } + + if (_disciplineIncidentExternalParticipants != null) foreach (var item in _disciplineIncidentExternalParticipants) + { + item.DisciplineIncident = this; + } + + if (_disciplineIncidentWeapons != null) foreach (var item in _disciplineIncidentWeapons) + { + item.DisciplineIncident = this; } } @@ -58549,18 +56691,25 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationAddress)target); + return Entities.Common.EdFi.DisciplineIncidentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncident)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationAddressMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationAddress)target, null); + Entities.Common.EdFi.DisciplineIncidentMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncident)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IDisciplineIncident.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- // ================================== @@ -58578,19 +56727,42 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (EducationOrganizationAddressPeriods.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddressPeriods") != false) + if (DisciplineIncidentBehaviors.Any() && mappingContract?.IsMemberSupported("DisciplineIncidentBehaviors") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationAddressPeriods"); + pathBuilder.Append("DisciplineIncidentBehaviors"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddressPeriods, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddressPeriods")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineIncidentBehaviors, validationContext, validationContext.Items.ForCollection("DisciplineIncidentBehaviors")))) + { + yield return result; + } + } + + if (DisciplineIncidentExternalParticipants.Any() && mappingContract?.IsMemberSupported("DisciplineIncidentExternalParticipants") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("DisciplineIncidentExternalParticipants"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineIncidentExternalParticipants, validationContext, validationContext.Items.ForCollection("DisciplineIncidentExternalParticipants")))) + { + yield return result; + } + } + + if (DisciplineIncidentWeapons.Any() && mappingContract?.IsMemberSupported("DisciplineIncidentWeapons") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("DisciplineIncidentWeapons"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(DisciplineIncidentWeapons, validationContext, validationContext.Items.ForCollection("DisciplineIncidentWeapons")))) { yield return result; } @@ -58641,14 +56813,16 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationAddressPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineIncidentPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_EducationOrganizationAddress = new FullName("edfi", "EducationOrganizationAddress"); + private static readonly FullName _fullName_edfi_DisciplineIncident = new FullName("edfi", "DisciplineIncident"); // Declare collection item validators - private EducationOrganizationAddressPeriodPutPostRequestValidator _educationOrganizationAddressPeriodsValidator = new (); + private DisciplineIncidentBehaviorPutPostRequestValidator _disciplineIncidentBehaviorsValidator = new (); + private DisciplineIncidentExternalParticipantPutPostRequestValidator _disciplineIncidentExternalParticipantsValidator = new (); + private DisciplineIncidentWeaponPutPostRequestValidator _disciplineIncidentWeaponsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -58665,19 +56839,41 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsEducationOrganizationAddressPeriodIncluded(x)); + var hasInvalidDisciplineIncidentBehaviorsItems = instance.DisciplineIncidentBehaviors.Any(x => !mappingContract.IsDisciplineIncidentBehaviorIncluded(x)); - if (hasInvalidEducationOrganizationAddressPeriodsItems) + if (hasInvalidDisciplineIncidentBehaviorsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddressPeriods", $"A supplied 'EducationOrganizationAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("DisciplineIncidentBehaviors", $"A supplied 'DisciplineIncidentBehavior' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsDisciplineIncidentExternalParticipantIncluded != null) + { + var hasInvalidDisciplineIncidentExternalParticipantsItems = instance.DisciplineIncidentExternalParticipants.Any(x => !mappingContract.IsDisciplineIncidentExternalParticipantIncluded(x)); + + if (hasInvalidDisciplineIncidentExternalParticipantsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("DisciplineIncidentExternalParticipants", $"A supplied 'DisciplineIncidentExternalParticipant' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsDisciplineIncidentWeaponIncluded != null) + { + var hasInvalidDisciplineIncidentWeaponsItems = instance.DisciplineIncidentWeapons.Any(x => !mappingContract.IsDisciplineIncidentWeaponIncluded(x)); + + if (hasInvalidDisciplineIncidentWeaponsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("DisciplineIncidentWeapons", $"A supplied 'DisciplineIncidentWeapon' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -58699,16 +56895,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationAddressPeriod table of the EducationOrganization aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineIncidentBehavior table of the DisciplineIncident aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationAddressPeriod : Entities.Common.EdFi.IEducationOrganizationAddressPeriod, IValidatableObject + public class DisciplineIncidentBehavior : Entities.Common.EdFi.IDisciplineIncidentBehavior, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationAddressPeriod"); + private static FullName _fullName = new FullName("edfi", "DisciplineIncidentBehavior"); // Fluent validator instance (threadsafe) - private static EducationOrganizationAddressPeriodPutPostRequestValidator _validator = new EducationOrganizationAddressPeriodPutPostRequestValidator(); + private static DisciplineIncidentBehaviorPutPostRequestValidator _validator = new DisciplineIncidentBehaviorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -58735,32 +56931,33 @@ public class EducationOrganizationAddressPeriod : Entities.Common.EdFi.IEducatio //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganizationAddress _educationOrganizationAddress; + private Entities.Common.EdFi.IDisciplineIncident _disciplineIncident; [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganizationAddress IEducationOrganizationAddressPeriod.EducationOrganizationAddress + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentBehavior.DisciplineIncident { - get { return _educationOrganizationAddress; } - set { SetEducationOrganizationAddress(value); } + get { return _disciplineIncident; } + set { SetDisciplineIncident(value); } } - public Entities.Common.EdFi.IEducationOrganizationAddress EducationOrganizationAddress + public Entities.Common.EdFi.IDisciplineIncident DisciplineIncident { - set { SetEducationOrganizationAddress(value); } + set { SetDisciplineIncident(value); } } - private void SetEducationOrganizationAddress(Entities.Common.EdFi.IEducationOrganizationAddress value) + private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident value) { - _educationOrganizationAddress = value; + _disciplineIncident = value; } /// - /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Describes behavior by category and provides a detailed description. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="behaviorDescriptor")][DescriptorExists("BehaviorDescriptor")] + public string BehaviorDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -58775,7 +56972,7 @@ private void SetEducationOrganizationAddress(Entities.Common.EdFi.IEducationOrga /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationAddressPeriod; + var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentBehavior; if (ReferenceEquals(this, compareTo)) return true; @@ -58784,12 +56981,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_educationOrganizationAddress == null || !_educationOrganizationAddress.Equals(compareTo.EducationOrganizationAddress)) + if (_disciplineIncident == null || !_disciplineIncident.Equals(compareTo.DisciplineIncident)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineIncidentBehavior).BehaviorDescriptor, compareTo.BehaviorDescriptor)) return false; @@ -58806,11 +57003,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_educationOrganizationAddress != null) - hash.Add(_educationOrganizationAddress); + if (_disciplineIncident != null) + hash.Add(_disciplineIncident); // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddressPeriod).BeginDate); + hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentBehavior).BehaviorDescriptor); return hash.ToHashCode(); } @@ -58826,11 +57023,12 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Specifies a more granular level of detail of a behavior involved in the incident. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="behaviorDetailedDescription")] + public string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -58851,7 +57049,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationAddressPeriod")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncidentBehavior")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -58875,12 +57073,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target); + return Entities.Common.EdFi.DisciplineIncidentBehaviorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentBehavior)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target, null); + Entities.Common.EdFi.DisciplineIncidentBehaviorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentBehavior)target, null); } // ------------------------------------------------------------- @@ -58955,9 +57153,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineIncidentBehaviorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -58986,16 +57184,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationCategory table of the EducationOrganization aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineIncidentExternalParticipant table of the DisciplineIncident aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationCategory : Entities.Common.EdFi.IEducationOrganizationCategory, IValidatableObject + public class DisciplineIncidentExternalParticipant : Entities.Common.EdFi.IDisciplineIncidentExternalParticipant, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationCategory"); + private static FullName _fullName = new FullName("edfi", "DisciplineIncidentExternalParticipant"); // Fluent validator instance (threadsafe) - private static EducationOrganizationCategoryPutPostRequestValidator _validator = new EducationOrganizationCategoryPutPostRequestValidator(); + private static DisciplineIncidentExternalParticipantPutPostRequestValidator _validator = new DisciplineIncidentExternalParticipantPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -59022,48 +57220,66 @@ public class EducationOrganizationCategory : Entities.Common.EdFi.IEducationOrga //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganization _educationOrganization; + private Entities.Common.EdFi.IDisciplineIncident _disciplineIncident; [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationCategory.EducationOrganization + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentExternalParticipant.DisciplineIncident { - get { return _educationOrganization; } - set { SetEducationOrganization(value); } + get { return _disciplineIncident; } + set { SetDisciplineIncident(value); } } - public Entities.Common.EdFi.IEducationOrganization EducationOrganization + public Entities.Common.EdFi.IDisciplineIncident DisciplineIncident { - set { SetEducationOrganization(value); } + set { SetDisciplineIncident(value); } } - private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident value) { - _educationOrganization = value; + _disciplineIncident = value; } /// - /// The classification of the education agency within the geographic boundaries of a state according to the level of administrative and operational control granted by the state. + /// The role or type of participation of an individual in the discipline incident. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="educationOrganizationCategoryDescriptor")][DescriptorExists("EducationOrganizationCategoryDescriptor")] - public string EducationOrganizationCategoryDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + [DataMember(Name="disciplineIncidentParticipationCodeDescriptor")][DescriptorExists("DisciplineIncidentParticipationCodeDescriptor")] + public string DisciplineIncidentParticipationCodeDescriptor { get; set; } /// - /// Determines equality based on the natural key properties of the resource. + /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="firstName")] + public string FirstName { get; set; } + + /// + /// The name borne in common by members of a family. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. /// /// /// A boolean value indicating equality result of the compared resources. /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationCategory; + var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant; if (ReferenceEquals(this, compareTo)) return true; @@ -59072,12 +57288,22 @@ public override bool Equals(object obj) return false; // Parent Property - if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + if (_disciplineIncident == null || !_disciplineIncident.Equals(compareTo.DisciplineIncident)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationCategory).EducationOrganizationCategoryDescriptor, compareTo.EducationOrganizationCategoryDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).FirstName, compareTo.FirstName)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).LastSurname, compareTo.LastSurname)) return false; @@ -59094,11 +57320,19 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_educationOrganization != null) - hash.Add(_educationOrganization); + if (_disciplineIncident != null) + hash.Add(_disciplineIncident); // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationCategory).EducationOrganizationCategoryDescriptor); + hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).DisciplineIncidentParticipationCodeDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).FirstName); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentExternalParticipant).LastSurname); return hash.ToHashCode(); } @@ -59132,7 +57366,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationCategory")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncidentExternalParticipant")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -59156,12 +57390,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationCategoryMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationCategory)target); + return Entities.Common.EdFi.DisciplineIncidentExternalParticipantMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationCategoryMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationCategory)target, null); + Entities.Common.EdFi.DisciplineIncidentExternalParticipantMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target, null); } // ------------------------------------------------------------- @@ -59236,9 +57470,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationCategoryPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineIncidentExternalParticipantPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -59267,16 +57501,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationIdentificationCode table of the EducationOrganization aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineIncidentWeapon table of the DisciplineIncident aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationIdentificationCode : Entities.Common.EdFi.IEducationOrganizationIdentificationCode, IValidatableObject + public class DisciplineIncidentWeapon : Entities.Common.EdFi.IDisciplineIncidentWeapon, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationIdentificationCode"); + private static FullName _fullName = new FullName("edfi", "DisciplineIncidentWeapon"); // Fluent validator instance (threadsafe) - private static EducationOrganizationIdentificationCodePutPostRequestValidator _validator = new EducationOrganizationIdentificationCodePutPostRequestValidator(); + private static DisciplineIncidentWeaponPutPostRequestValidator _validator = new DisciplineIncidentWeaponPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -59303,33 +57537,33 @@ public class EducationOrganizationIdentificationCode : Entities.Common.EdFi.IEdu //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganization _educationOrganization; + private Entities.Common.EdFi.IDisciplineIncident _disciplineIncident; [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIdentificationCode.EducationOrganization + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentWeapon.DisciplineIncident { - get { return _educationOrganization; } - set { SetEducationOrganization(value); } + get { return _disciplineIncident; } + set { SetDisciplineIncident(value); } } - public Entities.Common.EdFi.IEducationOrganization EducationOrganization + public Entities.Common.EdFi.IDisciplineIncident DisciplineIncident { - set { SetEducationOrganization(value); } + set { SetDisciplineIncident(value); } } - private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + private void SetDisciplineIncident(Entities.Common.EdFi.IDisciplineIncident value) { - _educationOrganization = value; + _disciplineIncident = value; } /// - /// The school system, state, or agency assigning the identification code. + /// Identifies the type of weapon used during an incident. The Federal Gun-Free Schools Act requires states to report the number of students expelled for bringing firearms to school by type of firearm. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="educationOrganizationIdentificationSystemDescriptor")][DescriptorExists("EducationOrganizationIdentificationSystemDescriptor")] - public string EducationOrganizationIdentificationSystemDescriptor { get; set; } + [DataMember(Name="weaponDescriptor")][DescriptorExists("WeaponDescriptor")] + public string WeaponDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -59344,7 +57578,7 @@ private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganizatio /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIdentificationCode; + var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentWeapon; if (ReferenceEquals(this, compareTo)) return true; @@ -59353,12 +57587,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + if (_disciplineIncident == null || !_disciplineIncident.Equals(compareTo.DisciplineIncident)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationIdentificationCode).EducationOrganizationIdentificationSystemDescriptor, compareTo.EducationOrganizationIdentificationSystemDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IDisciplineIncidentWeapon).WeaponDescriptor, compareTo.WeaponDescriptor)) return false; @@ -59375,11 +57609,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_educationOrganization != null) - hash.Add(_educationOrganization); + if (_disciplineIncident != null) + hash.Add(_disciplineIncident); // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIdentificationCode).EducationOrganizationIdentificationSystemDescriptor); + hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentWeapon).WeaponDescriptor); return hash.ToHashCode(); } @@ -59393,15 +57627,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// A unique number or alphanumeric code that is assigned to an education organization by a school, school system, state, or other agency or entity. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -59422,7 +57647,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationIdentificationCode")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "DisciplineIncident", "DisciplineIncidentWeapon")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -59446,12 +57671,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target); + return Entities.Common.EdFi.DisciplineIncidentWeaponMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentWeapon)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target, null); + Entities.Common.EdFi.DisciplineIncidentWeaponMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentWeapon)target, null); } // ------------------------------------------------------------- @@ -59526,9 +57751,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineIncidentWeaponPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -59556,17 +57781,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationIndicator table of the EducationOrganization aggregate in the ODS Database. + /// A class which represents the edfi.DisciplineIncidentParticipationCodeDescriptor table of the DisciplineIncidentParticipationCodeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicator : Entities.Common.EdFi.IEducationOrganizationIndicator, IValidatableObject + public class DisciplineIncidentParticipationCodeDescriptor : Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationIndicator"); + private static FullName _fullName = new FullName("edfi", "DisciplineIncidentParticipationCodeDescriptor"); // Fluent validator instance (threadsafe) - private static EducationOrganizationIndicatorPutPostRequestValidator _validator = new EducationOrganizationIndicatorPutPostRequestValidator(); + private static DisciplineIncidentParticipationCodeDescriptorPutPostRequestValidator _validator = new DisciplineIncidentParticipationCodeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -59577,16 +57807,19 @@ public class EducationOrganizationIndicator : Entities.Common.EdFi.IEducationOrg // Constructor // ------------------------------------------------------------- - public EducationOrganizationIndicator() - { - EducationOrganizationIndicatorPeriods = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DisciplineIncidentParticipationCodeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -59597,33 +57830,19 @@ public EducationOrganizationIndicator() //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - - [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIndicator.EducationOrganization - { - get { return _educationOrganization; } - set { SetEducationOrganization(value); } - } - public Entities.Common.EdFi.IEducationOrganization EducationOrganization - { - set { SetEducationOrganization(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int DisciplineIncidentParticipationCodeDescriptorId { get; set; } - private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + int IDescriptor.DescriptorId { - _educationOrganization = value; + get { return DisciplineIncidentParticipationCodeDescriptorId; } + set { DisciplineIncidentParticipationCodeDescriptorId = value; } } - - /// - /// The name or code for the indicator or metric. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="indicatorDescriptor")][DescriptorExists("IndicatorDescriptor")] - public string IndicatorDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -59638,7 +57857,7 @@ private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganizatio /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIndicator; + var compareTo = obj as Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -59646,13 +57865,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationIndicator).IndicatorDescriptor, compareTo.IndicatorDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor).DisciplineIncidentParticipationCodeDescriptorId.Equals(compareTo.DisciplineIncidentParticipationCodeDescriptorId)) return false; @@ -59668,12 +57883,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationOrganization != null) - hash.Add(_educationOrganization); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIndicator).IndicatorDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor).DisciplineIncidentParticipationCodeDescriptorId); return hash.ToHashCode(); } @@ -59682,43 +57894,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The person, organization, or department that defined the metric. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="designatedBy")] - public string DesignatedBy { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The name for a group of indicators. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="indicatorGroupDescriptor")][DescriptorExists("IndicatorGroupDescriptor")] - public string IndicatorGroupDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The value of the indicator or metric, as a value from a controlled vocabulary. The semantics of an empty value is \"not submitted.\" + /// The end date of the period when the descriptor is in effect. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="indicatorLevelDescriptor")][DescriptorExists("IndicatorLevelDescriptor")] - public string IndicatorLevelDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The value of the indicator or metric. The semantics of an empty value is \"not submitted.\" + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="indicatorValue")] - public string IndicatorValue { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -59739,64 +57968,33 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationIndicator")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationIndicatorPeriods; - private ICollection _educationOrganizationIndicatorPeriodsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="periods")] - public ICollection EducationOrganizationIndicatorPeriods - { - get { return _educationOrganizationIndicatorPeriods; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)e.Item).EducationOrganizationIndicator = this); - _educationOrganizationIndicatorPeriods = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)e.Item).EducationOrganizationIndicator = this; - _educationOrganizationIndicatorPeriodsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganizationIndicator.EducationOrganizationIndicatorPeriods - { - get { return _educationOrganizationIndicatorPeriodsCovariant; } - set { EducationOrganizationIndicatorPeriods = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_educationOrganizationIndicatorPeriods != null) foreach (var item in _educationOrganizationIndicatorPeriods) - { - item.EducationOrganizationIndicator = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -59804,12 +58002,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationIndicatorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicator)target); + return Entities.Common.EdFi.DisciplineIncidentParticipationCodeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationIndicatorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicator)target, null); + Entities.Common.EdFi.DisciplineIncidentParticipationCodeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target, null); } // ------------------------------------------------------------- @@ -59817,78 +58015,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (EducationOrganizationIndicatorPeriods.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicatorPeriods") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIndicatorPeriods"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicatorPeriods, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicatorPeriods")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -59896,14 +58022,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicatorPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisciplineIncidentParticipationCodeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_EducationOrganizationIndicator = new FullName("edfi", "EducationOrganizationIndicator"); - - // Declare collection item validators - private EducationOrganizationIndicatorPeriodPutPostRequestValidator _educationOrganizationIndicatorPeriodsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -59916,28 +58037,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (EducationOrganizationIndicatorMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_EducationOrganizationIndicator); - - if (mappingContract != null) - { - if (mappingContract.IsEducationOrganizationIndicatorPeriodIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorPeriodsItems = instance.EducationOrganizationIndicatorPeriods.Any(x => !mappingContract.IsEducationOrganizationIndicatorPeriodIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorPeriodsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicatorPeriods", $"A supplied 'EducationOrganizationIndicatorPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -59953,17 +58052,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationIndicatorPeriod table of the EducationOrganization aggregate in the ODS Database. + /// A class which represents the edfi.DisplacedStudentStatusDescriptor table of the DisplacedStudentStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicatorPeriod : Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod, IValidatableObject + public class DisplacedStudentStatusDescriptor : Entities.Common.EdFi.IDisplacedStudentStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationIndicatorPeriod"); + private static FullName _fullName = new FullName("edfi", "DisplacedStudentStatusDescriptor"); // Fluent validator instance (threadsafe) - private static EducationOrganizationIndicatorPeriodPutPostRequestValidator _validator = new EducationOrganizationIndicatorPeriodPutPostRequestValidator(); + private static DisplacedStudentStatusDescriptorPutPostRequestValidator _validator = new DisplacedStudentStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -59980,6 +58084,13 @@ public class EducationOrganizationIndicatorPeriod : Entities.Common.EdFi.IEducat // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the DisplacedStudentStatusDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -59990,32 +58101,19 @@ public class EducationOrganizationIndicatorPeriod : Entities.Common.EdFi.IEducat //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganizationIndicator _educationOrganizationIndicator; - - [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganizationIndicator IEducationOrganizationIndicatorPeriod.EducationOrganizationIndicator - { - get { return _educationOrganizationIndicator; } - set { SetEducationOrganizationIndicator(value); } - } - - public Entities.Common.EdFi.IEducationOrganizationIndicator EducationOrganizationIndicator - { - set { SetEducationOrganizationIndicator(value); } - } - - private void SetEducationOrganizationIndicator(Entities.Common.EdFi.IEducationOrganizationIndicator value) - { - _educationOrganizationIndicator = value; - } /// - /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + [JsonIgnore] + public int DisplacedStudentStatusDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return DisplacedStudentStatusDescriptorId; } + set { DisplacedStudentStatusDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -60030,7 +58128,7 @@ private void SetEducationOrganizationIndicator(Entities.Common.EdFi.IEducationOr /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod; + var compareTo = obj as Entities.Common.EdFi.IDisplacedStudentStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -60038,13 +58136,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationOrganizationIndicator == null || !_educationOrganizationIndicator.Equals(compareTo.EducationOrganizationIndicator)) - return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod).BeginDate.Equals(compareTo.BeginDate)) + // Derived Property + if (!(this as Entities.Common.EdFi.IDisplacedStudentStatusDescriptor).DisplacedStudentStatusDescriptorId.Equals(compareTo.DisplacedStudentStatusDescriptorId)) return false; @@ -60060,12 +58154,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationOrganizationIndicator != null) - hash.Add(_educationOrganizationIndicator); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod).BeginDate); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IDisplacedStudentStatusDescriptor).DisplacedStudentStatusDescriptorId); return hash.ToHashCode(); } @@ -60074,18 +58165,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -60106,8 +58239,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationIndicatorPeriod")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -60118,6 +58254,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -60130,12 +58273,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationIndicatorPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target); + return Entities.Common.EdFi.DisplacedStudentStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationIndicatorPeriodMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target, null); + Entities.Common.EdFi.DisplacedStudentStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -60143,66 +58286,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -60210,9 +58293,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicatorPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class DisplacedStudentStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -60240,17 +58323,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationInstitutionTelephone table of the EducationOrganization aggregate in the ODS Database. + /// A class which represents the edfi.EducationalEnvironmentDescriptor table of the EducationalEnvironmentDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationInstitutionTelephone : Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone, IValidatableObject + public class EducationalEnvironmentDescriptor : Entities.Common.EdFi.IEducationalEnvironmentDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationInstitutionTelephone"); + private static FullName _fullName = new FullName("edfi", "EducationalEnvironmentDescriptor"); // Fluent validator instance (threadsafe) - private static EducationOrganizationInstitutionTelephonePutPostRequestValidator _validator = new EducationOrganizationInstitutionTelephonePutPostRequestValidator(); + private static EducationalEnvironmentDescriptorPutPostRequestValidator _validator = new EducationalEnvironmentDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -60267,6 +58355,13 @@ public class EducationOrganizationInstitutionTelephone : Entities.Common.EdFi.IE // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the EducationalEnvironmentDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -60277,33 +58372,19 @@ public class EducationOrganizationInstitutionTelephone : Entities.Common.EdFi.IE //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - - [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInstitutionTelephone.EducationOrganization - { - get { return _educationOrganization; } - set { SetEducationOrganization(value); } - } - public Entities.Common.EdFi.IEducationOrganization EducationOrganization - { - set { SetEducationOrganization(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int EducationalEnvironmentDescriptorId { get; set; } - private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + int IDescriptor.DescriptorId { - _educationOrganization = value; + get { return EducationalEnvironmentDescriptorId; } + set { EducationalEnvironmentDescriptorId = value; } } - - /// - /// The type of communication number listed for an individual or organization. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="institutionTelephoneNumberTypeDescriptor")][DescriptorExists("InstitutionTelephoneNumberTypeDescriptor")] - public string InstitutionTelephoneNumberTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -60318,7 +58399,7 @@ private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganizatio /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone; + var compareTo = obj as Entities.Common.EdFi.IEducationalEnvironmentDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -60326,13 +58407,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone).InstitutionTelephoneNumberTypeDescriptor, compareTo.InstitutionTelephoneNumberTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IEducationalEnvironmentDescriptor).EducationalEnvironmentDescriptorId.Equals(compareTo.EducationalEnvironmentDescriptorId)) return false; @@ -60348,12 +58425,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationOrganization != null) - hash.Add(_educationOrganization); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone).InstitutionTelephoneNumberTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEducationalEnvironmentDescriptor).EducationalEnvironmentDescriptorId); return hash.ToHashCode(); } @@ -60362,20 +58436,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The telephone number including the area code, and extension, if applicable. + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="telephoneNumber")] - public string TelephoneNumber { get; set; } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -60396,8 +58510,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationInstitutionTelephone")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -60408,6 +58525,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -60420,12 +58544,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationInstitutionTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target); + return Entities.Common.EdFi.EducationalEnvironmentDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationInstitutionTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target, null); + Entities.Common.EdFi.EducationalEnvironmentDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target, null); } // ------------------------------------------------------------- @@ -60433,66 +58557,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -60500,9 +58564,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationInstitutionTelephonePutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationalEnvironmentDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -60530,17 +58594,111 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationInternationalAddress table of the EducationOrganization aggregate in the ODS Database. + /// Represents a reference to the EducationContent resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class EducationContentReference : IResourceReference + { + [DataMember(Name="contentIdentifier")] + public string ContentIdentifier { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return ContentIdentifier != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (ContentIdentifier == default) + { + yield return "ContentIdentifier"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "EducationContent", + Href = $"/ed-fi/educationContents/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.EducationContent table of the EducationContent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationInternationalAddress : Entities.Common.EdFi.IEducationOrganizationInternationalAddress, IValidatableObject + public class EducationContent : Entities.Common.EdFi.IEducationContent, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationInternationalAddress"); + private static FullName _fullName = new FullName("edfi", "EducationContent"); // Fluent validator instance (threadsafe) - private static EducationOrganizationInternationalAddressPutPostRequestValidator _validator = new EducationOrganizationInternationalAddressPutPostRequestValidator(); + private static EducationContentPutPostRequestValidator _validator = new EducationContentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -60551,49 +58709,82 @@ public class EducationOrganizationInternationalAddress : Entities.Common.EdFi.IE // Constructor // ------------------------------------------------------------- + public EducationContent() + { + EducationContentAppropriateGradeLevels = new List(); + EducationContentAppropriateSexes = new List(); + EducationContentAuthors = new List(); + EducationContentDerivativeSourceEducationContents = new List(); + EducationContentDerivativeSourceLearningResourceMetadataURIs = new List(); + EducationContentDerivativeSourceURIs = new List(); + EducationContentLanguages = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the EducationContent resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - [IgnoreDataMember] - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInternationalAddress.EducationOrganization + private bool _learningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference { - get { return _educationOrganization; } - set { SetEducationOrganization(value); } - } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) + _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - public Entities.Common.EdFi.IEducationOrganization EducationOrganization - { - set { SetEducationOrganization(value); } + return _learningStandardReference; + } } - private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + [DataMember(Name="learningStandardReference")] + [FullyDefinedReference] + public LearningStandard.EdFi.LearningStandardReference LearningStandardReference { - _educationOrganization = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLearningStandardReference != null + && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference; + + return null; + } + set + { + _learningStandardReferenceExplicitlyAssigned = true; + _learningStandardReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) + /// A unique identifier for the education content. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] - public string AddressTypeDescriptor { get; set; } + [NonDefaultStringLength(225, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="contentIdentifier")] + public string ContentIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -60608,7 +58799,7 @@ private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganizatio /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationInternationalAddress; + var compareTo = obj as Entities.Common.EdFi.IEducationContent; if (ReferenceEquals(this, compareTo)) return true; @@ -60616,13 +58807,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) - return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationInternationalAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) return false; @@ -60638,12 +58825,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_educationOrganization != null) - hash.Add(_educationOrganization); // Standard Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInternationalAddress).AddressTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IEducationContent).ContentIdentifier); return hash.ToHashCode(); } @@ -60659,76 +58843,149 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The first line of the address. + /// Indicates whether there are additional un-named authors. In a research report, this is often marked by the abbreviation \"et al\". /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine1")] - public string AddressLine1 { get; set; } + [DataMember(Name="additionalAuthorsIndicator")] + public bool? AdditionalAuthorsIndicator { get; set; } /// - /// The second line of the address. + /// The predominate type or kind characterizing the learning resource. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine2")] - public string AddressLine2 { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="contentClassDescriptor")][DescriptorExists("ContentClassDescriptor")] + public string ContentClassDescriptor { get; set; } /// - /// The third line of the address. + /// An amount that has to be paid or spent to buy or obtain the education content. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine3")] - public string AddressLine3 { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="cost")] + public decimal? Cost { get; set; } /// - /// The fourth line of the address. + /// The rate by which the cost applies. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine4")] - public string AddressLine4 { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="costRateDescriptor")][DescriptorExists("CostRateDescriptor")] + public string CostRateDescriptor { get; set; } /// - /// The first date the address is valid. For physical addresses, the date the individual moved to that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// An extended written representation of the education content. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BeginDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The name of the country. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// The predominate mode of learning supported by the learning resource. Acceptable values are active, expositive, or mixed. /// // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="countryDescriptor")][DescriptorExists("CountryDescriptor")] - public string CountryDescriptor { get; set; } + [DataMember(Name="interactivityStyleDescriptor")][DescriptorExists("InteractivityStyleDescriptor")] + public string InteractivityStyleDescriptor { get; set; } /// - /// The last date the address is valid. For physical addresses, the date the individual moved from that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="learningResourceMetadataURI")] + public string LearningResourceMetadataURI { get; set; } /// - /// The geographic latitude of the physical address. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IEducationContent.LearningStandardId + { + get + { + if (ImplicitLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + { + return ImplicitLearningStandardReference.LearningStandardId; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LearningStandard + _learningStandardReferenceExplicitlyAssigned = false; + ImplicitLearningStandardReference.LearningStandardId = value; + } + } + + /// + /// Namespace for the education content. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="latitude")] - public string Latitude { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The geographic longitude of the physical address. + /// The date on which this content was first published. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="longitude")] - public string Longitude { get; set; } + [DataMember(Name="publicationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? PublicationDate { get; set; } + + /// + /// The year at which this content was first published. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="publicationYear")] + public short? PublicationYear { get; set; } + + /// + /// The organization credited with publishing the resource. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="publisher")] + public string Publisher { get; set; } + + /// + /// A short description or name of the entity. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + + /// + /// Approximate or typical time that it takes to work with or through this learning resource for the typical intended target audience expressed in minutes. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="timeRequired")] + public string TimeRequired { get; set; } + + /// + /// The URL where the owner specifies permissions for using the resource. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="useRightsURL")] + public string UseRightsURL { get; set; } + + /// + /// The version identifier for the content. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="version")] + public string Version { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -60749,23 +59006,281 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationInternationalAddress")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _educationContentAppropriateGradeLevels; + private ICollection _educationContentAppropriateGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="appropriateGradeLevels")] + public ICollection EducationContentAppropriateGradeLevels + { + get { return _educationContentAppropriateGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)e.Item).EducationContent = this); + _educationContentAppropriateGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)e.Item).EducationContent = this; + _educationContentAppropriateGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateGradeLevels + { + get { return _educationContentAppropriateGradeLevelsCovariant; } + set { EducationContentAppropriateGradeLevels = new List(value.Cast()); } + } + + private ICollection _educationContentAppropriateSexes; + private ICollection _educationContentAppropriateSexesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="appropriateSexes")] + public ICollection EducationContentAppropriateSexes + { + get { return _educationContentAppropriateSexes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateSex)e.Item).EducationContent = this); + _educationContentAppropriateSexes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentAppropriateSex)e.Item).EducationContent = this; + _educationContentAppropriateSexesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateSexes + { + get { return _educationContentAppropriateSexesCovariant; } + set { EducationContentAppropriateSexes = new List(value.Cast()); } + } + + private ICollection _educationContentAuthors; + private ICollection _educationContentAuthorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="authors")] + public ICollection EducationContentAuthors + { + get { return _educationContentAuthors; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationContentAuthor)e.Item).EducationContent = this); + _educationContentAuthors = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentAuthor)e.Item).EducationContent = this; + _educationContentAuthorsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAuthors + { + get { return _educationContentAuthorsCovariant; } + set { EducationContentAuthors = new List(value.Cast()); } + } + + private ICollection _educationContentDerivativeSourceEducationContents; + private ICollection _educationContentDerivativeSourceEducationContentsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="derivativeSourceEducationContents")] + public ICollection EducationContentDerivativeSourceEducationContents + { + get { return _educationContentDerivativeSourceEducationContents; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)e.Item).EducationContent = this); + _educationContentDerivativeSourceEducationContents = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)e.Item).EducationContent = this; + _educationContentDerivativeSourceEducationContentsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceEducationContents + { + get { return _educationContentDerivativeSourceEducationContentsCovariant; } + set { EducationContentDerivativeSourceEducationContents = new List(value.Cast()); } + } + + private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIs; + private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="derivativeSourceLearningResourceMetadataURIs")] + public ICollection EducationContentDerivativeSourceLearningResourceMetadataURIs + { + get { return _educationContentDerivativeSourceLearningResourceMetadataURIs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)e.Item).EducationContent = this); + _educationContentDerivativeSourceLearningResourceMetadataURIs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)e.Item).EducationContent = this; + _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceLearningResourceMetadataURIs + { + get { return _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; } + set { EducationContentDerivativeSourceLearningResourceMetadataURIs = new List(value.Cast()); } + } + + private ICollection _educationContentDerivativeSourceURIs; + private ICollection _educationContentDerivativeSourceURIsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="derivativeSourceURIs")] + public ICollection EducationContentDerivativeSourceURIs + { + get { return _educationContentDerivativeSourceURIs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)e.Item).EducationContent = this); + _educationContentDerivativeSourceURIs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)e.Item).EducationContent = this; + _educationContentDerivativeSourceURIsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceURIs + { + get { return _educationContentDerivativeSourceURIsCovariant; } + set { EducationContentDerivativeSourceURIs = new List(value.Cast()); } + } + + private ICollection _educationContentLanguages; + private ICollection _educationContentLanguagesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="languages")] + public ICollection EducationContentLanguages + { + get { return _educationContentLanguages; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationContentLanguage)e.Item).EducationContent = this); + _educationContentLanguages = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationContentLanguage)e.Item).EducationContent = this; + _educationContentLanguagesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentLanguages + { + get { return _educationContentLanguagesCovariant; } + set { EducationContentLanguages = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationContentAppropriateGradeLevels != null) foreach (var item in _educationContentAppropriateGradeLevels) + { + item.EducationContent = this; + } + + if (_educationContentAppropriateSexes != null) foreach (var item in _educationContentAppropriateSexes) + { + item.EducationContent = this; + } + + if (_educationContentAuthors != null) foreach (var item in _educationContentAuthors) + { + item.EducationContent = this; + } + + if (_educationContentDerivativeSourceEducationContents != null) foreach (var item in _educationContentDerivativeSourceEducationContents) + { + item.EducationContent = this; + } + + if (_educationContentDerivativeSourceLearningResourceMetadataURIs != null) foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) + { + item.EducationContent = this; + } + + if (_educationContentDerivativeSourceURIs != null) foreach (var item in _educationContentDerivativeSourceURIs) + { + item.EducationContent = this; + } + + if (_educationContentLanguages != null) foreach (var item in _educationContentLanguages) + { + item.EducationContent = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -60773,18 +59288,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationInternationalAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target); + return Entities.Common.EdFi.EducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationInternationalAddressMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target, null); + Entities.Common.EdFi.EducationContentMapper.MapTo(this, (Entities.Common.EdFi.IEducationContent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IEducationContent.LearningStandardResourceId + { + get { return null; } + set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLearningStandardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -60802,12 +59331,95 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (EducationContentAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("EducationContentAppropriateGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationContentAppropriateGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("EducationContentAppropriateGradeLevels")))) + { + yield return result; + } + } + + if (EducationContentAppropriateSexes.Any() && mappingContract?.IsMemberSupported("EducationContentAppropriateSexes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationContentAppropriateSexes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentAppropriateSexes, validationContext, validationContext.Items.ForCollection("EducationContentAppropriateSexes")))) + { + yield return result; + } + } + + if (EducationContentAuthors.Any() && mappingContract?.IsMemberSupported("EducationContentAuthors") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationContentAuthors"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentAuthors, validationContext, validationContext.Items.ForCollection("EducationContentAuthors")))) + { + yield return result; + } + } + + if (EducationContentDerivativeSourceEducationContents.Any() && mappingContract?.IsMemberSupported("EducationContentDerivativeSourceEducationContents") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationContentDerivativeSourceEducationContents"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentDerivativeSourceEducationContents, validationContext, validationContext.Items.ForCollection("EducationContentDerivativeSourceEducationContents")))) + { + yield return result; + } + } + + if (EducationContentDerivativeSourceLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("EducationContentDerivativeSourceLearningResourceMetadataURIs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationContentDerivativeSourceLearningResourceMetadataURIs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentDerivativeSourceLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("EducationContentDerivativeSourceLearningResourceMetadataURIs")))) + { + yield return result; + } + } + + if (EducationContentDerivativeSourceURIs.Any() && mappingContract?.IsMemberSupported("EducationContentDerivativeSourceURIs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationContentDerivativeSourceURIs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentDerivativeSourceURIs, validationContext, validationContext.Items.ForCollection("EducationContentDerivativeSourceURIs")))) + { + yield return result; + } + } + + if (EducationContentLanguages.Any() && mappingContract?.IsMemberSupported("EducationContentLanguages") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationContentLanguages"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationContentLanguages, validationContext, validationContext.Items.ForCollection("EducationContentLanguages")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -60853,9 +59465,20 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationInternationalAddressPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationContentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_EducationContent = new FullName("edfi", "EducationContent"); + + // Declare collection item validators + private EducationContentAppropriateGradeLevelPutPostRequestValidator _educationContentAppropriateGradeLevelsValidator = new (); + private EducationContentAppropriateSexPutPostRequestValidator _educationContentAppropriateSexesValidator = new (); + private EducationContentAuthorPutPostRequestValidator _educationContentAuthorsValidator = new (); + private EducationContentDerivativeSourceEducationContentPutPostRequestValidator _educationContentDerivativeSourceEducationContentsValidator = new (); + private EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator _educationContentDerivativeSourceLearningResourceMetadataURIsValidator = new (); + private EducationContentDerivativeSourceURIPutPostRequestValidator _educationContentDerivativeSourceURIsValidator = new (); + private EducationContentLanguagePutPostRequestValidator _educationContentLanguagesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -60868,6 +59491,94 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (EducationContentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_EducationContent); + + if (mappingContract != null) + { + if (mappingContract.IsEducationContentAppropriateGradeLevelIncluded != null) + { + var hasInvalidEducationContentAppropriateGradeLevelsItems = instance.EducationContentAppropriateGradeLevels.Any(x => !mappingContract.IsEducationContentAppropriateGradeLevelIncluded(x)); + + if (hasInvalidEducationContentAppropriateGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationContentAppropriateGradeLevels", $"A supplied 'EducationContentAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationContentAppropriateSexIncluded != null) + { + var hasInvalidEducationContentAppropriateSexesItems = instance.EducationContentAppropriateSexes.Any(x => !mappingContract.IsEducationContentAppropriateSexIncluded(x)); + + if (hasInvalidEducationContentAppropriateSexesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationContentAppropriateSexes", $"A supplied 'EducationContentAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationContentAuthorIncluded != null) + { + var hasInvalidEducationContentAuthorsItems = instance.EducationContentAuthors.Any(x => !mappingContract.IsEducationContentAuthorIncluded(x)); + + if (hasInvalidEducationContentAuthorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationContentAuthors", $"A supplied 'EducationContentAuthor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationContentDerivativeSourceEducationContentIncluded != null) + { + var hasInvalidEducationContentDerivativeSourceEducationContentsItems = instance.EducationContentDerivativeSourceEducationContents.Any(x => !mappingContract.IsEducationContentDerivativeSourceEducationContentIncluded(x)); + + if (hasInvalidEducationContentDerivativeSourceEducationContentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationContentDerivativeSourceEducationContents", $"A supplied 'EducationContentDerivativeSourceEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationContentDerivativeSourceLearningResourceMetadataURIIncluded != null) + { + var hasInvalidEducationContentDerivativeSourceLearningResourceMetadataURIsItems = instance.EducationContentDerivativeSourceLearningResourceMetadataURIs.Any(x => !mappingContract.IsEducationContentDerivativeSourceLearningResourceMetadataURIIncluded(x)); + + if (hasInvalidEducationContentDerivativeSourceLearningResourceMetadataURIsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationContentDerivativeSourceLearningResourceMetadataURIs", $"A supplied 'EducationContentDerivativeSourceLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationContentDerivativeSourceURIIncluded != null) + { + var hasInvalidEducationContentDerivativeSourceURIsItems = instance.EducationContentDerivativeSourceURIs.Any(x => !mappingContract.IsEducationContentDerivativeSourceURIIncluded(x)); + + if (hasInvalidEducationContentDerivativeSourceURIsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationContentDerivativeSourceURIs", $"A supplied 'EducationContentDerivativeSourceURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationContentLanguageIncluded != null) + { + var hasInvalidEducationContentLanguagesItems = instance.EducationContentLanguages.Any(x => !mappingContract.IsEducationContentLanguageIncluded(x)); + + if (hasInvalidEducationContentLanguagesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationContentLanguages", $"A supplied 'EducationContentLanguage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -60883,22 +59594,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationAssociationTypeDescriptor table of the EducationOrganizationAssociationTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationContentAppropriateGradeLevel table of the EducationContent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationAssociationTypeDescriptor : Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationContentAppropriateGradeLevel : Entities.Common.EdFi.IEducationContentAppropriateGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationAssociationTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationContentAppropriateGradeLevel"); // Fluent validator instance (threadsafe) - private static EducationOrganizationAssociationTypeDescriptorPutPostRequestValidator _validator = new EducationOrganizationAssociationTypeDescriptorPutPostRequestValidator(); + private static EducationContentAppropriateGradeLevelPutPostRequestValidator _validator = new EducationContentAppropriateGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -60915,13 +59621,6 @@ public class EducationOrganizationAssociationTypeDescriptor : Entities.Common.Ed // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationOrganizationAssociationTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -60932,19 +59631,33 @@ public class EducationOrganizationAssociationTypeDescriptor : Entities.Common.Ed //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationContent _educationContent; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EducationOrganizationAssociationTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationContent IEducationContentAppropriateGradeLevel.EducationContent + { + get { return _educationContent; } + set { SetEducationContent(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationContent EducationContent { - get { return EducationOrganizationAssociationTypeDescriptorId; } - set { EducationOrganizationAssociationTypeDescriptorId = value; } + set { SetEducationContent(value); } + } + + private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + { + _educationContent = value; } + + /// + /// Grade levels for which this education content is applicable. If omitted, considered generally applicable. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -60959,7 +59672,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationContentAppropriateGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -60967,9 +59680,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor).EducationOrganizationAssociationTypeDescriptorId.Equals(compareTo.EducationOrganizationAssociationTypeDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationContentAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -60985,9 +59702,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationContent != null) + hash.Add(_educationContent); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor).EducationOrganizationAssociationTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationContentAppropriateGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -60996,55 +59716,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61070,11 +59741,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentAppropriateGradeLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61085,13 +59753,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -61104,12 +59765,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationAssociationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor)target); + return Entities.Common.EdFi.EducationContentAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationAssociationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor)target, null); + Entities.Common.EdFi.EducationContentAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target, null); } // ------------------------------------------------------------- @@ -61117,6 +59778,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -61124,9 +59845,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationAssociationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationContentAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -61154,22 +59875,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationCategoryDescriptor table of the EducationOrganizationCategoryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationContentAppropriateSex table of the EducationContent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationCategoryDescriptor : Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationContentAppropriateSex : Entities.Common.EdFi.IEducationContentAppropriateSex, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationContentAppropriateSex"); // Fluent validator instance (threadsafe) - private static EducationOrganizationCategoryDescriptorPutPostRequestValidator _validator = new EducationOrganizationCategoryDescriptorPutPostRequestValidator(); + private static EducationContentAppropriateSexPutPostRequestValidator _validator = new EducationContentAppropriateSexPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -61186,13 +59902,6 @@ public class EducationOrganizationCategoryDescriptor : Entities.Common.EdFi.IEdu // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationOrganizationCategoryDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -61203,19 +59912,33 @@ public class EducationOrganizationCategoryDescriptor : Entities.Common.EdFi.IEdu //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationContent _educationContent; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EducationOrganizationCategoryDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationContent IEducationContentAppropriateSex.EducationContent + { + get { return _educationContent; } + set { SetEducationContent(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationContent EducationContent { - get { return EducationOrganizationCategoryDescriptorId; } - set { EducationOrganizationCategoryDescriptorId = value; } + set { SetEducationContent(value); } + } + + private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + { + _educationContent = value; } + + /// + /// Sexes for which this education content is applicable. If omitted, considered generally applicable. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] + public string SexDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61230,7 +59953,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationContentAppropriateSex; if (ReferenceEquals(this, compareTo)) return true; @@ -61238,9 +59961,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor).EducationOrganizationCategoryDescriptorId.Equals(compareTo.EducationOrganizationCategoryDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationContentAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) return false; @@ -61256,9 +59983,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationContent != null) + hash.Add(_educationContent); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor).EducationOrganizationCategoryDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationContentAppropriateSex).SexDescriptor); return hash.ToHashCode(); } @@ -61267,55 +59997,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61341,11 +60022,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentAppropriateSex")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61356,13 +60034,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -61375,12 +60046,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor)target); + return Entities.Common.EdFi.EducationContentAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentAppropriateSex)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor)target, null); + Entities.Common.EdFi.EducationContentAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentAppropriateSex)target, null); } // ------------------------------------------------------------- @@ -61388,6 +60059,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -61395,9 +60126,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationContentAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -61425,22 +60156,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationOrganizationIdentificationSystemDescriptor table of the EducationOrganizationIdentificationSystemDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationContentAuthor table of the EducationContent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationIdentificationSystemDescriptor : Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationContentAuthor : Entities.Common.EdFi.IEducationContentAuthor, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationIdentificationSystemDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationContentAuthor"); // Fluent validator instance (threadsafe) - private static EducationOrganizationIdentificationSystemDescriptorPutPostRequestValidator _validator = new EducationOrganizationIdentificationSystemDescriptorPutPostRequestValidator(); + private static EducationContentAuthorPutPostRequestValidator _validator = new EducationContentAuthorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -61457,13 +60183,6 @@ public class EducationOrganizationIdentificationSystemDescriptor : Entities.Comm // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationOrganizationIdentificationSystemDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -61474,19 +60193,33 @@ public class EducationOrganizationIdentificationSystemDescriptor : Entities.Comm //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationContent _educationContent; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EducationOrganizationIdentificationSystemDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationContent IEducationContentAuthor.EducationContent + { + get { return _educationContent; } + set { SetEducationContent(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationContent EducationContent { - get { return EducationOrganizationIdentificationSystemDescriptorId; } - set { EducationOrganizationIdentificationSystemDescriptorId = value; } + set { SetEducationContent(value); } + } + + private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + { + _educationContent = value; } + + /// + /// The individual credited with the creation of the resource. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="author")] + public string Author { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61501,7 +60234,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationContentAuthor; if (ReferenceEquals(this, compareTo)) return true; @@ -61509,9 +60242,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor).EducationOrganizationIdentificationSystemDescriptorId.Equals(compareTo.EducationOrganizationIdentificationSystemDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentAuthor).Author, compareTo.Author)) return false; @@ -61527,9 +60264,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationContent != null) + hash.Add(_educationContent); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor).EducationOrganizationIdentificationSystemDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationContentAuthor).Author); return hash.ToHashCode(); } @@ -61538,55 +60278,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61612,11 +60303,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentAuthor")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -61627,13 +60315,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -61646,12 +60327,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor)target); + return Entities.Common.EdFi.EducationContentAuthorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentAuthor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor)target, null); + Entities.Common.EdFi.EducationContentAuthorMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentAuthor)target, null); } // ------------------------------------------------------------- @@ -61659,6 +60340,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -61666,9 +60407,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationContentAuthorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -61696,127 +60437,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the EducationOrganizationInterventionPrescriptionAssociation resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class EducationOrganizationInterventionPrescriptionAssociationReference : IResourceReference - { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="interventionPrescriptionEducationOrganizationId")] - public long InterventionPrescriptionEducationOrganizationId { get; set; } - - [DataMember(Name="interventionPrescriptionIdentificationCode")] - public string InterventionPrescriptionIdentificationCode { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return EducationOrganizationId != default(long) && InterventionPrescriptionEducationOrganizationId != default(long) && InterventionPrescriptionIdentificationCode != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (InterventionPrescriptionEducationOrganizationId == default) - { - yield return "InterventionPrescriptionEducationOrganizationId"; - } - - if (InterventionPrescriptionIdentificationCode == default) - { - yield return "InterventionPrescriptionIdentificationCode"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "EducationOrganizationInterventionPrescriptionAssociation", - Href = $"/ed-fi/educationOrganizationInterventionPrescriptionAssociations/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.EducationOrganizationInterventionPrescriptionAssociation table of the EducationOrganizationInterventionPrescriptionAssociation aggregate in the ODS Database. + /// A class which represents the edfi.EducationContentDerivativeSourceEducationContent table of the EducationContent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationInterventionPrescriptionAssociation : Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class EducationContentDerivativeSourceEducationContent : Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationInterventionPrescriptionAssociation"); + private static FullName _fullName = new FullName("edfi", "EducationContentDerivativeSourceEducationContent"); // Fluent validator instance (threadsafe) - private static EducationOrganizationInterventionPrescriptionAssociationPutPostRequestValidator _validator = new EducationOrganizationInterventionPrescriptionAssociationPutPostRequestValidator(); + private static EducationContentDerivativeSourceEducationContentPutPostRequestValidator _validator = new EducationContentDerivativeSourceEducationContentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -61833,83 +60464,43 @@ public class EducationOrganizationInterventionPrescriptionAssociation : Entities // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationOrganizationInterventionPrescriptionAssociation resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } - private bool _interventionPrescriptionReferenceExplicitlyAssigned; - private InterventionPrescription.EdFi.InterventionPrescriptionReference _interventionPrescriptionReference; - private InterventionPrescription.EdFi.InterventionPrescriptionReference ImplicitInterventionPrescriptionReference + private bool _derivativeSourceEducationContentReferenceExplicitlyAssigned; + private EducationContentReference _derivativeSourceEducationContentReference; + private EducationContentReference ImplicitDerivativeSourceEducationContentReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_interventionPrescriptionReference == null && !_interventionPrescriptionReferenceExplicitlyAssigned) - _interventionPrescriptionReference = new InterventionPrescription.EdFi.InterventionPrescriptionReference(); + if (_derivativeSourceEducationContentReference == null && !_derivativeSourceEducationContentReferenceExplicitlyAssigned) + _derivativeSourceEducationContentReference = new EducationContentReference(); - return _interventionPrescriptionReference; + return _derivativeSourceEducationContentReference; } } - [DataMember(Name="interventionPrescriptionReference")] + [DataMember(Name="derivativeSourceEducationContentReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public InterventionPrescription.EdFi.InterventionPrescriptionReference InterventionPrescriptionReference + public EducationContentReference DerivativeSourceEducationContentReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitInterventionPrescriptionReference != null - && (_interventionPrescriptionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - return ImplicitInterventionPrescriptionReference; + if (ImplicitDerivativeSourceEducationContentReference != null + && (_derivativeSourceEducationContentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDerivativeSourceEducationContentReference.IsReferenceFullyDefined())) + return ImplicitDerivativeSourceEducationContentReference; return null; } set { - _interventionPrescriptionReferenceExplicitlyAssigned = true; - _interventionPrescriptionReference = value; + _derivativeSourceEducationContentReferenceExplicitlyAssigned = true; + _derivativeSourceEducationContentReference = value; } } // ------------------------------------------------------------- @@ -61917,68 +60508,36 @@ public InterventionPrescription.EdFi.InterventionPrescriptionReference Intervent //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationContent _educationContent; - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationId + [IgnoreDataMember] + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducationContent.EducationContent { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } + get { return _educationContent; } + set { SetEducationContent(value); } } - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionEducationOrganizationId + public Entities.Common.EdFi.IEducationContent EducationContent { - get - { - if (ImplicitInterventionPrescriptionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - return ImplicitInterventionPrescriptionReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + set { SetEducationContent(value); } + } - // InterventionPrescription - _interventionPrescriptionReferenceExplicitlyAssigned = false; - ImplicitInterventionPrescriptionReference.EducationOrganizationId = value; - } + private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + { + _educationContent = value; } /// - /// A unique number or alphanumeric code assigned to an intervention prescription. + /// A unique identifier for the education content. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionIdentificationCode + string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceContentIdentifier { get { - if (ImplicitInterventionPrescriptionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - return ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode; + if (ImplicitDerivativeSourceEducationContentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitDerivativeSourceEducationContentReference.IsReferenceFullyDefined())) + return ImplicitDerivativeSourceEducationContentReference.ContentIdentifier; return default(string); } @@ -61987,9 +60546,9 @@ string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssoci // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // InterventionPrescription - _interventionPrescriptionReferenceExplicitlyAssigned = false; - ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode = value; + // DerivativeSourceEducationContent + _derivativeSourceEducationContentReferenceExplicitlyAssigned = false; + ImplicitDerivativeSourceEducationContentReference.ContentIdentifier = value; } } // ------------------------------------------------------------- @@ -62006,7 +60565,7 @@ string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssoci /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation; + var compareTo = obj as Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent; if (ReferenceEquals(this, compareTo)) return true; @@ -62014,19 +60573,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionEducationOrganizationId.Equals(compareTo.InterventionPrescriptionEducationOrganizationId)) + // Parent Property + if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionIdentificationCode, compareTo.InterventionPrescriptionIdentificationCode)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent).DerivativeSourceContentIdentifier, compareTo.DerivativeSourceContentIdentifier)) return false; @@ -62042,15 +60595,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationContent != null) + hash.Add(_educationContent); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).EducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionEducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionIdentificationCode); + hash.Add((this as Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent).DerivativeSourceContentIdentifier); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -62063,20 +60613,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The begin date of the period during which the intervention prescription is available. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BeginDate { get; set; } - - /// - /// The end date of the period during which the intervention prescription is available. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -62097,7 +60633,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationInterventionPrescriptionAssociation", "EducationOrganizationInterventionPrescriptionAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentDerivativeSourceEducationContent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -62109,13 +60645,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -62128,43 +60657,29 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationInterventionPrescriptionAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation)target); + return Entities.Common.EdFi.EducationContentDerivativeSourceEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationInterventionPrescriptionAssociationMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation)target, null); + Entities.Common.EdFi.EducationContentDerivativeSourceEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionResourceId + Guid? Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentResourceId { get { return null; } - set { ImplicitInterventionPrescriptionReference.ResourceId = value ?? default(Guid); } + set { ImplicitDerivativeSourceEducationContentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionDiscriminator + string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitInterventionPrescriptionReference.Discriminator = value; } + set { ImplicitDerivativeSourceEducationContentReference.Discriminator = value; } } @@ -62185,6 +60700,7 @@ string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssoci try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -62235,9 +60751,9 @@ string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssoci // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationInterventionPrescriptionAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationContentDerivativeSourceEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -62265,86 +60781,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the EducationOrganizationNetwork resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class EducationOrganizationNetworkReference : IResourceReference - { - [DataMember(Name="educationOrganizationNetworkId")] - public long EducationOrganizationNetworkId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return EducationOrganizationNetworkId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationOrganizationNetworkId == default) - { - yield return "EducationOrganizationNetworkId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "EducationOrganizationNetwork", - Href = $"/ed-fi/educationOrganizationNetworks/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - /// - /// A class which represents the edfi.EducationOrganizationNetwork table of the EducationOrganizationNetwork aggregate in the ODS Database. + /// A class which represents the edfi.EducationContentDerivativeSourceLearningResourceMetadataURI table of the EducationContent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationNetwork : Entities.Common.EdFi.IEducationOrganizationNetwork, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + public class EducationContentDerivativeSourceLearningResourceMetadataURI : Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationNetwork"); + private static FullName _fullName = new FullName("edfi", "EducationContentDerivativeSourceLearningResourceMetadataURI"); // Fluent validator instance (threadsafe) - private static EducationOrganizationNetworkPutPostRequestValidator _validator = new EducationOrganizationNetworkPutPostRequestValidator(); + private static EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator _validator = new EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -62355,30 +60802,12 @@ public class EducationOrganizationNetwork : Entities.Common.EdFi.IEducationOrgan // Constructor // ------------------------------------------------------------- - public EducationOrganizationNetwork() - { - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationOrganizationNetwork resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -62389,20 +60818,33 @@ public EducationOrganizationNetwork() //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationContent _educationContent; + + [IgnoreDataMember] + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceLearningResourceMetadataURI.EducationContent + { + get { return _educationContent; } + set { SetEducationContent(value); } + } + + public Entities.Common.EdFi.IEducationContent EducationContent + { + set { SetEducationContent(value); } + } + + private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + { + _educationContent = value; + } /// - /// The identifier assigned to a network of education organizations. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="educationOrganizationNetworkId")] - public long EducationOrganizationNetworkId { get; set; } - - long IEducationOrganization.EducationOrganizationId - { - get { return EducationOrganizationNetworkId; } - set { EducationOrganizationNetworkId = value; } - } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="derivativeSourceLearningResourceMetadataURI")] + public string DerivativeSourceLearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -62417,7 +60859,7 @@ long IEducationOrganization.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationNetwork; + var compareTo = obj as Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI; if (ReferenceEquals(this, compareTo)) return true; @@ -62425,9 +60867,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationNetwork).EducationOrganizationNetworkId.Equals(compareTo.EducationOrganizationNetworkId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI).DerivativeSourceLearningResourceMetadataURI, compareTo.DerivativeSourceLearningResourceMetadataURI)) return false; @@ -62443,9 +60889,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationContent != null) + hash.Add(_educationContent); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationNetwork).EducationOrganizationNetworkId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI).DerivativeSourceLearningResourceMetadataURI); return hash.ToHashCode(); } @@ -62454,53 +60903,11 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// The full, legally accepted name of the institution. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } - - /// - /// The current operational status of the education organization (e.g., active, inactive). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } - - /// - /// A short name for the institution. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } - - /// - /// The public web site address (URL) for the education organization. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The purpose(s) of the network (e.g., shared services, collective procurement). - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="networkPurposeDescriptor")][DescriptorExists("NetworkPurposeDescriptor")] - public string NetworkPurposeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -62516,138 +60923,12 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses - { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses - { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } - set - { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodes; } - set - { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } - set - { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators - { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } - } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephones; } - set - { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } - } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddresses; } - set - { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } - } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationNetwork", "EducationOrganizationNetwork")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentDerivativeSourceLearningResourceMetadataURI")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -62659,54 +60940,11 @@ public ICollection + public class EducationContentDerivativeSourceLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_EducationOrganizationNetwork = new FullName("edfi", "EducationOrganizationNetwork"); - - // Declare collection item validators - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -62890,211 +61047,313 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (EducationOrganizationNetworkMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_EducationOrganizationNetwork); - - if (mappingContract != null) + if (failures.Any()) { - if (mappingContract.IsEducationOrganizationAddressIncluded != null) - { - var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + foreach (var failure in failures) { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } + result.Errors.Add(failure); } - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + return false; + } - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + return true; + } + } + // ----------------------------------------------------------------- - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + /// + /// A class which represents the edfi.EducationContentDerivativeSourceURI table of the EducationContent aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class EducationContentDerivativeSourceURI : Entities.Common.EdFi.IEducationContentDerivativeSourceURI, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "EducationContentDerivativeSourceURI"); + + // Fluent validator instance (threadsafe) + private static EducationContentDerivativeSourceURIPutPostRequestValidator _validator = new EducationContentDerivativeSourceURIPutPostRequestValidator(); - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) - { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - if (hasInvalidEducationOrganizationInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + // ------------------------------------------------------------ - } + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return false; - } + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationContent _educationContent; - return true; + [IgnoreDataMember] + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.EducationContent + { + get { return _educationContent; } + set { SetEducationContent(value); } } - } - // ----------------------------------------------------------------- - -} -// Aggregate: EducationOrganizationNetworkAssociation -namespace EdFi.Ods.Api.Common.Models.Resources.EducationOrganizationNetworkAssociation.EdFi -{ - /// - /// Represents a reference to the EducationOrganizationNetworkAssociation resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class EducationOrganizationNetworkAssociationReference : IResourceReference - { - [DataMember(Name="educationOrganizationNetworkId")] - public long EducationOrganizationNetworkId { get; set; } + public Entities.Common.EdFi.IEducationContent EducationContent + { + set { SetEducationContent(value); } + } - [DataMember(Name="memberEducationOrganizationId")] - public long MemberEducationOrganizationId { get; set; } + private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + { + _educationContent = value; + } /// - /// Gets or sets the resource identifier of the referenced resource. + /// The URI (typical a URL) pointing to an education content item. /// - public Guid ResourceId { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="derivativeSourceURI")] + public string DerivativeSourceURI { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + /// Determines equality based on the natural key properties of the resource. /// - public string Discriminator { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IEducationContentDerivativeSourceURI; + if (ReferenceEquals(this, compareTo)) + return true; - private Link _link; + if (compareTo == null) + return false; - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + // Parent Property + if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) + return false; - return _link; - } + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationContentDerivativeSourceURI).DerivativeSourceURI, compareTo.DerivativeSourceURI)) + return false; + + + return true; } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Builds the hash code based on the unique identifying values. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - return EducationOrganizationNetworkId != default(long) && MemberEducationOrganizationId != default(long); + var hash = new HashCode(); + //Parent Property + if (_educationContent != null) + hash.Add(_educationContent); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationContentDerivativeSourceURI).DerivativeSourceURI); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - IEnumerable IResourceReference.GetUndefinedProperties() + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentDerivativeSourceURI")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - if (EducationOrganizationNetworkId == default) + return Entities.Common.EdFi.EducationContentDerivativeSourceURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.EducationContentDerivativeSourceURIMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - yield return "EducationOrganizationNetworkId"; - } + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - if (MemberEducationOrganizationId == default) + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally { - yield return "MemberEducationOrganizationId"; + // Restore original length + pathBuilder.Length = originalLength; } - + // ---------------------------------- } + } - private Link CreateLink() + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class EducationContentDerivativeSourceURIPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - var link = new Link + if (context.InstanceToValidate == null) { - Rel = "EducationOrganizationNetworkAssociation", - Href = $"/ed-fi/educationOrganizationNetworkAssociations/{ResourceId:n}" - }; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - if (string.IsNullOrEmpty(Discriminator)) - return link; + return false; + } - string[] linkParts = Discriminator.Split('.'); + var instance = context.InstanceToValidate; - if (linkParts.Length < 2) - return link; + var failures = new List(); - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.EducationOrganizationNetworkAssociation table of the EducationOrganizationNetworkAssociation aggregate in the ODS Database. + /// A class which represents the edfi.EducationContentLanguage table of the EducationContent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationNetworkAssociation : Entities.Common.EdFi.IEducationOrganizationNetworkAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class EducationContentLanguage : Entities.Common.EdFi.IEducationContentLanguage, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationNetworkAssociation"); + private static FullName _fullName = new FullName("edfi", "EducationContentLanguage"); // Fluent validator instance (threadsafe) - private static EducationOrganizationNetworkAssociationPutPostRequestValidator _validator = new EducationOrganizationNetworkAssociationPutPostRequestValidator(); + private static EducationContentLanguagePutPostRequestValidator _validator = new EducationContentLanguagePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -63111,140 +61370,43 @@ public class EducationOrganizationNetworkAssociation : Entities.Common.EdFi.IEdu // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationOrganizationNetworkAssociation resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationNetworkReferenceExplicitlyAssigned; - private EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference _educationOrganizationNetworkReference; - private EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference ImplicitEducationOrganizationNetworkReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationNetworkReference == null && !_educationOrganizationNetworkReferenceExplicitlyAssigned) - _educationOrganizationNetworkReference = new EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference(); - - return _educationOrganizationNetworkReference; - } - } - - [DataMember(Name="educationOrganizationNetworkReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference EducationOrganizationNetworkReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationNetworkReference != null - && (_educationOrganizationNetworkReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationNetworkReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationNetworkReference; - - return null; - } - set - { - _educationOrganizationNetworkReferenceExplicitlyAssigned = true; - _educationOrganizationNetworkReference = value; - } - } - private bool _memberEducationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _memberEducationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitMemberEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_memberEducationOrganizationReference == null && !_memberEducationOrganizationReferenceExplicitlyAssigned) - _memberEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _memberEducationOrganizationReference; - } - } - - [DataMember(Name="memberEducationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference MemberEducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitMemberEducationOrganizationReference != null - && (_memberEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitMemberEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitMemberEducationOrganizationReference; - - return null; - } - set - { - _memberEducationOrganizationReferenceExplicitlyAssigned = true; - _memberEducationOrganizationReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationContent _educationContent; - /// - /// The identifier assigned to a network of education organizations. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.EducationOrganizationNetworkId + [IgnoreDataMember] + Entities.Common.EdFi.IEducationContent IEducationContentLanguage.EducationContent { - get - { - if (ImplicitEducationOrganizationNetworkReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationNetworkReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationNetworkReference.EducationOrganizationNetworkId; + get { return _educationContent; } + set { SetEducationContent(value); } + } - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + public Entities.Common.EdFi.IEducationContent EducationContent + { + set { SetEducationContent(value); } + } - // EducationOrganizationNetwork - _educationOrganizationNetworkReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationNetworkReference.EducationOrganizationNetworkId = value; - } + private void SetEducationContent(Entities.Common.EdFi.IEducationContent value) + { + _educationContent = value; } /// - /// The identifier assigned to an education organization. + /// An indication of the languages in which the Education Content is designed. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationId - { - get - { - if (ImplicitMemberEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitMemberEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitMemberEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // MemberEducationOrganization - _memberEducationOrganizationReferenceExplicitlyAssigned = false; - ImplicitMemberEducationOrganizationReference.EducationOrganizationId = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="languageDescriptor")][DescriptorExists("LanguageDescriptor")] + public string LanguageDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -63259,7 +61421,7 @@ long Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducati /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation; + var compareTo = obj as Entities.Common.EdFi.IEducationContentLanguage; if (ReferenceEquals(this, compareTo)) return true; @@ -63267,14 +61429,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).EducationOrganizationNetworkId.Equals(compareTo.EducationOrganizationNetworkId)) + // Parent Property + if (_educationContent == null || !_educationContent.Equals(compareTo.EducationContent)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).MemberEducationOrganizationId.Equals(compareTo.MemberEducationOrganizationId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationContentLanguage).LanguageDescriptor, compareTo.LanguageDescriptor)) return false; @@ -63290,12 +61451,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationContent != null) + hash.Add(_educationContent); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).EducationOrganizationNetworkId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationContentLanguage).LanguageDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).MemberEducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -63308,20 +61470,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The date on which the education organization joined this network. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BeginDate { get; set; } - - /// - /// The date on which the education organization left this network. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -63342,7 +61490,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationNetworkAssociation", "EducationOrganizationNetworkAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationContent", "EducationContentLanguage")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -63354,13 +61502,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -63373,39 +61514,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationNetworkAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationNetworkAssociation)target); + return Entities.Common.EdFi.EducationContentLanguageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationContentLanguage)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationNetworkAssociationMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationNetworkAssociation)target, null); + Entities.Common.EdFi.EducationContentLanguageMapper.MapTo(this, (Entities.Common.EdFi.IEducationContentLanguage)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.EducationOrganizationNetworkResourceId - { - get { return null; } - set { ImplicitEducationOrganizationNetworkReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationResourceId - { - get { return null; } - set { ImplicitMemberEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitMemberEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -63423,6 +61543,7 @@ string Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEduca try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -63473,9 +61594,9 @@ string Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEduca // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationNetworkAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationContentLanguagePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -63504,23 +61625,20 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the EducationOrganizationPeerAssociation resource. + /// Represents a reference to the EducationOrganization resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationPeerAssociationReference : IResourceReference + public class EducationOrganizationReference : IResourceReference { [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } - [DataMember(Name="peerEducationOrganizationId")] - public long PeerEducationOrganizationId { get; set; } - /// /// Gets or sets the resource identifier of the referenced resource. /// @@ -63557,7 +61675,7 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EducationOrganizationId != default(long) && PeerEducationOrganizationId != default(long); + return EducationOrganizationId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() @@ -63567,19 +61685,14 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "EducationOrganizationId"; } - if (PeerEducationOrganizationId == default) - { - yield return "PeerEducationOrganizationId"; - } - } private Link CreateLink() { var link = new Link { - Rel = "EducationOrganizationPeerAssociation", - Href = $"/ed-fi/educationOrganizationPeerAssociations/{ResourceId:n}" + Rel = "EducationOrganization", + Href = $"/ed-fi/educationOrganizations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -63605,17 +61718,23 @@ private Link CreateLink() } } // Aggregate reference + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + /// - /// A class which represents the edfi.EducationOrganizationPeerAssociation table of the EducationOrganizationPeerAssociation aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationAddress table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationOrganizationPeerAssociation : Entities.Common.EdFi.IEducationOrganizationPeerAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class EducationOrganizationAddress : Entities.Common.EdFi.IEducationOrganizationAddress, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationOrganizationPeerAssociation"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationAddress"); // Fluent validator instance (threadsafe) - private static EducationOrganizationPeerAssociationPutPostRequestValidator _validator = new EducationOrganizationPeerAssociationPutPostRequestValidator(); + private static EducationOrganizationAddressPutPostRequestValidator _validator = new EducationOrganizationAddressPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -63626,146 +61745,89 @@ public class EducationOrganizationPeerAssociation : Entities.Common.EdFi.IEducat // Constructor // ------------------------------------------------------------- + public EducationOrganizationAddress() + { + EducationOrganizationAddressPeriods = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationOrganizationPeerAssociation resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationAddress.EducationOrganization { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } + get { return _educationOrganization; } + set { SetEducationOrganization(value); } } - private bool _peerEducationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _peerEducationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitPeerEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_peerEducationOrganizationReference == null && !_peerEducationOrganizationReferenceExplicitlyAssigned) - _peerEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _peerEducationOrganizationReference; - } + public Entities.Common.EdFi.IEducationOrganization EducationOrganization + { + set { SetEducationOrganization(value); } } - [DataMember(Name="peerEducationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference PeerEducationOrganizationReference + private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitPeerEducationOrganizationReference != null - && (_peerEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPeerEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitPeerEducationOrganizationReference; - - return null; - } - set - { - _peerEducationOrganizationReferenceExplicitlyAssigned = true; - _peerEducationOrganizationReference = value; - } + _educationOrganization = value; } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. + /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] + public string AddressTypeDescriptor { get; set; } - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } + /// + /// The name of the city in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="city")] + public string City { get; set; } /// - /// The identifier assigned to an education organization. + /// The five or nine digit zip code or overseas postal code portion of an address. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationId - { - get - { - if (ImplicitPeerEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPeerEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitPeerEducationOrganizationReference.EducationOrganizationId; + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="postalCode")] + public string PostalCode { get; set; } - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + /// + /// The abbreviation for the state (within the United States) or outlying area in which an address is located. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string StateAbbreviationDescriptor { get; set; } - // PeerEducationOrganization - _peerEducationOrganizationReferenceExplicitlyAssigned = false; - ImplicitPeerEducationOrganizationReference.EducationOrganizationId = value; - } - } + /// + /// The street number and street name or post office box number of an address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="streetNumberName")] + public string StreetNumberName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -63780,7 +61842,7 @@ long Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrg /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationPeerAssociation; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationAddress; if (ReferenceEquals(this, compareTo)) return true; @@ -63788,14 +61850,33 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + return false; + - // Referenced Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).PeerEducationOrganizationId.Equals(compareTo.PeerEducationOrganizationId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).City, compareTo.City)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).PostalCode, compareTo.PostalCode)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationAddress).StreetNumberName, compareTo.StreetNumberName)) return false; @@ -63811,12 +61892,29 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganization != null) + hash.Add(_educationOrganization); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).EducationOrganizationId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).AddressTypeDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).City); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).PostalCode); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).StateAbbreviationDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddress).StreetNumberName); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).PeerEducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -63829,6 +61927,77 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The apartment, room, or suite number of an address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="apartmentRoomSuiteNumber")] + public string ApartmentRoomSuiteNumber { get; set; } + + /// + /// The number of the building on the site, if more than one building shares the same address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="buildingSiteNumber")] + public string BuildingSiteNumber { get; set; } + + /// + /// The congressional district in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="congressionalDistrict")] + public string CongressionalDistrict { get; set; } + + /// + /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="countyFIPSCode")] + public string CountyFIPSCode { get; set; } + + /// + /// An indication that the address should not be published. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } + + /// + /// The geographic latitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="latitude")] + public string Latitude { get; set; } + + /// + /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] + public string LocaleDescriptor { get; set; } + + /// + /// The geographic longitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="longitude")] + public string Longitude { get; set; } + + /// + /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfCounty")] + public string NameOfCounty { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -63849,30 +62018,64 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationPeerAssociation", "EducationOrganizationPeerAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationAddress")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _educationOrganizationAddressPeriods; + private ICollection _educationOrganizationAddressPeriodsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="periods")] + public ICollection EducationOrganizationAddressPeriods + { + get { return _educationOrganizationAddressPeriods; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)e.Item).EducationOrganizationAddress = this); + _educationOrganizationAddressPeriods = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)e.Item).EducationOrganizationAddress = this; + _educationOrganizationAddressPeriodsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganizationAddress.EducationOrganizationAddressPeriods + { + get { return _educationOrganizationAddressPeriodsCovariant; } + set { EducationOrganizationAddressPeriods = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationOrganizationAddressPeriods != null) foreach (var item in _educationOrganizationAddressPeriods) + { + item.EducationOrganizationAddress = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -63880,46 +62083,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationOrganizationPeerAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationPeerAssociation)target); + return Entities.Common.EdFi.EducationOrganizationAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationAddress)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationOrganizationPeerAssociationMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationPeerAssociation)target, null); + Entities.Common.EdFi.EducationOrganizationAddressMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationAddress)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationResourceId - { - get { return null; } - set { ImplicitPeerEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitPeerEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -63937,11 +62112,24 @@ string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationO try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (EducationOrganizationAddressPeriods.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddressPeriods") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationAddressPeriods"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddressPeriods, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddressPeriods")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -63987,9 +62175,14 @@ string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationO // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationOrganizationPeerAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationAddressPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_EducationOrganizationAddress = new FullName("edfi", "EducationOrganizationAddress"); + + // Declare collection item validators + private EducationOrganizationAddressPeriodPutPostRequestValidator _educationOrganizationAddressPeriodsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -64002,6 +62195,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (EducationOrganizationAddressMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_EducationOrganizationAddress); + + if (mappingContract != null) + { + if (mappingContract.IsEducationOrganizationAddressPeriodIncluded != null) + { + var hasInvalidEducationOrganizationAddressPeriodsItems = instance.EducationOrganizationAddressPeriods.Any(x => !mappingContract.IsEducationOrganizationAddressPeriodIncluded(x)); + + if (hasInvalidEducationOrganizationAddressPeriodsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddressPeriods", $"A supplied 'EducationOrganizationAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -64017,22 +62232,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EducationPlanDescriptor table of the EducationPlanDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationAddressPeriod table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationPlanDescriptor : Entities.Common.EdFi.IEducationPlanDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationAddressPeriod : Entities.Common.EdFi.IEducationOrganizationAddressPeriod, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationPlanDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationAddressPeriod"); // Fluent validator instance (threadsafe) - private static EducationPlanDescriptorPutPostRequestValidator _validator = new EducationPlanDescriptorPutPostRequestValidator(); + private static EducationOrganizationAddressPeriodPutPostRequestValidator _validator = new EducationOrganizationAddressPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -64049,13 +62259,6 @@ public class EducationPlanDescriptor : Entities.Common.EdFi.IEducationPlanDescri // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationPlanDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -64066,19 +62269,32 @@ public class EducationPlanDescriptor : Entities.Common.EdFi.IEducationPlanDescri //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganizationAddress _educationOrganizationAddress; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EducationPlanDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganizationAddress IEducationOrganizationAddressPeriod.EducationOrganizationAddress + { + get { return _educationOrganizationAddress; } + set { SetEducationOrganizationAddress(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationOrganizationAddress EducationOrganizationAddress { - get { return EducationPlanDescriptorId; } - set { EducationPlanDescriptorId = value; } + set { SetEducationOrganizationAddress(value); } } + + private void SetEducationOrganizationAddress(Entities.Common.EdFi.IEducationOrganizationAddress value) + { + _educationOrganizationAddress = value; + } + + /// + /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -64093,7 +62309,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationPlanDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationAddressPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -64101,9 +62317,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganizationAddress == null || !_educationOrganizationAddress.Equals(compareTo.EducationOrganizationAddress)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IEducationPlanDescriptor).EducationPlanDescriptorId.Equals(compareTo.EducationPlanDescriptorId)) + // Standard Property + if (!(this as Entities.Common.EdFi.IEducationOrganizationAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) return false; @@ -64119,9 +62339,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganizationAddress != null) + hash.Add(_educationOrganizationAddress); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEducationPlanDescriptor).EducationPlanDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAddressPeriod).BeginDate); return hash.ToHashCode(); } @@ -64130,60 +62353,18 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -64204,11 +62385,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationAddressPeriod")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -64219,13 +62397,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -64238,12 +62409,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EducationPlanDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationPlanDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EducationPlanDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationPlanDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target, null); } // ------------------------------------------------------------- @@ -64251,6 +62422,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -64258,9 +62489,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EducationPlanDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -64288,86 +62519,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the EducationServiceCenter resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class EducationServiceCenterReference : IResourceReference - { - [DataMember(Name="educationServiceCenterId")] - public long EducationServiceCenterId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return EducationServiceCenterId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationServiceCenterId == default) - { - yield return "EducationServiceCenterId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "EducationServiceCenter", - Href = $"/ed-fi/educationServiceCenters/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - /// - /// A class which represents the edfi.EducationServiceCenter table of the EducationServiceCenter aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationCategory table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EducationServiceCenter : Entities.Common.EdFi.IEducationServiceCenter, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + public class EducationOrganizationCategory : Entities.Common.EdFi.IEducationOrganizationCategory, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EducationServiceCenter"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationCategory"); // Fluent validator instance (threadsafe) - private static EducationServiceCenterPutPostRequestValidator _validator = new EducationServiceCenterPutPostRequestValidator(); + private static EducationOrganizationCategoryPutPostRequestValidator _validator = new EducationOrganizationCategoryPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -64378,88 +62540,49 @@ public class EducationServiceCenter : Entities.Common.EdFi.IEducationServiceCent // Constructor // ------------------------------------------------------------- - public EducationServiceCenter() - { - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EducationServiceCenter resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _stateEducationAgencyReferenceExplicitlyAssigned; - private StateEducationAgency.EdFi.StateEducationAgencyReference _stateEducationAgencyReference; - private StateEducationAgency.EdFi.StateEducationAgencyReference ImplicitStateEducationAgencyReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_stateEducationAgencyReference == null && !_stateEducationAgencyReferenceExplicitlyAssigned) - _stateEducationAgencyReference = new StateEducationAgency.EdFi.StateEducationAgencyReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - return _stateEducationAgencyReference; - } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationCategory.EducationOrganization + { + get { return _educationOrganization; } + set { SetEducationOrganization(value); } } - [DataMember(Name="stateEducationAgencyReference")] - [FullyDefinedReference] - public StateEducationAgency.EdFi.StateEducationAgencyReference StateEducationAgencyReference + public Entities.Common.EdFi.IEducationOrganization EducationOrganization { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStateEducationAgencyReference != null - && (_stateEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) - return ImplicitStateEducationAgencyReference; - - return null; - } - set - { - _stateEducationAgencyReferenceExplicitlyAssigned = true; - _stateEducationAgencyReference = value; - } + set { SetEducationOrganization(value); } } - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- + private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + { + _educationOrganization = value; + } /// - /// The identifier assigned to an education service center. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The classification of the education agency within the geographic boundaries of a state according to the level of administrative and operational control granted by the state. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="educationServiceCenterId")] - public long EducationServiceCenterId { get; set; } - - long IEducationOrganization.EducationOrganizationId - { - get { return EducationServiceCenterId; } - set { EducationServiceCenterId = value; } - } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="educationOrganizationCategoryDescriptor")][DescriptorExists("EducationOrganizationCategoryDescriptor")] + public string EducationOrganizationCategoryDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -64474,7 +62597,7 @@ long IEducationOrganization.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEducationServiceCenter; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationCategory; if (ReferenceEquals(this, compareTo)) return true; @@ -64482,9 +62605,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IEducationServiceCenter).EducationServiceCenterId.Equals(compareTo.EducationServiceCenterId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationCategory).EducationOrganizationCategoryDescriptor, compareTo.EducationOrganizationCategoryDescriptor)) return false; @@ -64500,9 +62627,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganization != null) + hash.Add(_educationOrganization); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEducationServiceCenter).EducationServiceCenterId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationCategory).EducationOrganizationCategoryDescriptor); return hash.ToHashCode(); } @@ -64511,71 +62641,11 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// The full, legally accepted name of the institution. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } - - /// - /// The current operational status of the education organization (e.g., active, inactive). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } - - /// - /// A short name for the institution. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } - - /// - /// The public web site address (URL) for the education organization. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The identifier assigned to a state education agency. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.IEducationServiceCenter.StateEducationAgencyId - { - get - { - if (ImplicitStateEducationAgencyReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) - { - return ImplicitStateEducationAgencyReference.StateEducationAgencyId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StateEducationAgency - _stateEducationAgencyReferenceExplicitlyAssigned = false; - ImplicitStateEducationAgencyReference.StateEducationAgencyId = value.GetValueOrDefault(); - } - } // ------------------------------------------------------------- // ============================================================= @@ -64591,138 +62661,12 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses - { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses - { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } - set - { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodes; } - set - { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } - set - { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators - { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } - } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephones; } - set - { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } - } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddresses; } - set - { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } - } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationServiceCenter", "EducationServiceCenter")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationCategory")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -64734,54 +62678,11 @@ public ICollection + public class EducationOrganizationCategoryPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_EducationServiceCenter = new FullName("edfi", "EducationServiceCenter"); - - // Declare collection item validators - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -64972,83 +62785,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (EducationServiceCenterMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_EducationServiceCenter); - - if (mappingContract != null) - { - if (mappingContract.IsEducationOrganizationAddressIncluded != null) - { - var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); - - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) - { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - - if (hasInvalidEducationOrganizationInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -65064,22 +62800,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ElectronicMailTypeDescriptor table of the ElectronicMailTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationIdentificationCode table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ElectronicMailTypeDescriptor : Entities.Common.EdFi.IElectronicMailTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationIdentificationCode : Entities.Common.EdFi.IEducationOrganizationIdentificationCode, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ElectronicMailTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationIdentificationCode"); // Fluent validator instance (threadsafe) - private static ElectronicMailTypeDescriptorPutPostRequestValidator _validator = new ElectronicMailTypeDescriptorPutPostRequestValidator(); + private static EducationOrganizationIdentificationCodePutPostRequestValidator _validator = new EducationOrganizationIdentificationCodePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -65096,13 +62827,6 @@ public class ElectronicMailTypeDescriptor : Entities.Common.EdFi.IElectronicMail // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ElectronicMailTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -65113,19 +62837,33 @@ public class ElectronicMailTypeDescriptor : Entities.Common.EdFi.IElectronicMail //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ElectronicMailTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIdentificationCode.EducationOrganization + { + get { return _educationOrganization; } + set { SetEducationOrganization(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationOrganization EducationOrganization { - get { return ElectronicMailTypeDescriptorId; } - set { ElectronicMailTypeDescriptorId = value; } + set { SetEducationOrganization(value); } + } + + private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + { + _educationOrganization = value; } + + /// + /// The school system, state, or agency assigning the identification code. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="educationOrganizationIdentificationSystemDescriptor")][DescriptorExists("EducationOrganizationIdentificationSystemDescriptor")] + public string EducationOrganizationIdentificationSystemDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65140,7 +62878,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IElectronicMailTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIdentificationCode; if (ReferenceEquals(this, compareTo)) return true; @@ -65148,9 +62886,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IElectronicMailTypeDescriptor).ElectronicMailTypeDescriptorId.Equals(compareTo.ElectronicMailTypeDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationIdentificationCode).EducationOrganizationIdentificationSystemDescriptor, compareTo.EducationOrganizationIdentificationSystemDescriptor)) return false; @@ -65166,9 +62908,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganization != null) + hash.Add(_educationOrganization); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IElectronicMailTypeDescriptor).ElectronicMailTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIdentificationCode).EducationOrganizationIdentificationSystemDescriptor); return hash.ToHashCode(); } @@ -65177,60 +62922,20 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A shortened description for the descriptor. + /// A unique number or alphanumeric code that is assigned to an education organization by a school, school system, state, or other agency or entity. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65251,11 +62956,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationIdentificationCode")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65266,13 +62968,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -65285,12 +62980,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ElectronicMailTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IElectronicMailTypeDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ElectronicMailTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IElectronicMailTypeDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target, null); } // ------------------------------------------------------------- @@ -65298,6 +62993,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -65305,9 +63060,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ElectronicMailTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -65335,22 +63090,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EligibilityDelayReasonDescriptor table of the EligibilityDelayReasonDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationIndicator table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EligibilityDelayReasonDescriptor : Entities.Common.EdFi.IEligibilityDelayReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationIndicator : Entities.Common.EdFi.IEducationOrganizationIndicator, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EligibilityDelayReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationIndicator"); // Fluent validator instance (threadsafe) - private static EligibilityDelayReasonDescriptorPutPostRequestValidator _validator = new EligibilityDelayReasonDescriptorPutPostRequestValidator(); + private static EducationOrganizationIndicatorPutPostRequestValidator _validator = new EducationOrganizationIndicatorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -65361,19 +63111,16 @@ public class EligibilityDelayReasonDescriptor : Entities.Common.EdFi.IEligibilit // Constructor // ------------------------------------------------------------- + public EducationOrganizationIndicator() + { + EducationOrganizationIndicatorPeriods = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EligibilityDelayReasonDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -65384,34 +63131,48 @@ public class EligibilityDelayReasonDescriptor : Entities.Common.EdFi.IEligibilit //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EligibilityDelayReasonDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIndicator.EducationOrganization + { + get { return _educationOrganization; } + set { SetEducationOrganization(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationOrganization EducationOrganization { - get { return EligibilityDelayReasonDescriptorId; } - set { EligibilityDelayReasonDescriptorId = value; } + set { SetEducationOrganization(value); } } - // ------------------------------------------------------------- - // ============================================================= - // Equality - // ------------------------------------------------------------- + private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + { + _educationOrganization = value; + } /// - /// Determines equality based on the natural key properties of the resource. + /// The name or code for the indicator or metric. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="indicatorDescriptor")][DescriptorExists("IndicatorDescriptor")] + public string IndicatorDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. /// /// /// A boolean value indicating equality result of the compared resources. /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEligibilityDelayReasonDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIndicator; if (ReferenceEquals(this, compareTo)) return true; @@ -65419,9 +63180,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IEligibilityDelayReasonDescriptor).EligibilityDelayReasonDescriptorId.Equals(compareTo.EligibilityDelayReasonDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationIndicator).IndicatorDescriptor, compareTo.IndicatorDescriptor)) return false; @@ -65437,9 +63202,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganization != null) + hash.Add(_educationOrganization); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEligibilityDelayReasonDescriptor).EligibilityDelayReasonDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIndicator).IndicatorDescriptor); return hash.ToHashCode(); } @@ -65448,60 +63216,43 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The person, organization, or department that defined the metric. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="designatedBy")] + public string DesignatedBy { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The name for a group of indicators. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="indicatorGroupDescriptor")][DescriptorExists("IndicatorGroupDescriptor")] + public string IndicatorGroupDescriptor { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The value of the indicator or metric, as a value from a controlled vocabulary. The semantics of an empty value is \"not submitted.\" /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="indicatorLevelDescriptor")][DescriptorExists("IndicatorLevelDescriptor")] + public string IndicatorLevelDescriptor { get; set; } /// - /// A shortened description for the descriptor. + /// The value of the indicator or metric. The semantics of an empty value is \"not submitted.\" /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="indicatorValue")] + public string IndicatorValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65522,33 +63273,64 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationIndicator")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _educationOrganizationIndicatorPeriods; + private ICollection _educationOrganizationIndicatorPeriodsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="periods")] + public ICollection EducationOrganizationIndicatorPeriods + { + get { return _educationOrganizationIndicatorPeriods; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)e.Item).EducationOrganizationIndicator = this); + _educationOrganizationIndicatorPeriods = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)e.Item).EducationOrganizationIndicator = this; + _educationOrganizationIndicatorPeriodsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganizationIndicator.EducationOrganizationIndicatorPeriods + { + get { return _educationOrganizationIndicatorPeriodsCovariant; } + set { EducationOrganizationIndicatorPeriods = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationOrganizationIndicatorPeriods != null) foreach (var item in _educationOrganizationIndicatorPeriods) + { + item.EducationOrganizationIndicator = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -65556,12 +63338,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EligibilityDelayReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEligibilityDelayReasonDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationIndicatorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicator)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EligibilityDelayReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEligibilityDelayReasonDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationIndicatorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicator)target, null); } // ------------------------------------------------------------- @@ -65569,6 +63351,78 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (EducationOrganizationIndicatorPeriods.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicatorPeriods") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicatorPeriods"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicatorPeriods, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicatorPeriods")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -65576,9 +63430,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EligibilityDelayReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationIndicatorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_EducationOrganizationIndicator = new FullName("edfi", "EducationOrganizationIndicator"); + + // Declare collection item validators + private EducationOrganizationIndicatorPeriodPutPostRequestValidator _educationOrganizationIndicatorPeriodsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -65591,6 +63450,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (EducationOrganizationIndicatorMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_EducationOrganizationIndicator); + + if (mappingContract != null) + { + if (mappingContract.IsEducationOrganizationIndicatorPeriodIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorPeriodsItems = instance.EducationOrganizationIndicatorPeriods.Any(x => !mappingContract.IsEducationOrganizationIndicatorPeriodIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorPeriodsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicatorPeriods", $"A supplied 'EducationOrganizationIndicatorPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -65606,22 +63487,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EligibilityEvaluationTypeDescriptor table of the EligibilityEvaluationTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationIndicatorPeriod table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EligibilityEvaluationTypeDescriptor : Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationIndicatorPeriod : Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EligibilityEvaluationTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationIndicatorPeriod"); // Fluent validator instance (threadsafe) - private static EligibilityEvaluationTypeDescriptorPutPostRequestValidator _validator = new EligibilityEvaluationTypeDescriptorPutPostRequestValidator(); + private static EducationOrganizationIndicatorPeriodPutPostRequestValidator _validator = new EducationOrganizationIndicatorPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -65638,13 +63514,6 @@ public class EligibilityEvaluationTypeDescriptor : Entities.Common.EdFi.IEligibi // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EligibilityEvaluationTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -65655,19 +63524,32 @@ public class EligibilityEvaluationTypeDescriptor : Entities.Common.EdFi.IEligibi //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganizationIndicator _educationOrganizationIndicator; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EligibilityEvaluationTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganizationIndicator IEducationOrganizationIndicatorPeriod.EducationOrganizationIndicator + { + get { return _educationOrganizationIndicator; } + set { SetEducationOrganizationIndicator(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationOrganizationIndicator EducationOrganizationIndicator { - get { return EligibilityEvaluationTypeDescriptorId; } - set { EligibilityEvaluationTypeDescriptorId = value; } + set { SetEducationOrganizationIndicator(value); } + } + + private void SetEducationOrganizationIndicator(Entities.Common.EdFi.IEducationOrganizationIndicator value) + { + _educationOrganizationIndicator = value; } + + /// + /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65682,7 +63564,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -65690,9 +63572,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganizationIndicator == null || !_educationOrganizationIndicator.Equals(compareTo.EducationOrganizationIndicator)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor).EligibilityEvaluationTypeDescriptorId.Equals(compareTo.EligibilityEvaluationTypeDescriptorId)) + + // Standard Property + if (!(this as Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod).BeginDate.Equals(compareTo.BeginDate)) return false; @@ -65708,9 +63594,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganizationIndicator != null) + hash.Add(_educationOrganizationIndicator); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor).EligibilityEvaluationTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod).BeginDate); return hash.ToHashCode(); } @@ -65719,60 +63608,18 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65793,11 +63640,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationIndicatorPeriod")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65808,13 +63652,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -65827,12 +63664,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EligibilityEvaluationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationIndicatorPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EligibilityEvaluationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationIndicatorPeriodMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target, null); } // ------------------------------------------------------------- @@ -65840,6 +63677,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -65847,9 +63744,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EligibilityEvaluationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationIndicatorPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -65877,22 +63774,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EmploymentStatusDescriptor table of the EmploymentStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationInstitutionTelephone table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EmploymentStatusDescriptor : Entities.Common.EdFi.IEmploymentStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationInstitutionTelephone : Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EmploymentStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationInstitutionTelephone"); // Fluent validator instance (threadsafe) - private static EmploymentStatusDescriptorPutPostRequestValidator _validator = new EmploymentStatusDescriptorPutPostRequestValidator(); + private static EducationOrganizationInstitutionTelephonePutPostRequestValidator _validator = new EducationOrganizationInstitutionTelephonePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -65909,13 +63801,6 @@ public class EmploymentStatusDescriptor : Entities.Common.EdFi.IEmploymentStatus // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EmploymentStatusDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -65926,19 +63811,33 @@ public class EmploymentStatusDescriptor : Entities.Common.EdFi.IEmploymentStatus //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EmploymentStatusDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInstitutionTelephone.EducationOrganization + { + get { return _educationOrganization; } + set { SetEducationOrganization(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationOrganization EducationOrganization { - get { return EmploymentStatusDescriptorId; } - set { EmploymentStatusDescriptorId = value; } + set { SetEducationOrganization(value); } + } + + private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + { + _educationOrganization = value; } + + /// + /// The type of communication number listed for an individual or organization. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="institutionTelephoneNumberTypeDescriptor")][DescriptorExists("InstitutionTelephoneNumberTypeDescriptor")] + public string InstitutionTelephoneNumberTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -65953,7 +63852,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEmploymentStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone; if (ReferenceEquals(this, compareTo)) return true; @@ -65961,9 +63860,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IEmploymentStatusDescriptor).EmploymentStatusDescriptorId.Equals(compareTo.EmploymentStatusDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone).InstitutionTelephoneNumberTypeDescriptor, compareTo.InstitutionTelephoneNumberTypeDescriptor)) return false; @@ -65979,9 +63882,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganization != null) + hash.Add(_educationOrganization); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEmploymentStatusDescriptor).EmploymentStatusDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone).InstitutionTelephoneNumberTypeDescriptor); return hash.ToHashCode(); } @@ -65990,60 +63896,20 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A shortened description for the descriptor. + /// The telephone number including the area code, and extension, if applicable. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="telephoneNumber")] + public string TelephoneNumber { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -66064,11 +63930,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationInstitutionTelephone")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -66079,13 +63942,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -66098,12 +63954,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EmploymentStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEmploymentStatusDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationInstitutionTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EmploymentStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEmploymentStatusDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationInstitutionTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target, null); } // ------------------------------------------------------------- @@ -66111,6 +63967,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -66118,9 +64034,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EmploymentStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationInstitutionTelephonePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -66148,22 +64064,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EnrollmentTypeDescriptor table of the EnrollmentTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationInternationalAddress table of the EducationOrganization aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EnrollmentTypeDescriptor : Entities.Common.EdFi.IEnrollmentTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationInternationalAddress : Entities.Common.EdFi.IEducationOrganizationInternationalAddress, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EnrollmentTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationInternationalAddress"); // Fluent validator instance (threadsafe) - private static EnrollmentTypeDescriptorPutPostRequestValidator _validator = new EnrollmentTypeDescriptorPutPostRequestValidator(); + private static EducationOrganizationInternationalAddressPutPostRequestValidator _validator = new EducationOrganizationInternationalAddressPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -66180,13 +64091,6 @@ public class EnrollmentTypeDescriptor : Entities.Common.EdFi.IEnrollmentTypeDesc // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the EnrollmentTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -66197,19 +64101,33 @@ public class EnrollmentTypeDescriptor : Entities.Common.EdFi.IEnrollmentTypeDesc //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IEducationOrganization _educationOrganization; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EnrollmentTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInternationalAddress.EducationOrganization + { + get { return _educationOrganization; } + set { SetEducationOrganization(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IEducationOrganization EducationOrganization { - get { return EnrollmentTypeDescriptorId; } - set { EnrollmentTypeDescriptorId = value; } + set { SetEducationOrganization(value); } + } + + private void SetEducationOrganization(Entities.Common.EdFi.IEducationOrganization value) + { + _educationOrganization = value; } + + /// + /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] + public string AddressTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -66224,7 +64142,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEnrollmentTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationInternationalAddress; if (ReferenceEquals(this, compareTo)) return true; @@ -66232,9 +64150,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_educationOrganization == null || !_educationOrganization.Equals(compareTo.EducationOrganization)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IEnrollmentTypeDescriptor).EnrollmentTypeDescriptorId.Equals(compareTo.EnrollmentTypeDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEducationOrganizationInternationalAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) return false; @@ -66250,9 +64172,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_educationOrganization != null) + hash.Add(_educationOrganization); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IEnrollmentTypeDescriptor).EnrollmentTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInternationalAddress).AddressTypeDescriptor); return hash.ToHashCode(); } @@ -66261,60 +64186,83 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The first line of the address. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine1")] + public string AddressLine1 { get; set; } /// - /// The description of the descriptor. + /// The second line of the address. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine2")] + public string AddressLine2 { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The third line of the address. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine3")] + public string AddressLine3 { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The fourth line of the address. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine4")] + public string AddressLine4 { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The first date the address is valid. For physical addresses, the date the individual moved to that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BeginDate { get; set; } + + /// + /// The name of the country. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="countryDescriptor")][DescriptorExists("CountryDescriptor")] + public string CountryDescriptor { get; set; } /// - /// A shortened description for the descriptor. + /// The last date the address is valid. For physical addresses, the date the individual moved from that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// The geographic latitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="latitude")] + public string Latitude { get; set; } + + /// + /// The geographic longitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="longitude")] + public string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -66335,11 +64283,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganization", "EducationOrganizationInternationalAddress")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -66350,13 +64295,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -66369,12 +64307,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EnrollmentTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEnrollmentTypeDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationInternationalAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EnrollmentTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEnrollmentTypeDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationInternationalAddressMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target, null); } // ------------------------------------------------------------- @@ -66382,6 +64320,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -66389,9 +64387,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EnrollmentTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationInternationalAddressPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -66420,21 +64418,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EntryGradeLevelReasonDescriptor table of the EntryGradeLevelReasonDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationAssociationTypeDescriptor table of the EducationOrganizationAssociationTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EntryGradeLevelReasonDescriptor : Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationAssociationTypeDescriptor : Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EntryGradeLevelReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationAssociationTypeDescriptor"); // Fluent validator instance (threadsafe) - private static EntryGradeLevelReasonDescriptorPutPostRequestValidator _validator = new EntryGradeLevelReasonDescriptorPutPostRequestValidator(); + private static EducationOrganizationAssociationTypeDescriptorPutPostRequestValidator _validator = new EducationOrganizationAssociationTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -66453,7 +64451,7 @@ public class EntryGradeLevelReasonDescriptor : Entities.Common.EdFi.IEntryGradeL // ------------------------------------------------------------ /// - /// The unique identifier for the EntryGradeLevelReasonDescriptor resource. + /// The unique identifier for the EducationOrganizationAssociationTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -66474,12 +64472,12 @@ public class EntryGradeLevelReasonDescriptor : Entities.Common.EdFi.IEntryGradeL /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int EntryGradeLevelReasonDescriptorId { get; set; } + public int EducationOrganizationAssociationTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return EntryGradeLevelReasonDescriptorId; } - set { EntryGradeLevelReasonDescriptorId = value; } + get { return EducationOrganizationAssociationTypeDescriptorId; } + set { EducationOrganizationAssociationTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -66495,7 +64493,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -66505,7 +64503,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor).EntryGradeLevelReasonDescriptorId.Equals(compareTo.EntryGradeLevelReasonDescriptorId)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor).EducationOrganizationAssociationTypeDescriptorId.Equals(compareTo.EducationOrganizationAssociationTypeDescriptorId)) return false; @@ -66523,7 +64521,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor).EntryGradeLevelReasonDescriptorId); + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor).EducationOrganizationAssociationTypeDescriptorId); return hash.ToHashCode(); } @@ -66640,12 +64638,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EntryGradeLevelReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationAssociationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EntryGradeLevelReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationAssociationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -66660,9 +64658,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EntryGradeLevelReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationAssociationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -66691,21 +64689,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EntryTypeDescriptor table of the EntryTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationCategoryDescriptor table of the EducationOrganizationCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EntryTypeDescriptor : Entities.Common.EdFi.IEntryTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationCategoryDescriptor : Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EntryTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static EntryTypeDescriptorPutPostRequestValidator _validator = new EntryTypeDescriptorPutPostRequestValidator(); + private static EducationOrganizationCategoryDescriptorPutPostRequestValidator _validator = new EducationOrganizationCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -66724,7 +64722,7 @@ public class EntryTypeDescriptor : Entities.Common.EdFi.IEntryTypeDescriptor, En // ------------------------------------------------------------ /// - /// The unique identifier for the EntryTypeDescriptor resource. + /// The unique identifier for the EducationOrganizationCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -66745,12 +64743,12 @@ public class EntryTypeDescriptor : Entities.Common.EdFi.IEntryTypeDescriptor, En /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int EntryTypeDescriptorId { get; set; } + public int EducationOrganizationCategoryDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return EntryTypeDescriptorId; } - set { EntryTypeDescriptorId = value; } + get { return EducationOrganizationCategoryDescriptorId; } + set { EducationOrganizationCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -66766,7 +64764,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEntryTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -66776,7 +64774,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IEntryTypeDescriptor).EntryTypeDescriptorId.Equals(compareTo.EntryTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor).EducationOrganizationCategoryDescriptorId.Equals(compareTo.EducationOrganizationCategoryDescriptorId)) return false; @@ -66794,7 +64792,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IEntryTypeDescriptor).EntryTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor).EducationOrganizationCategoryDescriptorId); return hash.ToHashCode(); } @@ -66911,12 +64909,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EntryTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEntryTypeDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EntryTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEntryTypeDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor)target, null); } // ------------------------------------------------------------- @@ -66931,9 +64929,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EntryTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -66962,21 +64960,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EvaluationDelayReasonDescriptor table of the EvaluationDelayReasonDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationIdentificationSystemDescriptor table of the EducationOrganizationIdentificationSystemDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EvaluationDelayReasonDescriptor : Entities.Common.EdFi.IEvaluationDelayReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationIdentificationSystemDescriptor : Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "EvaluationDelayReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationIdentificationSystemDescriptor"); // Fluent validator instance (threadsafe) - private static EvaluationDelayReasonDescriptorPutPostRequestValidator _validator = new EvaluationDelayReasonDescriptorPutPostRequestValidator(); + private static EducationOrganizationIdentificationSystemDescriptorPutPostRequestValidator _validator = new EducationOrganizationIdentificationSystemDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -66995,7 +64993,7 @@ public class EvaluationDelayReasonDescriptor : Entities.Common.EdFi.IEvaluationD // ------------------------------------------------------------ /// - /// The unique identifier for the EvaluationDelayReasonDescriptor resource. + /// The unique identifier for the EducationOrganizationIdentificationSystemDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -67016,12 +65014,12 @@ public class EvaluationDelayReasonDescriptor : Entities.Common.EdFi.IEvaluationD /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int EvaluationDelayReasonDescriptorId { get; set; } + public int EducationOrganizationIdentificationSystemDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return EvaluationDelayReasonDescriptorId; } - set { EvaluationDelayReasonDescriptorId = value; } + get { return EducationOrganizationIdentificationSystemDescriptorId; } + set { EducationOrganizationIdentificationSystemDescriptorId = value; } } // ------------------------------------------------------------- @@ -67037,7 +65035,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEvaluationDelayReasonDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -67047,7 +65045,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IEvaluationDelayReasonDescriptor).EvaluationDelayReasonDescriptorId.Equals(compareTo.EvaluationDelayReasonDescriptorId)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor).EducationOrganizationIdentificationSystemDescriptorId.Equals(compareTo.EducationOrganizationIdentificationSystemDescriptorId)) return false; @@ -67065,7 +65063,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IEvaluationDelayReasonDescriptor).EvaluationDelayReasonDescriptorId); + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor).EducationOrganizationIdentificationSystemDescriptorId); return hash.ToHashCode(); } @@ -67182,12 +65180,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EvaluationDelayReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEvaluationDelayReasonDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EvaluationDelayReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEvaluationDelayReasonDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor)target, null); } // ------------------------------------------------------------- @@ -67202,9 +65200,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EvaluationDelayReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -67233,45 +65231,30 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the EvaluationRubricDimension resource. + /// Represents a reference to the EducationOrganizationInterventionPrescriptionAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class EvaluationRubricDimensionReference : IResourceReference + public class EducationOrganizationInterventionPrescriptionAssociationReference : IResourceReference { - [DataMember(Name="evaluationRubricRating")] - public int EvaluationRubricRating { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } - [DataMember(Name="programEducationOrganizationId")] - public long ProgramEducationOrganizationId { get; set; } + [DataMember(Name="interventionPrescriptionEducationOrganizationId")] + public long InterventionPrescriptionEducationOrganizationId { get; set; } - [DataMember(Name="programEvaluationElementTitle")] - public string ProgramEvaluationElementTitle { get; set; } + [DataMember(Name="interventionPrescriptionIdentificationCode")] + public string InterventionPrescriptionIdentificationCode { get; set; } - [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] - public string ProgramEvaluationPeriodDescriptor { get; set; } - - [DataMember(Name="programEvaluationTitle")] - public string ProgramEvaluationTitle { get; set; } - - [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] - public string ProgramEvaluationTypeDescriptor { get; set; } - - [DataMember(Name="programName")] - public string ProgramName { get; set; } - - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } /// /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource @@ -67304,49 +65287,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EvaluationRubricRating != default(int) && ProgramEducationOrganizationId != default(long) && ProgramEvaluationElementTitle != default(string) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); + return EducationOrganizationId != default(long) && InterventionPrescriptionEducationOrganizationId != default(long) && InterventionPrescriptionIdentificationCode != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (EvaluationRubricRating == default) - { - yield return "EvaluationRubricRating"; - } - - if (ProgramEducationOrganizationId == default) - { - yield return "ProgramEducationOrganizationId"; - } - - if (ProgramEvaluationElementTitle == default) - { - yield return "ProgramEvaluationElementTitle"; - } - - if (ProgramEvaluationPeriodDescriptor == default) - { - yield return "ProgramEvaluationPeriodDescriptor"; - } - - if (ProgramEvaluationTitle == default) - { - yield return "ProgramEvaluationTitle"; - } - - if (ProgramEvaluationTypeDescriptor == default) + if (EducationOrganizationId == default) { - yield return "ProgramEvaluationTypeDescriptor"; + yield return "EducationOrganizationId"; } - if (ProgramName == default) + if (InterventionPrescriptionEducationOrganizationId == default) { - yield return "ProgramName"; + yield return "InterventionPrescriptionEducationOrganizationId"; } - if (ProgramTypeDescriptor == default) + if (InterventionPrescriptionIdentificationCode == default) { - yield return "ProgramTypeDescriptor"; + yield return "InterventionPrescriptionIdentificationCode"; } } @@ -67355,8 +65313,8 @@ private Link CreateLink() { var link = new Link { - Rel = "EvaluationRubricDimension", - Href = $"/ed-fi/evaluationRubricDimensions/{ResourceId:n}" + Rel = "EducationOrganizationInterventionPrescriptionAssociation", + Href = $"/ed-fi/educationOrganizationInterventionPrescriptionAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -67383,17 +65341,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.EvaluationRubricDimension table of the EvaluationRubricDimension aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationInterventionPrescriptionAssociation table of the EducationOrganizationInterventionPrescriptionAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class EvaluationRubricDimension : Entities.Common.EdFi.IEvaluationRubricDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class EducationOrganizationInterventionPrescriptionAssociation : Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EvaluationRubricDimension"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationInterventionPrescriptionAssociation"); // Fluent validator instance (threadsafe) - private static EvaluationRubricDimensionPutPostRequestValidator _validator = new EvaluationRubricDimensionPutPostRequestValidator(); + private static EducationOrganizationInterventionPrescriptionAssociationPutPostRequestValidator _validator = new EducationOrganizationInterventionPrescriptionAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -67412,7 +65369,7 @@ public class EvaluationRubricDimension : Entities.Common.EdFi.IEvaluationRubricD // ------------------------------------------------------------ /// - /// The unique identifier for the EvaluationRubricDimension resource. + /// The unique identifier for the EducationOrganizationInterventionPrescriptionAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -67423,192 +65380,139 @@ public class EvaluationRubricDimension : Entities.Common.EdFi.IEvaluationRubricD // References // ------------------------------------------------------------- - private bool _programEvaluationElementReferenceExplicitlyAssigned; - private ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference _programEvaluationElementReference; - private ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference ImplicitProgramEvaluationElementReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programEvaluationElementReference == null && !_programEvaluationElementReferenceExplicitlyAssigned) - _programEvaluationElementReference = new ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _programEvaluationElementReference; + return _educationOrganizationReference; } } - [DataMember(Name="programEvaluationElementReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference ProgramEvaluationElementReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramEvaluationElementReference != null - && (_programEvaluationElementReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _programEvaluationElementReferenceExplicitlyAssigned = true; - _programEvaluationElementReference = value; - } - } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - private bool _evaluationRubricRatingExplicitlyAssigned = false; - private int _evaluationRubricRating; - - /// - /// The numeric rating associated with the evaluation rubric dimension. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="evaluationRubricRating")] - public int EvaluationRubricRating - { - get => _evaluationRubricRating; - set - { - _evaluationRubricRating = value; - _evaluationRubricRatingExplicitlyAssigned = true; - } - } - - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEducationOrganizationId - { - get - { - if (ImplicitProgramEvaluationElementReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference.ProgramEducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProgramEvaluationElement - _programEvaluationElementReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationElementReference.ProgramEducationOrganizationId = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } - - /// - /// The name or title of the program evaluation element. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementTitle + private bool _interventionPrescriptionReferenceExplicitlyAssigned; + private InterventionPrescription.EdFi.InterventionPrescriptionReference _interventionPrescriptionReference; + private InterventionPrescription.EdFi.InterventionPrescriptionReference ImplicitInterventionPrescriptionReference { get { - if (ImplicitProgramEvaluationElementReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference.ProgramEvaluationElementTitle; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_interventionPrescriptionReference == null && !_interventionPrescriptionReferenceExplicitlyAssigned) + _interventionPrescriptionReference = new InterventionPrescription.EdFi.InterventionPrescriptionReference(); - // ProgramEvaluationElement - _programEvaluationElementReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationElementReference.ProgramEvaluationElementTitle = value; + return _interventionPrescriptionReference; } } - /// - /// The name of the period for the program evaluation. - /// - - // IS in a reference (EvaluationRubricDimension.ProgramEvaluationPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationPeriodDescriptor + [DataMember(Name="interventionPrescriptionReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public InterventionPrescription.EdFi.InterventionPrescriptionReference InterventionPrescriptionReference { get { - if (ImplicitProgramEvaluationElementReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference.ProgramEvaluationPeriodDescriptor; + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitInterventionPrescriptionReference != null + && (_interventionPrescriptionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + return ImplicitInterventionPrescriptionReference; return null; } set { - ImplicitProgramEvaluationElementReference.ProgramEvaluationPeriodDescriptor = value; + _interventionPrescriptionReferenceExplicitlyAssigned = true; + _interventionPrescriptionReference = value; } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// An assigned unique identifier for the student program evaluation. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationTitle + long Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationId { get { - if (ImplicitProgramEvaluationElementReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference.ProgramEvaluationTitle; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; - return default(string); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ProgramEvaluationElement - _programEvaluationElementReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationElementReference.ProgramEvaluationTitle = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } /// - /// The type of program evaluation conducted. + /// The identifier assigned to an education organization. /// - - // IS in a reference (EvaluationRubricDimension.ProgramEvaluationTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationTypeDescriptor + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionEducationOrganizationId { get { - if (ImplicitProgramEvaluationElementReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference.ProgramEvaluationTypeDescriptor; + if (ImplicitInterventionPrescriptionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + return ImplicitInterventionPrescriptionReference.EducationOrganizationId; - return null; + return default(long); } set { - ImplicitProgramEvaluationElementReference.ProgramEvaluationTypeDescriptor = value; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // InterventionPrescription + _interventionPrescriptionReferenceExplicitlyAssigned = false; + ImplicitInterventionPrescriptionReference.EducationOrganizationId = value; } } /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// A unique number or alphanumeric code assigned to an intervention prescription. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramName + string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionIdentificationCode { get { - if (ImplicitProgramEvaluationElementReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference.ProgramName; + if (ImplicitInterventionPrescriptionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + return ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode; return default(string); } @@ -67617,30 +65521,9 @@ string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramName // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ProgramEvaluationElement - _programEvaluationElementReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationElementReference.ProgramName = value; - } - } - - /// - /// The type of program. - /// - - // IS in a reference (EvaluationRubricDimension.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramTypeDescriptor - { - get - { - if (ImplicitProgramEvaluationElementReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationElementReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramEvaluationElementReference.ProgramTypeDescriptor = value; + // InterventionPrescription + _interventionPrescriptionReferenceExplicitlyAssigned = false; + ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode = value; } } // ------------------------------------------------------------- @@ -67657,7 +65540,7 @@ string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramTypeDescriptor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEvaluationRubricDimension; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -67666,43 +65549,18 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IEvaluationRubricDimension).EvaluationRubricRating.Equals(compareTo.EvaluationRubricRating)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationElementTitle, compareTo.ProgramEvaluationElementTitle)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionEducationOrganizationId.Equals(compareTo.InterventionPrescriptionEducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramName, compareTo.ProgramName)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionIdentificationCode, compareTo.InterventionPrescriptionIdentificationCode)) return false; @@ -67719,33 +65577,14 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).EvaluationRubricRating); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEducationOrganizationId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationElementTitle); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationPeriodDescriptor); - + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTitle); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTypeDescriptor); - + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionEducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramName); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramTypeDescriptor); - + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation).InterventionPrescriptionIdentificationCode); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -67760,38 +65599,20 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The evaluation criterion description for the evaluation rubric dimension. + /// The begin date of the period during which the intervention prescription is available. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="evaluationCriterionDescription")] - public string EvaluationCriterionDescription { get; set; } - - /// - /// The rating level achieved for the evaluation rubric dimension. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="evaluationRubricRatingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] - public string EvaluationRubricRatingLevelDescriptor { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BeginDate { get; set; } /// - /// The sort order of the rubric dimension. + /// The end date of the period during which the intervention prescription is available. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="rubricDimensionSortOrder")] - public int? RubricDimensionSortOrder { get; set; } + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_evaluationRubricRatingExplicitlyAssigned) - { - yield return "EvaluationRubricRating"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -67810,7 +65631,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EvaluationRubricDimension", "EvaluationRubricDimension")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationInterventionPrescriptionAssociation", "EducationOrganizationInterventionPrescriptionAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -67841,29 +65662,43 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EvaluationRubricDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEvaluationRubricDimension)target); + return Entities.Common.EdFi.EducationOrganizationInterventionPrescriptionAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EvaluationRubricDimensionMapper.MapTo(this, (Entities.Common.EdFi.IEvaluationRubricDimension)target, null); + Entities.Common.EdFi.EducationOrganizationInterventionPrescriptionAssociationMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementResourceId + Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationResourceId { get { return null; } - set { ImplicitProgramEvaluationElementReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementDiscriminator + string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitProgramEvaluationElementReference.Discriminator = value; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionResourceId + { + get { return null; } + set { ImplicitInterventionPrescriptionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation.InterventionPrescriptionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitInterventionPrescriptionReference.Discriminator = value; } } @@ -67934,9 +65769,9 @@ string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementD // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EvaluationRubricDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationInterventionPrescriptionAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -67965,21 +65800,85 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.EventCircumstanceDescriptor table of the EventCircumstanceDescriptor aggregate in the ODS Database. + /// Represents a reference to the EducationOrganizationNetwork resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class EducationOrganizationNetworkReference : IResourceReference + { + [DataMember(Name="educationOrganizationNetworkId")] + public long EducationOrganizationNetworkId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationNetworkId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationNetworkId == default) + { + yield return "EducationOrganizationNetworkId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "EducationOrganizationNetwork", + Href = $"/ed-fi/educationOrganizationNetworks/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.EducationOrganizationNetwork table of the EducationOrganizationNetwork aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class EventCircumstanceDescriptor : Entities.Common.EdFi.IEventCircumstanceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationNetwork : Entities.Common.EdFi.IEducationOrganizationNetwork, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "EventCircumstanceDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationNetwork"); // Fluent validator instance (threadsafe) - private static EventCircumstanceDescriptorPutPostRequestValidator _validator = new EventCircumstanceDescriptorPutPostRequestValidator(); + private static EducationOrganizationNetworkPutPostRequestValidator _validator = new EducationOrganizationNetworkPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -67990,6 +65889,17 @@ public class EventCircumstanceDescriptor : Entities.Common.EdFi.IEventCircumstan // Constructor // ------------------------------------------------------------- + public EducationOrganizationNetwork() + { + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); + } // ------------------------------------------------------------ @@ -67998,7 +65908,7 @@ public class EventCircumstanceDescriptor : Entities.Common.EdFi.IEventCircumstan // ------------------------------------------------------------ /// - /// The unique identifier for the EventCircumstanceDescriptor resource. + /// The unique identifier for the EducationOrganizationNetwork resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -68015,16 +65925,17 @@ public class EventCircumstanceDescriptor : Entities.Common.EdFi.IEventCircumstan // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier assigned to a network of education organizations. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int EventCircumstanceDescriptorId { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="educationOrganizationNetworkId")] + public long EducationOrganizationNetworkId { get; set; } - int IDescriptor.DescriptorId + long IEducationOrganization.EducationOrganizationId { - get { return EventCircumstanceDescriptorId; } - set { EventCircumstanceDescriptorId = value; } + get { return EducationOrganizationNetworkId; } + set { EducationOrganizationNetworkId = value; } } // ------------------------------------------------------------- @@ -68040,7 +65951,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IEventCircumstanceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationNetwork; if (ReferenceEquals(this, compareTo)) return true; @@ -68050,7 +65961,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IEventCircumstanceDescriptor).EventCircumstanceDescriptorId.Equals(compareTo.EventCircumstanceDescriptorId)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationNetwork).EducationOrganizationNetworkId.Equals(compareTo.EducationOrganizationNetworkId)) return false; @@ -68068,7 +65979,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IEventCircumstanceDescriptor).EventCircumstanceDescriptorId); + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationNetwork).EducationOrganizationNetworkId); return hash.ToHashCode(); } @@ -68079,58 +65990,51 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The full, legally accepted name of the institution. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The current operational status of the education organization (e.g., active, inactive). /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// A short name for the institution. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } /// - /// A shortened description for the descriptor. + /// The public web site address (URL) for the education organization. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The purpose(s) of the network (e.g., shared services, collective procurement). + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="networkPurposeDescriptor")][DescriptorExists("NetworkPurposeDescriptor")] + public string NetworkPurposeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -68146,16 +66050,139 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses + { + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories + { + get { return _educationOrganizationCategories; } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators + { + get { return _educationOrganizationIndicators; } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationNetwork", "EducationOrganizationNetwork")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -68178,6 +66205,42 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -68185,12 +66248,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.EventCircumstanceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEventCircumstanceDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationNetworkMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationNetwork)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.EventCircumstanceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEventCircumstanceDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationNetworkMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationNetwork)target, null); } // ------------------------------------------------------------- @@ -68198,6 +66261,137 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -68205,9 +66399,19 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class EventCircumstanceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationNetworkPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_EducationOrganizationNetwork = new FullName("edfi", "EducationOrganizationNetwork"); + + // Declare collection item validators + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -68220,6 +66424,83 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (EducationOrganizationNetworkMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_EducationOrganizationNetwork); + + if (mappingContract != null) + { + if (mappingContract.IsEducationOrganizationAddressIncluded != null) + { + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); + + if (hasInvalidEducationOrganizationAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -68236,82 +66517,283 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ExitWithdrawTypeDescriptor table of the ExitWithdrawTypeDescriptor aggregate in the ODS Database. + /// Represents a reference to the EducationOrganizationNetworkAssociation resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class ExitWithdrawTypeDescriptor : Entities.Common.EdFi.IExitWithdrawTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationOrganizationNetworkAssociationReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "ExitWithdrawTypeDescriptor"); - - // Fluent validator instance (threadsafe) - private static ExitWithdrawTypeDescriptorPutPostRequestValidator _validator = new ExitWithdrawTypeDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ + [DataMember(Name="educationOrganizationNetworkId")] + public long EducationOrganizationNetworkId { get; set; } - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ + [DataMember(Name="memberEducationOrganizationId")] + public long MemberEducationOrganizationId { get; set; } /// - /// The unique identifier for the ExitWithdrawTypeDescriptor resource. + /// Gets or sets the resource identifier of the referenced resource. /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- + public Guid ResourceId { get; set; } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ExitWithdrawTypeDescriptorId { get; set; } + public string Discriminator { get; set; } - int IDescriptor.DescriptorId - { - get { return ExitWithdrawTypeDescriptorId; } - set { ExitWithdrawTypeDescriptorId = value; } - } - // ------------------------------------------------------------- - // ============================================================= - // Equality - // ------------------------------------------------------------- + private Link _link; - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationNetworkId != default(long) && MemberEducationOrganizationId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationNetworkId == default) + { + yield return "EducationOrganizationNetworkId"; + } + + if (MemberEducationOrganizationId == default) + { + yield return "MemberEducationOrganizationId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "EducationOrganizationNetworkAssociation", + Href = $"/ed-fi/educationOrganizationNetworkAssociations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.EducationOrganizationNetworkAssociation table of the EducationOrganizationNetworkAssociation aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class EducationOrganizationNetworkAssociation : Entities.Common.EdFi.IEducationOrganizationNetworkAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "EducationOrganizationNetworkAssociation"); + + // Fluent validator instance (threadsafe) + private static EducationOrganizationNetworkAssociationPutPostRequestValidator _validator = new EducationOrganizationNetworkAssociationPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the EducationOrganizationNetworkAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _educationOrganizationNetworkReferenceExplicitlyAssigned; + private EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference _educationOrganizationNetworkReference; + private EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference ImplicitEducationOrganizationNetworkReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationNetworkReference == null && !_educationOrganizationNetworkReferenceExplicitlyAssigned) + _educationOrganizationNetworkReference = new EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference(); + + return _educationOrganizationNetworkReference; + } + } + + [DataMember(Name="educationOrganizationNetworkReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganizationNetwork.EdFi.EducationOrganizationNetworkReference EducationOrganizationNetworkReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationNetworkReference != null + && (_educationOrganizationNetworkReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationNetworkReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationNetworkReference; + + return null; + } + set + { + _educationOrganizationNetworkReferenceExplicitlyAssigned = true; + _educationOrganizationNetworkReference = value; + } + } + private bool _memberEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _memberEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitMemberEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_memberEducationOrganizationReference == null && !_memberEducationOrganizationReferenceExplicitlyAssigned) + _memberEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _memberEducationOrganizationReference; + } + } + + [DataMember(Name="memberEducationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference MemberEducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitMemberEducationOrganizationReference != null + && (_memberEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitMemberEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitMemberEducationOrganizationReference; + + return null; + } + set + { + _memberEducationOrganizationReferenceExplicitlyAssigned = true; + _memberEducationOrganizationReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// The identifier assigned to a network of education organizations. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.EducationOrganizationNetworkId + { + get + { + if (ImplicitEducationOrganizationNetworkReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationNetworkReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationNetworkReference.EducationOrganizationNetworkId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganizationNetwork + _educationOrganizationNetworkReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationNetworkReference.EducationOrganizationNetworkId = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationId + { + get + { + if (ImplicitMemberEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitMemberEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitMemberEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // MemberEducationOrganization + _memberEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitMemberEducationOrganizationReference.EducationOrganizationId = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// /// A boolean value indicating equality result of the compared resources. /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IExitWithdrawTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -68320,8 +66802,13 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IExitWithdrawTypeDescriptor).ExitWithdrawTypeDescriptorId.Equals(compareTo.ExitWithdrawTypeDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).EducationOrganizationNetworkId.Equals(compareTo.EducationOrganizationNetworkId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).MemberEducationOrganizationId.Equals(compareTo.MemberEducationOrganizationId)) return false; @@ -68338,9 +66825,11 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IExitWithdrawTypeDescriptor).ExitWithdrawTypeDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).EducationOrganizationNetworkId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationNetworkAssociation).MemberEducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -68348,60 +66837,25 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The date on which the education organization joined this network. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BeginDate { get; set; } /// - /// A shortened description for the descriptor. + /// The date on which the education organization left this network. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -68422,11 +66876,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationNetworkAssociation", "EducationOrganizationNetworkAssociation")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -68456,19 +66907,99 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ExitWithdrawTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IExitWithdrawTypeDescriptor)target); + return Entities.Common.EdFi.EducationOrganizationNetworkAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationNetworkAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ExitWithdrawTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IExitWithdrawTypeDescriptor)target, null); + Entities.Common.EdFi.EducationOrganizationNetworkAssociationMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationNetworkAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.EducationOrganizationNetworkResourceId + { + get { return null; } + set { ImplicitEducationOrganizationNetworkReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationResourceId + { + get { return null; } + set { ImplicitMemberEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IEducationOrganizationNetworkAssociation.MemberEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitMemberEducationOrganizationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -68476,9 +67007,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ExitWithdrawTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationNetworkAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -68507,25 +67038,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the FeederSchoolAssociation resource. + /// Represents a reference to the EducationOrganizationPeerAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class FeederSchoolAssociationReference : IResourceReference + public class EducationOrganizationPeerAssociationReference : IResourceReference { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - [DataMember(Name="feederSchoolId")] - public long FeederSchoolId { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + [DataMember(Name="peerEducationOrganizationId")] + public long PeerEducationOrganizationId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -68563,24 +67091,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BeginDate != default(DateTime) && FeederSchoolId != default(long) && SchoolId != default(long); + return EducationOrganizationId != default(long) && PeerEducationOrganizationId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BeginDate == default) - { - yield return "BeginDate"; - } - - if (FeederSchoolId == default) + if (EducationOrganizationId == default) { - yield return "FeederSchoolId"; + yield return "EducationOrganizationId"; } - if (SchoolId == default) + if (PeerEducationOrganizationId == default) { - yield return "SchoolId"; + yield return "PeerEducationOrganizationId"; } } @@ -68589,8 +67112,8 @@ private Link CreateLink() { var link = new Link { - Rel = "FeederSchoolAssociation", - Href = $"/ed-fi/feederSchoolAssociations/{ResourceId:n}" + Rel = "EducationOrganizationPeerAssociation", + Href = $"/ed-fi/educationOrganizationPeerAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -68617,16 +67140,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.FeederSchoolAssociation table of the FeederSchoolAssociation aggregate in the ODS Database. + /// A class which represents the edfi.EducationOrganizationPeerAssociation table of the EducationOrganizationPeerAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class FeederSchoolAssociation : Entities.Common.EdFi.IFeederSchoolAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class EducationOrganizationPeerAssociation : Entities.Common.EdFi.IEducationOrganizationPeerAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "FeederSchoolAssociation"); + private static FullName _fullName = new FullName("edfi", "EducationOrganizationPeerAssociation"); // Fluent validator instance (threadsafe) - private static FeederSchoolAssociationPutPostRequestValidator _validator = new FeederSchoolAssociationPutPostRequestValidator(); + private static EducationOrganizationPeerAssociationPutPostRequestValidator _validator = new EducationOrganizationPeerAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -68645,7 +67168,7 @@ public class FeederSchoolAssociation : Entities.Common.EdFi.IFeederSchoolAssocia // ------------------------------------------------------------ /// - /// The unique identifier for the FeederSchoolAssociation resource. + /// The unique identifier for the EducationOrganizationPeerAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -68656,70 +67179,70 @@ public class FeederSchoolAssociation : Entities.Common.EdFi.IFeederSchoolAssocia // References // ------------------------------------------------------------- - private bool _feederSchoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _feederSchoolReference; - private School.EdFi.SchoolReference ImplicitFeederSchoolReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_feederSchoolReference == null && !_feederSchoolReferenceExplicitlyAssigned) - _feederSchoolReference = new School.EdFi.SchoolReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _feederSchoolReference; + return _educationOrganizationReference; } } - [DataMember(Name="feederSchoolReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference FeederSchoolReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitFeederSchoolReference != null - && (_feederSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitFeederSchoolReference.IsReferenceFullyDefined())) - return ImplicitFeederSchoolReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _feederSchoolReferenceExplicitlyAssigned = true; - _feederSchoolReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference + private bool _peerEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _peerEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitPeerEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); + if (_peerEducationOrganizationReference == null && !_peerEducationOrganizationReferenceExplicitlyAssigned) + _peerEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _schoolReference; + return _peerEducationOrganizationReference; } } - [DataMember(Name="schoolReference")] + [DataMember(Name="peerEducationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference + public EducationOrganization.EdFi.EducationOrganizationReference PeerEducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; + if (ImplicitPeerEducationOrganizationReference != null + && (_peerEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPeerEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitPeerEducationOrganizationReference; return null; } set { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; + _peerEducationOrganizationReferenceExplicitlyAssigned = true; + _peerEducationOrganizationReference = value; } } // ------------------------------------------------------------- @@ -68729,24 +67252,16 @@ public School.EdFi.SchoolReference SchoolReference // ------------------------------------------------------------- /// - /// The month, day, and year of the first day of the feeder school association. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolId + long Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationId { get { - if (ImplicitFeederSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitFeederSchoolReference.IsReferenceFullyDefined())) - return ImplicitFeederSchoolReference.SchoolId; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -68755,23 +67270,23 @@ long Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // FeederSchool - _feederSchoolReferenceExplicitlyAssigned = false; - ImplicitFeederSchoolReference.SchoolId = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IFeederSchoolAssociation.SchoolId + long Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationId { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + if (ImplicitPeerEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPeerEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitPeerEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -68780,9 +67295,9 @@ long Entities.Common.EdFi.IFeederSchoolAssociation.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; + // PeerEducationOrganization + _peerEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitPeerEducationOrganizationReference.EducationOrganizationId = value; } } // ------------------------------------------------------------- @@ -68799,7 +67314,7 @@ long Entities.Common.EdFi.IFeederSchoolAssociation.SchoolId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IFeederSchoolAssociation; + var compareTo = obj as Entities.Common.EdFi.IEducationOrganizationPeerAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -68808,18 +67323,13 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IFeederSchoolAssociation).BeginDate.Equals(compareTo.BeginDate)) - return false; - - // Referenced Property - if (!(this as Entities.Common.EdFi.IFeederSchoolAssociation).FeederSchoolId.Equals(compareTo.FeederSchoolId)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IFeederSchoolAssociation).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).PeerEducationOrganizationId.Equals(compareTo.PeerEducationOrganizationId)) return false; @@ -68836,15 +67346,11 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IFeederSchoolAssociation).BeginDate); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IFeederSchoolAssociation).FeederSchoolId); + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IFeederSchoolAssociation).SchoolId); + hash.Add((this as Entities.Common.EdFi.IEducationOrganizationPeerAssociation).PeerEducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -68857,21 +67363,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The month, day, and year of the last day of the feeder school association. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } - - /// - /// Describes the relationship from the feeder school to the receiving school, for example by program emphasis, such as special education, language immersion, science, or performing art. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="feederRelationshipDescription")] - public string FeederRelationshipDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -68892,7 +67383,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FeederSchoolAssociation", "FeederSchoolAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationOrganizationPeerAssociation", "EducationOrganizationPeerAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -68923,29 +67414,43 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.FeederSchoolAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFeederSchoolAssociation)target); + return Entities.Common.EdFi.EducationOrganizationPeerAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationOrganizationPeerAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.FeederSchoolAssociationMapper.MapTo(this, (Entities.Common.EdFi.IFeederSchoolAssociation)target, null); + Entities.Common.EdFi.EducationOrganizationPeerAssociationMapper.MapTo(this, (Entities.Common.EdFi.IEducationOrganizationPeerAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolResourceId + Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationResourceId { get { return null; } - set { ImplicitFeederSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } + string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } - Guid? Entities.Common.EdFi.IFeederSchoolAssociation.SchoolResourceId + + Guid? Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationResourceId { get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitPeerEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.PeerEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitPeerEducationOrganizationReference.Discriminator = value; } } @@ -69016,9 +67521,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class FeederSchoolAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationOrganizationPeerAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -69047,21 +67552,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.FinancialCollectionDescriptor table of the FinancialCollectionDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EducationPlanDescriptor table of the EducationPlanDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class FinancialCollectionDescriptor : Entities.Common.EdFi.IFinancialCollectionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EducationPlanDescriptor : Entities.Common.EdFi.IEducationPlanDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "FinancialCollectionDescriptor"); + private static FullName _fullName = new FullName("edfi", "EducationPlanDescriptor"); // Fluent validator instance (threadsafe) - private static FinancialCollectionDescriptorPutPostRequestValidator _validator = new FinancialCollectionDescriptorPutPostRequestValidator(); + private static EducationPlanDescriptorPutPostRequestValidator _validator = new EducationPlanDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -69080,7 +67585,7 @@ public class FinancialCollectionDescriptor : Entities.Common.EdFi.IFinancialColl // ------------------------------------------------------------ /// - /// The unique identifier for the FinancialCollectionDescriptor resource. + /// The unique identifier for the EducationPlanDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -69101,12 +67606,12 @@ public class FinancialCollectionDescriptor : Entities.Common.EdFi.IFinancialColl /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int FinancialCollectionDescriptorId { get; set; } + public int EducationPlanDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return FinancialCollectionDescriptorId; } - set { FinancialCollectionDescriptorId = value; } + get { return EducationPlanDescriptorId; } + set { EducationPlanDescriptorId = value; } } // ------------------------------------------------------------- @@ -69122,7 +67627,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IFinancialCollectionDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEducationPlanDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -69132,7 +67637,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IFinancialCollectionDescriptor).FinancialCollectionDescriptorId.Equals(compareTo.FinancialCollectionDescriptorId)) + if (!(this as Entities.Common.EdFi.IEducationPlanDescriptor).EducationPlanDescriptorId.Equals(compareTo.EducationPlanDescriptorId)) return false; @@ -69150,7 +67655,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IFinancialCollectionDescriptor).FinancialCollectionDescriptorId); + hash.Add((this as Entities.Common.EdFi.IEducationPlanDescriptor).EducationPlanDescriptorId); return hash.ToHashCode(); } @@ -69267,12 +67772,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.FinancialCollectionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFinancialCollectionDescriptor)target); + return Entities.Common.EdFi.EducationPlanDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationPlanDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.FinancialCollectionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IFinancialCollectionDescriptor)target, null); + Entities.Common.EdFi.EducationPlanDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEducationPlanDescriptor)target, null); } // ------------------------------------------------------------- @@ -69287,9 +67792,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class FinancialCollectionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationPlanDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -69318,34 +67823,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the FunctionDimension resource. + /// Represents a reference to the EducationServiceCenter resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class FunctionDimensionReference : IResourceReference + public class EducationServiceCenterReference : IResourceReference { - [DataMember(Name="code")] - public string Code { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + [DataMember(Name="educationServiceCenterId")] + public long EducationServiceCenterId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. /// public Guid ResourceId { get; set; } - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - private Link _link; @@ -69371,19 +67867,14 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return Code != default(string) && FiscalYear != default(int); + return EducationServiceCenterId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (Code == default) - { - yield return "Code"; - } - - if (FiscalYear == default) + if (EducationServiceCenterId == default) { - yield return "FiscalYear"; + yield return "EducationServiceCenterId"; } } @@ -69392,45 +67883,25 @@ private Link CreateLink() { var link = new Link { - Rel = "FunctionDimension", - Href = $"/ed-fi/functionDimensions/{ResourceId:n}" + Rel = "EducationServiceCenter", + Href = $"/ed-fi/educationServiceCenters/{ResourceId:n}" }; - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return link; } } // Aggregate reference /// - /// A class which represents the edfi.FunctionDimension table of the FunctionDimension aggregate in the ODS Database. + /// A class which represents the edfi.EducationServiceCenter table of the EducationServiceCenter aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class FunctionDimension : Entities.Common.EdFi.IFunctionDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class EducationServiceCenter : Entities.Common.EdFi.IEducationServiceCenter, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "FunctionDimension"); + private static FullName _fullName = new FullName("edfi", "EducationServiceCenter"); // Fluent validator instance (threadsafe) - private static FunctionDimensionPutPostRequestValidator _validator = new FunctionDimensionPutPostRequestValidator(); + private static EducationServiceCenterPutPostRequestValidator _validator = new EducationServiceCenterPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -69441,9 +67912,16 @@ public class FunctionDimension : Entities.Common.EdFi.IFunctionDimension, IHasET // Constructor // ------------------------------------------------------------- - public FunctionDimension() + public EducationServiceCenter() { - FunctionDimensionReportingTags = new List(); + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); } // ------------------------------------------------------------ @@ -69453,7 +67931,7 @@ public FunctionDimension() // ------------------------------------------------------------ /// - /// The unique identifier for the FunctionDimension resource. + /// The unique identifier for the EducationServiceCenter resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -69463,6 +67941,40 @@ public FunctionDimension() // ============================================================= // References // ------------------------------------------------------------- + + private bool _stateEducationAgencyReferenceExplicitlyAssigned; + private StateEducationAgency.EdFi.StateEducationAgencyReference _stateEducationAgencyReference; + private StateEducationAgency.EdFi.StateEducationAgencyReference ImplicitStateEducationAgencyReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_stateEducationAgencyReference == null && !_stateEducationAgencyReferenceExplicitlyAssigned) + _stateEducationAgencyReference = new StateEducationAgency.EdFi.StateEducationAgencyReference(); + + return _stateEducationAgencyReference; + } + } + + [DataMember(Name="stateEducationAgencyReference")] + [FullyDefinedReference] + public StateEducationAgency.EdFi.StateEducationAgencyReference StateEducationAgencyReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStateEducationAgencyReference != null + && (_stateEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) + return ImplicitStateEducationAgencyReference; + + return null; + } + set + { + _stateEducationAgencyReferenceExplicitlyAssigned = true; + _stateEducationAgencyReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -69470,33 +67982,18 @@ public FunctionDimension() // ------------------------------------------------------------- /// - /// The code representation of the account function dimension. + /// The identifier assigned to an education service center. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="code")] - public string Code { get; set; } - - private bool _fiscalYearExplicitlyAssigned = false; - private int _fiscalYear; + [DataMember(Name="educationServiceCenterId")] + public long EducationServiceCenterId { get; set; } - /// - /// The fiscal year for which the account function dimension is valid. - /// - // NOT in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get => _fiscalYear; - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; - } + long IEducationOrganization.EducationOrganizationId + { + get { return EducationServiceCenterId; } + set { EducationServiceCenterId = value; } } - // ------------------------------------------------------------- // ============================================================= @@ -69511,7 +68008,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IFunctionDimension; + var compareTo = obj as Entities.Common.EdFi.IEducationServiceCenter; if (ReferenceEquals(this, compareTo)) return true; @@ -69520,13 +68017,8 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IFunctionDimension).Code, compareTo.Code)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IFunctionDimension).FiscalYear.Equals(compareTo.FiscalYear)) + // Derived Property + if (!(this as Entities.Common.EdFi.IEducationServiceCenter).EducationServiceCenterId.Equals(compareTo.EducationServiceCenterId)) return false; @@ -69543,12 +68035,8 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IFunctionDimension).Code); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IFunctionDimension).FiscalYear); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEducationServiceCenter).EducationServiceCenterId); return hash.ToHashCode(); } @@ -69557,6 +68045,39 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// The full, legally accepted name of the institution. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } + + /// + /// The current operational status of the education organization (e.g., active, inactive). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } + + /// + /// A short name for the institution. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } + + /// + /// The public web site address (URL) for the education organization. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -69564,21 +68085,32 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A description of the account function dimension. + /// The identifier assigned to a state education agency. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeName")] - public string CodeName { get; set; } - // ------------------------------------------------------------- - - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IEducationServiceCenter.StateEducationAgencyId { - if (!_fiscalYearExplicitlyAssigned) + get { - yield return "FiscalYear"; + if (ImplicitStateEducationAgencyReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) + { + return ImplicitStateEducationAgencyReference.StateEducationAgencyId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StateEducationAgency + _stateEducationAgencyReferenceExplicitlyAssigned = false; + ImplicitStateEducationAgencyReference.StateEducationAgencyId = value.GetValueOrDefault(); } } + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -69593,48 +68125,144 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Inherited Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FunctionDimension", "FunctionDimension")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses + { + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } + } - // ============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _functionDimensionReportingTags; - private ICollection _functionDimensionReportingTagsCovariant; + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories + { + get { return _educationOrganizationCategories; } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection FunctionDimensionReportingTags + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes { - get { return _functionDimensionReportingTags; } + get { return _educationOrganizationIdentificationCodes; } set { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IFunctionDimensionReportingTag)e.Item).FunctionDimension = this); - _functionDimensionReportingTags = list; + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IFunctionDimensionReportingTag)e.Item).FunctionDimension = this; - _functionDimensionReportingTagsCovariant = covariantList; + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators + { + get { return _educationOrganizationIndicators; } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IFunctionDimension.FunctionDimensionReportingTags + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators { - get { return _functionDimensionReportingTagsCovariant; } - set { FunctionDimensionReportingTags = new List(value.Cast()); } + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } } + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EducationServiceCenter", "EducationServiceCenter")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + // ============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -69657,9 +68285,34 @@ public ICollection FunctionDimensionReportingTags internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_functionDimensionReportingTags != null) foreach (var item in _functionDimensionReportingTags) + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) { - item.FunctionDimension = this; + item.EducationOrganization = this; + } + + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; } } @@ -69670,18 +68323,25 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.FunctionDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFunctionDimension)target); + return Entities.Common.EdFi.EducationServiceCenterMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEducationServiceCenter)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.FunctionDimensionMapper.MapTo(this, (Entities.Common.EdFi.IFunctionDimension)target, null); + Entities.Common.EdFi.EducationServiceCenterMapper.MapTo(this, (Entities.Common.EdFi.IEducationServiceCenter)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IEducationServiceCenter.StateEducationAgencyResourceId + { + get { return null; } + set { ImplicitStateEducationAgencyReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- // ================================== @@ -69704,13 +68364,73 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (FunctionDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("FunctionDimensionReportingTags") != false) + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("FunctionDimensionReportingTags"); + pathBuilder.Append("EducationOrganizationAddresses"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(FunctionDimensionReportingTags, validationContext, validationContext.Items.ForCollection("FunctionDimensionReportingTags")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) { yield return result; } @@ -69761,14 +68481,19 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class FunctionDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class EducationServiceCenterPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_FunctionDimension = new FullName("edfi", "FunctionDimension"); + private static readonly FullName _fullName_edfi_EducationServiceCenter = new FullName("edfi", "EducationServiceCenter"); // Declare collection item validators - private FunctionDimensionReportingTagPutPostRequestValidator _functionDimensionReportingTagsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -69785,19 +68510,74 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsFunctionDimensionReportingTagIncluded(x)); + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - if (hasInvalidFunctionDimensionReportingTagsItems) + if (hasInvalidEducationOrganizationAddressesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("FunctionDimensionReportingTags", $"A supplied 'FunctionDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -69818,17 +68598,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.FunctionDimensionReportingTag table of the FunctionDimension aggregate in the ODS Database. + /// A class which represents the edfi.ElectronicMailTypeDescriptor table of the ElectronicMailTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class FunctionDimensionReportingTag : Entities.Common.EdFi.IFunctionDimensionReportingTag, IValidatableObject + public class ElectronicMailTypeDescriptor : Entities.Common.EdFi.IElectronicMailTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "FunctionDimensionReportingTag"); + private static FullName _fullName = new FullName("edfi", "ElectronicMailTypeDescriptor"); // Fluent validator instance (threadsafe) - private static FunctionDimensionReportingTagPutPostRequestValidator _validator = new FunctionDimensionReportingTagPutPostRequestValidator(); + private static ElectronicMailTypeDescriptorPutPostRequestValidator _validator = new ElectronicMailTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -69845,6 +68630,13 @@ public class FunctionDimensionReportingTag : Entities.Common.EdFi.IFunctionDimen // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ElectronicMailTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -69855,33 +68647,19 @@ public class FunctionDimensionReportingTag : Entities.Common.EdFi.IFunctionDimen //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IFunctionDimension _functionDimension; - - [IgnoreDataMember] - Entities.Common.EdFi.IFunctionDimension IFunctionDimensionReportingTag.FunctionDimension - { - get { return _functionDimension; } - set { SetFunctionDimension(value); } - } - public Entities.Common.EdFi.IFunctionDimension FunctionDimension - { - set { SetFunctionDimension(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ElectronicMailTypeDescriptorId { get; set; } - private void SetFunctionDimension(Entities.Common.EdFi.IFunctionDimension value) + int IDescriptor.DescriptorId { - _functionDimension = value; + get { return ElectronicMailTypeDescriptorId; } + set { ElectronicMailTypeDescriptorId = value; } } - - /// - /// Optional tag for accountability reporting. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -69896,7 +68674,7 @@ private void SetFunctionDimension(Entities.Common.EdFi.IFunctionDimension value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IFunctionDimensionReportingTag; + var compareTo = obj as Entities.Common.EdFi.IElectronicMailTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -69904,13 +68682,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_functionDimension == null || !_functionDimension.Equals(compareTo.FunctionDimension)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IFunctionDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IElectronicMailTypeDescriptor).ElectronicMailTypeDescriptorId.Equals(compareTo.ElectronicMailTypeDescriptorId)) return false; @@ -69926,12 +68700,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_functionDimension != null) - hash.Add(_functionDimension); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IFunctionDimensionReportingTag).ReportingTagDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IElectronicMailTypeDescriptor).ElectronicMailTypeDescriptorId); return hash.ToHashCode(); } @@ -69940,6 +68711,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -69965,8 +68785,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FunctionDimension", "FunctionDimensionReportingTag")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -69977,6 +68800,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -69989,12 +68819,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.FunctionDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFunctionDimensionReportingTag)target); + return Entities.Common.EdFi.ElectronicMailTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IElectronicMailTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.FunctionDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IFunctionDimensionReportingTag)target, null); + Entities.Common.EdFi.ElectronicMailTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IElectronicMailTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -70002,66 +68832,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -70069,9 +68839,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class FunctionDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class ElectronicMailTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -70100,119 +68870,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the FundDimension resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class FundDimensionReference : IResourceReference - { - [DataMember(Name="code")] - public string Code { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return Code != default(string) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (Code == default) - { - yield return "Code"; - } - - if (FiscalYear == default) - { - yield return "FiscalYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "FundDimension", - Href = $"/ed-fi/fundDimensions/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.FundDimension table of the FundDimension aggregate in the ODS Database. + /// A class which represents the edfi.EligibilityDelayReasonDescriptor table of the EligibilityDelayReasonDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class FundDimension : Entities.Common.EdFi.IFundDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class EligibilityDelayReasonDescriptor : Entities.Common.EdFi.IEligibilityDelayReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "FundDimension"); + private static FullName _fullName = new FullName("edfi", "EligibilityDelayReasonDescriptor"); // Fluent validator instance (threadsafe) - private static FundDimensionPutPostRequestValidator _validator = new FundDimensionPutPostRequestValidator(); + private static EligibilityDelayReasonDescriptorPutPostRequestValidator _validator = new EligibilityDelayReasonDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -70223,10 +68895,6 @@ public class FundDimension : Entities.Common.EdFi.IFundDimension, IHasETag, IDat // Constructor // ------------------------------------------------------------- - public FundDimension() - { - FundDimensionReportingTags = new List(); - } // ------------------------------------------------------------ @@ -70235,7 +68903,7 @@ public FundDimension() // ------------------------------------------------------------ /// - /// The unique identifier for the FundDimension resource. + /// The unique identifier for the EligibilityDelayReasonDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -70252,33 +68920,17 @@ public FundDimension() // ------------------------------------------------------------- /// - /// The code representation of the account fund dimension. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="code")] - public string Code { get; set; } - - private bool _fiscalYearExplicitlyAssigned = false; - private int _fiscalYear; + [JsonIgnore] + public int EligibilityDelayReasonDescriptorId { get; set; } - /// - /// The fiscal year for which the account fund dimension is valid. - /// - // NOT in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get => _fiscalYear; - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; - } + int IDescriptor.DescriptorId + { + get { return EligibilityDelayReasonDescriptorId; } + set { EligibilityDelayReasonDescriptorId = value; } } - // ------------------------------------------------------------- // ============================================================= @@ -70293,7 +68945,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IFundDimension; + var compareTo = obj as Entities.Common.EdFi.IEligibilityDelayReasonDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -70302,13 +68954,8 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IFundDimension).Code, compareTo.Code)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IFundDimension).FiscalYear.Equals(compareTo.FiscalYear)) + // Derived Property + if (!(this as Entities.Common.EdFi.IEligibilityDelayReasonDescriptor).EligibilityDelayReasonDescriptorId.Equals(compareTo.EligibilityDelayReasonDescriptorId)) return false; @@ -70325,12 +68972,8 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IFundDimension).Code); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IFundDimension).FiscalYear); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEligibilityDelayReasonDescriptor).EligibilityDelayReasonDescriptorId); return hash.ToHashCode(); } @@ -70339,28 +68982,61 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// A description of the account fund dimension. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeName")] - public string CodeName { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -70380,43 +69056,16 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FundDimension", "FundDimension")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _fundDimensionReportingTags; - private ICollection _fundDimensionReportingTagsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection FundDimensionReportingTags - { - get { return _fundDimensionReportingTags; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IFundDimensionReportingTag)e.Item).FundDimension = this); - _fundDimensionReportingTags = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IFundDimensionReportingTag)e.Item).FundDimension = this; - _fundDimensionReportingTagsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IFundDimension.FundDimensionReportingTags - { - get { return _fundDimensionReportingTagsCovariant; } - set { FundDimensionReportingTags = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -70434,17 +69083,6 @@ public ICollection FundDimensionReportingTags // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_fundDimensionReportingTags != null) foreach (var item in _fundDimensionReportingTags) - { - item.FundDimension = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -70452,12 +69090,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.FundDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFundDimension)target); + return Entities.Common.EdFi.EligibilityDelayReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEligibilityDelayReasonDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.FundDimensionMapper.MapTo(this, (Entities.Common.EdFi.IFundDimension)target, null); + Entities.Common.EdFi.EligibilityDelayReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEligibilityDelayReasonDescriptor)target, null); } // ------------------------------------------------------------- @@ -70465,77 +69103,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (FundDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("FundDimensionReportingTags") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("FundDimensionReportingTags"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(FundDimensionReportingTags, validationContext, validationContext.Items.ForCollection("FundDimensionReportingTags")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -70543,14 +69110,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class FundDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class EligibilityDelayReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_FundDimension = new FullName("edfi", "FundDimension"); - - // Declare collection item validators - private FundDimensionReportingTagPutPostRequestValidator _fundDimensionReportingTagsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -70563,28 +69125,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (FundDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_FundDimension); - - if (mappingContract != null) - { - if (mappingContract.IsFundDimensionReportingTagIncluded != null) - { - var hasInvalidFundDimensionReportingTagsItems = instance.FundDimensionReportingTags.Any(x => !mappingContract.IsFundDimensionReportingTagIncluded(x)); - - if (hasInvalidFundDimensionReportingTagsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("FundDimensionReportingTags", $"A supplied 'FundDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -70600,17 +69140,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.FundDimensionReportingTag table of the FundDimension aggregate in the ODS Database. + /// A class which represents the edfi.EligibilityEvaluationTypeDescriptor table of the EligibilityEvaluationTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class FundDimensionReportingTag : Entities.Common.EdFi.IFundDimensionReportingTag, IValidatableObject + public class EligibilityEvaluationTypeDescriptor : Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "FundDimensionReportingTag"); + private static FullName _fullName = new FullName("edfi", "EligibilityEvaluationTypeDescriptor"); // Fluent validator instance (threadsafe) - private static FundDimensionReportingTagPutPostRequestValidator _validator = new FundDimensionReportingTagPutPostRequestValidator(); + private static EligibilityEvaluationTypeDescriptorPutPostRequestValidator _validator = new EligibilityEvaluationTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -70627,6 +69172,13 @@ public class FundDimensionReportingTag : Entities.Common.EdFi.IFundDimensionRepo // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the EligibilityEvaluationTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -70637,33 +69189,19 @@ public class FundDimensionReportingTag : Entities.Common.EdFi.IFundDimensionRepo //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IFundDimension _fundDimension; - - [IgnoreDataMember] - Entities.Common.EdFi.IFundDimension IFundDimensionReportingTag.FundDimension - { - get { return _fundDimension; } - set { SetFundDimension(value); } - } - public Entities.Common.EdFi.IFundDimension FundDimension - { - set { SetFundDimension(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int EligibilityEvaluationTypeDescriptorId { get; set; } - private void SetFundDimension(Entities.Common.EdFi.IFundDimension value) + int IDescriptor.DescriptorId { - _fundDimension = value; + get { return EligibilityEvaluationTypeDescriptorId; } + set { EligibilityEvaluationTypeDescriptorId = value; } } - - /// - /// Optional tag for accountability reporting. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -70678,7 +69216,7 @@ private void SetFundDimension(Entities.Common.EdFi.IFundDimension value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IFundDimensionReportingTag; + var compareTo = obj as Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -70686,13 +69224,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_fundDimension == null || !_fundDimension.Equals(compareTo.FundDimension)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IFundDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor).EligibilityEvaluationTypeDescriptorId.Equals(compareTo.EligibilityEvaluationTypeDescriptorId)) return false; @@ -70708,12 +69242,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_fundDimension != null) - hash.Add(_fundDimension); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IFundDimensionReportingTag).ReportingTagDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor).EligibilityEvaluationTypeDescriptorId); return hash.ToHashCode(); } @@ -70722,6 +69253,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -70747,8 +69327,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FundDimension", "FundDimensionReportingTag")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -70759,6 +69342,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -70771,12 +69361,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.FundDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFundDimensionReportingTag)target); + return Entities.Common.EdFi.EligibilityEvaluationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.FundDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IFundDimensionReportingTag)target, null); + Entities.Common.EdFi.EligibilityEvaluationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -70784,66 +69374,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -70851,9 +69381,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class FundDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class EligibilityEvaluationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -70882,165 +69412,292 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the GeneralStudentProgramAssociation resource. + /// A class which represents the edfi.EmploymentStatusDescriptor table of the EmploymentStatusDescriptor aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GeneralStudentProgramAssociationReference : IResourceReference + public class EmploymentStatusDescriptor : Entities.Common.EdFi.IEmploymentStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + private static FullName _fullName = new FullName("edfi", "EmploymentStatusDescriptor"); - [DataMember(Name="programEducationOrganizationId")] - public long ProgramEducationOrganizationId { get; set; } + // Fluent validator instance (threadsafe) + private static EmploymentStatusDescriptorPutPostRequestValidator _validator = new EmploymentStatusDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - [DataMember(Name="programName")] - public string ProgramName { get; set; } + // ============================================================= + // Constructor + // ------------------------------------------------------------- - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } + + // ------------------------------------------------------------ - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ /// - /// Gets or sets the resource identifier of the referenced resource. + /// The unique identifier for the EmploymentStatusDescriptor resource. /// - public Guid ResourceId { get; set; } + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - public string Discriminator { get; set; } + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int EmploymentStatusDescriptorId { get; set; } + int IDescriptor.DescriptorId + { + get { return EmploymentStatusDescriptorId; } + set { EmploymentStatusDescriptorId = value; } + } + // ------------------------------------------------------------- - private Link _link; + // ============================================================= + // Equality + // ------------------------------------------------------------- - [DataMember(Name="link")] - public Link Link + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + var compareTo = obj as Entities.Common.EdFi.IEmploymentStatusDescriptor; - return _link; - } + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IEmploymentStatusDescriptor).EmploymentStatusDescriptorId.Equals(compareTo.EmploymentStatusDescriptorId)) + return false; + + + return true; } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Builds the hash code based on the unique identifying values. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - return BeginDate != default(DateTime) && EducationOrganizationId != default(long) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StudentUniqueId != default(string); + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEmploymentStatusDescriptor).EmploymentStatusDescriptorId); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (BeginDate == default) - { - yield return "BeginDate"; - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } - if (ProgramEducationOrganizationId == default) - { - yield return "ProgramEducationOrganizationId"; - } + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } - if (ProgramName == default) - { - yield return "ProgramName"; - } + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } - if (ProgramTypeDescriptor == default) - { - yield return "ProgramTypeDescriptor"; - } + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } } + // ------------------------------------------------------------- - private Link CreateLink() - { - var link = new Link - { - Rel = "GeneralStudentProgramAssociation", - Href = $"/ed-fi/generalStudentProgramAssociations/{ResourceId:n}" - }; + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (string.IsNullOrEmpty(Discriminator)) - return link; + // ============================================================= + // Versioning + // ------------------------------------------------------------- - string[] linkParts = Discriminator.Split('.'); + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } - if (linkParts.Length < 2) - return link; + // ------------------------------------------------------------- - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.EmploymentStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEmploymentStatusDescriptor)target); + } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + void IMappable.Map(object target) + { + Entities.Common.EdFi.EmploymentStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEmploymentStatusDescriptor)target, null); } - } // Aggregate reference + // ------------------------------------------------------------- + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } // ================================================================= // Validators // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class EmploymentStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } // ----------------------------------------------------------------- +} +// Aggregate: EnrollmentTypeDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.EnrollmentTypeDescriptor.EdFi +{ /// - /// A class which represents the edfi.GeneralStudentProgramAssociationProgramParticipationStatus table of the GeneralStudentProgramAssociation aggregate in the ODS Database. + /// A class which represents the edfi.EnrollmentTypeDescriptor table of the EnrollmentTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GeneralStudentProgramAssociationProgramParticipationStatus : Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus, IValidatableObject + public class EnrollmentTypeDescriptor : Entities.Common.EdFi.IEnrollmentTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "GeneralStudentProgramAssociationProgramParticipationStatus"); + private static FullName _fullName = new FullName("edfi", "EnrollmentTypeDescriptor"); // Fluent validator instance (threadsafe) - private static GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator _validator = new GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator(); + private static EnrollmentTypeDescriptorPutPostRequestValidator _validator = new EnrollmentTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -71057,6 +69714,13 @@ public class GeneralStudentProgramAssociationProgramParticipationStatus : Entiti // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the EnrollmentTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -71067,41 +69731,19 @@ public class GeneralStudentProgramAssociationProgramParticipationStatus : Entiti //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IGeneralStudentProgramAssociation _generalStudentProgramAssociation; - - [IgnoreDataMember] - Entities.Common.EdFi.IGeneralStudentProgramAssociation IGeneralStudentProgramAssociationProgramParticipationStatus.GeneralStudentProgramAssociation - { - get { return _generalStudentProgramAssociation; } - set { SetGeneralStudentProgramAssociation(value); } - } - - public Entities.Common.EdFi.IGeneralStudentProgramAssociation GeneralStudentProgramAssociation - { - set { SetGeneralStudentProgramAssociation(value); } - } - - private void SetGeneralStudentProgramAssociation(Entities.Common.EdFi.IGeneralStudentProgramAssociation value) - { - _generalStudentProgramAssociation = value; - } - - /// - /// The student's program participation status. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="participationStatusDescriptor")][DescriptorExists("ParticipationStatusDescriptor")] - public string ParticipationStatusDescriptor { get; set; } /// - /// The date the student's program participation status began. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="statusBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime StatusBeginDate { get; set; } + [JsonIgnore] + public int EnrollmentTypeDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return EnrollmentTypeDescriptorId; } + set { EnrollmentTypeDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -71116,7 +69758,7 @@ private void SetGeneralStudentProgramAssociation(Entities.Common.EdFi.IGeneralSt /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus; + var compareTo = obj as Entities.Common.EdFi.IEnrollmentTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -71124,18 +69766,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_generalStudentProgramAssociation == null || !_generalStudentProgramAssociation.Equals(compareTo.GeneralStudentProgramAssociation)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).ParticipationStatusDescriptor, compareTo.ParticipationStatusDescriptor)) - return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).StatusBeginDate.Equals(compareTo.StatusBeginDate)) + // Derived Property + if (!(this as Entities.Common.EdFi.IEnrollmentTypeDescriptor).EnrollmentTypeDescriptorId.Equals(compareTo.EnrollmentTypeDescriptorId)) return false; @@ -71151,16 +69784,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_generalStudentProgramAssociation != null) - hash.Add(_generalStudentProgramAssociation); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).ParticipationStatusDescriptor); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).StatusBeginDate); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEnrollmentTypeDescriptor).EnrollmentTypeDescriptorId); return hash.ToHashCode(); } @@ -71169,26 +69795,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The person, organization, or department that designated the participation status. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="designatedBy")] - public string DesignatedBy { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The date the student's program participation status ended. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="statusEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? StatusEndDate { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -71209,8 +69869,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GeneralStudentProgramAssociation", "GeneralStudentProgramAssociationProgramParticipationStatus")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -71221,6 +69884,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -71233,12 +69903,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target); + return Entities.Common.EdFi.EnrollmentTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEnrollmentTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusMapper.MapTo(this, (Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target, null); + Entities.Common.EdFi.EnrollmentTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEnrollmentTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -71246,66 +69916,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -71313,9 +69923,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator : FluentValidation.AbstractValidator + public class EnrollmentTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -71344,199 +69954,292 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Grade resource. + /// A class which represents the edfi.EntryGradeLevelReasonDescriptor table of the EntryGradeLevelReasonDescriptor aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GradeReference : IResourceReference + public class EntryGradeLevelReasonDescriptor : Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - [DataMember(Name="gradeTypeDescriptor")][DescriptorExists("GradeTypeDescriptor")] - public string GradeTypeDescriptor { get; set; } + private static FullName _fullName = new FullName("edfi", "EntryGradeLevelReasonDescriptor"); - [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] - public string GradingPeriodDescriptor { get; set; } + // Fluent validator instance (threadsafe) + private static EntryGradeLevelReasonDescriptorPutPostRequestValidator _validator = new EntryGradeLevelReasonDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - [DataMember(Name="gradingPeriodName")] - public string GradingPeriodName { get; set; } + // ============================================================= + // Constructor + // ------------------------------------------------------------- - [DataMember(Name="gradingPeriodSchoolYear")] - public short GradingPeriodSchoolYear { get; set; } + + // ------------------------------------------------------------ - [DataMember(Name="localCourseCode")] - public string LocalCourseCode { get; set; } + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + /// + /// The unique identifier for the EntryGradeLevelReasonDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- - [DataMember(Name="sectionIdentifier")] - public string SectionIdentifier { get; set; } + //============================================================== + // Primary Key + // ------------------------------------------------------------- - [DataMember(Name="sessionName")] - public string SessionName { get; set; } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int EntryGradeLevelReasonDescriptorId { get; set; } - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId + int IDescriptor.DescriptorId { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } + get { return EntryGradeLevelReasonDescriptorId; } + set { EntryGradeLevelReasonDescriptorId = value; } } - private string _studentUniqueId; + // ------------------------------------------------------------- - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + /// Determines equality based on the natural key properties of the resource. /// - public string Discriminator { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor; + if (ReferenceEquals(this, compareTo)) + return true; - private Link _link; + if (compareTo == null) + return false; - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - return _link; - } + // Derived Property + if (!(this as Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor).EntryGradeLevelReasonDescriptorId.Equals(compareTo.EntryGradeLevelReasonDescriptorId)) + return false; + + + return true; } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Builds the hash code based on the unique identifying values. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - return BeginDate != default(DateTime) && GradeTypeDescriptor != default(string) && GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && GradingPeriodSchoolYear != default(short) && LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string) && StudentUniqueId != default(string); + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor).EntryGradeLevelReasonDescriptorId); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (BeginDate == default) - { - yield return "BeginDate"; - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- - if (GradeTypeDescriptor == default) - { - yield return "GradeTypeDescriptor"; - } + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } - if (GradingPeriodDescriptor == default) - { - yield return "GradingPeriodDescriptor"; - } + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } - if (GradingPeriodName == default) - { - yield return "GradingPeriodName"; - } + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } - if (GradingPeriodSchoolYear == default) - { - yield return "GradingPeriodSchoolYear"; - } + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } - if (LocalCourseCode == default) - { - yield return "LocalCourseCode"; - } + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } - if (SchoolId == default) - { - yield return "SchoolId"; - } + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - if (SchoolYear == default) - { - yield return "SchoolYear"; - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (SectionIdentifier == default) - { - yield return "SectionIdentifier"; - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (SessionName == default) - { - yield return "SessionName"; - } + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } } + // ------------------------------------------------------------- - private Link CreateLink() + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - var link = new Link - { - Rel = "Grade", - Href = $"/ed-fi/grades/{ResourceId:n}" - }; + return Entities.Common.EdFi.EntryGradeLevelReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor)target); + } - if (string.IsNullOrEmpty(Discriminator)) - return link; + void IMappable.Map(object target) + { + Entities.Common.EdFi.EntryGradeLevelReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor)target, null); + } + // ------------------------------------------------------------- - string[] linkParts = Discriminator.Split('.'); + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } - if (linkParts.Length < 2) - return link; + // ================================================================= + // Validators + // ----------------------------------------------------------------- - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + [ExcludeFromCodeCoverage] + public class EntryGradeLevelReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- + +} +// Aggregate: EntryTypeDescriptor +namespace EdFi.Ods.Api.Common.Models.Resources.EntryTypeDescriptor.EdFi +{ /// - /// A class which represents the edfi.Grade table of the Grade aggregate in the ODS Database. + /// A class which represents the edfi.EntryTypeDescriptor table of the EntryTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Grade : Entities.Common.EdFi.IGrade, IHasETag, IDateVersionedEntity, IValidatableObject + public class EntryTypeDescriptor : Entities.Common.EdFi.IEntryTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "Grade"); + private static FullName _fullName = new FullName("edfi", "EntryTypeDescriptor"); // Fluent validator instance (threadsafe) - private static GradePutPostRequestValidator _validator = new GradePutPostRequestValidator(); + private static EntryTypeDescriptorPutPostRequestValidator _validator = new EntryTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -71547,10 +70250,6 @@ public class Grade : Entities.Common.EdFi.IGrade, IHasETag, IDateVersionedEntity // Constructor // ------------------------------------------------------------- - public Grade() - { - GradeLearningStandardGrades = new List(); - } // ------------------------------------------------------------ @@ -71559,7 +70258,7 @@ public Grade() // ------------------------------------------------------------ /// - /// The unique identifier for the Grade resource. + /// The unique identifier for the EntryTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -71569,529 +70268,129 @@ public Grade() // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _gradingPeriodReferenceExplicitlyAssigned; - private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; - private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) - _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); - - return _gradingPeriodReference; - } - } - - [DataMember(Name="gradingPeriodReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGradingPeriodReference != null - && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference; - - return null; - } - set - { - _gradingPeriodReferenceExplicitlyAssigned = true; - _gradingPeriodReference = value; - } - } - private bool _studentSectionAssociationReferenceExplicitlyAssigned; - private StudentSectionAssociation.EdFi.StudentSectionAssociationReference _studentSectionAssociationReference; - private StudentSectionAssociation.EdFi.StudentSectionAssociationReference ImplicitStudentSectionAssociationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentSectionAssociationReference == null && !_studentSectionAssociationReferenceExplicitlyAssigned) - _studentSectionAssociationReference = new StudentSectionAssociation.EdFi.StudentSectionAssociationReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- - return _studentSectionAssociationReference; - } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int EntryTypeDescriptorId { get; set; } - [DataMember(Name="studentSectionAssociationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public StudentSectionAssociation.EdFi.StudentSectionAssociationReference StudentSectionAssociationReference + int IDescriptor.DescriptorId { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentSectionAssociationReference != null - && (_studentSectionAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference; - - return null; - } - set - { - _studentSectionAssociationReferenceExplicitlyAssigned = true; - _studentSectionAssociationReference = value; - } + get { return EntryTypeDescriptorId; } + set { EntryTypeDescriptorId = value; } } // ------------------------------------------------------------- - //============================================================== - // Primary Key + // ============================================================= + // Equality // ------------------------------------------------------------- /// - /// Month, day, and year of the student's entry or assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Determines equality based on the natural key properties of the resource. /// - // IS in a reference, NOT a lookup column - DateTime Entities.Common.EdFi.IGrade.BeginDate + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get - { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.BeginDate; + var compareTo = obj as Entities.Common.EdFi.IEntryTypeDescriptor; - return default(DateTime); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + if (ReferenceEquals(this, compareTo)) + return true; - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.BeginDate = value; - } - } + if (compareTo == null) + return false; - /// - /// The type of grade reported (e.g., exam, final, grading period). - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeTypeDescriptor")][DescriptorExists("GradeTypeDescriptor")] - public string GradeTypeDescriptor { get; set; } - /// - /// The state's name of the period for which grades are reported. - /// + // Derived Property + if (!(this as Entities.Common.EdFi.IEntryTypeDescriptor).EntryTypeDescriptorId.Equals(compareTo.EntryTypeDescriptorId)) + return false; - // IS in a reference (Grade.GradingPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.IGrade.GradingPeriodDescriptor - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodDescriptor; - return null; - } - set - { - ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; - } + return true; } /// - /// The school's descriptive name of the grading period. + /// Builds the hash code based on the unique identifying values. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGrade.GradingPeriodName + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodName; + var hash = new HashCode(); - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEntryTypeDescriptor).EntryTypeDescriptorId); - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.GradingPeriodName = value; - } + return hash.ToHashCode(); } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- /// - /// The identifier for the grading period school year. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IGrade.GradingPeriodSchoolYear - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolYear = value; - } - } - - /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGrade.LocalCourseCode - { - get - { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.LocalCourseCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.LocalCourseCode = value; - } - } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IGrade.SchoolId - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolId = value; - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SchoolId = value; - } - } - - /// - /// The identifier for the school year. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IGrade.SchoolYear - { - get - { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SchoolYear = value; - } - } - - /// - /// The local identifier assigned to a section. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGrade.SectionIdentifier - { - get - { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.SectionIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SectionIdentifier = value; - } - } - - /// - /// The identifier for the calendar for the academic session. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGrade.SessionName - { - get - { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.SessionName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SessionName = value; - } - } - - /// - /// A unique alphanumeric code assigned to a student. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGrade.StudentUniqueId - { - get - { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IGrade; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IGrade).BeginDate.Equals(compareTo.BeginDate)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGrade).GradeTypeDescriptor, compareTo.GradeTypeDescriptor)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGrade).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).GradingPeriodName, compareTo.GradingPeriodName)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IGrade).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).LocalCourseCode, compareTo.LocalCourseCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IGrade).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IGrade).SchoolYear.Equals(compareTo.SchoolYear)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).SectionIdentifier, compareTo.SectionIdentifier)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).SessionName, compareTo.SessionName)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).StudentUniqueId, compareTo.StudentUniqueId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).BeginDate); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IGrade).GradeTypeDescriptor); - - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IGrade).GradingPeriodDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).GradingPeriodName); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).GradingPeriodSchoolYear); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).LocalCourseCode); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).SchoolId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).SchoolYear); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).SectionIdentifier); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).SessionName); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGrade).StudentUniqueId); - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// As-Of date for a grade posted as the current grade. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="currentGradeAsOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? CurrentGradeAsOfDate { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// An indicator that the posted grade is an interim grade for the grading period and not the final grade. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="currentGradeIndicator")] - public bool? CurrentGradeIndicator { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// A statement provided by the teacher that provides information in addition to the grade or assessment score. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="diagnosticStatement")] - public string DiagnosticStatement { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// A description of the grade earned by the learner. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(64, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="gradeEarnedDescription")] - public string GradeEarnedDescription { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// A final or interim (grading period) indicator of student performance in a class as submitted by the instructor. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="letterGradeEarned")] - public string LetterGradeEarned { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// A final or interim (grading period) indicator of student performance in a class as submitted by the instructor. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="numericGradeEarned")] - public decimal? NumericGradeEarned { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - /// - /// A conversion of the level to a standard set of performance levels. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="performanceBaseConversionDescriptor")][DescriptorExists("PerformanceBaseConversionDescriptor")] - public string PerformanceBaseConversionDescriptor { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -72112,43 +70411,16 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Grade", "Grade")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _gradeLearningStandardGrades; - private ICollection _gradeLearningStandardGradesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="learningStandardGrades")] - public ICollection GradeLearningStandardGrades - { - get { return _gradeLearningStandardGrades; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGradeLearningStandardGrade)e.Item).Grade = this); - _gradeLearningStandardGrades = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGradeLearningStandardGrade)e.Item).Grade = this; - _gradeLearningStandardGradesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGrade.GradeLearningStandardGrades - { - get { return _gradeLearningStandardGradesCovariant; } - set { GradeLearningStandardGrades = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -72166,17 +70438,6 @@ public ICollection GradeLearningStandardGrades // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_gradeLearningStandardGrades != null) foreach (var item in _gradeLearningStandardGrades) - { - item.Grade = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -72184,157 +70445,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GradeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGrade)target); + return Entities.Common.EdFi.EntryTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEntryTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GradeMapper.MapTo(this, (Entities.Common.EdFi.IGrade)target, null); + Entities.Common.EdFi.EntryTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEntryTypeDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGrade.GradingPeriodResourceId - { - get { return null; } - set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGrade.GradingPeriodDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitGradingPeriodReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IGrade.StudentSectionAssociationResourceId - { - get { return null; } - set { ImplicitStudentSectionAssociationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGrade.StudentSectionAssociationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentSectionAssociationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (GradeLearningStandardGrades.Any() && mappingContract?.IsMemberSupported("GradeLearningStandardGrades") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GradeLearningStandardGrades"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GradeLearningStandardGrades, validationContext, validationContext.Items.ForCollection("GradeLearningStandardGrades")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetSchoolIdSources() - { - // Obtain value from other references - var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolId; - - if (valueFromGradingPeriodReference != null) - { - yield return ("gradingPeriodReference.schoolId", this.GradingPeriodReference.SchoolId); - } - - // Obtain value from other references - var valueFromStudentSectionAssociationReference = this.StudentSectionAssociationReference?.SchoolId; - - if (valueFromStudentSectionAssociationReference != null) - { - yield return ("studentSectionAssociationReference.schoolId", this.StudentSectionAssociationReference.SchoolId); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -72342,14 +70465,9 @@ string Entities.Common.EdFi.IGrade.StudentSectionAssociationDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GradePutPostRequestValidator : FluentValidation.AbstractValidator + public class EntryTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Grade = new FullName("edfi", "Grade"); - - // Declare collection item validators - private GradeLearningStandardGradePutPostRequestValidator _gradeLearningStandardGradesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -72362,28 +70480,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext co var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (GradeMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Grade); - - if (mappingContract != null) - { - if (mappingContract.IsGradeLearningStandardGradeIncluded != null) - { - var hasInvalidGradeLearningStandardGradesItems = instance.GradeLearningStandardGrades.Any(x => !mappingContract.IsGradeLearningStandardGradeIncluded(x)); - - if (hasInvalidGradeLearningStandardGradesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GradeLearningStandardGrades", $"A supplied 'GradeLearningStandardGrade' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -72399,17 +70495,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext co } // ----------------------------------------------------------------- +} +// Aggregate: EvaluationDelayReasonDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.EvaluationDelayReasonDescriptor.EdFi +{ /// - /// A class which represents the edfi.GradeLearningStandardGrade table of the Grade aggregate in the ODS Database. + /// A class which represents the edfi.EvaluationDelayReasonDescriptor table of the EvaluationDelayReasonDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GradeLearningStandardGrade : Entities.Common.EdFi.IGradeLearningStandardGrade, IValidatableObject + public class EvaluationDelayReasonDescriptor : Entities.Common.EdFi.IEvaluationDelayReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "GradeLearningStandardGrade"); + private static FullName _fullName = new FullName("edfi", "EvaluationDelayReasonDescriptor"); // Fluent validator instance (threadsafe) - private static GradeLearningStandardGradePutPostRequestValidator _validator = new GradeLearningStandardGradePutPostRequestValidator(); + private static EvaluationDelayReasonDescriptorPutPostRequestValidator _validator = new EvaluationDelayReasonDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -72426,92 +70527,35 @@ public class GradeLearningStandardGrade : Entities.Common.EdFi.IGradeLearningSta // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the EvaluationDelayReasonDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _learningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) - _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _learningStandardReference; - } - } - - [DataMember(Name="learningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference LearningStandardReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLearningStandardReference != null - && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference; - - return null; - } - set - { - _learningStandardReferenceExplicitlyAssigned = true; - _learningStandardReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IGrade _grade; - - [IgnoreDataMember] - Entities.Common.EdFi.IGrade IGradeLearningStandardGrade.Grade - { - get { return _grade; } - set { SetGrade(value); } - } - - public Entities.Common.EdFi.IGrade Grade - { - set { SetGrade(value); } - } - - private void SetGrade(Entities.Common.EdFi.IGrade value) - { - _grade = value; - } /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardId - { - get - { - if (ImplicitLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int EvaluationDelayReasonDescriptorId { get; set; } - // LearningStandard - _learningStandardReferenceExplicitlyAssigned = false; - ImplicitLearningStandardReference.LearningStandardId = value; - } + int IDescriptor.DescriptorId + { + get { return EvaluationDelayReasonDescriptorId; } + set { EvaluationDelayReasonDescriptorId = value; } } // ------------------------------------------------------------- @@ -72527,7 +70571,7 @@ string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGradeLearningStandardGrade; + var compareTo = obj as Entities.Common.EdFi.IEvaluationDelayReasonDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -72535,13 +70579,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_grade == null || !_grade.Equals(compareTo.Grade)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradeLearningStandardGrade).LearningStandardId, compareTo.LearningStandardId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IEvaluationDelayReasonDescriptor).EvaluationDelayReasonDescriptorId.Equals(compareTo.EvaluationDelayReasonDescriptorId)) return false; @@ -72557,12 +70597,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_grade != null) - hash.Add(_grade); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGradeLearningStandardGrade).LearningStandardId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IEvaluationDelayReasonDescriptor).EvaluationDelayReasonDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -72570,43 +70608,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// A statement provided by the teacher that provides information in addition to the grade or assessment score. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="diagnosticStatement")] - public string DiagnosticStatement { get; set; } + [DataMember(Name="description")] + public string Description { get; set; } /// - /// A final or interim (grading period) indicator of student performance for a learning standard as submitted by the instructor. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="letterGradeEarned")] - public string LetterGradeEarned { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// A final or interim (grading period) indicator of student performance for a learning standard as submitted by the instructor. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="numericGradeEarned")] - public decimal? NumericGradeEarned { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// A performance level that describes the student proficiency. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="performanceBaseConversionDescriptor")][DescriptorExists("PerformanceBaseConversionDescriptor")] - public string PerformanceBaseConversionDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -72627,8 +70682,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Grade", "GradeLearningStandardGrade")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -72639,6 +70697,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -72651,93 +70716,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GradeLearningStandardGradeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradeLearningStandardGrade)target); + return Entities.Common.EdFi.EvaluationDelayReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEvaluationDelayReasonDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GradeLearningStandardGradeMapper.MapTo(this, (Entities.Common.EdFi.IGradeLearningStandardGrade)target, null); + Entities.Common.EdFi.EvaluationDelayReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEvaluationDelayReasonDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardResourceId - { - get { return null; } - set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLearningStandardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -72745,9 +70736,9 @@ string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardDiscrimi // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GradeLearningStandardGradePutPostRequestValidator : FluentValidation.AbstractValidator + public class EvaluationDelayReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -72776,22 +70767,40 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the GradebookEntry resource. + /// Represents a reference to the EvaluationRubricDimension resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class GradebookEntryReference : IResourceReference + public class EvaluationRubricDimensionReference : IResourceReference { - [DataMember(Name="gradebookEntryIdentifier")] - public string GradebookEntryIdentifier { get; set; } + [DataMember(Name="evaluationRubricRating")] + public int EvaluationRubricRating { get; set; } - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } + + [DataMember(Name="programEvaluationElementTitle")] + public string ProgramEvaluationElementTitle { get; set; } + + [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] + public string ProgramEvaluationPeriodDescriptor { get; set; } + + [DataMember(Name="programEvaluationTitle")] + public string ProgramEvaluationTitle { get; set; } + + [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] + public string ProgramEvaluationTypeDescriptor { get; set; } + + [DataMember(Name="programName")] + public string ProgramName { get; set; } + + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -72829,19 +70838,49 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return GradebookEntryIdentifier != default(string) && Namespace != default(string); + return EvaluationRubricRating != default(int) && ProgramEducationOrganizationId != default(long) && ProgramEvaluationElementTitle != default(string) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (GradebookEntryIdentifier == default) + if (EvaluationRubricRating == default) { - yield return "GradebookEntryIdentifier"; + yield return "EvaluationRubricRating"; } - if (Namespace == default) + if (ProgramEducationOrganizationId == default) { - yield return "Namespace"; + yield return "ProgramEducationOrganizationId"; + } + + if (ProgramEvaluationElementTitle == default) + { + yield return "ProgramEvaluationElementTitle"; + } + + if (ProgramEvaluationPeriodDescriptor == default) + { + yield return "ProgramEvaluationPeriodDescriptor"; + } + + if (ProgramEvaluationTitle == default) + { + yield return "ProgramEvaluationTitle"; + } + + if (ProgramEvaluationTypeDescriptor == default) + { + yield return "ProgramEvaluationTypeDescriptor"; + } + + if (ProgramName == default) + { + yield return "ProgramName"; + } + + if (ProgramTypeDescriptor == default) + { + yield return "ProgramTypeDescriptor"; } } @@ -72850,8 +70889,8 @@ private Link CreateLink() { var link = new Link { - Rel = "GradebookEntry", - Href = $"/ed-fi/gradebookEntries/{ResourceId:n}" + Rel = "EvaluationRubricDimension", + Href = $"/ed-fi/evaluationRubricDimensions/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -72878,16 +70917,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.GradebookEntry table of the GradebookEntry aggregate in the ODS Database. + /// A class which represents the edfi.EvaluationRubricDimension table of the EvaluationRubricDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GradebookEntry : Entities.Common.EdFi.IGradebookEntry, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class EvaluationRubricDimension : Entities.Common.EdFi.IEvaluationRubricDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GradebookEntry"); + private static FullName _fullName = new FullName("edfi", "EvaluationRubricDimension"); // Fluent validator instance (threadsafe) - private static GradebookEntryPutPostRequestValidator _validator = new GradebookEntryPutPostRequestValidator(); + private static EvaluationRubricDimensionPutPostRequestValidator _validator = new EvaluationRubricDimensionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -72898,10 +70938,6 @@ public class GradebookEntry : Entities.Common.EdFi.IGradebookEntry, IHasETag, ID // Constructor // ------------------------------------------------------------- - public GradebookEntry() - { - GradebookEntryLearningStandards = new List(); - } // ------------------------------------------------------------ @@ -72910,7 +70946,7 @@ public GradebookEntry() // ------------------------------------------------------------ /// - /// The unique identifier for the GradebookEntry resource. + /// The unique identifier for the EvaluationRubricDimension resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -72921,70 +70957,37 @@ public GradebookEntry() // References // ------------------------------------------------------------- - private bool _gradingPeriodReferenceExplicitlyAssigned; - private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; - private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) - _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); - - return _gradingPeriodReference; - } - } - - [DataMember(Name="gradingPeriodReference")] - [FullyDefinedReference] - public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGradingPeriodReference != null - && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference; - - return null; - } - set - { - _gradingPeriodReferenceExplicitlyAssigned = true; - _gradingPeriodReference = value; - } - } - private bool _sectionReferenceExplicitlyAssigned; - private Section.EdFi.SectionReference _sectionReference; - private Section.EdFi.SectionReference ImplicitSectionReference + private bool _programEvaluationElementReferenceExplicitlyAssigned; + private ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference _programEvaluationElementReference; + private ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference ImplicitProgramEvaluationElementReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) - _sectionReference = new Section.EdFi.SectionReference(); + if (_programEvaluationElementReference == null && !_programEvaluationElementReferenceExplicitlyAssigned) + _programEvaluationElementReference = new ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference(); - return _sectionReference; + return _programEvaluationElementReference; } } - [DataMember(Name="sectionReference")] - [FullyDefinedReference] - public Section.EdFi.SectionReference SectionReference + [DataMember(Name="programEvaluationElementReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public ProgramEvaluationElement.EdFi.ProgramEvaluationElementReference ProgramEvaluationElementReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSectionReference != null - && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference; + if (ImplicitProgramEvaluationElementReference != null + && (_programEvaluationElementReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference; return null; } set { - _sectionReferenceExplicitlyAssigned = true; - _sectionReference = value; + _programEvaluationElementReferenceExplicitlyAssigned = true; + _programEvaluationElementReference = value; } } // ------------------------------------------------------------- @@ -72992,192 +70995,62 @@ public Section.EdFi.SectionReference SectionReference //============================================================== // Primary Key // ------------------------------------------------------------- + + private bool _evaluationRubricRatingExplicitlyAssigned = false; + private int _evaluationRubricRating; /// - /// A unique number or alphanumeric code assigned to a gradebook entry by the source system. + /// The numeric rating associated with the evaluation rubric dimension. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradebookEntryIdentifier")] - public string GradebookEntryIdentifier { get; set; } - - /// - /// Namespace URI for the source of the gradebook entry. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IGradebookEntry; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradebookEntry).GradebookEntryIdentifier, compareTo.GradebookEntryIdentifier)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradebookEntry).Namespace, compareTo.Namespace)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IGradebookEntry).GradebookEntryIdentifier); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IGradebookEntry).Namespace); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The date the assignment, homework, or assessment was assigned or executed. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="dateAssigned")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime DateAssigned { get; set; } - - /// - /// A description of the assignment, homework, or classroom assessment. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The date the assignment, homework, or assessment is due. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="dueDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DueDate { get; set; } - - /// - /// The time the assignment, homework, or assessment is due. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="dueTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan? DueTime { get; set; } - - /// - /// The type of the gradebook entry. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="gradebookEntryTypeDescriptor")][DescriptorExists("GradebookEntryTypeDescriptor")] - public string GradebookEntryTypeDescriptor { get; set; } - - /// - /// The state's name of the period for which grades are reported. - /// - - // IS in a reference (GradebookEntry.GradingPeriodDescriptorId), IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - string Entities.Common.EdFi.IGradebookEntry.GradingPeriodDescriptor - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - { - return ImplicitGradingPeriodReference.GradingPeriodDescriptor; - } - - return null; - } - set - { - ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + [DataMember(Name="evaluationRubricRating")] + public int EvaluationRubricRating + { + get => _evaluationRubricRating; + set + { + _evaluationRubricRating = value; + _evaluationRubricRatingExplicitlyAssigned = true; } } + /// - /// The school's descriptive name of the grading period. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGradebookEntry.GradingPeriodName + long Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEducationOrganizationId { get { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - { - return ImplicitGradingPeriodReference.GradingPeriodName; - } + if (ImplicitProgramEvaluationElementReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference.ProgramEducationOrganizationId; - return default(string); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.GradingPeriodName = value; + // ProgramEvaluationElement + _programEvaluationElementReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationElementReference.ProgramEducationOrganizationId = value; } } /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// The name or title of the program evaluation element. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGradebookEntry.LocalCourseCode + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementTitle { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - { - return ImplicitSectionReference.LocalCourseCode; - } + if (ImplicitProgramEvaluationElementReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference.ProgramEvaluationElementTitle; return default(string); } @@ -73186,134 +71059,90 @@ string Entities.Common.EdFi.IGradebookEntry.LocalCourseCode // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.LocalCourseCode = value; + // ProgramEvaluationElement + _programEvaluationElementReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationElementReference.ProgramEvaluationElementTitle = value; } } /// - /// The maximum number of points that can be earned for the submission. + /// The name of the period for the program evaluation. /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxPoints")] - public decimal? MaxPoints { get; set; } - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.IGradebookEntry.SchoolId + // IS in a reference (EvaluationRubricDimension.ProgramEvaluationPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationPeriodDescriptor { get { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - { - return ImplicitGradingPeriodReference.SchoolId; - } - - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - { - return ImplicitSectionReference.SchoolId; - } + if (ImplicitProgramEvaluationElementReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference.ProgramEvaluationPeriodDescriptor; - return default(long?); + return null; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolId = value.GetValueOrDefault(); - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolId = value.GetValueOrDefault(); + ImplicitProgramEvaluationElementReference.ProgramEvaluationPeriodDescriptor = value; } } /// - /// The identifier for the school year. + /// An assigned unique identifier for the student program evaluation. /// // IS in a reference, NOT a lookup column - short? Entities.Common.EdFi.IGradebookEntry.SchoolYear + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationTitle { get { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - { - return ImplicitGradingPeriodReference.SchoolYear; - } - - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - { - return ImplicitSectionReference.SchoolYear; - } + if (ImplicitProgramEvaluationElementReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference.ProgramEvaluationTitle; - return default(short?); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolYear = value.GetValueOrDefault(); - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolYear = value.GetValueOrDefault(); + // ProgramEvaluationElement + _programEvaluationElementReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationElementReference.ProgramEvaluationTitle = value; } } /// - /// The local identifier assigned to a section. + /// The type of program evaluation conducted. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGradebookEntry.SectionIdentifier + + // IS in a reference (EvaluationRubricDimension.ProgramEvaluationTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationTypeDescriptor { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - { - return ImplicitSectionReference.SectionIdentifier; - } + if (ImplicitProgramEvaluationElementReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference.ProgramEvaluationTypeDescriptor; - return default(string); + return null; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SectionIdentifier = value; + ImplicitProgramEvaluationElementReference.ProgramEvaluationTypeDescriptor = value; } } /// - /// The identifier for the calendar for the academic session. + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGradebookEntry.SessionName + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramName { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - { - return ImplicitSectionReference.SessionName; - } + if (ImplicitProgramEvaluationElementReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference.ProgramName; return default(string); } @@ -73322,480 +71151,30 @@ string Entities.Common.EdFi.IGradebookEntry.SessionName // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SessionName = value; + // ProgramEvaluationElement + _programEvaluationElementReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationElementReference.ProgramName = value; } } /// - /// The local identifier assigned to a section. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="sourceSectionIdentifier")] - public string SourceSectionIdentifier { get; set; } - - /// - /// The name or title of the activity to be recorded in the gradebook entry. + /// The type of program. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="title")] - public string Title { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GradebookEntry", "GradebookEntry")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _gradebookEntryLearningStandards; - private ICollection _gradebookEntryLearningStandardsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="learningStandards")] - public ICollection GradebookEntryLearningStandards - { - get { return _gradebookEntryLearningStandards; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGradebookEntryLearningStandard)e.Item).GradebookEntry = this); - _gradebookEntryLearningStandards = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGradebookEntryLearningStandard)e.Item).GradebookEntry = this; - _gradebookEntryLearningStandardsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGradebookEntry.GradebookEntryLearningStandards - { - get { return _gradebookEntryLearningStandardsCovariant; } - set { GradebookEntryLearningStandards = new List(value.Cast()); } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_gradebookEntryLearningStandards != null) foreach (var item in _gradebookEntryLearningStandards) - { - item.GradebookEntry = this; - } - - } - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.GradebookEntryMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradebookEntry)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.GradebookEntryMapper.MapTo(this, (Entities.Common.EdFi.IGradebookEntry)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGradebookEntry.GradingPeriodResourceId - { - get { return null; } - set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGradebookEntry.GradingPeriodDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitGradingPeriodReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IGradebookEntry.SectionResourceId - { - get { return null; } - set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGradebookEntry.SectionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitSectionReference.Discriminator = value; } - } - - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (GradebookEntryLearningStandards.Any() && mappingContract?.IsMemberSupported("GradebookEntryLearningStandards") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GradebookEntryLearningStandards"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GradebookEntryLearningStandards, validationContext, validationContext.Items.ForCollection("GradebookEntryLearningStandards")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetSchoolIdSources() - { - // Obtain value from other references - var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolId; - - if (valueFromGradingPeriodReference != null) - { - yield return ("gradingPeriodReference.schoolId", this.GradingPeriodReference.SchoolId); - } - - // Obtain value from other references - var valueFromSectionReference = this.SectionReference?.SchoolId; - - if (valueFromSectionReference != null) - { - yield return ("sectionReference.schoolId", this.SectionReference.SchoolId); - } - - } - var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); - - if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, short value)> GetSchoolYearSources() - { - // Obtain value from other references - var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolYear; - - if (valueFromGradingPeriodReference != null) - { - yield return ("gradingPeriodReference.schoolYear", this.GradingPeriodReference.SchoolYear); - } - - // Obtain value from other references - var valueFromSectionReference = this.SectionReference?.SchoolYear; - - if (valueFromSectionReference != null) - { - yield return ("sectionReference.schoolYear", this.SectionReference.SchoolYear); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class GradebookEntryPutPostRequestValidator : FluentValidation.AbstractValidator - { - private static readonly FullName _fullName_edfi_GradebookEntry = new FullName("edfi", "GradebookEntry"); - - // Declare collection item validators - private GradebookEntryLearningStandardPutPostRequestValidator _gradebookEntryLearningStandardsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (GradebookEntryMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_GradebookEntry); - - if (mappingContract != null) - { - if (mappingContract.IsGradebookEntryLearningStandardIncluded != null) - { - var hasInvalidGradebookEntryLearningStandardsItems = instance.GradebookEntryLearningStandards.Any(x => !mappingContract.IsGradebookEntryLearningStandardIncluded(x)); - - if (hasInvalidGradebookEntryLearningStandardsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GradebookEntryLearningStandards", $"A supplied 'GradebookEntryLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.GradebookEntryLearningStandard table of the GradebookEntry aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class GradebookEntryLearningStandard : Entities.Common.EdFi.IGradebookEntryLearningStandard, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "GradebookEntryLearningStandard"); - - // Fluent validator instance (threadsafe) - private static GradebookEntryLearningStandardPutPostRequestValidator _validator = new GradebookEntryLearningStandardPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - - private bool _learningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) - _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _learningStandardReference; - } - } - [DataMember(Name="learningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference LearningStandardReference + // IS in a reference (EvaluationRubricDimension.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramTypeDescriptor { get { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLearningStandardReference != null - && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference; + if (ImplicitProgramEvaluationElementReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationElementReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationElementReference.ProgramTypeDescriptor; return null; } set { - _learningStandardReferenceExplicitlyAssigned = true; - _learningStandardReference = value; - } - } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IGradebookEntry _gradebookEntry; - - [IgnoreDataMember] - Entities.Common.EdFi.IGradebookEntry IGradebookEntryLearningStandard.GradebookEntry - { - get { return _gradebookEntry; } - set { SetGradebookEntry(value); } - } - - public Entities.Common.EdFi.IGradebookEntry GradebookEntry - { - set { SetGradebookEntry(value); } - } - - private void SetGradebookEntry(Entities.Common.EdFi.IGradebookEntry value) - { - _gradebookEntry = value; - } - - /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardId - { - get - { - if (ImplicitLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LearningStandard - _learningStandardReferenceExplicitlyAssigned = false; - ImplicitLearningStandardReference.LearningStandardId = value; + ImplicitProgramEvaluationElementReference.ProgramTypeDescriptor = value; } } // ------------------------------------------------------------- @@ -73812,7 +71191,7 @@ string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGradebookEntryLearningStandard; + var compareTo = obj as Entities.Common.EdFi.IEvaluationRubricDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -73820,13 +71199,44 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_gradebookEntry == null || !_gradebookEntry.Equals(compareTo.GradebookEntry)) + + // Standard Property + if (!(this as Entities.Common.EdFi.IEvaluationRubricDimension).EvaluationRubricRating.Equals(compareTo.EvaluationRubricRating)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradebookEntryLearningStandard).LearningStandardId, compareTo.LearningStandardId)) + if (!(this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationElementTitle, compareTo.ProgramEvaluationElementTitle)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -73842,12 +71252,34 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_gradebookEntry != null) - hash.Add(_gradebookEntry); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).EvaluationRubricRating); + //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGradebookEntryLearningStandard).LearningStandardId); + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationElementTitle); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationPeriodDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTitle); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramEvaluationTypeDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IEvaluationRubricDimension).ProgramTypeDescriptor); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -73860,8 +71292,40 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The evaluation criterion description for the evaluation rubric dimension. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="evaluationCriterionDescription")] + public string EvaluationCriterionDescription { get; set; } + + /// + /// The rating level achieved for the evaluation rubric dimension. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="evaluationRubricRatingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] + public string EvaluationRubricRatingLevelDescriptor { get; set; } + + /// + /// The sort order of the rubric dimension. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="rubricDimensionSortOrder")] + public int? RubricDimensionSortOrder { get; set; } // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_evaluationRubricRatingExplicitlyAssigned) + { + yield return "EvaluationRubricRating"; + } + } + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -73880,7 +71344,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GradebookEntry", "GradebookEntryLearningStandard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "EvaluationRubricDimension", "EvaluationRubricDimension")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -73892,6 +71356,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -73904,29 +71375,29 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GradebookEntryLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradebookEntryLearningStandard)target); + return Entities.Common.EdFi.EvaluationRubricDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEvaluationRubricDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GradebookEntryLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IGradebookEntryLearningStandard)target, null); + Entities.Common.EdFi.EvaluationRubricDimensionMapper.MapTo(this, (Entities.Common.EdFi.IEvaluationRubricDimension)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardResourceId + Guid? Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementResourceId { get { return null; } - set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } + set { ImplicitProgramEvaluationElementReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardDiscriminator + string Entities.Common.EdFi.IEvaluationRubricDimension.ProgramEvaluationElementDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitLearningStandardReference.Discriminator = value; } + set { ImplicitProgramEvaluationElementReference.Discriminator = value; } } @@ -73947,7 +71418,6 @@ string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardDisc try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -73998,9 +71468,9 @@ string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardDisc // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GradebookEntryLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class EvaluationRubricDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -74029,21 +71499,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GradebookEntryTypeDescriptor table of the GradebookEntryTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.EventCircumstanceDescriptor table of the EventCircumstanceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GradebookEntryTypeDescriptor : Entities.Common.EdFi.IGradebookEntryTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class EventCircumstanceDescriptor : Entities.Common.EdFi.IEventCircumstanceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "GradebookEntryTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "EventCircumstanceDescriptor"); // Fluent validator instance (threadsafe) - private static GradebookEntryTypeDescriptorPutPostRequestValidator _validator = new GradebookEntryTypeDescriptorPutPostRequestValidator(); + private static EventCircumstanceDescriptorPutPostRequestValidator _validator = new EventCircumstanceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -74062,7 +71532,7 @@ public class GradebookEntryTypeDescriptor : Entities.Common.EdFi.IGradebookEntry // ------------------------------------------------------------ /// - /// The unique identifier for the GradebookEntryTypeDescriptor resource. + /// The unique identifier for the EventCircumstanceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -74083,12 +71553,12 @@ public class GradebookEntryTypeDescriptor : Entities.Common.EdFi.IGradebookEntry /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int GradebookEntryTypeDescriptorId { get; set; } + public int EventCircumstanceDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return GradebookEntryTypeDescriptorId; } - set { GradebookEntryTypeDescriptorId = value; } + get { return EventCircumstanceDescriptorId; } + set { EventCircumstanceDescriptorId = value; } } // ------------------------------------------------------------- @@ -74104,7 +71574,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGradebookEntryTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IEventCircumstanceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -74114,7 +71584,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IGradebookEntryTypeDescriptor).GradebookEntryTypeDescriptorId.Equals(compareTo.GradebookEntryTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.IEventCircumstanceDescriptor).EventCircumstanceDescriptorId.Equals(compareTo.EventCircumstanceDescriptorId)) return false; @@ -74132,7 +71602,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IGradebookEntryTypeDescriptor).GradebookEntryTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.IEventCircumstanceDescriptor).EventCircumstanceDescriptorId); return hash.ToHashCode(); } @@ -74249,12 +71719,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GradebookEntryTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradebookEntryTypeDescriptor)target); + return Entities.Common.EdFi.EventCircumstanceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IEventCircumstanceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GradebookEntryTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradebookEntryTypeDescriptor)target, null); + Entities.Common.EdFi.EventCircumstanceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IEventCircumstanceDescriptor)target, null); } // ------------------------------------------------------------- @@ -74269,9 +71739,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GradebookEntryTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class EventCircumstanceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -74300,21 +71770,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GradeLevelDescriptor table of the GradeLevelDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ExitWithdrawTypeDescriptor table of the ExitWithdrawTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GradeLevelDescriptor : Entities.Common.EdFi.IGradeLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ExitWithdrawTypeDescriptor : Entities.Common.EdFi.IExitWithdrawTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "GradeLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "ExitWithdrawTypeDescriptor"); // Fluent validator instance (threadsafe) - private static GradeLevelDescriptorPutPostRequestValidator _validator = new GradeLevelDescriptorPutPostRequestValidator(); + private static ExitWithdrawTypeDescriptorPutPostRequestValidator _validator = new ExitWithdrawTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -74333,7 +71803,7 @@ public class GradeLevelDescriptor : Entities.Common.EdFi.IGradeLevelDescriptor, // ------------------------------------------------------------ /// - /// The unique identifier for the GradeLevelDescriptor resource. + /// The unique identifier for the ExitWithdrawTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -74354,12 +71824,12 @@ public class GradeLevelDescriptor : Entities.Common.EdFi.IGradeLevelDescriptor, /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int GradeLevelDescriptorId { get; set; } + public int ExitWithdrawTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return GradeLevelDescriptorId; } - set { GradeLevelDescriptorId = value; } + get { return ExitWithdrawTypeDescriptorId; } + set { ExitWithdrawTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -74375,7 +71845,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGradeLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.IExitWithdrawTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -74385,7 +71855,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IGradeLevelDescriptor).GradeLevelDescriptorId.Equals(compareTo.GradeLevelDescriptorId)) + if (!(this as Entities.Common.EdFi.IExitWithdrawTypeDescriptor).ExitWithdrawTypeDescriptorId.Equals(compareTo.ExitWithdrawTypeDescriptorId)) return false; @@ -74403,7 +71873,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IGradeLevelDescriptor).GradeLevelDescriptorId); + hash.Add((this as Entities.Common.EdFi.IExitWithdrawTypeDescriptor).ExitWithdrawTypeDescriptorId); return hash.ToHashCode(); } @@ -74520,12 +71990,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GradeLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradeLevelDescriptor)target); + return Entities.Common.EdFi.ExitWithdrawTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IExitWithdrawTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GradeLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradeLevelDescriptor)target, null); + Entities.Common.EdFi.ExitWithdrawTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IExitWithdrawTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -74540,9 +72010,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GradeLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ExitWithdrawTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -74571,584 +72041,39 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GradePointAverageTypeDescriptor table of the GradePointAverageTypeDescriptor aggregate in the ODS Database. + /// Represents a reference to the FeederSchoolAssociation resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class GradePointAverageTypeDescriptor : Entities.Common.EdFi.IGradePointAverageTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class FeederSchoolAssociationReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "GradePointAverageTypeDescriptor"); - - // Fluent validator instance (threadsafe) - private static GradePointAverageTypeDescriptorPutPostRequestValidator _validator = new GradePointAverageTypeDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - - // ------------------------------------------------------------ + [DataMember(Name="feederSchoolId")] + public long FeederSchoolId { get; set; } - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } /// - /// The unique identifier for the GradePointAverageTypeDescriptor resource. + /// Gets or sets the resource identifier of the referenced resource. /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- + public Guid ResourceId { get; set; } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int GradePointAverageTypeDescriptorId { get; set; } + public string Discriminator { get; set; } - int IDescriptor.DescriptorId - { - get { return GradePointAverageTypeDescriptorId; } - set { GradePointAverageTypeDescriptorId = value; } - } - // ------------------------------------------------------------- - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IGradePointAverageTypeDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IGradePointAverageTypeDescriptor).GradePointAverageTypeDescriptorId.Equals(compareTo.GradePointAverageTypeDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IGradePointAverageTypeDescriptor).GradePointAverageTypeDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.GradePointAverageTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradePointAverageTypeDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.GradePointAverageTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradePointAverageTypeDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class GradePointAverageTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: GradeTypeDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.GradeTypeDescriptor.EdFi -{ - /// - /// A class which represents the edfi.GradeTypeDescriptor table of the GradeTypeDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class GradeTypeDescriptor : Entities.Common.EdFi.IGradeTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "GradeTypeDescriptor"); - - // Fluent validator instance (threadsafe) - private static GradeTypeDescriptorPutPostRequestValidator _validator = new GradeTypeDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the GradeTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int GradeTypeDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return GradeTypeDescriptorId; } - set { GradeTypeDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IGradeTypeDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IGradeTypeDescriptor).GradeTypeDescriptorId.Equals(compareTo.GradeTypeDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IGradeTypeDescriptor).GradeTypeDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.GradeTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradeTypeDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.GradeTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradeTypeDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class GradeTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: GradingPeriod - -namespace EdFi.Ods.Api.Common.Models.Resources.GradingPeriod.EdFi -{ - /// - /// Represents a reference to the GradingPeriod resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class GradingPeriodReference : IResourceReference - { - [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] - public string GradingPeriodDescriptor { get; set; } - - [DataMember(Name="gradingPeriodName")] - public string GradingPeriodName { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; + private Link _link; [DataMember(Name="link")] public Link Link @@ -75172,19 +72097,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && SchoolId != default(long) && SchoolYear != default(short); + return BeginDate != default(DateTime) && FeederSchoolId != default(long) && SchoolId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (GradingPeriodDescriptor == default) + if (BeginDate == default) { - yield return "GradingPeriodDescriptor"; + yield return "BeginDate"; } - if (GradingPeriodName == default) + if (FeederSchoolId == default) { - yield return "GradingPeriodName"; + yield return "FeederSchoolId"; } if (SchoolId == default) @@ -75192,19 +72117,14 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "SchoolId"; } - if (SchoolYear == default) - { - yield return "SchoolYear"; - } - } private Link CreateLink() { var link = new Link { - Rel = "GradingPeriod", - Href = $"/ed-fi/gradingPeriods/{ResourceId:n}" + Rel = "FeederSchoolAssociation", + Href = $"/ed-fi/feederSchoolAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -75231,17 +72151,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.GradingPeriod table of the GradingPeriod aggregate in the ODS Database. + /// A class which represents the edfi.FeederSchoolAssociation table of the FeederSchoolAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class GradingPeriod : Entities.Common.EdFi.IGradingPeriod, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class FeederSchoolAssociation : Entities.Common.EdFi.IFeederSchoolAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GradingPeriod"); + private static FullName _fullName = new FullName("edfi", "FeederSchoolAssociation"); // Fluent validator instance (threadsafe) - private static GradingPeriodPutPostRequestValidator _validator = new GradingPeriodPutPostRequestValidator(); + private static FeederSchoolAssociationPutPostRequestValidator _validator = new FeederSchoolAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -75260,7 +72179,7 @@ public class GradingPeriod : Entities.Common.EdFi.IGradingPeriod, IHasETag, IDat // ------------------------------------------------------------ /// - /// The unique identifier for the GradingPeriod resource. + /// The unique identifier for the FeederSchoolAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -75271,70 +72190,70 @@ public class GradingPeriod : Entities.Common.EdFi.IGradingPeriod, IHasETag, IDat // References // ------------------------------------------------------------- - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference + private bool _feederSchoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _feederSchoolReference; + private School.EdFi.SchoolReference ImplicitFeederSchoolReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); + if (_feederSchoolReference == null && !_feederSchoolReferenceExplicitlyAssigned) + _feederSchoolReference = new School.EdFi.SchoolReference(); - return _schoolReference; + return _feederSchoolReference; } } - [DataMember(Name="schoolReference")] + [DataMember(Name="feederSchoolReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference + public School.EdFi.SchoolReference FeederSchoolReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; + if (ImplicitFeederSchoolReference != null + && (_feederSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitFeederSchoolReference.IsReferenceFullyDefined())) + return ImplicitFeederSchoolReference; return null; } set { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; + _feederSchoolReferenceExplicitlyAssigned = true; + _feederSchoolReference = value; } } - private bool _schoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) - _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); - return _schoolYearTypeReference; + return _schoolReference; } } - [DataMember(Name="schoolYearTypeReference")] + [DataMember(Name="schoolReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + public School.EdFi.SchoolReference SchoolReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolYearTypeReference != null - && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference; + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; return null; } set { - _schoolYearTypeReferenceExplicitlyAssigned = true; - _schoolYearTypeReference = value; + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; } } // ------------------------------------------------------------- @@ -75344,34 +72263,24 @@ public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference // ------------------------------------------------------------- /// - /// The state's name of the period for which grades are reported. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] - public string GradingPeriodDescriptor { get; set; } - - /// - /// The school's descriptive name of the grading period. + /// The month, day, and year of the first day of the feeder school association. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradingPeriodName")] - public string GradingPeriodName { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } /// /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IGradingPeriod.SchoolId + long Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolId { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + if (ImplicitFeederSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitFeederSchoolReference.IsReferenceFullyDefined())) + return ImplicitFeederSchoolReference.SchoolId; return default(long); } @@ -75380,34 +72289,34 @@ long Entities.Common.EdFi.IGradingPeriod.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; + // FeederSchool + _feederSchoolReferenceExplicitlyAssigned = false; + ImplicitFeederSchoolReference.SchoolId = value; } } /// - /// The identifier for the grading period school year. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IGradingPeriod.SchoolYear + long Entities.Common.EdFi.IFeederSchoolAssociation.SchoolId { get { - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference.SchoolYear; + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; - return default(short); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value; + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; } } // ------------------------------------------------------------- @@ -75424,7 +72333,7 @@ short Entities.Common.EdFi.IGradingPeriod.SchoolYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGradingPeriod; + var compareTo = obj as Entities.Common.EdFi.IFeederSchoolAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -75434,22 +72343,17 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodName, compareTo.GradingPeriodName)) + if (!(this as Entities.Common.EdFi.IFeederSchoolAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IGradingPeriod).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.IFeederSchoolAssociation).FeederSchoolId.Equals(compareTo.FeederSchoolId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IGradingPeriod).SchoolYear.Equals(compareTo.SchoolYear)) + if (!(this as Entities.Common.EdFi.IFeederSchoolAssociation).SchoolId.Equals(compareTo.SchoolId)) return false; @@ -75467,18 +72371,14 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodName); + hash.Add((this as Entities.Common.EdFi.IFeederSchoolAssociation).BeginDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGradingPeriod).SchoolId); + hash.Add((this as Entities.Common.EdFi.IFeederSchoolAssociation).FeederSchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGradingPeriod).SchoolYear); + hash.Add((this as Entities.Common.EdFi.IFeederSchoolAssociation).SchoolId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -75493,57 +72393,21 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Month, day, and year of the first day of the grading period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - /// - /// Month, day, and year of the last day of the grading period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The month, day, and year of the last day of the feeder school association. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EndDate { get; set; } - - /// - /// The sequential order of this period relative to other periods. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="periodSequence")] - public int? PeriodSequence { get; set; } - - private bool _totalInstructionalDaysExplicitlyAssigned = false; - private int _totalInstructionalDays; + public DateTime? EndDate { get; set; } /// - /// Total days available for educational instruction during the grading period. + /// Describes the relationship from the feeder school to the receiving school, for example by program emphasis, such as special education, language immersion, science, or performing art. /// // NOT in a reference, NOT a lookup column - [Range(0, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="totalInstructionalDays")] - public int TotalInstructionalDays - { - get => _totalInstructionalDays; - set - { - _totalInstructionalDays = value; - _totalInstructionalDaysExplicitlyAssigned = true; - } - } - + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="feederRelationshipDescription")] + public string FeederRelationshipDescription { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_totalInstructionalDaysExplicitlyAssigned) - { - yield return "TotalInstructionalDays"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -75562,7 +72426,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GradingPeriod", "GradingPeriod")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FeederSchoolAssociation", "FeederSchoolAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -75593,29 +72457,29 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GradingPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradingPeriod)target); + return Entities.Common.EdFi.FeederSchoolAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFeederSchoolAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GradingPeriodMapper.MapTo(this, (Entities.Common.EdFi.IGradingPeriod)target, null); + Entities.Common.EdFi.FeederSchoolAssociationMapper.MapTo(this, (Entities.Common.EdFi.IFeederSchoolAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGradingPeriod.SchoolResourceId + Guid? Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolResourceId { get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitFeederSchoolReference.ResourceId = value ?? default(Guid); } } - Guid? Entities.Common.EdFi.IGradingPeriod.SchoolYearTypeResourceId + Guid? Entities.Common.EdFi.IFeederSchoolAssociation.SchoolResourceId { get { return null; } - set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } } @@ -75686,9 +72550,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GradingPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class FeederSchoolAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -75717,21 +72581,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GradingPeriodDescriptor table of the GradingPeriodDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.FinancialCollectionDescriptor table of the FinancialCollectionDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GradingPeriodDescriptor : Entities.Common.EdFi.IGradingPeriodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class FinancialCollectionDescriptor : Entities.Common.EdFi.IFinancialCollectionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "GradingPeriodDescriptor"); + private static FullName _fullName = new FullName("edfi", "FinancialCollectionDescriptor"); // Fluent validator instance (threadsafe) - private static GradingPeriodDescriptorPutPostRequestValidator _validator = new GradingPeriodDescriptorPutPostRequestValidator(); + private static FinancialCollectionDescriptorPutPostRequestValidator _validator = new FinancialCollectionDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -75750,7 +72614,7 @@ public class GradingPeriodDescriptor : Entities.Common.EdFi.IGradingPeriodDescri // ------------------------------------------------------------ /// - /// The unique identifier for the GradingPeriodDescriptor resource. + /// The unique identifier for the FinancialCollectionDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -75771,12 +72635,12 @@ public class GradingPeriodDescriptor : Entities.Common.EdFi.IGradingPeriodDescri /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int GradingPeriodDescriptorId { get; set; } + public int FinancialCollectionDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return GradingPeriodDescriptorId; } - set { GradingPeriodDescriptorId = value; } + get { return FinancialCollectionDescriptorId; } + set { FinancialCollectionDescriptorId = value; } } // ------------------------------------------------------------- @@ -75792,7 +72656,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGradingPeriodDescriptor; + var compareTo = obj as Entities.Common.EdFi.IFinancialCollectionDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -75802,7 +72666,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IGradingPeriodDescriptor).GradingPeriodDescriptorId.Equals(compareTo.GradingPeriodDescriptorId)) + if (!(this as Entities.Common.EdFi.IFinancialCollectionDescriptor).FinancialCollectionDescriptorId.Equals(compareTo.FinancialCollectionDescriptorId)) return false; @@ -75820,7 +72684,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IGradingPeriodDescriptor).GradingPeriodDescriptorId); + hash.Add((this as Entities.Common.EdFi.IFinancialCollectionDescriptor).FinancialCollectionDescriptorId); return hash.ToHashCode(); } @@ -75937,12 +72801,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GradingPeriodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradingPeriodDescriptor)target); + return Entities.Common.EdFi.FinancialCollectionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFinancialCollectionDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GradingPeriodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradingPeriodDescriptor)target, null); + Entities.Common.EdFi.FinancialCollectionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IFinancialCollectionDescriptor)target, null); } // ------------------------------------------------------------- @@ -75957,9 +72821,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GradingPeriodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class FinancialCollectionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -75988,25 +72852,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the GraduationPlan resource. + /// Represents a reference to the FunctionDimension resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class GraduationPlanReference : IResourceReference + public class FunctionDimensionReference : IResourceReference { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="graduationPlanTypeDescriptor")][DescriptorExists("GraduationPlanTypeDescriptor")] - public string GraduationPlanTypeDescriptor { get; set; } + [DataMember(Name="code")] + public string Code { get; set; } - [DataMember(Name="graduationSchoolYear")] - public short GraduationSchoolYear { get; set; } + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -76044,24 +72905,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EducationOrganizationId != default(long) && GraduationPlanTypeDescriptor != default(string) && GraduationSchoolYear != default(short); + return Code != default(string) && FiscalYear != default(int); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (GraduationPlanTypeDescriptor == default) + if (Code == default) { - yield return "GraduationPlanTypeDescriptor"; + yield return "Code"; } - if (GraduationSchoolYear == default) + if (FiscalYear == default) { - yield return "GraduationSchoolYear"; + yield return "FiscalYear"; } } @@ -76070,8 +72926,8 @@ private Link CreateLink() { var link = new Link { - Rel = "GraduationPlan", - Href = $"/ed-fi/graduationPlans/{ResourceId:n}" + Rel = "FunctionDimension", + Href = $"/ed-fi/functionDimensions/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -76098,17 +72954,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.GraduationPlan table of the GraduationPlan aggregate in the ODS Database. + /// A class which represents the edfi.FunctionDimension table of the FunctionDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class GraduationPlan : Entities.Common.EdFi.IGraduationPlan, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class FunctionDimension : Entities.Common.EdFi.IFunctionDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GraduationPlan"); + private static FullName _fullName = new FullName("edfi", "FunctionDimension"); // Fluent validator instance (threadsafe) - private static GraduationPlanPutPostRequestValidator _validator = new GraduationPlanPutPostRequestValidator(); + private static FunctionDimensionPutPostRequestValidator _validator = new FunctionDimensionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -76119,12 +72975,9 @@ public class GraduationPlan : Entities.Common.EdFi.IGraduationPlan, IHasETag, ID // Constructor // ------------------------------------------------------------- - public GraduationPlan() + public FunctionDimension() { - GraduationPlanCreditsByCourses = new List(); - GraduationPlanCreditsByCreditCategories = new List(); - GraduationPlanCreditsBySubjects = new List(); - GraduationPlanRequiredAssessments = new List(); + FunctionDimensionReportingTags = new List(); } // ------------------------------------------------------------ @@ -76134,7 +72987,7 @@ public GraduationPlan() // ------------------------------------------------------------ /// - /// The unique identifier for the GraduationPlan resource. + /// The unique identifier for the FunctionDimension resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -76144,73 +72997,6 @@ public GraduationPlan() // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } - private bool _graduationSchoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _graduationSchoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitGraduationSchoolYearTypeReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_graduationSchoolYearTypeReference == null && !_graduationSchoolYearTypeReferenceExplicitlyAssigned) - _graduationSchoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - - return _graduationSchoolYearTypeReference; - } - } - - [DataMember(Name="graduationSchoolYearTypeReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public SchoolYearType.EdFi.SchoolYearTypeReference GraduationSchoolYearTypeReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGraduationSchoolYearTypeReference != null - && (_graduationSchoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGraduationSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitGraduationSchoolYearTypeReference; - - return null; - } - set - { - _graduationSchoolYearTypeReferenceExplicitlyAssigned = true; - _graduationSchoolYearTypeReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -76218,63 +73004,33 @@ public SchoolYearType.EdFi.SchoolYearTypeReference GraduationSchoolYearTypeRefer // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IGraduationPlan.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } - - /// - /// The type of academic plan the student is following for graduation. + /// The code representation of the account function dimension. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="graduationPlanTypeDescriptor")][DescriptorExists("GraduationPlanTypeDescriptor")] - public string GraduationPlanTypeDescriptor { get; set; } + [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="code")] + public string Code { get; set; } + + private bool _fiscalYearExplicitlyAssigned = false; + private int _fiscalYear; /// - /// The school year the student is expected to graduate. + /// The fiscal year for which the account function dimension is valid. /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IGraduationPlan.GraduationSchoolYear - { - get - { - if (ImplicitGraduationSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGraduationSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitGraduationSchoolYearTypeReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GraduationSchoolYearType - _graduationSchoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitGraduationSchoolYearTypeReference.SchoolYear = value; + // NOT in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get => _fiscalYear; + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; } } + // ------------------------------------------------------------- // ============================================================= @@ -76289,7 +73045,7 @@ short Entities.Common.EdFi.IGraduationPlan.GraduationSchoolYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlan; + var compareTo = obj as Entities.Common.EdFi.IFunctionDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -76298,18 +73054,13 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IGraduationPlan).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlan).GraduationPlanTypeDescriptor, compareTo.GraduationPlanTypeDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IFunctionDimension).Code, compareTo.Code)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IGraduationPlan).GraduationSchoolYear.Equals(compareTo.GraduationSchoolYear)) + // Standard Property + if (!(this as Entities.Common.EdFi.IFunctionDimension).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -76326,15 +73077,13 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlan).EducationOrganizationId); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlan).GraduationPlanTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IFunctionDimension).Code); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlan).GraduationSchoolYear); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IFunctionDimension).FiscalYear); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -76349,54 +73098,19 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// An indicator of whether the graduation plan is tailored for an individual. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="individualPlan")] - public bool? IndividualPlan { get; set; } - - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="totalRequiredCreditConversion")] - public decimal? TotalRequiredCreditConversion { get; set; } - - private bool _totalRequiredCreditsExplicitlyAssigned = false; - private decimal _totalRequiredCredits; - - /// - /// The value of credits or units of value awarded for the completion of a course. + /// A description of the account function dimension. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="totalRequiredCredits")] - public decimal TotalRequiredCredits - { - get => _totalRequiredCredits; - set - { - _totalRequiredCredits = value; - _totalRequiredCreditsExplicitlyAssigned = true; - } - } - - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="totalRequiredCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string TotalRequiredCreditTypeDescriptor { get; set; } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeName")] + public string CodeName { get; set; } // ------------------------------------------------------------- IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() { - if (!_totalRequiredCreditsExplicitlyAssigned) + if (!_fiscalYearExplicitlyAssigned) { - yield return "TotalRequiredCredits"; + yield return "FiscalYear"; } } @@ -76418,131 +73132,41 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlan")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FunctionDimension", "FunctionDimension")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _graduationPlanCreditsByCourses; - private ICollection _graduationPlanCreditsByCoursesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="creditsByCourses")] - public ICollection GraduationPlanCreditsByCourses - { - get { return _graduationPlanCreditsByCourses; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourse)e.Item).GraduationPlan = this); - _graduationPlanCreditsByCourses = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourse)e.Item).GraduationPlan = this; - _graduationPlanCreditsByCoursesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCourses - { - get { return _graduationPlanCreditsByCoursesCovariant; } - set { GraduationPlanCreditsByCourses = new List(value.Cast()); } - } - - private ICollection _graduationPlanCreditsByCreditCategories; - private ICollection _graduationPlanCreditsByCreditCategoriesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="creditsByCreditCategories")] - public ICollection GraduationPlanCreditsByCreditCategories - { - get { return _graduationPlanCreditsByCreditCategories; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)e.Item).GraduationPlan = this); - _graduationPlanCreditsByCreditCategories = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)e.Item).GraduationPlan = this; - _graduationPlanCreditsByCreditCategoriesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCreditCategories - { - get { return _graduationPlanCreditsByCreditCategoriesCovariant; } - set { GraduationPlanCreditsByCreditCategories = new List(value.Cast()); } - } - - private ICollection _graduationPlanCreditsBySubjects; - private ICollection _graduationPlanCreditsBySubjectsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="creditsBySubjects")] - public ICollection GraduationPlanCreditsBySubjects - { - get { return _graduationPlanCreditsBySubjects; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsBySubject)e.Item).GraduationPlan = this); - _graduationPlanCreditsBySubjects = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsBySubject)e.Item).GraduationPlan = this; - _graduationPlanCreditsBySubjectsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsBySubjects - { - get { return _graduationPlanCreditsBySubjectsCovariant; } - set { GraduationPlanCreditsBySubjects = new List(value.Cast()); } - } - - private ICollection _graduationPlanRequiredAssessments; - private ICollection _graduationPlanRequiredAssessmentsCovariant; + private ICollection _functionDimensionReportingTags; + private ICollection _functionDimensionReportingTagsCovariant; [NoDuplicateMembers] - [DataMember(Name="requiredAssessments")] - public ICollection GraduationPlanRequiredAssessments + [DataMember(Name="reportingTags")] + public ICollection FunctionDimensionReportingTags { - get { return _graduationPlanRequiredAssessments; } + get { return _functionDimensionReportingTags; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessment)e.Item).GraduationPlan = this); - _graduationPlanRequiredAssessments = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IFunctionDimensionReportingTag)e.Item).FunctionDimension = this); + _functionDimensionReportingTags = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessment)e.Item).GraduationPlan = this; - _graduationPlanRequiredAssessmentsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IFunctionDimensionReportingTag)e.Item).FunctionDimension = this; + _functionDimensionReportingTagsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanRequiredAssessments + ICollection Entities.Common.EdFi.IFunctionDimension.FunctionDimensionReportingTags { - get { return _graduationPlanRequiredAssessmentsCovariant; } - set { GraduationPlanRequiredAssessments = new List(value.Cast()); } + get { return _functionDimensionReportingTagsCovariant; } + set { FunctionDimensionReportingTags = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -76567,24 +73191,9 @@ public ICollection GraduationPlanRequiredAsses internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_graduationPlanCreditsByCourses != null) foreach (var item in _graduationPlanCreditsByCourses) - { - item.GraduationPlan = this; - } - - if (_graduationPlanCreditsByCreditCategories != null) foreach (var item in _graduationPlanCreditsByCreditCategories) - { - item.GraduationPlan = this; - } - - if (_graduationPlanCreditsBySubjects != null) foreach (var item in _graduationPlanCreditsBySubjects) - { - item.GraduationPlan = this; - } - - if (_graduationPlanRequiredAssessments != null) foreach (var item in _graduationPlanRequiredAssessments) + if (_functionDimensionReportingTags != null) foreach (var item in _functionDimensionReportingTags) { - item.GraduationPlan = this; + item.FunctionDimension = this; } } @@ -76595,39 +73204,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlan)target); + return Entities.Common.EdFi.FunctionDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFunctionDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlan)target, null); + Entities.Common.EdFi.FunctionDimensionMapper.MapTo(this, (Entities.Common.EdFi.IFunctionDimension)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGraduationPlan.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IGraduationPlan.GraduationSchoolYearTypeResourceId - { - get { return null; } - set { ImplicitGraduationSchoolYearTypeReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- // ================================== @@ -76650,49 +73238,13 @@ string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator // ---------------------- // Validate collections // ---------------------- - if (GraduationPlanCreditsByCourses.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsByCourses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GraduationPlanCreditsByCourses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsByCourses, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsByCourses")))) - { - yield return result; - } - } - - if (GraduationPlanCreditsByCreditCategories.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsByCreditCategories") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GraduationPlanCreditsByCreditCategories"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsByCreditCategories, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsByCreditCategories")))) - { - yield return result; - } - } - - if (GraduationPlanCreditsBySubjects.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsBySubjects") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GraduationPlanCreditsBySubjects"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsBySubjects, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsBySubjects")))) - { - yield return result; - } - } - - if (GraduationPlanRequiredAssessments.Any() && mappingContract?.IsMemberSupported("GraduationPlanRequiredAssessments") != false) + if (FunctionDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("FunctionDimensionReportingTags") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("GraduationPlanRequiredAssessments"); + pathBuilder.Append("FunctionDimensionReportingTags"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanRequiredAssessments, validationContext, validationContext.Items.ForCollection("GraduationPlanRequiredAssessments")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(FunctionDimensionReportingTags, validationContext, validationContext.Items.ForCollection("FunctionDimensionReportingTags")))) { yield return result; } @@ -76743,17 +73295,14 @@ string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanPutPostRequestValidator : FluentValidation.AbstractValidator + public class FunctionDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_GraduationPlan = new FullName("edfi", "GraduationPlan"); + private static readonly FullName _fullName_edfi_FunctionDimension = new FullName("edfi", "FunctionDimension"); // Declare collection item validators - private GraduationPlanCreditsByCoursePutPostRequestValidator _graduationPlanCreditsByCoursesValidator = new (); - private GraduationPlanCreditsByCreditCategoryPutPostRequestValidator _graduationPlanCreditsByCreditCategoriesValidator = new (); - private GraduationPlanCreditsBySubjectPutPostRequestValidator _graduationPlanCreditsBySubjectsValidator = new (); - private GraduationPlanRequiredAssessmentPutPostRequestValidator _graduationPlanRequiredAssessmentsValidator = new (); + private FunctionDimensionReportingTagPutPostRequestValidator _functionDimensionReportingTagsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -76770,52 +73319,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsGraduationPlanCreditsByCourseIncluded(x)); - - if (hasInvalidGraduationPlanCreditsByCoursesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GraduationPlanCreditsByCourses", $"A supplied 'GraduationPlanCreditsByCourse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsGraduationPlanCreditsByCreditCategoryIncluded != null) - { - var hasInvalidGraduationPlanCreditsByCreditCategoriesItems = instance.GraduationPlanCreditsByCreditCategories.Any(x => !mappingContract.IsGraduationPlanCreditsByCreditCategoryIncluded(x)); - - if (hasInvalidGraduationPlanCreditsByCreditCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GraduationPlanCreditsByCreditCategories", $"A supplied 'GraduationPlanCreditsByCreditCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsGraduationPlanCreditsBySubjectIncluded != null) - { - var hasInvalidGraduationPlanCreditsBySubjectsItems = instance.GraduationPlanCreditsBySubjects.Any(x => !mappingContract.IsGraduationPlanCreditsBySubjectIncluded(x)); - - if (hasInvalidGraduationPlanCreditsBySubjectsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GraduationPlanCreditsBySubjects", $"A supplied 'GraduationPlanCreditsBySubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsGraduationPlanRequiredAssessmentIncluded != null) + if (mappingContract.IsFunctionDimensionReportingTagIncluded != null) { - var hasInvalidGraduationPlanRequiredAssessmentsItems = instance.GraduationPlanRequiredAssessments.Any(x => !mappingContract.IsGraduationPlanRequiredAssessmentIncluded(x)); + var hasInvalidFunctionDimensionReportingTagsItems = instance.FunctionDimensionReportingTags.Any(x => !mappingContract.IsFunctionDimensionReportingTagIncluded(x)); - if (hasInvalidGraduationPlanRequiredAssessmentsItems) + if (hasInvalidFunctionDimensionReportingTagsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GraduationPlanRequiredAssessments", $"A supplied 'GraduationPlanRequiredAssessment' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("FunctionDimensionReportingTags", $"A supplied 'FunctionDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -76837,17 +73353,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanCreditsByCourse table of the GraduationPlan aggregate in the ODS Database. + /// A class which represents the edfi.FunctionDimensionReportingTag table of the FunctionDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class GraduationPlanCreditsByCourse : Entities.Common.EdFi.IGraduationPlanCreditsByCourse, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class FunctionDimensionReportingTag : Entities.Common.EdFi.IFunctionDimensionReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsByCourse"); + private static FullName _fullName = new FullName("edfi", "FunctionDimensionReportingTag"); // Fluent validator instance (threadsafe) - private static GraduationPlanCreditsByCoursePutPostRequestValidator _validator = new GraduationPlanCreditsByCoursePutPostRequestValidator(); + private static FunctionDimensionReportingTagPutPostRequestValidator _validator = new FunctionDimensionReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -76858,10 +73373,6 @@ public class GraduationPlanCreditsByCourse : Entities.Common.EdFi.IGraduationPla // Constructor // ------------------------------------------------------------- - public GraduationPlanCreditsByCourse() - { - GraduationPlanCreditsByCourseCourses = new List(); - } // ------------------------------------------------------------ @@ -76878,33 +73389,33 @@ public GraduationPlanCreditsByCourse() //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IGraduationPlan _graduationPlan; + private Entities.Common.EdFi.IFunctionDimension _functionDimension; [IgnoreDataMember] - Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPlan + Entities.Common.EdFi.IFunctionDimension IFunctionDimensionReportingTag.FunctionDimension { - get { return _graduationPlan; } - set { SetGraduationPlan(value); } + get { return _functionDimension; } + set { SetFunctionDimension(value); } } - public Entities.Common.EdFi.IGraduationPlan GraduationPlan + public Entities.Common.EdFi.IFunctionDimension FunctionDimension { - set { SetGraduationPlan(value); } + set { SetFunctionDimension(value); } } - private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + private void SetFunctionDimension(Entities.Common.EdFi.IFunctionDimension value) { - _graduationPlan = value; + _functionDimension = value; } /// - /// Identifying name given to a collection of courses. + /// Optional tag for accountability reporting. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(120, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseSetName")] - public string CourseSetName { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -76919,7 +73430,7 @@ private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsByCourse; + var compareTo = obj as Entities.Common.EdFi.IFunctionDimensionReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -76928,12 +73439,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + if (_functionDimension == null || !_functionDimension.Equals(compareTo.FunctionDimension)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourse).CourseSetName, compareTo.CourseSetName)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IFunctionDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -76950,11 +73461,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_graduationPlan != null) - hash.Add(_graduationPlan); + if (_functionDimension != null) + hash.Add(_functionDimension); // Standard Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourse).CourseSetName); + hash.Add((this as Entities.Common.EdFi.IFunctionDimensionReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -76968,60 +73479,8 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="creditConversion")] - public decimal? CreditConversion { get; set; } - - private bool _creditsExplicitlyAssigned = false; - private decimal _credits; - - /// - /// The value of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="credits")] - public decimal Credits - { - get => _credits; - set - { - _credits = value; - _creditsExplicitlyAssigned = true; - } - } - - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="creditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string CreditTypeDescriptor { get; set; } - - /// - /// The grade level when the student is planned to take the course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="whenTakenGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string WhenTakenGradeLevelDescriptor { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_creditsExplicitlyAssigned) - { - yield return "Credits"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -77040,43 +73499,13 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsByCourse")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FunctionDimension", "FunctionDimensionReportingTag")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _graduationPlanCreditsByCourseCourses; - private ICollection _graduationPlanCreditsByCourseCoursesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="courses")] - public ICollection GraduationPlanCreditsByCourseCourses - { - get { return _graduationPlanCreditsByCourseCourses; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)e.Item).GraduationPlanCreditsByCourse = this); - _graduationPlanCreditsByCourseCourses = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)e.Item).GraduationPlanCreditsByCourse = this; - _graduationPlanCreditsByCourseCoursesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlanCreditsByCourse.GraduationPlanCreditsByCourseCourses - { - get { return _graduationPlanCreditsByCourseCoursesCovariant; } - set { GraduationPlanCreditsByCourseCourses = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -77087,17 +73516,6 @@ public ICollection GraduationPlanCreditsByC // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_graduationPlanCreditsByCourseCourses != null) foreach (var item in _graduationPlanCreditsByCourseCourses) - { - item.GraduationPlanCreditsByCourse = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -77105,12 +73523,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanCreditsByCourseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourse)target); + return Entities.Common.EdFi.FunctionDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFunctionDimensionReportingTag)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanCreditsByCourseMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourse)target, null); + Entities.Common.EdFi.FunctionDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IFunctionDimensionReportingTag)target, null); } // ------------------------------------------------------------- @@ -77140,18 +73558,6 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (GraduationPlanCreditsByCourseCourses.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsByCourseCourses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GraduationPlanCreditsByCourseCourses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsByCourseCourses, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsByCourseCourses")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -77197,14 +73603,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsByCoursePutPostRequestValidator : FluentValidation.AbstractValidator + public class FunctionDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_GraduationPlanCreditsByCourse = new FullName("edfi", "GraduationPlanCreditsByCourse"); - - // Declare collection item validators - private GraduationPlanCreditsByCourseCoursePutPostRequestValidator _graduationPlanCreditsByCourseCoursesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -77217,28 +73618,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (GraduationPlanCreditsByCourseMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_GraduationPlanCreditsByCourse); - - if (mappingContract != null) - { - if (mappingContract.IsGraduationPlanCreditsByCourseCourseIncluded != null) - { - var hasInvalidGraduationPlanCreditsByCourseCoursesItems = instance.GraduationPlanCreditsByCourseCourses.Any(x => !mappingContract.IsGraduationPlanCreditsByCourseCourseIncluded(x)); - - if (hasInvalidGraduationPlanCreditsByCourseCoursesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GraduationPlanCreditsByCourseCourses", $"A supplied 'GraduationPlanCreditsByCourseCourse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -77254,145 +73633,186 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanCreditsByCourseCourse table of the GraduationPlan aggregate in the ODS Database. + /// Represents a reference to the FundDimension resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsByCourseCourse : Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse, IValidatableObject + public class FundDimensionReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsByCourseCourse"); + [DataMember(Name="code")] + public string Code { get; set; } - // Fluent validator instance (threadsafe) - private static GraduationPlanCreditsByCourseCoursePutPostRequestValidator _validator = new GraduationPlanCreditsByCourseCoursePutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } - // ============================================================= - // Constructor - // ------------------------------------------------------------- + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } - - // ------------------------------------------------------------ + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - // ============================================================= - // References - // ------------------------------------------------------------- + private Link _link; - private bool _courseReferenceExplicitlyAssigned; - private Course.EdFi.CourseReference _courseReference; - private Course.EdFi.CourseReference ImplicitCourseReference + [DataMember(Name="link")] + public Link Link { get { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_courseReference == null && !_courseReferenceExplicitlyAssigned) - _courseReference = new Course.EdFi.CourseReference(); + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } - return _courseReference; + return _link; } } - [DataMember(Name="courseReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Course.EdFi.CourseReference CourseReference + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCourseReference != null - && (_courseReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - return ImplicitCourseReference; + return Code != default(string) && FiscalYear != default(int); + } - return null; - } - set + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (Code == default) { - _courseReferenceExplicitlyAssigned = true; - _courseReference = value; + yield return "Code"; } - } - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IGraduationPlanCreditsByCourse _graduationPlanCreditsByCourse; + if (FiscalYear == default) + { + yield return "FiscalYear"; + } - [IgnoreDataMember] - Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCourseCourse.GraduationPlanCreditsByCourse - { - get { return _graduationPlanCreditsByCourse; } - set { SetGraduationPlanCreditsByCourse(value); } } - public Entities.Common.EdFi.IGraduationPlanCreditsByCourse GraduationPlanCreditsByCourse + private Link CreateLink() { - set { SetGraduationPlanCreditsByCourse(value); } + var link = new Link + { + Rel = "FundDimension", + Href = $"/ed-fi/fundDimensions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } + } // Aggregate reference - private void SetGraduationPlanCreditsByCourse(Entities.Common.EdFi.IGraduationPlanCreditsByCourse value) + /// + /// A class which represents the edfi.FundDimension table of the FundDimension aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class FundDimension : Entities.Common.EdFi.IFundDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "FundDimension"); + + // Fluent validator instance (threadsafe) + private static FundDimensionPutPostRequestValidator _validator = new FundDimensionPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public FundDimension() { - _graduationPlanCreditsByCourse = value; + FundDimensionReportingTags = new List(); } + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ /// - /// A unique alphanumeric code assigned to a course. + /// The unique identifier for the FundDimension resource. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseCode - { - get - { - if (ImplicitCourseReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - return ImplicitCourseReference.CourseCode; + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- - // Course - _courseReferenceExplicitlyAssigned = false; - ImplicitCourseReference.CourseCode = value; - } - } + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. + /// The code representation of the account fund dimension. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseEducationOrganizationId - { - get - { - if (ImplicitCourseReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) - return ImplicitCourseReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="code")] + public string Code { get; set; } + + private bool _fiscalYearExplicitlyAssigned = false; + private int _fiscalYear; - // Course - _courseReferenceExplicitlyAssigned = false; - ImplicitCourseReference.EducationOrganizationId = value; + /// + /// The fiscal year for which the account fund dimension is valid. + /// + // NOT in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get => _fiscalYear; + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; } } + // ------------------------------------------------------------- // ============================================================= @@ -77407,7 +73827,7 @@ long Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseEducationOr /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse; + var compareTo = obj as Entities.Common.EdFi.IFundDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -77415,18 +73835,14 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_graduationPlanCreditsByCourse == null || !_graduationPlanCreditsByCourse.Equals(compareTo.GraduationPlanCreditsByCourse)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseCode, compareTo.CourseCode)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IFundDimension).Code, compareTo.Code)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseEducationOrganizationId.Equals(compareTo.CourseEducationOrganizationId)) + // Standard Property + if (!(this as Entities.Common.EdFi.IFundDimension).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -77442,15 +73858,14 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_graduationPlanCreditsByCourse != null) - hash.Add(_graduationPlanCreditsByCourse); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseCode); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IFundDimension).Code); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IFundDimension).FiscalYear); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseEducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -77463,8 +73878,24 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// A description of the account fund dimension. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeName")] + public string CodeName { get; set; } // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_fiscalYearExplicitlyAssigned) + { + yield return "FiscalYear"; + } + } + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -77483,23 +73914,71 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsByCourseCourse")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FundDimension", "FundDimension")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _fundDimensionReportingTags; + private ICollection _fundDimensionReportingTagsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportingTags")] + public ICollection FundDimensionReportingTags + { + get { return _fundDimensionReportingTags; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IFundDimensionReportingTag)e.Item).FundDimension = this); + _fundDimensionReportingTags = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IFundDimensionReportingTag)e.Item).FundDimension = this; + _fundDimensionReportingTagsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IFundDimension.FundDimensionReportingTags + { + get { return _fundDimensionReportingTagsCovariant; } + set { FundDimensionReportingTags = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_fundDimensionReportingTags != null) foreach (var item in _fundDimensionReportingTags) + { + item.FundDimension = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -77507,32 +73986,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanCreditsByCourseCourseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)target); + return Entities.Common.EdFi.FundDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFundDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanCreditsByCourseCourseMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)target, null); + Entities.Common.EdFi.FundDimensionMapper.MapTo(this, (Entities.Common.EdFi.IFundDimension)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseResourceId - { - get { return null; } - set { ImplicitCourseReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCourseReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -77550,12 +74015,23 @@ string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseDiscrimin try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (FundDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("FundDimensionReportingTags") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("FundDimensionReportingTags"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(FundDimensionReportingTags, validationContext, validationContext.Items.ForCollection("FundDimensionReportingTags")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -77601,9 +74077,14 @@ string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseDiscrimin // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsByCourseCoursePutPostRequestValidator : FluentValidation.AbstractValidator + public class FundDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_FundDimension = new FullName("edfi", "FundDimension"); + + // Declare collection item validators + private FundDimensionReportingTagPutPostRequestValidator _fundDimensionReportingTagsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -77616,6 +74097,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (FundDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_FundDimension); + + if (mappingContract != null) + { + if (mappingContract.IsFundDimensionReportingTagIncluded != null) + { + var hasInvalidFundDimensionReportingTagsItems = instance.FundDimensionReportingTags.Any(x => !mappingContract.IsFundDimensionReportingTagIncluded(x)); + + if (hasInvalidFundDimensionReportingTagsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("FundDimensionReportingTags", $"A supplied 'FundDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -77632,17 +74135,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanCreditsByCreditCategory table of the GraduationPlan aggregate in the ODS Database. + /// A class which represents the edfi.FundDimensionReportingTag table of the FundDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class GraduationPlanCreditsByCreditCategory : Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class FundDimensionReportingTag : Entities.Common.EdFi.IFundDimensionReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsByCreditCategory"); + private static FullName _fullName = new FullName("edfi", "FundDimensionReportingTag"); // Fluent validator instance (threadsafe) - private static GraduationPlanCreditsByCreditCategoryPutPostRequestValidator _validator = new GraduationPlanCreditsByCreditCategoryPutPostRequestValidator(); + private static FundDimensionReportingTagPutPostRequestValidator _validator = new FundDimensionReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -77669,33 +74171,33 @@ public class GraduationPlanCreditsByCreditCategory : Entities.Common.EdFi.IGradu //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IGraduationPlan _graduationPlan; + private Entities.Common.EdFi.IFundDimension _fundDimension; [IgnoreDataMember] - Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCreditCategory.GraduationPlan + Entities.Common.EdFi.IFundDimension IFundDimensionReportingTag.FundDimension { - get { return _graduationPlan; } - set { SetGraduationPlan(value); } + get { return _fundDimension; } + set { SetFundDimension(value); } } - public Entities.Common.EdFi.IGraduationPlan GraduationPlan + public Entities.Common.EdFi.IFundDimension FundDimension { - set { SetGraduationPlan(value); } + set { SetFundDimension(value); } } - private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + private void SetFundDimension(Entities.Common.EdFi.IFundDimension value) { - _graduationPlan = value; + _fundDimension = value; } /// - /// A categorization for the course transcript credits awarded in the course transcript. + /// Optional tag for accountability reporting. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="creditCategoryDescriptor")][DescriptorExists("CreditCategoryDescriptor")] - public string CreditCategoryDescriptor { get; set; } + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -77710,7 +74212,7 @@ private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory; + var compareTo = obj as Entities.Common.EdFi.IFundDimensionReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -77719,12 +74221,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + if (_fundDimension == null || !_fundDimension.Equals(compareTo.FundDimension)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory).CreditCategoryDescriptor, compareTo.CreditCategoryDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IFundDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -77741,11 +74243,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_graduationPlan != null) - hash.Add(_graduationPlan); + if (_fundDimension != null) + hash.Add(_fundDimension); // Standard Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory).CreditCategoryDescriptor); + hash.Add((this as Entities.Common.EdFi.IFundDimensionReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -77759,52 +74261,8 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="creditConversion")] - public decimal? CreditConversion { get; set; } - - private bool _creditsExplicitlyAssigned = false; - private decimal _credits; - - /// - /// The value of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="credits")] - public decimal Credits - { - get => _credits; - set - { - _credits = value; - _creditsExplicitlyAssigned = true; - } - } - - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="creditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string CreditTypeDescriptor { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_creditsExplicitlyAssigned) - { - yield return "Credits"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -77823,7 +74281,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsByCreditCategory")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "FundDimension", "FundDimensionReportingTag")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -77847,12 +74305,12 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanCreditsByCreditCategoryMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)target); + return Entities.Common.EdFi.FundDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IFundDimensionReportingTag)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanCreditsByCreditCategoryMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)target, null); + Entities.Common.EdFi.FundDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IFundDimensionReportingTag)target, null); } // ------------------------------------------------------------- @@ -77927,9 +74385,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsByCreditCategoryPutPostRequestValidator : FluentValidation.AbstractValidator + public class FundDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -77957,75 +74415,231 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanCreditsBySubject table of the GraduationPlan aggregate in the ODS Database. + /// Represents a reference to the GeneralStudentProgramAssociation resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class GraduationPlanCreditsBySubject : Entities.Common.EdFi.IGraduationPlanCreditsBySubject, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class GeneralStudentProgramAssociationReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsBySubject"); - - // Fluent validator instance (threadsafe) - private static GraduationPlanCreditsBySubjectPutPostRequestValidator _validator = new GraduationPlanCreditsBySubjectPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IGraduationPlan _graduationPlan; + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } - [IgnoreDataMember] - Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsBySubject.GraduationPlan - { - get { return _graduationPlan; } - set { SetGraduationPlan(value); } - } + [DataMember(Name="programName")] + public string ProgramName { get; set; } - public Entities.Common.EdFi.IGraduationPlan GraduationPlan - { - set { SetGraduationPlan(value); } - } + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } - private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId { - _graduationPlan = value; + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } } + private string _studentUniqueId; /// - /// The intended major subject area of the graduation requirement. + /// Gets or sets the resource identifier of the referenced resource. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } - // ------------------------------------------------------------- + public Guid ResourceId { get; set; } - // ============================================================= - // Equality + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return BeginDate != default(DateTime) && EducationOrganizationId != default(long) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (BeginDate == default) + { + yield return "BeginDate"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (ProgramEducationOrganizationId == default) + { + yield return "ProgramEducationOrganizationId"; + } + + if (ProgramName == default) + { + yield return "ProgramName"; + } + + if (ProgramTypeDescriptor == default) + { + yield return "ProgramTypeDescriptor"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "GeneralStudentProgramAssociation", + Href = $"/ed-fi/generalStudentProgramAssociations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.GeneralStudentProgramAssociationProgramParticipationStatus table of the GeneralStudentProgramAssociation aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class GeneralStudentProgramAssociationProgramParticipationStatus : Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "GeneralStudentProgramAssociationProgramParticipationStatus"); + + // Fluent validator instance (threadsafe) + private static GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator _validator = new GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IGeneralStudentProgramAssociation _generalStudentProgramAssociation; + + [IgnoreDataMember] + Entities.Common.EdFi.IGeneralStudentProgramAssociation IGeneralStudentProgramAssociationProgramParticipationStatus.GeneralStudentProgramAssociation + { + get { return _generalStudentProgramAssociation; } + set { SetGeneralStudentProgramAssociation(value); } + } + + public Entities.Common.EdFi.IGeneralStudentProgramAssociation GeneralStudentProgramAssociation + { + set { SetGeneralStudentProgramAssociation(value); } + } + + private void SetGeneralStudentProgramAssociation(Entities.Common.EdFi.IGeneralStudentProgramAssociation value) + { + _generalStudentProgramAssociation = value; + } + + /// + /// The student's program participation status. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="participationStatusDescriptor")][DescriptorExists("ParticipationStatusDescriptor")] + public string ParticipationStatusDescriptor { get; set; } + + /// + /// The date the student's program participation status began. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="statusBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime StatusBeginDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality // ------------------------------------------------------------- /// @@ -78036,7 +74650,7 @@ private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsBySubject; + var compareTo = obj as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus; if (ReferenceEquals(this, compareTo)) return true; @@ -78045,12 +74659,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + if (_generalStudentProgramAssociation == null || !_generalStudentProgramAssociation.Equals(compareTo.GeneralStudentProgramAssociation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsBySubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).ParticipationStatusDescriptor, compareTo.ParticipationStatusDescriptor)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).StatusBeginDate.Equals(compareTo.StatusBeginDate)) return false; @@ -78067,11 +74686,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_graduationPlan != null) - hash.Add(_graduationPlan); + if (_generalStudentProgramAssociation != null) + hash.Add(_generalStudentProgramAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsBySubject).AcademicSubjectDescriptor); + hash.Add((this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).ParticipationStatusDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus).StatusBeginDate); return hash.ToHashCode(); } @@ -78087,50 +74710,21 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// The person, organization, or department that designated the participation status. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="creditConversion")] - public decimal? CreditConversion { get; set; } - - private bool _creditsExplicitlyAssigned = false; - private decimal _credits; + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="designatedBy")] + public string DesignatedBy { get; set; } /// - /// The value of credits or units of value awarded for the completion of a course. + /// The date the student's program participation status ended. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="credits")] - public decimal Credits - { - get => _credits; - set - { - _credits = value; - _creditsExplicitlyAssigned = true; - } - } - - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="creditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string CreditTypeDescriptor { get; set; } + [DataMember(Name="statusEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? StatusEndDate { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_creditsExplicitlyAssigned) - { - yield return "Credits"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -78149,7 +74743,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsBySubject")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GeneralStudentProgramAssociation", "GeneralStudentProgramAssociationProgramParticipationStatus")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -78173,12 +74767,12 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanCreditsBySubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsBySubject)target); + return Entities.Common.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanCreditsBySubjectMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsBySubject)target, null); + Entities.Common.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusMapper.MapTo(this, (Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target, null); } // ------------------------------------------------------------- @@ -78253,9 +74847,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanCreditsBySubjectPutPostRequestValidator : FluentValidation.AbstractValidator + public class GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -78283,17 +74877,200 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanRequiredAssessment table of the GraduationPlan aggregate in the ODS Database. + /// Represents a reference to the Grade resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class GradeReference : IResourceReference + { + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } + + [DataMember(Name="gradeTypeDescriptor")][DescriptorExists("GradeTypeDescriptor")] + public string GradeTypeDescriptor { get; set; } + + [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] + public string GradingPeriodDescriptor { get; set; } + + [DataMember(Name="gradingPeriodName")] + public string GradingPeriodName { get; set; } + + [DataMember(Name="gradingPeriodSchoolYear")] + public short GradingPeriodSchoolYear { get; set; } + + [DataMember(Name="localCourseCode")] + public string LocalCourseCode { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + + [DataMember(Name="sectionIdentifier")] + public string SectionIdentifier { get; set; } + + [DataMember(Name="sessionName")] + public string SessionName { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return BeginDate != default(DateTime) && GradeTypeDescriptor != default(string) && GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && GradingPeriodSchoolYear != default(short) && LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (BeginDate == default) + { + yield return "BeginDate"; + } + + if (GradeTypeDescriptor == default) + { + yield return "GradeTypeDescriptor"; + } + + if (GradingPeriodDescriptor == default) + { + yield return "GradingPeriodDescriptor"; + } + + if (GradingPeriodName == default) + { + yield return "GradingPeriodName"; + } + + if (GradingPeriodSchoolYear == default) + { + yield return "GradingPeriodSchoolYear"; + } + + if (LocalCourseCode == default) + { + yield return "LocalCourseCode"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + + if (SectionIdentifier == default) + { + yield return "SectionIdentifier"; + } + + if (SessionName == default) + { + yield return "SessionName"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "Grade", + Href = $"/ed-fi/grades/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.Grade table of the Grade aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessment : Entities.Common.EdFi.IGraduationPlanRequiredAssessment, IValidatableObject + public class Grade : Entities.Common.EdFi.IGrade, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GraduationPlanRequiredAssessment"); + private static FullName _fullName = new FullName("edfi", "Grade"); // Fluent validator instance (threadsafe) - private static GraduationPlanRequiredAssessmentPutPostRequestValidator _validator = new GraduationPlanRequiredAssessmentPutPostRequestValidator(); + private static GradePutPostRequestValidator _validator = new GradePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -78304,9 +75081,9 @@ public class GraduationPlanRequiredAssessment : Entities.Common.EdFi.IGraduation // Constructor // ------------------------------------------------------------- - public GraduationPlanRequiredAssessment() + public Grade() { - GraduationPlanRequiredAssessmentScores = new List(); + GradeLearningStandardGrades = new List(); } // ------------------------------------------------------------ @@ -78314,43 +75091,83 @@ public GraduationPlanRequiredAssessment() // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the Grade resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _assessmentReferenceExplicitlyAssigned; - private Assessment.EdFi.AssessmentReference _assessmentReference; - private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference + private bool _gradingPeriodReferenceExplicitlyAssigned; + private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; + private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) - _assessmentReference = new Assessment.EdFi.AssessmentReference(); + if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) + _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); - return _assessmentReference; + return _gradingPeriodReference; } } - [DataMember(Name="assessmentReference")] + [DataMember(Name="gradingPeriodReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Assessment.EdFi.AssessmentReference AssessmentReference + public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitAssessmentReference != null - && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference; + if (ImplicitGradingPeriodReference != null + && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference; return null; } set { - _assessmentReferenceExplicitlyAssigned = true; - _assessmentReference = value; + _gradingPeriodReferenceExplicitlyAssigned = true; + _gradingPeriodReference = value; + } + } + private bool _studentSectionAssociationReferenceExplicitlyAssigned; + private StudentSectionAssociation.EdFi.StudentSectionAssociationReference _studentSectionAssociationReference; + private StudentSectionAssociation.EdFi.StudentSectionAssociationReference ImplicitStudentSectionAssociationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentSectionAssociationReference == null && !_studentSectionAssociationReferenceExplicitlyAssigned) + _studentSectionAssociationReference = new StudentSectionAssociation.EdFi.StudentSectionAssociationReference(); + + return _studentSectionAssociationReference; + } + } + + [DataMember(Name="studentSectionAssociationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentSectionAssociation.EdFi.StudentSectionAssociationReference StudentSectionAssociationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentSectionAssociationReference != null + && (_studentSectionAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference; + + return null; + } + set + { + _studentSectionAssociationReferenceExplicitlyAssigned = true; + _studentSectionAssociationReference = value; } } // ------------------------------------------------------------- @@ -78358,36 +75175,123 @@ public Assessment.EdFi.AssessmentReference AssessmentReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IGraduationPlan _graduationPlan; - [IgnoreDataMember] - Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.GraduationPlan + /// + /// Month, day, and year of the student's entry or assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // IS in a reference, NOT a lookup column + DateTime Entities.Common.EdFi.IGrade.BeginDate { - get { return _graduationPlan; } - set { SetGraduationPlan(value); } + get + { + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.BeginDate; + + return default(DateTime); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.BeginDate = value; + } } - public Entities.Common.EdFi.IGraduationPlan GraduationPlan + /// + /// The type of grade reported (e.g., exam, final, grading period). + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeTypeDescriptor")][DescriptorExists("GradeTypeDescriptor")] + public string GradeTypeDescriptor { get; set; } + + /// + /// The state's name of the period for which grades are reported. + /// + + // IS in a reference (Grade.GradingPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.IGrade.GradingPeriodDescriptor { - set { SetGraduationPlan(value); } + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodDescriptor; + + return null; + } + set + { + ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + } } - private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + /// + /// The school's descriptive name of the grading period. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGrade.GradingPeriodName { - _graduationPlan = value; + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.GradingPeriodName = value; + } } /// - /// A unique number or alphanumeric code assigned to an assessment. + /// The identifier for the grading period school year. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentIdentifier + short Entities.Common.EdFi.IGrade.GradingPeriodSchoolYear { get { - if (ImplicitAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference.AssessmentIdentifier; + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolYear = value; + } + } + + /// + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGrade.LocalCourseCode + { + get + { + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.LocalCourseCode; return default(string); } @@ -78396,23 +75300,77 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentIdentifi // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Assessment - _assessmentReferenceExplicitlyAssigned = false; - ImplicitAssessmentReference.AssessmentIdentifier = value; + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.LocalCourseCode = value; } } /// - /// Namespace for the assessment. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.Namespace + long Entities.Common.EdFi.IGrade.SchoolId { get { - if (ImplicitAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference.Namespace; + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolId = value; + + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SchoolId = value; + } + } + + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IGrade.SchoolYear + { + get + { + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SchoolYear = value; + } + } + + /// + /// The local identifier assigned to a section. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGrade.SectionIdentifier + { + get + { + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.SectionIdentifier; return default(string); } @@ -78421,9 +75379,60 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.Namespace // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Assessment - _assessmentReferenceExplicitlyAssigned = false; - ImplicitAssessmentReference.Namespace = value; + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SectionIdentifier = value; + } + } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGrade.SessionName + { + get + { + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.SessionName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SessionName = value; + } + } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGrade.StudentUniqueId + { + get + { + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } // ------------------------------------------------------------- @@ -78440,7 +75449,7 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.Namespace /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanRequiredAssessment; + var compareTo = obj as Entities.Common.EdFi.IGrade; if (ReferenceEquals(this, compareTo)) return true; @@ -78448,18 +75457,59 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + + // Referenced Property + if (!(this as Entities.Common.EdFi.IGrade).BeginDate.Equals(compareTo.BeginDate)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGrade).GradeTypeDescriptor, compareTo.GradeTypeDescriptor)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGrade).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).GradingPeriodName, compareTo.GradingPeriodName)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).Namespace, compareTo.Namespace)) + if (!(this as Entities.Common.EdFi.IGrade).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).LocalCourseCode, compareTo.LocalCourseCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IGrade).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IGrade).SchoolYear.Equals(compareTo.SchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).SectionIdentifier, compareTo.SectionIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).SessionName, compareTo.SessionName)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGrade).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -78475,15 +75525,41 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_graduationPlan != null) - hash.Add(_graduationPlan); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).AssessmentIdentifier); + hash.Add((this as Entities.Common.EdFi.IGrade).BeginDate); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGrade).GradeTypeDescriptor); + + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IGrade).GradingPeriodDescriptor); + //Referenced Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).Namespace); + hash.Add((this as Entities.Common.EdFi.IGrade).GradingPeriodName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGrade).GradingPeriodSchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGrade).LocalCourseCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGrade).SchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGrade).SchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGrade).SectionIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGrade).SessionName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGrade).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -78496,24 +75572,65 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- /// - /// performanceLevel + /// As-Of date for a grade posted as the current grade. /// - - [DataMember(Name = "performanceLevel")] - public GraduationPlanRequiredAssessmentPerformanceLevel GraduationPlanRequiredAssessmentPerformanceLevel { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="currentGradeAsOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? CurrentGradeAsOfDate { get; set; } - Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentPerformanceLevel - { - get { return GraduationPlanRequiredAssessmentPerformanceLevel; } - set { GraduationPlanRequiredAssessmentPerformanceLevel = (GraduationPlanRequiredAssessmentPerformanceLevel) value; } - } + /// + /// An indicator that the posted grade is an interim grade for the grading period and not the final grade. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="currentGradeIndicator")] + public bool? CurrentGradeIndicator { get; set; } + + /// + /// A statement provided by the teacher that provides information in addition to the grade or assessment score. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="diagnosticStatement")] + public string DiagnosticStatement { get; set; } + + /// + /// A description of the grade earned by the learner. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(64, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="gradeEarnedDescription")] + public string GradeEarnedDescription { get; set; } + + /// + /// A final or interim (grading period) indicator of student performance in a class as submitted by the instructor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="letterGradeEarned")] + public string LetterGradeEarned { get; set; } + + /// + /// A final or interim (grading period) indicator of student performance in a class as submitted by the instructor. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="numericGradeEarned")] + public decimal? NumericGradeEarned { get; set; } + + /// + /// A conversion of the level to a standard set of performance levels. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="performanceBaseConversionDescriptor")][DescriptorExists("PerformanceBaseConversionDescriptor")] + public string PerformanceBaseConversionDescriptor { get; set; } + // ------------------------------------------------------------- + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -78529,41 +75646,41 @@ Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel Entities. // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanRequiredAssessment")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Grade", "Grade")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _graduationPlanRequiredAssessmentScores; - private ICollection _graduationPlanRequiredAssessmentScoresCovariant; + private ICollection _gradeLearningStandardGrades; + private ICollection _gradeLearningStandardGradesCovariant; [NoDuplicateMembers] - [DataMember(Name="scores")] - public ICollection GraduationPlanRequiredAssessmentScores + [DataMember(Name="learningStandardGrades")] + public ICollection GradeLearningStandardGrades { - get { return _graduationPlanRequiredAssessmentScores; } + get { return _gradeLearningStandardGrades; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)e.Item).GraduationPlanRequiredAssessment = this); - _graduationPlanRequiredAssessmentScores = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGradeLearningStandardGrade)e.Item).Grade = this); + _gradeLearningStandardGrades = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)e.Item).GraduationPlanRequiredAssessment = this; - _graduationPlanRequiredAssessmentScoresCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGradeLearningStandardGrade)e.Item).Grade = this; + _gradeLearningStandardGradesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentScores + ICollection Entities.Common.EdFi.IGrade.GradeLearningStandardGrades { - get { return _graduationPlanRequiredAssessmentScoresCovariant; } - set { GraduationPlanRequiredAssessmentScores = new List(value.Cast()); } + get { return _gradeLearningStandardGradesCovariant; } + set { GradeLearningStandardGrades = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -78571,6 +75688,13 @@ public ICollection GraduationPlanRequired // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -78581,9 +75705,9 @@ public ICollection GraduationPlanRequired internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_graduationPlanRequiredAssessmentScores != null) foreach (var item in _graduationPlanRequiredAssessmentScores) + if (_gradeLearningStandardGrades != null) foreach (var item in _gradeLearningStandardGrades) { - item.GraduationPlanRequiredAssessment = this; + item.Grade = this; } } @@ -78594,29 +75718,43 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanRequiredAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessment)target); + return Entities.Common.EdFi.GradeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGrade)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanRequiredAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessment)target, null); + Entities.Common.EdFi.GradeMapper.MapTo(this, (Entities.Common.EdFi.IGrade)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentResourceId + Guid? Entities.Common.EdFi.IGrade.GradingPeriodResourceId { get { return null; } - set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } + set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscriminator + string Entities.Common.EdFi.IGrade.GradingPeriodDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitAssessmentReference.Discriminator = value; } + set { ImplicitGradingPeriodReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IGrade.StudentSectionAssociationResourceId + { + get { return null; } + set { ImplicitStudentSectionAssociationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGrade.StudentSectionAssociationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentSectionAssociationReference.Discriminator = value; } } @@ -78637,19 +75775,18 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscrimi try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (GraduationPlanRequiredAssessmentScores.Any() && mappingContract?.IsMemberSupported("GraduationPlanRequiredAssessmentScores") != false) + if (GradeLearningStandardGrades.Any() && mappingContract?.IsMemberSupported("GradeLearningStandardGrades") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("GraduationPlanRequiredAssessmentScores"); + pathBuilder.Append("GradeLearningStandardGrades"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanRequiredAssessmentScores, validationContext, validationContext.Items.ForCollection("GraduationPlanRequiredAssessmentScores")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GradeLearningStandardGrades, validationContext, validationContext.Items.ForCollection("GradeLearningStandardGrades")))) { yield return result; } @@ -78659,18 +75796,6 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscrimi // --------------------------- // Validate embedded objects // --------------------------- - if (GraduationPlanRequiredAssessmentPerformanceLevel != null && mappingContract?.IsMemberSupported("GraduationPlanRequiredAssessmentPerformanceLevel") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GraduationPlanRequiredAssessmentPerformanceLevel"); - - foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(GraduationPlanRequiredAssessmentPerformanceLevel, validationContext, validationContext.Items.ForEmbeddedObject("GraduationPlanRequiredAssessmentPerformanceLevel")))) - { - yield return result; - } - } - // --------------------- // Validate Extensions @@ -78686,19 +75811,58 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscrimi yield return result; } } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - if (!fluentValidationResult.IsValid) + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); } - } - finally + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from other references + var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolId; + + if (valueFromGradingPeriodReference != null) + { + yield return ("gradingPeriodReference.schoolId", this.GradingPeriodReference.SchoolId); + } + + // Obtain value from other references + var valueFromStudentSectionAssociationReference = this.StudentSectionAssociationReference?.SchoolId; + + if (valueFromStudentSectionAssociationReference != null) + { + yield return ("studentSectionAssociationReference.schoolId", this.StudentSectionAssociationReference.SchoolId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally { // Restore original length pathBuilder.Length = originalLength; @@ -78712,14 +75876,14 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscrimi // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradePutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_GraduationPlanRequiredAssessment = new FullName("edfi", "GraduationPlanRequiredAssessment"); + private static readonly FullName _fullName_edfi_Grade = new FullName("edfi", "Grade"); // Declare collection item validators - private GraduationPlanRequiredAssessmentScorePutPostRequestValidator _graduationPlanRequiredAssessmentScoresValidator = new (); + private GradeLearningStandardGradePutPostRequestValidator _gradeLearningStandardGradesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -78736,19 +75900,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsGraduationPlanRequiredAssessmentScoreIncluded(x)); + var hasInvalidGradeLearningStandardGradesItems = instance.GradeLearningStandardGrades.Any(x => !mappingContract.IsGradeLearningStandardGradeIncluded(x)); - if (hasInvalidGraduationPlanRequiredAssessmentScoresItems) + if (hasInvalidGradeLearningStandardGradesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GraduationPlanRequiredAssessmentScores", $"A supplied 'GraduationPlanRequiredAssessmentScore' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("GradeLearningStandardGrades", $"A supplied 'GradeLearningStandardGrade' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -78770,16 +75934,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanRequiredAssessmentPerformanceLevel table of the GraduationPlan aggregate in the ODS Database. + /// A class which represents the edfi.GradeLearningStandardGrade table of the Grade aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessmentPerformanceLevel : Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel, IValidatableObject + public class GradeLearningStandardGrade : Entities.Common.EdFi.IGradeLearningStandardGrade, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GraduationPlanRequiredAssessmentPerformanceLevel"); + private static FullName _fullName = new FullName("edfi", "GradeLearningStandardGrade"); // Fluent validator instance (threadsafe) - private static GraduationPlanRequiredAssessmentPerformanceLevelPutPostRequestValidator _validator = new GraduationPlanRequiredAssessmentPerformanceLevelPutPostRequestValidator(); + private static GradeLearningStandardGradePutPostRequestValidator _validator = new GradeLearningStandardGradePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -78801,28 +75965,87 @@ public class GraduationPlanRequiredAssessmentPerformanceLevel : Entities.Common. // ============================================================= // References // ------------------------------------------------------------- + + private bool _learningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) + _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); + + return _learningStandardReference; + } + } + + [DataMember(Name="learningStandardReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LearningStandard.EdFi.LearningStandardReference LearningStandardReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLearningStandardReference != null + && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference; + + return null; + } + set + { + _learningStandardReferenceExplicitlyAssigned = true; + _learningStandardReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IGraduationPlanRequiredAssessment _graduationPlanRequiredAssessment; + private Entities.Common.EdFi.IGrade _grade; [IgnoreDataMember] - Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentPerformanceLevel.GraduationPlanRequiredAssessment + Entities.Common.EdFi.IGrade IGradeLearningStandardGrade.Grade { - get { return _graduationPlanRequiredAssessment; } - set { SetGraduationPlanRequiredAssessment(value); } + get { return _grade; } + set { SetGrade(value); } } - public Entities.Common.EdFi.IGraduationPlanRequiredAssessment GraduationPlanRequiredAssessment + public Entities.Common.EdFi.IGrade Grade { - set { SetGraduationPlanRequiredAssessment(value); } + set { SetGrade(value); } } - private void SetGraduationPlanRequiredAssessment(Entities.Common.EdFi.IGraduationPlanRequiredAssessment value) + private void SetGrade(Entities.Common.EdFi.IGrade value) { - _graduationPlanRequiredAssessment = value; + _grade = value; + } + + /// + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardId + { + get + { + if (ImplicitLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference.LearningStandardId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LearningStandard + _learningStandardReferenceExplicitlyAssigned = false; + ImplicitLearningStandardReference.LearningStandardId = value; + } } // ------------------------------------------------------------- @@ -78838,7 +76061,7 @@ private void SetGraduationPlanRequiredAssessment(Entities.Common.EdFi.IGraduatio /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel; + var compareTo = obj as Entities.Common.EdFi.IGradeLearningStandardGrade; if (ReferenceEquals(this, compareTo)) return true; @@ -78847,7 +76070,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_graduationPlanRequiredAssessment == null || !_graduationPlanRequiredAssessment.Equals(compareTo.GraduationPlanRequiredAssessment)) + if (_grade == null || !_grade.Equals(compareTo.Grade)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradeLearningStandardGrade).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -78864,8 +76092,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_graduationPlanRequiredAssessment != null) - hash.Add(_graduationPlanRequiredAssessment); + if (_grade != null) + hash.Add(_grade); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGradeLearningStandardGrade).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -78880,54 +76111,36 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The method that the instructor of the class uses to report the performance and achievement of all students. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } - - /// - /// The maximum score to make the indicated level of performance. + /// A statement provided by the teacher that provides information in addition to the grade or assessment score. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maximumScore")] - public string MaximumScore { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="diagnosticStatement")] + public string DiagnosticStatement { get; set; } /// - /// The minimum score required to make the indicated level of performance. + /// A final or interim (grading period) indicator of student performance for a learning standard as submitted by the instructor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="minimumScore")] - public string MinimumScore { get; set; } - - /// - /// The performance level(s) defined for the assessment. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] - public string PerformanceLevelDescriptor { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="letterGradeEarned")] + public string LetterGradeEarned { get; set; } /// - /// The name of the indicator being measured for a collection of performance level values. + /// A final or interim (grading period) indicator of student performance for a learning standard as submitted by the instructor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="performanceLevelIndicatorName")] - public string PerformanceLevelIndicatorName { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="numericGradeEarned")] + public decimal? NumericGradeEarned { get; set; } /// - /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. + /// A performance level that describes the student proficiency. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] - public string ResultDatatypeTypeDescriptor { get; set; } + [DataMember(Name="performanceBaseConversionDescriptor")][DescriptorExists("PerformanceBaseConversionDescriptor")] + public string PerformanceBaseConversionDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -78948,7 +76161,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanRequiredAssessmentPerformanceLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Grade", "GradeLearningStandardGrade")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -78972,18 +76185,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanRequiredAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel)target); + return Entities.Common.EdFi.GradeLearningStandardGradeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradeLearningStandardGrade)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanRequiredAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel)target, null); + Entities.Common.EdFi.GradeLearningStandardGradeMapper.MapTo(this, (Entities.Common.EdFi.IGradeLearningStandardGrade)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardResourceId + { + get { return null; } + set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGradeLearningStandardGrade.LearningStandardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLearningStandardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -79052,9 +76279,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradeLearningStandardGradePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -79082,17 +76309,119 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanRequiredAssessmentScore table of the GraduationPlan aggregate in the ODS Database. + /// Represents a reference to the GradebookEntry resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class GradebookEntryReference : IResourceReference + { + [DataMember(Name="gradebookEntryIdentifier")] + public string GradebookEntryIdentifier { get; set; } + + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return GradebookEntryIdentifier != default(string) && Namespace != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (GradebookEntryIdentifier == default) + { + yield return "GradebookEntryIdentifier"; + } + + if (Namespace == default) + { + yield return "Namespace"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "GradebookEntry", + Href = $"/ed-fi/gradebookEntries/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.GradebookEntry table of the GradebookEntry aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessmentScore : Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore, IValidatableObject + public class GradebookEntry : Entities.Common.EdFi.IGradebookEntry, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GraduationPlanRequiredAssessmentScore"); + private static FullName _fullName = new FullName("edfi", "GradebookEntry"); // Fluent validator instance (threadsafe) - private static GraduationPlanRequiredAssessmentScorePutPostRequestValidator _validator = new GraduationPlanRequiredAssessmentScorePutPostRequestValidator(); + private static GradebookEntryPutPostRequestValidator _validator = new GradebookEntryPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -79103,49 +76432,118 @@ public class GraduationPlanRequiredAssessmentScore : Entities.Common.EdFi.IGradu // Constructor // ------------------------------------------------------------- + public GradebookEntry() + { + GradebookEntryLearningStandards = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the GradebookEntry resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IGraduationPlanRequiredAssessment _graduationPlanRequiredAssessment; - [IgnoreDataMember] - Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentScore.GraduationPlanRequiredAssessment + private bool _gradingPeriodReferenceExplicitlyAssigned; + private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; + private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference { - get { return _graduationPlanRequiredAssessment; } - set { SetGraduationPlanRequiredAssessment(value); } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) + _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); + + return _gradingPeriodReference; + } } - public Entities.Common.EdFi.IGraduationPlanRequiredAssessment GraduationPlanRequiredAssessment + [DataMember(Name="gradingPeriodReference")] + [FullyDefinedReference] + public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference { - set { SetGraduationPlanRequiredAssessment(value); } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitGradingPeriodReference != null + && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference; + + return null; + } + set + { + _gradingPeriodReferenceExplicitlyAssigned = true; + _gradingPeriodReference = value; + } + } + private bool _sectionReferenceExplicitlyAssigned; + private Section.EdFi.SectionReference _sectionReference; + private Section.EdFi.SectionReference ImplicitSectionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) + _sectionReference = new Section.EdFi.SectionReference(); + + return _sectionReference; + } } - private void SetGraduationPlanRequiredAssessment(Entities.Common.EdFi.IGraduationPlanRequiredAssessment value) + [DataMember(Name="sectionReference")] + [FullyDefinedReference] + public Section.EdFi.SectionReference SectionReference { - _graduationPlanRequiredAssessment = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSectionReference != null + && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference; + + return null; + } + set + { + _sectionReferenceExplicitlyAssigned = true; + _sectionReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. + /// A unique number or alphanumeric code assigned to a gradebook entry by the source system. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradebookEntryIdentifier")] + public string GradebookEntryIdentifier { get; set; } + + /// + /// Namespace URI for the source of the gradebook entry. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="namespace")] + public string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -79160,7 +76558,7 @@ private void SetGraduationPlanRequiredAssessment(Entities.Common.EdFi.IGraduatio /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore; + var compareTo = obj as Entities.Common.EdFi.IGradebookEntry; if (ReferenceEquals(this, compareTo)) return true; @@ -79168,13 +76566,14 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_graduationPlanRequiredAssessment == null || !_graduationPlanRequiredAssessment.Equals(compareTo.GraduationPlanRequiredAssessment)) + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradebookEntry).GradebookEntryIdentifier, compareTo.GradebookEntryIdentifier)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradebookEntry).Namespace, compareTo.Namespace)) return false; @@ -79190,12 +76589,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_graduationPlanRequiredAssessment != null) - hash.Add(_graduationPlanRequiredAssessment); // Standard Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore).AssessmentReportingMethodDescriptor); + hash.Add((this as Entities.Common.EdFi.IGradebookEntry).GradebookEntryIdentifier); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGradebookEntry).Namespace); return hash.ToHashCode(); } @@ -79211,28 +76611,274 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The maximum score possible on the assessment. + /// The date the assignment, homework, or assessment was assigned or executed. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maximumScore")] - public string MaximumScore { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="dateAssigned")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime DateAssigned { get; set; } /// - /// The minimum score possible on the assessment. + /// A description of the assignment, homework, or classroom assessment. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="minimumScore")] - public string MinimumScore { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. + /// The date the assignment, homework, or assessment is due. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="dueDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DueDate { get; set; } + + /// + /// The time the assignment, homework, or assessment is due. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="dueTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan? DueTime { get; set; } + + /// + /// The type of the gradebook entry. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] - public string ResultDatatypeTypeDescriptor { get; set; } + [DataMember(Name="gradebookEntryTypeDescriptor")][DescriptorExists("GradebookEntryTypeDescriptor")] + public string GradebookEntryTypeDescriptor { get; set; } + + /// + /// The state's name of the period for which grades are reported. + /// + + // IS in a reference (GradebookEntry.GradingPeriodDescriptorId), IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + string Entities.Common.EdFi.IGradebookEntry.GradingPeriodDescriptor + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + { + return ImplicitGradingPeriodReference.GradingPeriodDescriptor; + } + + return null; + } + set + { + ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + } + } + + /// + /// The school's descriptive name of the grading period. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGradebookEntry.GradingPeriodName + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + { + return ImplicitGradingPeriodReference.GradingPeriodName; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.GradingPeriodName = value; + } + } + + /// + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGradebookEntry.LocalCourseCode + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + { + return ImplicitSectionReference.LocalCourseCode; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.LocalCourseCode = value; + } + } + + /// + /// The maximum number of points that can be earned for the submission. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxPoints")] + public decimal? MaxPoints { get; set; } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IGradebookEntry.SchoolId + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + { + return ImplicitGradingPeriodReference.SchoolId; + } + + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + { + return ImplicitSectionReference.SchoolId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolId = value.GetValueOrDefault(); + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolId = value.GetValueOrDefault(); + } + } + + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short? Entities.Common.EdFi.IGradebookEntry.SchoolYear + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + { + return ImplicitGradingPeriodReference.SchoolYear; + } + + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + { + return ImplicitSectionReference.SchoolYear; + } + + return default(short?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolYear = value.GetValueOrDefault(); + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolYear = value.GetValueOrDefault(); + } + } + + /// + /// The local identifier assigned to a section. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGradebookEntry.SectionIdentifier + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + { + return ImplicitSectionReference.SectionIdentifier; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SectionIdentifier = value; + } + } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGradebookEntry.SessionName + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + { + return ImplicitSectionReference.SessionName; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SessionName = value; + } + } + + /// + /// The local identifier assigned to a section. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="sourceSectionIdentifier")] + public string SourceSectionIdentifier { get; set; } + + /// + /// The name or title of the activity to be recorded in the gradebook entry. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="title")] + public string Title { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -79253,23 +76899,71 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanRequiredAssessmentScore")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GradebookEntry", "GradebookEntry")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _gradebookEntryLearningStandards; + private ICollection _gradebookEntryLearningStandardsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="learningStandards")] + public ICollection GradebookEntryLearningStandards + { + get { return _gradebookEntryLearningStandards; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGradebookEntryLearningStandard)e.Item).GradebookEntry = this); + _gradebookEntryLearningStandards = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGradebookEntryLearningStandard)e.Item).GradebookEntry = this; + _gradebookEntryLearningStandardsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGradebookEntry.GradebookEntryLearningStandards + { + get { return _gradebookEntryLearningStandardsCovariant; } + set { GradebookEntryLearningStandards = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_gradebookEntryLearningStandards != null) foreach (var item in _gradebookEntryLearningStandards) + { + item.GradebookEntry = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -79277,18 +76971,46 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanRequiredAssessmentScoreMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)target); + return Entities.Common.EdFi.GradebookEntryMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradebookEntry)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanRequiredAssessmentScoreMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)target, null); + Entities.Common.EdFi.GradebookEntryMapper.MapTo(this, (Entities.Common.EdFi.IGradebookEntry)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IGradebookEntry.GradingPeriodResourceId + { + get { return null; } + set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGradebookEntry.GradingPeriodDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitGradingPeriodReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IGradebookEntry.SectionResourceId + { + get { return null; } + set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGradebookEntry.SectionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitSectionReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -79306,12 +77028,23 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (GradebookEntryLearningStandards.Any() && mappingContract?.IsMemberSupported("GradebookEntryLearningStandards") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GradebookEntryLearningStandards"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GradebookEntryLearningStandards, validationContext, validationContext.Items.ForCollection("GradebookEntryLearningStandards")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -79331,6 +77064,77 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from other references + var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolId; + + if (valueFromGradingPeriodReference != null) + { + yield return ("gradingPeriodReference.schoolId", this.GradingPeriodReference.SchoolId); + } + + // Obtain value from other references + var valueFromSectionReference = this.SectionReference?.SchoolId; + + if (valueFromSectionReference != null) + { + yield return ("sectionReference.schoolId", this.SectionReference.SchoolId); + } + + } + var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); + + if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, short value)> GetSchoolYearSources() + { + // Obtain value from other references + var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolYear; + + if (valueFromGradingPeriodReference != null) + { + yield return ("gradingPeriodReference.schoolYear", this.GradingPeriodReference.SchoolYear); + } + + // Obtain value from other references + var valueFromSectionReference = this.SectionReference?.SchoolYear; + + if (valueFromSectionReference != null) + { + yield return ("sectionReference.schoolYear", this.SectionReference.SchoolYear); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -79357,9 +77161,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanRequiredAssessmentScorePutPostRequestValidator : FluentValidation.AbstractValidator + public class GradebookEntryPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_GradebookEntry = new FullName("edfi", "GradebookEntry"); + + // Declare collection item validators + private GradebookEntryLearningStandardPutPostRequestValidator _gradebookEntryLearningStandardsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -79372,6 +77181,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (GradebookEntryMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_GradebookEntry); + + if (mappingContract != null) + { + if (mappingContract.IsGradebookEntryLearningStandardIncluded != null) + { + var hasInvalidGradebookEntryLearningStandardsItems = instance.GradebookEntryLearningStandards.Any(x => !mappingContract.IsGradebookEntryLearningStandardIncluded(x)); + + if (hasInvalidGradebookEntryLearningStandardsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GradebookEntryLearningStandards", $"A supplied 'GradebookEntryLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -79387,22 +77218,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GraduationPlanTypeDescriptor table of the GraduationPlanTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GradebookEntryLearningStandard table of the GradebookEntry aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GraduationPlanTypeDescriptor : Entities.Common.EdFi.IGraduationPlanTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GradebookEntryLearningStandard : Entities.Common.EdFi.IGradebookEntryLearningStandard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "GraduationPlanTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "GradebookEntryLearningStandard"); // Fluent validator instance (threadsafe) - private static GraduationPlanTypeDescriptorPutPostRequestValidator _validator = new GraduationPlanTypeDescriptorPutPostRequestValidator(); + private static GradebookEntryLearningStandardPutPostRequestValidator _validator = new GradebookEntryLearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -79419,35 +77245,92 @@ public class GraduationPlanTypeDescriptor : Entities.Common.EdFi.IGraduationPlan // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the GraduationPlanTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _learningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) + _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); + + return _learningStandardReference; + } + } + + [DataMember(Name="learningStandardReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LearningStandard.EdFi.LearningStandardReference LearningStandardReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLearningStandardReference != null + && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference; + + return null; + } + set + { + _learningStandardReferenceExplicitlyAssigned = true; + _learningStandardReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGradebookEntry _gradebookEntry; + + [IgnoreDataMember] + Entities.Common.EdFi.IGradebookEntry IGradebookEntryLearningStandard.GradebookEntry + { + get { return _gradebookEntry; } + set { SetGradebookEntry(value); } + } + + public Entities.Common.EdFi.IGradebookEntry GradebookEntry + { + set { SetGradebookEntry(value); } + } + + private void SetGradebookEntry(Entities.Common.EdFi.IGradebookEntry value) + { + _gradebookEntry = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int GraduationPlanTypeDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardId { - get { return GraduationPlanTypeDescriptorId; } - set { GraduationPlanTypeDescriptorId = value; } + get + { + if (ImplicitLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference.LearningStandardId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LearningStandard + _learningStandardReferenceExplicitlyAssigned = false; + ImplicitLearningStandardReference.LearningStandardId = value; + } } // ------------------------------------------------------------- @@ -79463,7 +77346,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGraduationPlanTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGradebookEntryLearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -79471,9 +77354,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_gradebookEntry == null || !_gradebookEntry.Equals(compareTo.GradebookEntry)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IGraduationPlanTypeDescriptor).GraduationPlanTypeDescriptorId.Equals(compareTo.GraduationPlanTypeDescriptorId)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradebookEntryLearningStandard).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -79489,10 +77376,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_gradebookEntry != null) + hash.Add(_gradebookEntry); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IGraduationPlanTypeDescriptor).GraduationPlanTypeDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGradebookEntryLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -79500,55 +77389,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -79574,11 +77414,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GradebookEntry", "GradebookEntryLearningStandard")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -79589,13 +77426,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -79608,19 +77438,93 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GraduationPlanTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanTypeDescriptor)target); + return Entities.Common.EdFi.GradebookEntryLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradebookEntryLearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GraduationPlanTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanTypeDescriptor)target, null); + Entities.Common.EdFi.GradebookEntryLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IGradebookEntryLearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardResourceId + { + get { return null; } + set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGradebookEntryLearningStandard.LearningStandardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLearningStandardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -79628,9 +77532,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GraduationPlanTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradebookEntryLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -79659,21 +77563,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.GunFreeSchoolsActReportingStatusDescriptor table of the GunFreeSchoolsActReportingStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GradebookEntryTypeDescriptor table of the GradebookEntryTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class GunFreeSchoolsActReportingStatusDescriptor : Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GradebookEntryTypeDescriptor : Entities.Common.EdFi.IGradebookEntryTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "GunFreeSchoolsActReportingStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "GradebookEntryTypeDescriptor"); // Fluent validator instance (threadsafe) - private static GunFreeSchoolsActReportingStatusDescriptorPutPostRequestValidator _validator = new GunFreeSchoolsActReportingStatusDescriptorPutPostRequestValidator(); + private static GradebookEntryTypeDescriptorPutPostRequestValidator _validator = new GradebookEntryTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -79692,7 +77596,7 @@ public class GunFreeSchoolsActReportingStatusDescriptor : Entities.Common.EdFi.I // ------------------------------------------------------------ /// - /// The unique identifier for the GunFreeSchoolsActReportingStatusDescriptor resource. + /// The unique identifier for the GradebookEntryTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -79713,12 +77617,12 @@ public class GunFreeSchoolsActReportingStatusDescriptor : Entities.Common.EdFi.I /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int GunFreeSchoolsActReportingStatusDescriptorId { get; set; } + public int GradebookEntryTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return GunFreeSchoolsActReportingStatusDescriptorId; } - set { GunFreeSchoolsActReportingStatusDescriptorId = value; } + get { return GradebookEntryTypeDescriptorId; } + set { GradebookEntryTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -79734,7 +77638,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGradebookEntryTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -79744,7 +77648,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor).GunFreeSchoolsActReportingStatusDescriptorId.Equals(compareTo.GunFreeSchoolsActReportingStatusDescriptorId)) + if (!(this as Entities.Common.EdFi.IGradebookEntryTypeDescriptor).GradebookEntryTypeDescriptorId.Equals(compareTo.GradebookEntryTypeDescriptorId)) return false; @@ -79762,7 +77666,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor).GunFreeSchoolsActReportingStatusDescriptorId); + hash.Add((this as Entities.Common.EdFi.IGradebookEntryTypeDescriptor).GradebookEntryTypeDescriptorId); return hash.ToHashCode(); } @@ -79879,12 +77783,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.GunFreeSchoolsActReportingStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor)target); + return Entities.Common.EdFi.GradebookEntryTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradebookEntryTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.GunFreeSchoolsActReportingStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor)target, null); + Entities.Common.EdFi.GradebookEntryTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradebookEntryTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -79899,9 +77803,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class GunFreeSchoolsActReportingStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradebookEntryTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -79930,21 +77834,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.HomelessPrimaryNighttimeResidenceDescriptor table of the HomelessPrimaryNighttimeResidenceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GradeLevelDescriptor table of the GradeLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class HomelessPrimaryNighttimeResidenceDescriptor : Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GradeLevelDescriptor : Entities.Common.EdFi.IGradeLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "HomelessPrimaryNighttimeResidenceDescriptor"); + private static FullName _fullName = new FullName("edfi", "GradeLevelDescriptor"); // Fluent validator instance (threadsafe) - private static HomelessPrimaryNighttimeResidenceDescriptorPutPostRequestValidator _validator = new HomelessPrimaryNighttimeResidenceDescriptorPutPostRequestValidator(); + private static GradeLevelDescriptorPutPostRequestValidator _validator = new GradeLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -79963,7 +77867,7 @@ public class HomelessPrimaryNighttimeResidenceDescriptor : Entities.Common.EdFi. // ------------------------------------------------------------ /// - /// The unique identifier for the HomelessPrimaryNighttimeResidenceDescriptor resource. + /// The unique identifier for the GradeLevelDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -79984,12 +77888,12 @@ public class HomelessPrimaryNighttimeResidenceDescriptor : Entities.Common.EdFi. /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int HomelessPrimaryNighttimeResidenceDescriptorId { get; set; } + public int GradeLevelDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return HomelessPrimaryNighttimeResidenceDescriptorId; } - set { HomelessPrimaryNighttimeResidenceDescriptorId = value; } + get { return GradeLevelDescriptorId; } + set { GradeLevelDescriptorId = value; } } // ------------------------------------------------------------- @@ -80005,7 +77909,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGradeLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -80015,7 +77919,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor).HomelessPrimaryNighttimeResidenceDescriptorId.Equals(compareTo.HomelessPrimaryNighttimeResidenceDescriptorId)) + if (!(this as Entities.Common.EdFi.IGradeLevelDescriptor).GradeLevelDescriptorId.Equals(compareTo.GradeLevelDescriptorId)) return false; @@ -80033,7 +77937,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor).HomelessPrimaryNighttimeResidenceDescriptorId); + hash.Add((this as Entities.Common.EdFi.IGradeLevelDescriptor).GradeLevelDescriptorId); return hash.ToHashCode(); } @@ -80150,12 +78054,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.HomelessPrimaryNighttimeResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor)target); + return Entities.Common.EdFi.GradeLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradeLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.HomelessPrimaryNighttimeResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor)target, null); + Entities.Common.EdFi.GradeLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradeLevelDescriptor)target, null); } // ------------------------------------------------------------- @@ -80170,9 +78074,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class HomelessPrimaryNighttimeResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradeLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -80201,21 +78105,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.HomelessProgramServiceDescriptor table of the HomelessProgramServiceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GradePointAverageTypeDescriptor table of the GradePointAverageTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class HomelessProgramServiceDescriptor : Entities.Common.EdFi.IHomelessProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GradePointAverageTypeDescriptor : Entities.Common.EdFi.IGradePointAverageTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "HomelessProgramServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "GradePointAverageTypeDescriptor"); // Fluent validator instance (threadsafe) - private static HomelessProgramServiceDescriptorPutPostRequestValidator _validator = new HomelessProgramServiceDescriptorPutPostRequestValidator(); + private static GradePointAverageTypeDescriptorPutPostRequestValidator _validator = new GradePointAverageTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -80234,7 +78138,7 @@ public class HomelessProgramServiceDescriptor : Entities.Common.EdFi.IHomelessPr // ------------------------------------------------------------ /// - /// The unique identifier for the HomelessProgramServiceDescriptor resource. + /// The unique identifier for the GradePointAverageTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -80255,12 +78159,12 @@ public class HomelessProgramServiceDescriptor : Entities.Common.EdFi.IHomelessPr /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int HomelessProgramServiceDescriptorId { get; set; } + public int GradePointAverageTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return HomelessProgramServiceDescriptorId; } - set { HomelessProgramServiceDescriptorId = value; } + get { return GradePointAverageTypeDescriptorId; } + set { GradePointAverageTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -80276,7 +78180,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IHomelessProgramServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGradePointAverageTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -80286,7 +78190,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IHomelessProgramServiceDescriptor).HomelessProgramServiceDescriptorId.Equals(compareTo.HomelessProgramServiceDescriptorId)) + if (!(this as Entities.Common.EdFi.IGradePointAverageTypeDescriptor).GradePointAverageTypeDescriptorId.Equals(compareTo.GradePointAverageTypeDescriptorId)) return false; @@ -80304,7 +78208,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IHomelessProgramServiceDescriptor).HomelessProgramServiceDescriptorId); + hash.Add((this as Entities.Common.EdFi.IGradePointAverageTypeDescriptor).GradePointAverageTypeDescriptorId); return hash.ToHashCode(); } @@ -80421,12 +78325,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.HomelessProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IHomelessProgramServiceDescriptor)target); + return Entities.Common.EdFi.GradePointAverageTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradePointAverageTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.HomelessProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IHomelessProgramServiceDescriptor)target, null); + Entities.Common.EdFi.GradePointAverageTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradePointAverageTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -80441,9 +78345,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class HomelessProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradePointAverageTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -80472,21 +78376,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.IDEAPartDescriptor table of the IDEAPartDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GradeTypeDescriptor table of the GradeTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class IDEAPartDescriptor : Entities.Common.EdFi.IIDEAPartDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GradeTypeDescriptor : Entities.Common.EdFi.IGradeTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "IDEAPartDescriptor"); + private static FullName _fullName = new FullName("edfi", "GradeTypeDescriptor"); // Fluent validator instance (threadsafe) - private static IDEAPartDescriptorPutPostRequestValidator _validator = new IDEAPartDescriptorPutPostRequestValidator(); + private static GradeTypeDescriptorPutPostRequestValidator _validator = new GradeTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -80505,7 +78409,7 @@ public class IDEAPartDescriptor : Entities.Common.EdFi.IIDEAPartDescriptor, Enti // ------------------------------------------------------------ /// - /// The unique identifier for the IDEAPartDescriptor resource. + /// The unique identifier for the GradeTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -80526,12 +78430,12 @@ public class IDEAPartDescriptor : Entities.Common.EdFi.IIDEAPartDescriptor, Enti /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int IDEAPartDescriptorId { get; set; } + public int GradeTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return IDEAPartDescriptorId; } - set { IDEAPartDescriptorId = value; } + get { return GradeTypeDescriptorId; } + set { GradeTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -80547,7 +78451,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IIDEAPartDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGradeTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -80557,7 +78461,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IIDEAPartDescriptor).IDEAPartDescriptorId.Equals(compareTo.IDEAPartDescriptorId)) + if (!(this as Entities.Common.EdFi.IGradeTypeDescriptor).GradeTypeDescriptorId.Equals(compareTo.GradeTypeDescriptorId)) return false; @@ -80575,7 +78479,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IIDEAPartDescriptor).IDEAPartDescriptorId); + hash.Add((this as Entities.Common.EdFi.IGradeTypeDescriptor).GradeTypeDescriptorId); return hash.ToHashCode(); } @@ -80692,12 +78596,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.IDEAPartDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIDEAPartDescriptor)target); + return Entities.Common.EdFi.GradeTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradeTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.IDEAPartDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIDEAPartDescriptor)target, null); + Entities.Common.EdFi.GradeTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradeTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -80712,9 +78616,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class IDEAPartDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradeTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -80743,21 +78647,135 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.IdentificationDocumentUseDescriptor table of the IdentificationDocumentUseDescriptor aggregate in the ODS Database. + /// Represents a reference to the GradingPeriod resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class GradingPeriodReference : IResourceReference + { + [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] + public string GradingPeriodDescriptor { get; set; } + + [DataMember(Name="gradingPeriodName")] + public string GradingPeriodName { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && SchoolId != default(long) && SchoolYear != default(short); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (GradingPeriodDescriptor == default) + { + yield return "GradingPeriodDescriptor"; + } + + if (GradingPeriodName == default) + { + yield return "GradingPeriodName"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "GradingPeriod", + Href = $"/ed-fi/gradingPeriods/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.GradingPeriod table of the GradingPeriod aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class IdentificationDocumentUseDescriptor : Entities.Common.EdFi.IIdentificationDocumentUseDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class GradingPeriod : Entities.Common.EdFi.IGradingPeriod, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "IdentificationDocumentUseDescriptor"); + private static FullName _fullName = new FullName("edfi", "GradingPeriod"); // Fluent validator instance (threadsafe) - private static IdentificationDocumentUseDescriptorPutPostRequestValidator _validator = new IdentificationDocumentUseDescriptorPutPostRequestValidator(); + private static GradingPeriodPutPostRequestValidator _validator = new GradingPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -80776,7 +78794,7 @@ public class IdentificationDocumentUseDescriptor : Entities.Common.EdFi.IIdentif // ------------------------------------------------------------ /// - /// The unique identifier for the IdentificationDocumentUseDescriptor resource. + /// The unique identifier for the GradingPeriod resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -80786,6 +78804,73 @@ public class IdentificationDocumentUseDescriptor : Entities.Common.EdFi.IIdentif // ============================================================= // References // ------------------------------------------------------------- + + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); + + return _schoolReference; + } + } + + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; + + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } + } + private bool _schoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) + _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + + return _schoolYearTypeReference; + } + } + + [DataMember(Name="schoolYearTypeReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolYearTypeReference != null + && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference; + + return null; + } + set + { + _schoolYearTypeReferenceExplicitlyAssigned = true; + _schoolYearTypeReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -80793,16 +78878,71 @@ public class IdentificationDocumentUseDescriptor : Entities.Common.EdFi.IIdentif // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The state's name of the period for which grades are reported. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] + public string GradingPeriodDescriptor { get; set; } + + /// + /// The school's descriptive name of the grading period. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int IdentificationDocumentUseDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradingPeriodName")] + public string GradingPeriodName { get; set; } - int IDescriptor.DescriptorId + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IGradingPeriod.SchoolId { - get { return IdentificationDocumentUseDescriptorId; } - set { IdentificationDocumentUseDescriptorId = value; } + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + } + } + + /// + /// The identifier for the grading period school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IGradingPeriod.SchoolYear + { + get + { + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value; + } } // ------------------------------------------------------------- @@ -80818,7 +78958,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IIdentificationDocumentUseDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGradingPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -80827,8 +78967,23 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IIdentificationDocumentUseDescriptor).IdentificationDocumentUseDescriptorId.Equals(compareTo.IdentificationDocumentUseDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodName, compareTo.GradingPeriodName)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IGradingPeriod).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IGradingPeriod).SchoolYear.Equals(compareTo.SchoolYear)) return false; @@ -80845,9 +79000,19 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IIdentificationDocumentUseDescriptor).IdentificationDocumentUseDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGradingPeriod).GradingPeriodName); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGradingPeriod).SchoolId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGradingPeriod).SchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -80855,61 +79020,63 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The description of the descriptor. + /// Month, day, and year of the first day of the grading period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// Month, day, and year of the last day of the grading period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EndDate { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The sequential order of this period relative to other periods. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [DataMember(Name="periodSequence")] + public int? PeriodSequence { get; set; } + + private bool _totalInstructionalDaysExplicitlyAssigned = false; + private int _totalInstructionalDays; /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// Total days available for educational instruction during the grading period. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [Range(0, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="totalInstructionalDays")] + public int TotalInstructionalDays + { + get => _totalInstructionalDays; + set + { + _totalInstructionalDays = value; + _totalInstructionalDaysExplicitlyAssigned = true; + } + } - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_totalInstructionalDaysExplicitlyAssigned) + { + yield return "TotalInstructionalDays"; + } + } // ============================================================= // One-to-one relationships @@ -80929,11 +79096,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GradingPeriod", "GradingPeriod")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -80963,19 +79127,92 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.IdentificationDocumentUseDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIdentificationDocumentUseDescriptor)target); + return Entities.Common.EdFi.GradingPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradingPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.IdentificationDocumentUseDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIdentificationDocumentUseDescriptor)target, null); + Entities.Common.EdFi.GradingPeriodMapper.MapTo(this, (Entities.Common.EdFi.IGradingPeriod)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IGradingPeriod.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IGradingPeriod.SchoolYearTypeResourceId + { + get { return null; } + set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -80983,9 +79220,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class IdentificationDocumentUseDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradingPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -81014,21 +79251,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ImmunizationTypeDescriptor table of the ImmunizationTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GradingPeriodDescriptor table of the GradingPeriodDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ImmunizationTypeDescriptor : Entities.Common.EdFi.IImmunizationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GradingPeriodDescriptor : Entities.Common.EdFi.IGradingPeriodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ImmunizationTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "GradingPeriodDescriptor"); // Fluent validator instance (threadsafe) - private static ImmunizationTypeDescriptorPutPostRequestValidator _validator = new ImmunizationTypeDescriptorPutPostRequestValidator(); + private static GradingPeriodDescriptorPutPostRequestValidator _validator = new GradingPeriodDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -81047,7 +79284,7 @@ public class ImmunizationTypeDescriptor : Entities.Common.EdFi.IImmunizationType // ------------------------------------------------------------ /// - /// The unique identifier for the ImmunizationTypeDescriptor resource. + /// The unique identifier for the GradingPeriodDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -81068,12 +79305,12 @@ public class ImmunizationTypeDescriptor : Entities.Common.EdFi.IImmunizationType /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ImmunizationTypeDescriptorId { get; set; } + public int GradingPeriodDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ImmunizationTypeDescriptorId; } - set { ImmunizationTypeDescriptorId = value; } + get { return GradingPeriodDescriptorId; } + set { GradingPeriodDescriptorId = value; } } // ------------------------------------------------------------- @@ -81089,7 +79326,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IImmunizationTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGradingPeriodDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -81099,7 +79336,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IImmunizationTypeDescriptor).ImmunizationTypeDescriptorId.Equals(compareTo.ImmunizationTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.IGradingPeriodDescriptor).GradingPeriodDescriptorId.Equals(compareTo.GradingPeriodDescriptorId)) return false; @@ -81117,7 +79354,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IImmunizationTypeDescriptor).ImmunizationTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.IGradingPeriodDescriptor).GradingPeriodDescriptorId); return hash.ToHashCode(); } @@ -81234,12 +79471,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ImmunizationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IImmunizationTypeDescriptor)target); + return Entities.Common.EdFi.GradingPeriodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGradingPeriodDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ImmunizationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IImmunizationTypeDescriptor)target, null); + Entities.Common.EdFi.GradingPeriodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGradingPeriodDescriptor)target, null); } // ------------------------------------------------------------- @@ -81254,9 +79491,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ImmunizationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GradingPeriodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -81285,21 +79522,127 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.IncidentLocationDescriptor table of the IncidentLocationDescriptor aggregate in the ODS Database. + /// Represents a reference to the GraduationPlan resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class GraduationPlanReference : IResourceReference + { + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="graduationPlanTypeDescriptor")][DescriptorExists("GraduationPlanTypeDescriptor")] + public string GraduationPlanTypeDescriptor { get; set; } + + [DataMember(Name="graduationSchoolYear")] + public short GraduationSchoolYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationId != default(long) && GraduationPlanTypeDescriptor != default(string) && GraduationSchoolYear != default(short); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (GraduationPlanTypeDescriptor == default) + { + yield return "GraduationPlanTypeDescriptor"; + } + + if (GraduationSchoolYear == default) + { + yield return "GraduationSchoolYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "GraduationPlan", + Href = $"/ed-fi/graduationPlans/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.GraduationPlan table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class IncidentLocationDescriptor : Entities.Common.EdFi.IIncidentLocationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class GraduationPlan : Entities.Common.EdFi.IGraduationPlan, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "IncidentLocationDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlan"); // Fluent validator instance (threadsafe) - private static IncidentLocationDescriptorPutPostRequestValidator _validator = new IncidentLocationDescriptorPutPostRequestValidator(); + private static GraduationPlanPutPostRequestValidator _validator = new GraduationPlanPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -81310,6 +79653,13 @@ public class IncidentLocationDescriptor : Entities.Common.EdFi.IIncidentLocation // Constructor // ------------------------------------------------------------- + public GraduationPlan() + { + GraduationPlanCreditsByCourses = new List(); + GraduationPlanCreditsByCreditCategories = new List(); + GraduationPlanCreditsBySubjects = new List(); + GraduationPlanRequiredAssessments = new List(); + } // ------------------------------------------------------------ @@ -81318,7 +79668,7 @@ public class IncidentLocationDescriptor : Entities.Common.EdFi.IIncidentLocation // ------------------------------------------------------------ /// - /// The unique identifier for the IncidentLocationDescriptor resource. + /// The unique identifier for the GraduationPlan resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -81328,6 +79678,73 @@ public class IncidentLocationDescriptor : Entities.Common.EdFi.IIncidentLocation // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } + private bool _graduationSchoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _graduationSchoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitGraduationSchoolYearTypeReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_graduationSchoolYearTypeReference == null && !_graduationSchoolYearTypeReferenceExplicitlyAssigned) + _graduationSchoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + + return _graduationSchoolYearTypeReference; + } + } + + [DataMember(Name="graduationSchoolYearTypeReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public SchoolYearType.EdFi.SchoolYearTypeReference GraduationSchoolYearTypeReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitGraduationSchoolYearTypeReference != null + && (_graduationSchoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGraduationSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitGraduationSchoolYearTypeReference; + + return null; + } + set + { + _graduationSchoolYearTypeReferenceExplicitlyAssigned = true; + _graduationSchoolYearTypeReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -81335,16 +79752,62 @@ public class IncidentLocationDescriptor : Entities.Common.EdFi.IIncidentLocation // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int IncidentLocationDescriptorId { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IGraduationPlan.EducationOrganizationId + { + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; - int IDescriptor.DescriptorId + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } + + /// + /// The type of academic plan the student is following for graduation. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="graduationPlanTypeDescriptor")][DescriptorExists("GraduationPlanTypeDescriptor")] + public string GraduationPlanTypeDescriptor { get; set; } + + /// + /// The school year the student is expected to graduate. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IGraduationPlan.GraduationSchoolYear { - get { return IncidentLocationDescriptorId; } - set { IncidentLocationDescriptorId = value; } + get + { + if (ImplicitGraduationSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGraduationSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitGraduationSchoolYearTypeReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GraduationSchoolYearType + _graduationSchoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitGraduationSchoolYearTypeReference.SchoolYear = value; + } } // ------------------------------------------------------------- @@ -81360,7 +79823,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IIncidentLocationDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlan; if (ReferenceEquals(this, compareTo)) return true; @@ -81369,8 +79832,18 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IIncidentLocationDescriptor).IncidentLocationDescriptorId.Equals(compareTo.IncidentLocationDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IGraduationPlan).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlan).GraduationPlanTypeDescriptor, compareTo.GraduationPlanTypeDescriptor)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IGraduationPlan).GraduationSchoolYear.Equals(compareTo.GraduationSchoolYear)) return false; @@ -81387,9 +79860,15 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IIncidentLocationDescriptor).IncidentLocationDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlan).EducationOrganizationId); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlan).GraduationPlanTypeDescriptor); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlan).GraduationSchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -81397,61 +79876,63 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The description of the descriptor. + /// An indicator of whether the graduation plan is tailored for an individual. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [DataMember(Name="individualPlan")] + public bool? IndividualPlan { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="totalRequiredCreditConversion")] + public decimal? TotalRequiredCreditConversion { get; set; } + + private bool _totalRequiredCreditsExplicitlyAssigned = false; + private decimal _totalRequiredCredits; /// - /// The end date of the period when the descriptor is in effect. + /// The value of credits or units of value awarded for the completion of a course. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="totalRequiredCredits")] + public decimal TotalRequiredCredits + { + get => _totalRequiredCredits; + set + { + _totalRequiredCredits = value; + _totalRequiredCreditsExplicitlyAssigned = true; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The type of credits or units of value awarded for the completion of a course. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="totalRequiredCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string TotalRequiredCreditTypeDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_totalRequiredCreditsExplicitlyAssigned) + { + yield return "TotalRequiredCredits"; + } + } // ============================================================= // One-to-one relationships @@ -81471,106 +79952,436 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlan")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ + private ICollection _graduationPlanCreditsByCourses; + private ICollection _graduationPlanCreditsByCoursesCovariant; - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) + [NoDuplicateMembers] + [DataMember(Name="creditsByCourses")] + public ICollection GraduationPlanCreditsByCourses { - return Entities.Common.EdFi.IncidentLocationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIncidentLocationDescriptor)target); + get { return _graduationPlanCreditsByCourses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourse)e.Item).GraduationPlan = this); + _graduationPlanCreditsByCourses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourse)e.Item).GraduationPlan = this; + _graduationPlanCreditsByCoursesCovariant = covariantList; + } } - void IMappable.Map(object target) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCourses { - Entities.Common.EdFi.IncidentLocationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIncidentLocationDescriptor)target, null); + get { return _graduationPlanCreditsByCoursesCovariant; } + set { GraduationPlanCreditsByCourses = new List(value.Cast()); } } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - // ================================================================= - // Validators - // ----------------------------------------------------------------- + private ICollection _graduationPlanCreditsByCreditCategories; + private ICollection _graduationPlanCreditsByCreditCategoriesCovariant; - [ExcludeFromCodeCoverage] - public class IncidentLocationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + [NoDuplicateMembers] + [DataMember(Name="creditsByCreditCategories")] + public ICollection GraduationPlanCreditsByCreditCategories { - if (context.InstanceToValidate == null) + get { return _graduationPlanCreditsByCreditCategories; } + set { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)e.Item).GraduationPlan = this); + _graduationPlanCreditsByCreditCategories = list; - return false; + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)e.Item).GraduationPlan = this; + _graduationPlanCreditsByCreditCategoriesCovariant = covariantList; } + } - var instance = context.InstanceToValidate; + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsByCreditCategories + { + get { return _graduationPlanCreditsByCreditCategoriesCovariant; } + set { GraduationPlanCreditsByCreditCategories = new List(value.Cast()); } + } - var failures = new List(); + private ICollection _graduationPlanCreditsBySubjects; + private ICollection _graduationPlanCreditsBySubjectsCovariant; - if (failures.Any()) + [NoDuplicateMembers] + [DataMember(Name="creditsBySubjects")] + public ICollection GraduationPlanCreditsBySubjects + { + get { return _graduationPlanCreditsBySubjects; } + set { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsBySubject)e.Item).GraduationPlan = this); + _graduationPlanCreditsBySubjects = list; - return false; + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsBySubject)e.Item).GraduationPlan = this; + _graduationPlanCreditsBySubjectsCovariant = covariantList; } + } - return true; + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanCreditsBySubjects + { + get { return _graduationPlanCreditsBySubjectsCovariant; } + set { GraduationPlanCreditsBySubjects = new List(value.Cast()); } } - } - // ----------------------------------------------------------------- -} -// Aggregate: IndicatorDescriptor + private ICollection _graduationPlanRequiredAssessments; + private ICollection _graduationPlanRequiredAssessmentsCovariant; -namespace EdFi.Ods.Api.Common.Models.Resources.IndicatorDescriptor.EdFi -{ - /// - /// A class which represents the edfi.IndicatorDescriptor table of the IndicatorDescriptor aggregate in the ODS Database. + [NoDuplicateMembers] + [DataMember(Name="requiredAssessments")] + public ICollection GraduationPlanRequiredAssessments + { + get { return _graduationPlanRequiredAssessments; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessment)e.Item).GraduationPlan = this); + _graduationPlanRequiredAssessments = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessment)e.Item).GraduationPlan = this; + _graduationPlanRequiredAssessmentsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlan.GraduationPlanRequiredAssessments + { + get { return _graduationPlanRequiredAssessmentsCovariant; } + set { GraduationPlanRequiredAssessments = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_graduationPlanCreditsByCourses != null) foreach (var item in _graduationPlanCreditsByCourses) + { + item.GraduationPlan = this; + } + + if (_graduationPlanCreditsByCreditCategories != null) foreach (var item in _graduationPlanCreditsByCreditCategories) + { + item.GraduationPlan = this; + } + + if (_graduationPlanCreditsBySubjects != null) foreach (var item in _graduationPlanCreditsBySubjects) + { + item.GraduationPlan = this; + } + + if (_graduationPlanRequiredAssessments != null) foreach (var item in _graduationPlanRequiredAssessments) + { + item.GraduationPlan = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.GraduationPlanMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlan)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.GraduationPlanMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlan)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IGraduationPlan.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IGraduationPlan.GraduationSchoolYearTypeResourceId + { + get { return null; } + set { ImplicitGraduationSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (GraduationPlanCreditsByCourses.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsByCourses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GraduationPlanCreditsByCourses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsByCourses, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsByCourses")))) + { + yield return result; + } + } + + if (GraduationPlanCreditsByCreditCategories.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsByCreditCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GraduationPlanCreditsByCreditCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsByCreditCategories, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsByCreditCategories")))) + { + yield return result; + } + } + + if (GraduationPlanCreditsBySubjects.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsBySubjects") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GraduationPlanCreditsBySubjects"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsBySubjects, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsBySubjects")))) + { + yield return result; + } + } + + if (GraduationPlanRequiredAssessments.Any() && mappingContract?.IsMemberSupported("GraduationPlanRequiredAssessments") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GraduationPlanRequiredAssessments"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanRequiredAssessments, validationContext, validationContext.Items.ForCollection("GraduationPlanRequiredAssessments")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class GraduationPlanPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_GraduationPlan = new FullName("edfi", "GraduationPlan"); + + // Declare collection item validators + private GraduationPlanCreditsByCoursePutPostRequestValidator _graduationPlanCreditsByCoursesValidator = new (); + private GraduationPlanCreditsByCreditCategoryPutPostRequestValidator _graduationPlanCreditsByCreditCategoriesValidator = new (); + private GraduationPlanCreditsBySubjectPutPostRequestValidator _graduationPlanCreditsBySubjectsValidator = new (); + private GraduationPlanRequiredAssessmentPutPostRequestValidator _graduationPlanRequiredAssessmentsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (GraduationPlanMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_GraduationPlan); + + if (mappingContract != null) + { + if (mappingContract.IsGraduationPlanCreditsByCourseIncluded != null) + { + var hasInvalidGraduationPlanCreditsByCoursesItems = instance.GraduationPlanCreditsByCourses.Any(x => !mappingContract.IsGraduationPlanCreditsByCourseIncluded(x)); + + if (hasInvalidGraduationPlanCreditsByCoursesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GraduationPlanCreditsByCourses", $"A supplied 'GraduationPlanCreditsByCourse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsGraduationPlanCreditsByCreditCategoryIncluded != null) + { + var hasInvalidGraduationPlanCreditsByCreditCategoriesItems = instance.GraduationPlanCreditsByCreditCategories.Any(x => !mappingContract.IsGraduationPlanCreditsByCreditCategoryIncluded(x)); + + if (hasInvalidGraduationPlanCreditsByCreditCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GraduationPlanCreditsByCreditCategories", $"A supplied 'GraduationPlanCreditsByCreditCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsGraduationPlanCreditsBySubjectIncluded != null) + { + var hasInvalidGraduationPlanCreditsBySubjectsItems = instance.GraduationPlanCreditsBySubjects.Any(x => !mappingContract.IsGraduationPlanCreditsBySubjectIncluded(x)); + + if (hasInvalidGraduationPlanCreditsBySubjectsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GraduationPlanCreditsBySubjects", $"A supplied 'GraduationPlanCreditsBySubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsGraduationPlanRequiredAssessmentIncluded != null) + { + var hasInvalidGraduationPlanRequiredAssessmentsItems = instance.GraduationPlanRequiredAssessments.Any(x => !mappingContract.IsGraduationPlanRequiredAssessmentIncluded(x)); + + if (hasInvalidGraduationPlanRequiredAssessmentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GraduationPlanRequiredAssessments", $"A supplied 'GraduationPlanRequiredAssessment' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.GraduationPlanCreditsByCourse table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class IndicatorDescriptor : Entities.Common.EdFi.IIndicatorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class GraduationPlanCreditsByCourse : Entities.Common.EdFi.IGraduationPlanCreditsByCourse, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "IndicatorDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsByCourse"); // Fluent validator instance (threadsafe) - private static IndicatorDescriptorPutPostRequestValidator _validator = new IndicatorDescriptorPutPostRequestValidator(); + private static GraduationPlanCreditsByCoursePutPostRequestValidator _validator = new GraduationPlanCreditsByCoursePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -81581,19 +80392,16 @@ public class IndicatorDescriptor : Entities.Common.EdFi.IIndicatorDescriptor, En // Constructor // ------------------------------------------------------------- + public GraduationPlanCreditsByCourse() + { + GraduationPlanCreditsByCourseCourses = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the IndicatorDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -81604,19 +80412,33 @@ public class IndicatorDescriptor : Entities.Common.EdFi.IIndicatorDescriptor, En //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGraduationPlan _graduationPlan; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int IndicatorDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPlan + { + get { return _graduationPlan; } + set { SetGraduationPlan(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IGraduationPlan GraduationPlan { - get { return IndicatorDescriptorId; } - set { IndicatorDescriptorId = value; } + set { SetGraduationPlan(value); } + } + + private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + { + _graduationPlan = value; } + + /// + /// Identifying name given to a collection of courses. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(120, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="courseSetName")] + public string CourseSetName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -81631,7 +80453,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IIndicatorDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsByCourse; if (ReferenceEquals(this, compareTo)) return true; @@ -81639,9 +80461,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IIndicatorDescriptor).IndicatorDescriptorId.Equals(compareTo.IndicatorDescriptorId)) + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourse).CourseSetName, compareTo.CourseSetName)) return false; @@ -81657,9 +80483,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_graduationPlan != null) + hash.Add(_graduationPlan); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IIndicatorDescriptor).IndicatorDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourse).CourseSetName); return hash.ToHashCode(); } @@ -81668,61 +80497,64 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The description of the descriptor. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="creditConversion")] + public decimal? CreditConversion { get; set; } + + private bool _creditsExplicitlyAssigned = false; + private decimal _credits; /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The value of credits or units of value awarded for the completion of a course. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="credits")] + public decimal Credits + { + get => _credits; + set + { + _credits = value; + _creditsExplicitlyAssigned = true; + } + } - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The type of credits or units of value awarded for the completion of a course. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="creditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string CreditTypeDescriptor { get; set; } /// - /// A shortened description for the descriptor. + /// The grade level when the student is planned to take the course. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="whenTakenGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string WhenTakenGradeLevelDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_creditsExplicitlyAssigned) + { + yield return "Credits"; + } + } // ============================================================= // One-to-one relationships @@ -81742,33 +80574,64 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsByCourse")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _graduationPlanCreditsByCourseCourses; + private ICollection _graduationPlanCreditsByCourseCoursesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="courses")] + public ICollection GraduationPlanCreditsByCourseCourses + { + get { return _graduationPlanCreditsByCourseCourses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)e.Item).GraduationPlanCreditsByCourse = this); + _graduationPlanCreditsByCourseCourses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)e.Item).GraduationPlanCreditsByCourse = this; + _graduationPlanCreditsByCourseCoursesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlanCreditsByCourse.GraduationPlanCreditsByCourseCourses + { + get { return _graduationPlanCreditsByCourseCoursesCovariant; } + set { GraduationPlanCreditsByCourseCourses = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_graduationPlanCreditsByCourseCourses != null) foreach (var item in _graduationPlanCreditsByCourseCourses) + { + item.GraduationPlanCreditsByCourse = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -81776,12 +80639,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.IndicatorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIndicatorDescriptor)target); + return Entities.Common.EdFi.GraduationPlanCreditsByCourseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourse)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.IndicatorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIndicatorDescriptor)target, null); + Entities.Common.EdFi.GraduationPlanCreditsByCourseMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourse)target, null); } // ------------------------------------------------------------- @@ -81789,6 +80652,78 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (GraduationPlanCreditsByCourseCourses.Any() && mappingContract?.IsMemberSupported("GraduationPlanCreditsByCourseCourses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GraduationPlanCreditsByCourseCourses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanCreditsByCourseCourses, validationContext, validationContext.Items.ForCollection("GraduationPlanCreditsByCourseCourses")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -81796,9 +80731,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class IndicatorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GraduationPlanCreditsByCoursePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_GraduationPlanCreditsByCourse = new FullName("edfi", "GraduationPlanCreditsByCourse"); + + // Declare collection item validators + private GraduationPlanCreditsByCourseCoursePutPostRequestValidator _graduationPlanCreditsByCourseCoursesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -81811,6 +80751,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (GraduationPlanCreditsByCourseMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_GraduationPlanCreditsByCourse); + + if (mappingContract != null) + { + if (mappingContract.IsGraduationPlanCreditsByCourseCourseIncluded != null) + { + var hasInvalidGraduationPlanCreditsByCourseCoursesItems = instance.GraduationPlanCreditsByCourseCourses.Any(x => !mappingContract.IsGraduationPlanCreditsByCourseCourseIncluded(x)); + + if (hasInvalidGraduationPlanCreditsByCourseCoursesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GraduationPlanCreditsByCourseCourses", $"A supplied 'GraduationPlanCreditsByCourseCourse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -81826,22 +80788,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.IndicatorGroupDescriptor table of the IndicatorGroupDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GraduationPlanCreditsByCourseCourse table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class IndicatorGroupDescriptor : Entities.Common.EdFi.IIndicatorGroupDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GraduationPlanCreditsByCourseCourse : Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "IndicatorGroupDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsByCourseCourse"); // Fluent validator instance (threadsafe) - private static IndicatorGroupDescriptorPutPostRequestValidator _validator = new IndicatorGroupDescriptorPutPostRequestValidator(); + private static GraduationPlanCreditsByCourseCoursePutPostRequestValidator _validator = new GraduationPlanCreditsByCourseCoursePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -81858,35 +80815,117 @@ public class IndicatorGroupDescriptor : Entities.Common.EdFi.IIndicatorGroupDesc // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the IndicatorGroupDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _courseReferenceExplicitlyAssigned; + private Course.EdFi.CourseReference _courseReference; + private Course.EdFi.CourseReference ImplicitCourseReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_courseReference == null && !_courseReferenceExplicitlyAssigned) + _courseReference = new Course.EdFi.CourseReference(); + + return _courseReference; + } + } + + [DataMember(Name="courseReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Course.EdFi.CourseReference CourseReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCourseReference != null + && (_courseReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + return ImplicitCourseReference; + + return null; + } + set + { + _courseReferenceExplicitlyAssigned = true; + _courseReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGraduationPlanCreditsByCourse _graduationPlanCreditsByCourse; + + [IgnoreDataMember] + Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCourseCourse.GraduationPlanCreditsByCourse + { + get { return _graduationPlanCreditsByCourse; } + set { SetGraduationPlanCreditsByCourse(value); } + } + + public Entities.Common.EdFi.IGraduationPlanCreditsByCourse GraduationPlanCreditsByCourse + { + set { SetGraduationPlanCreditsByCourse(value); } + } + + private void SetGraduationPlanCreditsByCourse(Entities.Common.EdFi.IGraduationPlanCreditsByCourse value) + { + _graduationPlanCreditsByCourse = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// A unique alphanumeric code assigned to a course. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int IndicatorGroupDescriptorId { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseCode + { + get + { + if (ImplicitCourseReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + return ImplicitCourseReference.CourseCode; - int IDescriptor.DescriptorId + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Course + _courseReferenceExplicitlyAssigned = false; + ImplicitCourseReference.CourseCode = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseEducationOrganizationId { - get { return IndicatorGroupDescriptorId; } - set { IndicatorGroupDescriptorId = value; } + get + { + if (ImplicitCourseReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseReference.IsReferenceFullyDefined())) + return ImplicitCourseReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Course + _courseReferenceExplicitlyAssigned = false; + ImplicitCourseReference.EducationOrganizationId = value; + } } // ------------------------------------------------------------- @@ -81902,7 +80941,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IIndicatorGroupDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse; if (ReferenceEquals(this, compareTo)) return true; @@ -81910,9 +80949,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_graduationPlanCreditsByCourse == null || !_graduationPlanCreditsByCourse.Equals(compareTo.GraduationPlanCreditsByCourse)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IIndicatorGroupDescriptor).IndicatorGroupDescriptorId.Equals(compareTo.IndicatorGroupDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseCode, compareTo.CourseCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseEducationOrganizationId.Equals(compareTo.CourseEducationOrganizationId)) return false; @@ -81928,10 +80976,15 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_graduationPlanCreditsByCourse != null) + hash.Add(_graduationPlanCreditsByCourse); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IIndicatorGroupDescriptor).IndicatorGroupDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseCode); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse).CourseEducationOrganizationId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -81939,55 +80992,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82013,11 +81017,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsByCourseCourse")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82028,13 +81029,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -82047,19 +81041,93 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.IndicatorGroupDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIndicatorGroupDescriptor)target); + return Entities.Common.EdFi.GraduationPlanCreditsByCourseCourseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.IndicatorGroupDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIndicatorGroupDescriptor)target, null); + Entities.Common.EdFi.GraduationPlanCreditsByCourseCourseMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseResourceId + { + get { return null; } + set { ImplicitCourseReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse.CourseDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitCourseReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -82067,9 +81135,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class IndicatorGroupDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GraduationPlanCreditsByCourseCoursePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -82097,22 +81165,18 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.IndicatorLevelDescriptor table of the IndicatorLevelDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GraduationPlanCreditsByCreditCategory table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class IndicatorLevelDescriptor : Entities.Common.EdFi.IIndicatorLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class GraduationPlanCreditsByCreditCategory : Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "IndicatorLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsByCreditCategory"); // Fluent validator instance (threadsafe) - private static IndicatorLevelDescriptorPutPostRequestValidator _validator = new IndicatorLevelDescriptorPutPostRequestValidator(); + private static GraduationPlanCreditsByCreditCategoryPutPostRequestValidator _validator = new GraduationPlanCreditsByCreditCategoryPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -82129,13 +81193,6 @@ public class IndicatorLevelDescriptor : Entities.Common.EdFi.IIndicatorLevelDesc // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the IndicatorLevelDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -82146,19 +81203,33 @@ public class IndicatorLevelDescriptor : Entities.Common.EdFi.IIndicatorLevelDesc //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGraduationPlan _graduationPlan; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int IndicatorLevelDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCreditCategory.GraduationPlan + { + get { return _graduationPlan; } + set { SetGraduationPlan(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IGraduationPlan GraduationPlan { - get { return IndicatorLevelDescriptorId; } - set { IndicatorLevelDescriptorId = value; } + set { SetGraduationPlan(value); } + } + + private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + { + _graduationPlan = value; } + + /// + /// A categorization for the course transcript credits awarded in the course transcript. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="creditCategoryDescriptor")][DescriptorExists("CreditCategoryDescriptor")] + public string CreditCategoryDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82173,7 +81244,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IIndicatorLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory; if (ReferenceEquals(this, compareTo)) return true; @@ -82181,9 +81252,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IIndicatorLevelDescriptor).IndicatorLevelDescriptorId.Equals(compareTo.IndicatorLevelDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory).CreditCategoryDescriptor, compareTo.CreditCategoryDescriptor)) return false; @@ -82199,9 +81274,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_graduationPlan != null) + hash.Add(_graduationPlan); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IIndicatorLevelDescriptor).IndicatorLevelDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory).CreditCategoryDescriptor); return hash.ToHashCode(); } @@ -82210,61 +81288,56 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="creditConversion")] + public decimal? CreditConversion { get; set; } + + private bool _creditsExplicitlyAssigned = false; + private decimal _credits; /// - /// The description of the descriptor. + /// The value of credits or units of value awarded for the completion of a course. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="credits")] + public decimal Credits + { + get => _credits; + set + { + _credits = value; + _creditsExplicitlyAssigned = true; + } + } + /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The type of credits or units of value awarded for the completion of a course. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="creditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string CreditTypeDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_creditsExplicitlyAssigned) + { + yield return "Credits"; + } + } // ============================================================= // One-to-one relationships @@ -82284,11 +81357,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsByCreditCategory")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82299,13 +81369,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -82318,12 +81381,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.IndicatorLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIndicatorLevelDescriptor)target); + return Entities.Common.EdFi.GraduationPlanCreditsByCreditCategoryMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.IndicatorLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIndicatorLevelDescriptor)target, null); + Entities.Common.EdFi.GraduationPlanCreditsByCreditCategoryMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory)target, null); } // ------------------------------------------------------------- @@ -82331,6 +81394,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -82338,9 +81461,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class IndicatorLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GraduationPlanCreditsByCreditCategoryPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -82368,22 +81491,18 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InstitutionTelephoneNumberTypeDescriptor table of the InstitutionTelephoneNumberTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GraduationPlanCreditsBySubject table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InstitutionTelephoneNumberTypeDescriptor : Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class GraduationPlanCreditsBySubject : Entities.Common.EdFi.IGraduationPlanCreditsBySubject, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InstitutionTelephoneNumberTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlanCreditsBySubject"); // Fluent validator instance (threadsafe) - private static InstitutionTelephoneNumberTypeDescriptorPutPostRequestValidator _validator = new InstitutionTelephoneNumberTypeDescriptorPutPostRequestValidator(); + private static GraduationPlanCreditsBySubjectPutPostRequestValidator _validator = new GraduationPlanCreditsBySubjectPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -82400,13 +81519,6 @@ public class InstitutionTelephoneNumberTypeDescriptor : Entities.Common.EdFi.IIn // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the InstitutionTelephoneNumberTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -82417,19 +81529,33 @@ public class InstitutionTelephoneNumberTypeDescriptor : Entities.Common.EdFi.IIn //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGraduationPlan _graduationPlan; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int InstitutionTelephoneNumberTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsBySubject.GraduationPlan + { + get { return _graduationPlan; } + set { SetGraduationPlan(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IGraduationPlan GraduationPlan { - get { return InstitutionTelephoneNumberTypeDescriptorId; } - set { InstitutionTelephoneNumberTypeDescriptorId = value; } + set { SetGraduationPlan(value); } + } + + private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + { + _graduationPlan = value; } + + /// + /// The intended major subject area of the graduation requirement. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82444,7 +81570,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanCreditsBySubject; if (ReferenceEquals(this, compareTo)) return true; @@ -82452,9 +81578,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor).InstitutionTelephoneNumberTypeDescriptorId.Equals(compareTo.InstitutionTelephoneNumberTypeDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlanCreditsBySubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) return false; @@ -82470,9 +81600,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_graduationPlan != null) + hash.Add(_graduationPlan); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor).InstitutionTelephoneNumberTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanCreditsBySubject).AcademicSubjectDescriptor); return hash.ToHashCode(); } @@ -82481,61 +81614,56 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="creditConversion")] + public decimal? CreditConversion { get; set; } + + private bool _creditsExplicitlyAssigned = false; + private decimal _credits; /// - /// The end date of the period when the descriptor is in effect. + /// The value of credits or units of value awarded for the completion of a course. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="credits")] + public decimal Credits + { + get => _credits; + set + { + _credits = value; + _creditsExplicitlyAssigned = true; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The type of credits or units of value awarded for the completion of a course. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="creditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string CreditTypeDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_creditsExplicitlyAssigned) + { + yield return "Credits"; + } + } // ============================================================= // One-to-one relationships @@ -82555,11 +81683,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanCreditsBySubject")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82570,13 +81695,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -82589,12 +81707,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InstitutionTelephoneNumberTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor)target); + return Entities.Common.EdFi.GraduationPlanCreditsBySubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsBySubject)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InstitutionTelephoneNumberTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor)target, null); + Entities.Common.EdFi.GraduationPlanCreditsBySubjectMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanCreditsBySubject)target, null); } // ------------------------------------------------------------- @@ -82602,6 +81720,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -82609,9 +81787,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InstitutionTelephoneNumberTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GraduationPlanCreditsBySubjectPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -82639,22 +81817,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InteractivityStyleDescriptor table of the InteractivityStyleDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GraduationPlanRequiredAssessment table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InteractivityStyleDescriptor : Entities.Common.EdFi.IInteractivityStyleDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GraduationPlanRequiredAssessment : Entities.Common.EdFi.IGraduationPlanRequiredAssessment, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InteractivityStyleDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlanRequiredAssessment"); // Fluent validator instance (threadsafe) - private static InteractivityStyleDescriptorPutPostRequestValidator _validator = new InteractivityStyleDescriptorPutPostRequestValidator(); + private static GraduationPlanRequiredAssessmentPutPostRequestValidator _validator = new GraduationPlanRequiredAssessmentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -82665,41 +81838,127 @@ public class InteractivityStyleDescriptor : Entities.Common.EdFi.IInteractivityS // Constructor // ------------------------------------------------------------- + public GraduationPlanRequiredAssessment() + { + GraduationPlanRequiredAssessmentScores = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the InteractivityStyleDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _assessmentReferenceExplicitlyAssigned; + private Assessment.EdFi.AssessmentReference _assessmentReference; + private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) + _assessmentReference = new Assessment.EdFi.AssessmentReference(); + + return _assessmentReference; + } + } + + [DataMember(Name="assessmentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Assessment.EdFi.AssessmentReference AssessmentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssessmentReference != null + && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference; + + return null; + } + set + { + _assessmentReferenceExplicitlyAssigned = true; + _assessmentReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGraduationPlan _graduationPlan; + + [IgnoreDataMember] + Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.GraduationPlan + { + get { return _graduationPlan; } + set { SetGraduationPlan(value); } + } + + public Entities.Common.EdFi.IGraduationPlan GraduationPlan + { + set { SetGraduationPlan(value); } + } + + private void SetGraduationPlan(Entities.Common.EdFi.IGraduationPlan value) + { + _graduationPlan = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// A unique number or alphanumeric code assigned to an assessment. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int InteractivityStyleDescriptorId { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentIdentifier + { + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.AssessmentIdentifier; - int IDescriptor.DescriptorId + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.AssessmentIdentifier = value; + } + } + + /// + /// Namespace for the assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.Namespace { - get { return InteractivityStyleDescriptorId; } - set { InteractivityStyleDescriptorId = value; } + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.Namespace; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.Namespace = value; + } } // ------------------------------------------------------------- @@ -82715,7 +81974,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInteractivityStyleDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanRequiredAssessment; if (ReferenceEquals(this, compareTo)) return true; @@ -82723,9 +81982,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_graduationPlan == null || !_graduationPlan.Equals(compareTo.GraduationPlan)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IInteractivityStyleDescriptor).InteractivityStyleDescriptorId.Equals(compareTo.InteractivityStyleDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).Namespace, compareTo.Namespace)) return false; @@ -82741,10 +82009,15 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_graduationPlan != null) + hash.Add(_graduationPlan); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IInteractivityStyleDescriptor).InteractivityStyleDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).AssessmentIdentifier); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessment).Namespace); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -82752,55 +82025,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -82811,6 +82035,19 @@ public override int GetHashCode() // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + /// + /// performanceLevel + /// + + [DataMember(Name = "performanceLevel")] + public GraduationPlanRequiredAssessmentPerformanceLevel GraduationPlanRequiredAssessmentPerformanceLevel { get; set; } + + Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentPerformanceLevel + { + get { return GraduationPlanRequiredAssessmentPerformanceLevel; } + set { GraduationPlanRequiredAssessmentPerformanceLevel = (GraduationPlanRequiredAssessmentPerformanceLevel) value; } + } + // ------------------------------------------------------------- // ============================================================= @@ -82826,33 +82063,64 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanRequiredAssessment")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _graduationPlanRequiredAssessmentScores; + private ICollection _graduationPlanRequiredAssessmentScoresCovariant; + + [NoDuplicateMembers] + [DataMember(Name="scores")] + public ICollection GraduationPlanRequiredAssessmentScores + { + get { return _graduationPlanRequiredAssessmentScores; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)e.Item).GraduationPlanRequiredAssessment = this); + _graduationPlanRequiredAssessmentScores = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)e.Item).GraduationPlanRequiredAssessment = this; + _graduationPlanRequiredAssessmentScoresCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGraduationPlanRequiredAssessment.GraduationPlanRequiredAssessmentScores + { + get { return _graduationPlanRequiredAssessmentScoresCovariant; } + set { GraduationPlanRequiredAssessmentScores = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_graduationPlanRequiredAssessmentScores != null) foreach (var item in _graduationPlanRequiredAssessmentScores) + { + item.GraduationPlanRequiredAssessment = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -82860,19 +82128,117 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InteractivityStyleDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInteractivityStyleDescriptor)target); + return Entities.Common.EdFi.GraduationPlanRequiredAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessment)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InteractivityStyleDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInteractivityStyleDescriptor)target, null); + Entities.Common.EdFi.GraduationPlanRequiredAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessment)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentResourceId + { + get { return null; } + set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssessmentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (GraduationPlanRequiredAssessmentScores.Any() && mappingContract?.IsMemberSupported("GraduationPlanRequiredAssessmentScores") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GraduationPlanRequiredAssessmentScores"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GraduationPlanRequiredAssessmentScores, validationContext, validationContext.Items.ForCollection("GraduationPlanRequiredAssessmentScores")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + if (GraduationPlanRequiredAssessmentPerformanceLevel != null && mappingContract?.IsMemberSupported("GraduationPlanRequiredAssessmentPerformanceLevel") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GraduationPlanRequiredAssessmentPerformanceLevel"); + + foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(GraduationPlanRequiredAssessmentPerformanceLevel, validationContext, validationContext.Items.ForEmbeddedObject("GraduationPlanRequiredAssessmentPerformanceLevel")))) + { + yield return result; + } + } + + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -82880,9 +82246,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InteractivityStyleDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GraduationPlanRequiredAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_GraduationPlanRequiredAssessment = new FullName("edfi", "GraduationPlanRequiredAssessment"); + + // Declare collection item validators + private GraduationPlanRequiredAssessmentScorePutPostRequestValidator _graduationPlanRequiredAssessmentScoresValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -82895,6 +82266,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (GraduationPlanRequiredAssessmentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_GraduationPlanRequiredAssessment); + + if (mappingContract != null) + { + if (mappingContract.IsGraduationPlanRequiredAssessmentScoreIncluded != null) + { + var hasInvalidGraduationPlanRequiredAssessmentScoresItems = instance.GraduationPlanRequiredAssessmentScores.Any(x => !mappingContract.IsGraduationPlanRequiredAssessmentScoreIncluded(x)); + + if (hasInvalidGraduationPlanRequiredAssessmentScoresItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GraduationPlanRequiredAssessmentScores", $"A supplied 'GraduationPlanRequiredAssessmentScore' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -82910,22 +82303,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InternetAccessDescriptor table of the InternetAccessDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GraduationPlanRequiredAssessmentPerformanceLevel table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InternetAccessDescriptor : Entities.Common.EdFi.IInternetAccessDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GraduationPlanRequiredAssessmentPerformanceLevel : Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InternetAccessDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlanRequiredAssessmentPerformanceLevel"); // Fluent validator instance (threadsafe) - private static InternetAccessDescriptorPutPostRequestValidator _validator = new InternetAccessDescriptorPutPostRequestValidator(); + private static GraduationPlanRequiredAssessmentPerformanceLevelPutPostRequestValidator _validator = new GraduationPlanRequiredAssessmentPerformanceLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -82942,13 +82330,6 @@ public class InternetAccessDescriptor : Entities.Common.EdFi.IInternetAccessDesc // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the InternetAccessDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -82959,18 +82340,23 @@ public class InternetAccessDescriptor : Entities.Common.EdFi.IInternetAccessDesc //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGraduationPlanRequiredAssessment _graduationPlanRequiredAssessment; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int InternetAccessDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentPerformanceLevel.GraduationPlanRequiredAssessment + { + get { return _graduationPlanRequiredAssessment; } + set { SetGraduationPlanRequiredAssessment(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IGraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { - get { return InternetAccessDescriptorId; } - set { InternetAccessDescriptorId = value; } + set { SetGraduationPlanRequiredAssessment(value); } + } + + private void SetGraduationPlanRequiredAssessment(Entities.Common.EdFi.IGraduationPlanRequiredAssessment value) + { + _graduationPlanRequiredAssessment = value; } // ------------------------------------------------------------- @@ -82986,7 +82372,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInternetAccessDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -82994,9 +82380,8 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Derived Property - if (!(this as Entities.Common.EdFi.IInternetAccessDescriptor).InternetAccessDescriptorId.Equals(compareTo.InternetAccessDescriptorId)) + // Parent Property + if (_graduationPlanRequiredAssessment == null || !_graduationPlanRequiredAssessment.Equals(compareTo.GraduationPlanRequiredAssessment)) return false; @@ -83012,10 +82397,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IInternetAccessDescriptor).InternetAccessDescriptorId); - + //Parent Property + if (_graduationPlanRequiredAssessment != null) + hash.Add(_graduationPlanRequiredAssessment); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -83023,60 +82407,61 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The method that the instructor of the class uses to report the performance and achievement of all students. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } /// - /// The description of the descriptor. + /// The maximum score to make the indicated level of performance. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maximumScore")] + public string MaximumScore { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The minimum score required to make the indicated level of performance. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="minimumScore")] + public string MinimumScore { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The performance level(s) defined for the assessment. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] + public string PerformanceLevelDescriptor { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The name of the indicator being measured for a collection of performance level values. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="performanceLevelIndicatorName")] + public string PerformanceLevelIndicatorName { get; set; } /// - /// A shortened description for the descriptor. + /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] + public string ResultDatatypeTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -83097,11 +82482,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanRequiredAssessmentPerformanceLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -83112,13 +82494,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -83131,12 +82506,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InternetAccessDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInternetAccessDescriptor)target); + return Entities.Common.EdFi.GraduationPlanRequiredAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InternetAccessDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInternetAccessDescriptor)target, null); + Entities.Common.EdFi.GraduationPlanRequiredAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel)target, null); } // ------------------------------------------------------------- @@ -83144,6 +82519,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -83151,9 +82586,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InternetAccessDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GraduationPlanRequiredAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -83181,22 +82616,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InternetAccessTypeInResidenceDescriptor table of the InternetAccessTypeInResidenceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GraduationPlanRequiredAssessmentScore table of the GraduationPlan aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InternetAccessTypeInResidenceDescriptor : Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GraduationPlanRequiredAssessmentScore : Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InternetAccessTypeInResidenceDescriptor"); + private static FullName _fullName = new FullName("edfi", "GraduationPlanRequiredAssessmentScore"); // Fluent validator instance (threadsafe) - private static InternetAccessTypeInResidenceDescriptorPutPostRequestValidator _validator = new InternetAccessTypeInResidenceDescriptorPutPostRequestValidator(); + private static GraduationPlanRequiredAssessmentScorePutPostRequestValidator _validator = new GraduationPlanRequiredAssessmentScorePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -83213,13 +82643,6 @@ public class InternetAccessTypeInResidenceDescriptor : Entities.Common.EdFi.IInt // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the InternetAccessTypeInResidenceDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -83230,19 +82653,33 @@ public class InternetAccessTypeInResidenceDescriptor : Entities.Common.EdFi.IInt //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IGraduationPlanRequiredAssessment _graduationPlanRequiredAssessment; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int InternetAccessTypeInResidenceDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentScore.GraduationPlanRequiredAssessment + { + get { return _graduationPlanRequiredAssessment; } + set { SetGraduationPlanRequiredAssessment(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IGraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { - get { return InternetAccessTypeInResidenceDescriptorId; } - set { InternetAccessTypeInResidenceDescriptorId = value; } + set { SetGraduationPlanRequiredAssessment(value); } + } + + private void SetGraduationPlanRequiredAssessment(Entities.Common.EdFi.IGraduationPlanRequiredAssessment value) + { + _graduationPlanRequiredAssessment = value; } + + /// + /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -83257,7 +82694,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore; if (ReferenceEquals(this, compareTo)) return true; @@ -83265,9 +82702,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_graduationPlanRequiredAssessment == null || !_graduationPlanRequiredAssessment.Equals(compareTo.GraduationPlanRequiredAssessment)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor).InternetAccessTypeInResidenceDescriptorId.Equals(compareTo.InternetAccessTypeInResidenceDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) return false; @@ -83283,9 +82724,308 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_graduationPlanRequiredAssessment != null) + hash.Add(_graduationPlanRequiredAssessment); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor).InternetAccessTypeInResidenceDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore).AssessmentReportingMethodDescriptor); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The maximum score possible on the assessment. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maximumScore")] + public string MaximumScore { get; set; } + + /// + /// The minimum score possible on the assessment. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="minimumScore")] + public string MinimumScore { get; set; } + + /// + /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] + public string ResultDatatypeTypeDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "GraduationPlan", "GraduationPlanRequiredAssessmentScore")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.GraduationPlanRequiredAssessmentScoreMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.GraduationPlanRequiredAssessmentScoreMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class GraduationPlanRequiredAssessmentScorePutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: GraduationPlanTypeDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.GraduationPlanTypeDescriptor.EdFi +{ + /// + /// A class which represents the edfi.GraduationPlanTypeDescriptor table of the GraduationPlanTypeDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class GraduationPlanTypeDescriptor : Entities.Common.EdFi.IGraduationPlanTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "GraduationPlanTypeDescriptor"); + + // Fluent validator instance (threadsafe) + private static GraduationPlanTypeDescriptorPutPostRequestValidator _validator = new GraduationPlanTypeDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the GraduationPlanTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int GraduationPlanTypeDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return GraduationPlanTypeDescriptorId; } + set { GraduationPlanTypeDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IGraduationPlanTypeDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IGraduationPlanTypeDescriptor).GraduationPlanTypeDescriptorId.Equals(compareTo.GraduationPlanTypeDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IGraduationPlanTypeDescriptor).GraduationPlanTypeDescriptorId); return hash.ToHashCode(); } @@ -83402,12 +83142,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InternetAccessTypeInResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor)target); + return Entities.Common.EdFi.GraduationPlanTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGraduationPlanTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InternetAccessTypeInResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor)target, null); + Entities.Common.EdFi.GraduationPlanTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGraduationPlanTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -83422,9 +83162,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InternetAccessTypeInResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GraduationPlanTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -83453,21 +83193,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InternetPerformanceInResidenceDescriptor table of the InternetPerformanceInResidenceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.GunFreeSchoolsActReportingStatusDescriptor table of the GunFreeSchoolsActReportingStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InternetPerformanceInResidenceDescriptor : Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class GunFreeSchoolsActReportingStatusDescriptor : Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InternetPerformanceInResidenceDescriptor"); + private static FullName _fullName = new FullName("edfi", "GunFreeSchoolsActReportingStatusDescriptor"); // Fluent validator instance (threadsafe) - private static InternetPerformanceInResidenceDescriptorPutPostRequestValidator _validator = new InternetPerformanceInResidenceDescriptorPutPostRequestValidator(); + private static GunFreeSchoolsActReportingStatusDescriptorPutPostRequestValidator _validator = new GunFreeSchoolsActReportingStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -83486,7 +83226,7 @@ public class InternetPerformanceInResidenceDescriptor : Entities.Common.EdFi.IIn // ------------------------------------------------------------ /// - /// The unique identifier for the InternetPerformanceInResidenceDescriptor resource. + /// The unique identifier for the GunFreeSchoolsActReportingStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -83507,12 +83247,12 @@ public class InternetPerformanceInResidenceDescriptor : Entities.Common.EdFi.IIn /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int InternetPerformanceInResidenceDescriptorId { get; set; } + public int GunFreeSchoolsActReportingStatusDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return InternetPerformanceInResidenceDescriptorId; } - set { InternetPerformanceInResidenceDescriptorId = value; } + get { return GunFreeSchoolsActReportingStatusDescriptorId; } + set { GunFreeSchoolsActReportingStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -83528,7 +83268,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -83538,7 +83278,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor).InternetPerformanceInResidenceDescriptorId.Equals(compareTo.InternetPerformanceInResidenceDescriptorId)) + if (!(this as Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor).GunFreeSchoolsActReportingStatusDescriptorId.Equals(compareTo.GunFreeSchoolsActReportingStatusDescriptorId)) return false; @@ -83556,7 +83296,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor).InternetPerformanceInResidenceDescriptorId); + hash.Add((this as Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor).GunFreeSchoolsActReportingStatusDescriptorId); return hash.ToHashCode(); } @@ -83673,12 +83413,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InternetPerformanceInResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor)target); + return Entities.Common.EdFi.GunFreeSchoolsActReportingStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InternetPerformanceInResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor)target, null); + Entities.Common.EdFi.GunFreeSchoolsActReportingStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -83693,9 +83433,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InternetPerformanceInResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class GunFreeSchoolsActReportingStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -83724,118 +83464,292 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Intervention resource. + /// A class which represents the edfi.HomelessPrimaryNighttimeResidenceDescriptor table of the HomelessPrimaryNighttimeResidenceDescriptor aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionReference : IResourceReference + public class HomelessPrimaryNighttimeResidenceDescriptor : Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + private static FullName _fullName = new FullName("edfi", "HomelessPrimaryNighttimeResidenceDescriptor"); - [DataMember(Name="interventionIdentificationCode")] - public string InterventionIdentificationCode { get; set; } + // Fluent validator instance (threadsafe) + private static HomelessPrimaryNighttimeResidenceDescriptorPutPostRequestValidator _validator = new HomelessPrimaryNighttimeResidenceDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ /// - /// Gets or sets the resource identifier of the referenced resource. + /// The unique identifier for the HomelessPrimaryNighttimeResidenceDescriptor resource. /// - public Guid ResourceId { get; set; } + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - public string Discriminator { get; set; } + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int HomelessPrimaryNighttimeResidenceDescriptorId { get; set; } + int IDescriptor.DescriptorId + { + get { return HomelessPrimaryNighttimeResidenceDescriptorId; } + set { HomelessPrimaryNighttimeResidenceDescriptorId = value; } + } + // ------------------------------------------------------------- - private Link _link; + // ============================================================= + // Equality + // ------------------------------------------------------------- - [DataMember(Name="link")] - public Link Link + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + var compareTo = obj as Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor; - return _link; - } + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor).HomelessPrimaryNighttimeResidenceDescriptorId.Equals(compareTo.HomelessPrimaryNighttimeResidenceDescriptorId)) + return false; + + + return true; } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Builds the hash code based on the unique identifying values. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - return EducationOrganizationId != default(long) && InterventionIdentificationCode != default(string); + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor).HomelessPrimaryNighttimeResidenceDescriptorId); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- - if (InterventionIdentificationCode == default) - { - yield return "InterventionIdentificationCode"; - } + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } } + // ------------------------------------------------------------- - private Link CreateLink() + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - var link = new Link - { - Rel = "Intervention", - Href = $"/ed-fi/interventions/{ResourceId:n}" - }; + return Entities.Common.EdFi.HomelessPrimaryNighttimeResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor)target); + } - if (string.IsNullOrEmpty(Discriminator)) - return link; + void IMappable.Map(object target) + { + Entities.Common.EdFi.HomelessPrimaryNighttimeResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor)target, null); + } + // ------------------------------------------------------------- - string[] linkParts = Discriminator.Split('.'); + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } - if (linkParts.Length < 2) - return link; + // ================================================================= + // Validators + // ----------------------------------------------------------------- - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + [ExcludeFromCodeCoverage] + public class HomelessPrimaryNighttimeResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- + +} +// Aggregate: HomelessProgramServiceDescriptor +namespace EdFi.Ods.Api.Common.Models.Resources.HomelessProgramServiceDescriptor.EdFi +{ /// - /// A class which represents the edfi.Intervention table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.HomelessProgramServiceDescriptor table of the HomelessProgramServiceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Intervention : Entities.Common.EdFi.IIntervention, IHasETag, IDateVersionedEntity, IValidatableObject + public class HomelessProgramServiceDescriptor : Entities.Common.EdFi.IHomelessProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "Intervention"); + private static FullName _fullName = new FullName("edfi", "HomelessProgramServiceDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionPutPostRequestValidator _validator = new InterventionPutPostRequestValidator(); + private static HomelessProgramServiceDescriptorPutPostRequestValidator _validator = new HomelessProgramServiceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -83846,19 +83760,6 @@ public class Intervention : Entities.Common.EdFi.IIntervention, IHasETag, IDateV // Constructor // ------------------------------------------------------------- - public Intervention() - { - InterventionAppropriateGradeLevels = new List(); - InterventionAppropriateSexes = new List(); - InterventionDiagnoses = new List(); - InterventionEducationContents = new List(); - InterventionInterventionPrescriptions = new List(); - InterventionLearningResourceMetadataURIs = new List(); - InterventionMeetingTimes = new List(); - InterventionPopulationServeds = new List(); - InterventionStaffs = new List(); - InterventionURIs = new List(); - } // ------------------------------------------------------------ @@ -83867,7 +83768,7 @@ public Intervention() // ------------------------------------------------------------ /// - /// The unique identifier for the Intervention resource. + /// The unique identifier for the HomelessProgramServiceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -83877,40 +83778,6 @@ public Intervention() // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -83918,38 +83785,17 @@ public EducationOrganization.EdFi.EducationOrganizationReference EducationOrgani // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IIntervention.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int HomelessProgramServiceDescriptorId { get; set; } - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } + int IDescriptor.DescriptorId + { + get { return HomelessProgramServiceDescriptorId; } + set { HomelessProgramServiceDescriptorId = value; } } - - /// - /// A unique number or alphanumeric code assigned to an intervention. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="interventionIdentificationCode")] - public string InterventionIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -83964,7 +83810,7 @@ long Entities.Common.EdFi.IIntervention.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IIntervention; + var compareTo = obj as Entities.Common.EdFi.IHomelessProgramServiceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -83973,13 +83819,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IIntervention).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IIntervention).InterventionIdentificationCode, compareTo.InterventionIdentificationCode)) + // Derived Property + if (!(this as Entities.Common.EdFi.IHomelessProgramServiceDescriptor).HomelessProgramServiceDescriptorId.Equals(compareTo.HomelessProgramServiceDescriptorId)) return false; @@ -83996,11 +83837,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IIntervention).EducationOrganizationId); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IIntervention).InterventionIdentificationCode); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IHomelessProgramServiceDescriptor).HomelessProgramServiceDescriptorId); return hash.ToHashCode(); } @@ -84009,66 +83847,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// The start date for the intervention implementation. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - /// - /// The way in which an intervention was implemented. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="deliveryMethodDescriptor")][DescriptorExists("DeliveryMethodDescriptor")] - public string DeliveryMethodDescriptor { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The end date for the intervention implementation. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The way in which an intervention is used: curriculum, supplement, or practice. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="interventionClassDescriptor")][DescriptorExists("InterventionClassDescriptor")] - public string InterventionClassDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The maximum duration of time in minutes that may be assigned for the intervention. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="maxDosage")] - public int? MaxDosage { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The minimum duration of time in minutes that may be assigned for the intervention. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="minDosage")] - public int? MinDosage { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// Namespace for the intervention. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -84089,313 +83921,287 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "Intervention")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _interventionAppropriateGradeLevels; - private ICollection _interventionAppropriateGradeLevelsCovariant; + // ------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="appropriateGradeLevels")] - public ICollection InterventionAppropriateGradeLevels - { - get { return _interventionAppropriateGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateGradeLevel)e.Item).Intervention = this); - _interventionAppropriateGradeLevels = list; + // ============================================================= + // Versioning + // ------------------------------------------------------------- - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateGradeLevel)e.Item).Intervention = this; - _interventionAppropriateGradeLevelsCovariant = covariantList; - } - } + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateGradeLevels - { - get { return _interventionAppropriateGradeLevelsCovariant; } - set { InterventionAppropriateGradeLevels = new List(value.Cast()); } - } + // ------------------------------------------------------------- - private ICollection _interventionAppropriateSexes; - private ICollection _interventionAppropriateSexesCovariant; + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ - [NoDuplicateMembers] - [DataMember(Name="appropriateSexes")] - public ICollection InterventionAppropriateSexes + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - get { return _interventionAppropriateSexes; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateSex)e.Item).Intervention = this); - _interventionAppropriateSexes = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateSex)e.Item).Intervention = this; - _interventionAppropriateSexesCovariant = covariantList; - } + return Entities.Common.EdFi.HomelessProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IHomelessProgramServiceDescriptor)target); } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateSexes + void IMappable.Map(object target) { - get { return _interventionAppropriateSexesCovariant; } - set { InterventionAppropriateSexes = new List(value.Cast()); } + Entities.Common.EdFi.HomelessProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IHomelessProgramServiceDescriptor)target, null); } + // ------------------------------------------------------------- - private ICollection _interventionDiagnoses; - private ICollection _interventionDiagnosesCovariant; + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } - [NoDuplicateMembers] - [DataMember(Name="diagnoses")] - public ICollection InterventionDiagnoses + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class HomelessProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - get { return _interventionDiagnoses; } - set + if (context.InstanceToValidate == null) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionDiagnosis)e.Item).Intervention = this); - _interventionDiagnoses = list; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionDiagnosis)e.Item).Intervention = this; - _interventionDiagnosesCovariant = covariantList; + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionDiagnoses - { - get { return _interventionDiagnosesCovariant; } - set { InterventionDiagnoses = new List(value.Cast()); } - } + var instance = context.InstanceToValidate; - private ICollection _interventionEducationContents; - private ICollection _interventionEducationContentsCovariant; + var failures = new List(); - [NoDuplicateMembers] - [DataMember(Name="educationContents")] - public ICollection InterventionEducationContents - { - get { return _interventionEducationContents; } - set + if (failures.Any()) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionEducationContent)e.Item).Intervention = this); - _interventionEducationContents = list; + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionEducationContent)e.Item).Intervention = this; - _interventionEducationContentsCovariant = covariantList; + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionEducationContents - { - get { return _interventionEducationContentsCovariant; } - set { InterventionEducationContents = new List(value.Cast()); } + return true; } + } + // ----------------------------------------------------------------- - private ICollection _interventionInterventionPrescriptions; - private ICollection _interventionInterventionPrescriptionsCovariant; +} +// Aggregate: IDEAPartDescriptor - [NoDuplicateMembers] - [DataMember(Name="interventionPrescriptions")] - public ICollection InterventionInterventionPrescriptions - { - get { return _interventionInterventionPrescriptions; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionInterventionPrescription)e.Item).Intervention = this); - _interventionInterventionPrescriptions = list; +namespace EdFi.Ods.Api.Common.Models.Resources.IDEAPartDescriptor.EdFi +{ + /// + /// A class which represents the edfi.IDEAPartDescriptor table of the IDEAPartDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class IDEAPartDescriptor : Entities.Common.EdFi.IIDEAPartDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "IDEAPartDescriptor"); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionInterventionPrescription)e.Item).Intervention = this; - _interventionInterventionPrescriptionsCovariant = covariantList; - } - } + // Fluent validator instance (threadsafe) + private static IDEAPartDescriptorPutPostRequestValidator _validator = new IDEAPartDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionInterventionPrescriptions - { - get { return _interventionInterventionPrescriptionsCovariant; } - set { InterventionInterventionPrescriptions = new List(value.Cast()); } - } + // ============================================================= + // Constructor + // ------------------------------------------------------------- - private ICollection _interventionLearningResourceMetadataURIs; - private ICollection _interventionLearningResourceMetadataURIsCovariant; + + // ------------------------------------------------------------ - [NoDuplicateMembers] - [DataMember(Name="learningResourceMetadataURIs")] - public ICollection InterventionLearningResourceMetadataURIs - { - get { return _interventionLearningResourceMetadataURIs; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)e.Item).Intervention = this); - _interventionLearningResourceMetadataURIs = list; + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)e.Item).Intervention = this; - _interventionLearningResourceMetadataURIsCovariant = covariantList; - } - } + /// + /// The unique identifier for the IDEAPartDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionLearningResourceMetadataURIs + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int IDEAPartDescriptorId { get; set; } + + int IDescriptor.DescriptorId { - get { return _interventionLearningResourceMetadataURIsCovariant; } - set { InterventionLearningResourceMetadataURIs = new List(value.Cast()); } + get { return IDEAPartDescriptorId; } + set { IDEAPartDescriptorId = value; } } + // ------------------------------------------------------------- - private ICollection _interventionMeetingTimes; - private ICollection _interventionMeetingTimesCovariant; + // ============================================================= + // Equality + // ------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="meetingTimes")] - public ICollection InterventionMeetingTimes + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get { return _interventionMeetingTimes; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionMeetingTime)e.Item).Intervention = this); - _interventionMeetingTimes = list; + var compareTo = obj as Entities.Common.EdFi.IIDEAPartDescriptor; - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionMeetingTime)e.Item).Intervention = this; - _interventionMeetingTimesCovariant = covariantList; - } - } + if (ReferenceEquals(this, compareTo)) + return true; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionMeetingTimes - { - get { return _interventionMeetingTimesCovariant; } - set { InterventionMeetingTimes = new List(value.Cast()); } - } + if (compareTo == null) + return false; - private ICollection _interventionPopulationServeds; - private ICollection _interventionPopulationServedsCovariant; - [NoDuplicateMembers] - [DataMember(Name="populationServeds")] - public ICollection InterventionPopulationServeds - { - get { return _interventionPopulationServeds; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPopulationServed)e.Item).Intervention = this); - _interventionPopulationServeds = list; + // Derived Property + if (!(this as Entities.Common.EdFi.IIDEAPartDescriptor).IDEAPartDescriptorId.Equals(compareTo.IDEAPartDescriptorId)) + return false; - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPopulationServed)e.Item).Intervention = this; - _interventionPopulationServedsCovariant = covariantList; - } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionPopulationServeds + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - get { return _interventionPopulationServedsCovariant; } - set { InterventionPopulationServeds = new List(value.Cast()); } + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IIDEAPartDescriptor).IDEAPartDescriptorId); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - private ICollection _interventionStaffs; - private ICollection _interventionStaffsCovariant; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="staffs")] - public ICollection InterventionStaffs - { - get { return _interventionStaffs; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStaff)e.Item).Intervention = this); - _interventionStaffs = list; + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStaff)e.Item).Intervention = this; - _interventionStaffsCovariant = covariantList; - } - } + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionStaffs - { - get { return _interventionStaffsCovariant; } - set { InterventionStaffs = new List(value.Cast()); } - } + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } - private ICollection _interventionURIs; - private ICollection _interventionURIsCovariant; + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } - [NoDuplicateMembers] - [DataMember(Name="uris")] - public ICollection InterventionURIs - { - get { return _interventionURIs; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionURI)e.Item).Intervention = this); - _interventionURIs = list; + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionURI)e.Item).Intervention = this; - _interventionURIsCovariant = covariantList; - } - } + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IIntervention.InterventionURIs - { - get { return _interventionURIsCovariant; } - set { InterventionURIs = new List(value.Cast()); } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } } + // ------------------------------------------------------------- + // ============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -84413,62 +84219,6 @@ public ICollection InterventionURIs // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_interventionAppropriateGradeLevels != null) foreach (var item in _interventionAppropriateGradeLevels) - { - item.Intervention = this; - } - - if (_interventionAppropriateSexes != null) foreach (var item in _interventionAppropriateSexes) - { - item.Intervention = this; - } - - if (_interventionDiagnoses != null) foreach (var item in _interventionDiagnoses) - { - item.Intervention = this; - } - - if (_interventionEducationContents != null) foreach (var item in _interventionEducationContents) - { - item.Intervention = this; - } - - if (_interventionInterventionPrescriptions != null) foreach (var item in _interventionInterventionPrescriptions) - { - item.Intervention = this; - } - - if (_interventionLearningResourceMetadataURIs != null) foreach (var item in _interventionLearningResourceMetadataURIs) - { - item.Intervention = this; - } - - if (_interventionMeetingTimes != null) foreach (var item in _interventionMeetingTimes) - { - item.Intervention = this; - } - - if (_interventionPopulationServeds != null) foreach (var item in _interventionPopulationServeds) - { - item.Intervention = this; - } - - if (_interventionStaffs != null) foreach (var item in _interventionStaffs) - { - item.Intervention = this; - } - - if (_interventionURIs != null) foreach (var item in _interventionURIs) - { - item.Intervention = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -84476,212 +84226,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIntervention)target); + return Entities.Common.EdFi.IDEAPartDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIDEAPartDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionMapper.MapTo(this, (Entities.Common.EdFi.IIntervention)target, null); + Entities.Common.EdFi.IDEAPartDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIDEAPartDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IIntervention.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IIntervention.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (InterventionAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("InterventionAppropriateGradeLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionAppropriateGradeLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("InterventionAppropriateGradeLevels")))) - { - yield return result; - } - } - - if (InterventionAppropriateSexes.Any() && mappingContract?.IsMemberSupported("InterventionAppropriateSexes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionAppropriateSexes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionAppropriateSexes, validationContext, validationContext.Items.ForCollection("InterventionAppropriateSexes")))) - { - yield return result; - } - } - - if (InterventionDiagnoses.Any() && mappingContract?.IsMemberSupported("InterventionDiagnoses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionDiagnoses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionDiagnoses, validationContext, validationContext.Items.ForCollection("InterventionDiagnoses")))) - { - yield return result; - } - } - - if (InterventionEducationContents.Any() && mappingContract?.IsMemberSupported("InterventionEducationContents") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionEducationContents"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionEducationContents, validationContext, validationContext.Items.ForCollection("InterventionEducationContents")))) - { - yield return result; - } - } - - if (InterventionInterventionPrescriptions.Any() && mappingContract?.IsMemberSupported("InterventionInterventionPrescriptions") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionInterventionPrescriptions"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionInterventionPrescriptions, validationContext, validationContext.Items.ForCollection("InterventionInterventionPrescriptions")))) - { - yield return result; - } - } - - if (InterventionLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("InterventionLearningResourceMetadataURIs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionLearningResourceMetadataURIs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("InterventionLearningResourceMetadataURIs")))) - { - yield return result; - } - } - - if (InterventionMeetingTimes.Any() && mappingContract?.IsMemberSupported("InterventionMeetingTimes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionMeetingTimes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionMeetingTimes, validationContext, validationContext.Items.ForCollection("InterventionMeetingTimes")))) - { - yield return result; - } - } - - if (InterventionPopulationServeds.Any() && mappingContract?.IsMemberSupported("InterventionPopulationServeds") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPopulationServeds"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPopulationServeds, validationContext, validationContext.Items.ForCollection("InterventionPopulationServeds")))) - { - yield return result; - } - } - - if (InterventionStaffs.Any() && mappingContract?.IsMemberSupported("InterventionStaffs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStaffs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStaffs, validationContext, validationContext.Items.ForCollection("InterventionStaffs")))) - { - yield return result; - } - } - - if (InterventionURIs.Any() && mappingContract?.IsMemberSupported("InterventionURIs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionURIs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionURIs, validationContext, validationContext.Items.ForCollection("InterventionURIs")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -84689,23 +84246,9 @@ string Entities.Common.EdFi.IIntervention.EducationOrganizationDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPutPostRequestValidator : FluentValidation.AbstractValidator + public class IDEAPartDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Intervention = new FullName("edfi", "Intervention"); - - // Declare collection item validators - private InterventionAppropriateGradeLevelPutPostRequestValidator _interventionAppropriateGradeLevelsValidator = new (); - private InterventionAppropriateSexPutPostRequestValidator _interventionAppropriateSexesValidator = new (); - private InterventionDiagnosisPutPostRequestValidator _interventionDiagnosesValidator = new (); - private InterventionEducationContentPutPostRequestValidator _interventionEducationContentsValidator = new (); - private InterventionInterventionPrescriptionPutPostRequestValidator _interventionInterventionPrescriptionsValidator = new (); - private InterventionLearningResourceMetadataURIPutPostRequestValidator _interventionLearningResourceMetadataURIsValidator = new (); - private InterventionMeetingTimePutPostRequestValidator _interventionMeetingTimesValidator = new (); - private InterventionPopulationServedPutPostRequestValidator _interventionPopulationServedsValidator = new (); - private InterventionStaffPutPostRequestValidator _interventionStaffsValidator = new (); - private InterventionURIPutPostRequestValidator _interventionURIsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -84718,127 +84261,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (InterventionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Intervention); - - if (mappingContract != null) - { - if (mappingContract.IsInterventionAppropriateGradeLevelIncluded != null) - { - var hasInvalidInterventionAppropriateGradeLevelsItems = instance.InterventionAppropriateGradeLevels.Any(x => !mappingContract.IsInterventionAppropriateGradeLevelIncluded(x)); - - if (hasInvalidInterventionAppropriateGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionAppropriateGradeLevels", $"A supplied 'InterventionAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionAppropriateSexIncluded != null) - { - var hasInvalidInterventionAppropriateSexesItems = instance.InterventionAppropriateSexes.Any(x => !mappingContract.IsInterventionAppropriateSexIncluded(x)); - - if (hasInvalidInterventionAppropriateSexesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionAppropriateSexes", $"A supplied 'InterventionAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionDiagnosisIncluded != null) - { - var hasInvalidInterventionDiagnosesItems = instance.InterventionDiagnoses.Any(x => !mappingContract.IsInterventionDiagnosisIncluded(x)); - - if (hasInvalidInterventionDiagnosesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionDiagnoses", $"A supplied 'InterventionDiagnosis' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionEducationContentIncluded != null) - { - var hasInvalidInterventionEducationContentsItems = instance.InterventionEducationContents.Any(x => !mappingContract.IsInterventionEducationContentIncluded(x)); - - if (hasInvalidInterventionEducationContentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionEducationContents", $"A supplied 'InterventionEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionInterventionPrescriptionIncluded != null) - { - var hasInvalidInterventionInterventionPrescriptionsItems = instance.InterventionInterventionPrescriptions.Any(x => !mappingContract.IsInterventionInterventionPrescriptionIncluded(x)); - - if (hasInvalidInterventionInterventionPrescriptionsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionInterventionPrescriptions", $"A supplied 'InterventionInterventionPrescription' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionLearningResourceMetadataURIIncluded != null) - { - var hasInvalidInterventionLearningResourceMetadataURIsItems = instance.InterventionLearningResourceMetadataURIs.Any(x => !mappingContract.IsInterventionLearningResourceMetadataURIIncluded(x)); - - if (hasInvalidInterventionLearningResourceMetadataURIsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionLearningResourceMetadataURIs", $"A supplied 'InterventionLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionMeetingTimeIncluded != null) - { - var hasInvalidInterventionMeetingTimesItems = instance.InterventionMeetingTimes.Any(x => !mappingContract.IsInterventionMeetingTimeIncluded(x)); - - if (hasInvalidInterventionMeetingTimesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionMeetingTimes", $"A supplied 'InterventionMeetingTime' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionPopulationServedIncluded != null) - { - var hasInvalidInterventionPopulationServedsItems = instance.InterventionPopulationServeds.Any(x => !mappingContract.IsInterventionPopulationServedIncluded(x)); - - if (hasInvalidInterventionPopulationServedsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPopulationServeds", $"A supplied 'InterventionPopulationServed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStaffIncluded != null) - { - var hasInvalidInterventionStaffsItems = instance.InterventionStaffs.Any(x => !mappingContract.IsInterventionStaffIncluded(x)); - - if (hasInvalidInterventionStaffsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStaffs", $"A supplied 'InterventionStaff' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionURIIncluded != null) - { - var hasInvalidInterventionURIsItems = instance.InterventionURIs.Any(x => !mappingContract.IsInterventionURIIncluded(x)); - - if (hasInvalidInterventionURIsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionURIs", $"A supplied 'InterventionURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -84854,17 +84276,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionAppropriateGradeLevel table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.IdentificationDocumentUseDescriptor table of the IdentificationDocumentUseDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionAppropriateGradeLevel : Entities.Common.EdFi.IInterventionAppropriateGradeLevel, IValidatableObject + public class IdentificationDocumentUseDescriptor : Entities.Common.EdFi.IIdentificationDocumentUseDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionAppropriateGradeLevel"); + private static FullName _fullName = new FullName("edfi", "IdentificationDocumentUseDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionAppropriateGradeLevelPutPostRequestValidator _validator = new InterventionAppropriateGradeLevelPutPostRequestValidator(); + private static IdentificationDocumentUseDescriptorPutPostRequestValidator _validator = new IdentificationDocumentUseDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -84881,6 +84308,13 @@ public class InterventionAppropriateGradeLevel : Entities.Common.EdFi.IIntervent // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the IdentificationDocumentUseDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -84891,33 +84325,19 @@ public class InterventionAppropriateGradeLevel : Entities.Common.EdFi.IIntervent //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionAppropriateGradeLevel.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int IdentificationDocumentUseDescriptorId { get; set; } - private void SetIntervention(Entities.Common.EdFi.IIntervention value) + int IDescriptor.DescriptorId { - _intervention = value; + get { return IdentificationDocumentUseDescriptorId; } + set { IdentificationDocumentUseDescriptorId = value; } } - - /// - /// Grade levels for the intervention. If omitted, considered generally applicable. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -84932,7 +84352,7 @@ private void SetIntervention(Entities.Common.EdFi.IIntervention value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionAppropriateGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IIdentificationDocumentUseDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -84940,13 +84360,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IIdentificationDocumentUseDescriptor).IdentificationDocumentUseDescriptorId.Equals(compareTo.IdentificationDocumentUseDescriptorId)) return false; @@ -84962,12 +84378,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionAppropriateGradeLevel).GradeLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IIdentificationDocumentUseDescriptor).IdentificationDocumentUseDescriptorId); return hash.ToHashCode(); } @@ -84976,6 +84389,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85001,8 +84463,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionAppropriateGradeLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -85013,6 +84478,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -85025,12 +84497,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionAppropriateGradeLevel)target); + return Entities.Common.EdFi.IdentificationDocumentUseDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIdentificationDocumentUseDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IInterventionAppropriateGradeLevel)target, null); + Entities.Common.EdFi.IdentificationDocumentUseDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIdentificationDocumentUseDescriptor)target, null); } // ------------------------------------------------------------- @@ -85038,66 +84510,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -85105,9 +84517,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class IdentificationDocumentUseDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -85135,17 +84547,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionAppropriateSex table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.ImmunizationTypeDescriptor table of the ImmunizationTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionAppropriateSex : Entities.Common.EdFi.IInterventionAppropriateSex, IValidatableObject + public class ImmunizationTypeDescriptor : Entities.Common.EdFi.IImmunizationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionAppropriateSex"); + private static FullName _fullName = new FullName("edfi", "ImmunizationTypeDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionAppropriateSexPutPostRequestValidator _validator = new InterventionAppropriateSexPutPostRequestValidator(); + private static ImmunizationTypeDescriptorPutPostRequestValidator _validator = new ImmunizationTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -85162,6 +84579,13 @@ public class InterventionAppropriateSex : Entities.Common.EdFi.IInterventionAppr // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ImmunizationTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -85172,33 +84596,19 @@ public class InterventionAppropriateSex : Entities.Common.EdFi.IInterventionAppr //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionAppropriateSex.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ImmunizationTypeDescriptorId { get; set; } - private void SetIntervention(Entities.Common.EdFi.IIntervention value) + int IDescriptor.DescriptorId { - _intervention = value; + get { return ImmunizationTypeDescriptorId; } + set { ImmunizationTypeDescriptorId = value; } } - - /// - /// Sexes for the intervention. If omitted, considered generally applicable. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] - public string SexDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85213,7 +84623,7 @@ private void SetIntervention(Entities.Common.EdFi.IIntervention value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionAppropriateSex; + var compareTo = obj as Entities.Common.EdFi.IImmunizationTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -85221,13 +84631,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IImmunizationTypeDescriptor).ImmunizationTypeDescriptorId.Equals(compareTo.ImmunizationTypeDescriptorId)) return false; @@ -85243,12 +84649,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionAppropriateSex).SexDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IImmunizationTypeDescriptor).ImmunizationTypeDescriptorId); return hash.ToHashCode(); } @@ -85257,6 +84660,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85282,8 +84734,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionAppropriateSex")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -85294,6 +84749,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -85306,12 +84768,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionAppropriateSex)target); + return Entities.Common.EdFi.ImmunizationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IImmunizationTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IInterventionAppropriateSex)target, null); + Entities.Common.EdFi.ImmunizationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IImmunizationTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -85319,85 +84781,25 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + } - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; + // ================================================================= + // Validators + // ----------------------------------------------------------------- - try + [ExcludeFromCodeCoverage] + public class ImmunizationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // ---------------------- - // Validate collections - // ---------------------- + return false; + } - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class InterventionAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; + var instance = context.InstanceToValidate; var failures = new List(); @@ -85416,17 +84818,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionDiagnosis table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.IncidentLocationDescriptor table of the IncidentLocationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionDiagnosis : Entities.Common.EdFi.IInterventionDiagnosis, IValidatableObject + public class IncidentLocationDescriptor : Entities.Common.EdFi.IIncidentLocationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionDiagnosis"); + private static FullName _fullName = new FullName("edfi", "IncidentLocationDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionDiagnosisPutPostRequestValidator _validator = new InterventionDiagnosisPutPostRequestValidator(); + private static IncidentLocationDescriptorPutPostRequestValidator _validator = new IncidentLocationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -85443,6 +84850,13 @@ public class InterventionDiagnosis : Entities.Common.EdFi.IInterventionDiagnosis // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the IncidentLocationDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -85453,33 +84867,19 @@ public class InterventionDiagnosis : Entities.Common.EdFi.IInterventionDiagnosis //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionDiagnosis.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int IncidentLocationDescriptorId { get; set; } - private void SetIntervention(Entities.Common.EdFi.IIntervention value) + int IDescriptor.DescriptorId { - _intervention = value; + get { return IncidentLocationDescriptorId; } + set { IncidentLocationDescriptorId = value; } } - - /// - /// Targeted purpose of the intervention. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="diagnosisDescriptor")][DescriptorExists("DiagnosisDescriptor")] - public string DiagnosisDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85494,7 +84894,7 @@ private void SetIntervention(Entities.Common.EdFi.IIntervention value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionDiagnosis; + var compareTo = obj as Entities.Common.EdFi.IIncidentLocationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -85502,13 +84902,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionDiagnosis).DiagnosisDescriptor, compareTo.DiagnosisDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IIncidentLocationDescriptor).IncidentLocationDescriptorId.Equals(compareTo.IncidentLocationDescriptorId)) return false; @@ -85524,12 +84920,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionDiagnosis).DiagnosisDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IIncidentLocationDescriptor).IncidentLocationDescriptorId); return hash.ToHashCode(); } @@ -85538,6 +84931,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85563,8 +85005,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionDiagnosis")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -85575,6 +85020,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -85587,12 +85039,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionDiagnosisMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionDiagnosis)target); + return Entities.Common.EdFi.IncidentLocationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIncidentLocationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionDiagnosisMapper.MapTo(this, (Entities.Common.EdFi.IInterventionDiagnosis)target, null); + Entities.Common.EdFi.IncidentLocationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIncidentLocationDescriptor)target, null); } // ------------------------------------------------------------- @@ -85600,66 +85052,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -85667,9 +85059,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionDiagnosisPutPostRequestValidator : FluentValidation.AbstractValidator + public class IncidentLocationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -85697,17 +85089,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionEducationContent table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.IndicatorDescriptor table of the IndicatorDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionEducationContent : Entities.Common.EdFi.IInterventionEducationContent, IValidatableObject + public class IndicatorDescriptor : Entities.Common.EdFi.IIndicatorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionEducationContent"); + private static FullName _fullName = new FullName("edfi", "IndicatorDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionEducationContentPutPostRequestValidator _validator = new InterventionEducationContentPutPostRequestValidator(); + private static IndicatorDescriptorPutPostRequestValidator _validator = new IndicatorDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -85724,92 +85121,35 @@ public class InterventionEducationContent : Entities.Common.EdFi.IInterventionEd // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the IndicatorDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationContentReferenceExplicitlyAssigned; - private EducationContent.EdFi.EducationContentReference _educationContentReference; - private EducationContent.EdFi.EducationContentReference ImplicitEducationContentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationContentReference == null && !_educationContentReferenceExplicitlyAssigned) - _educationContentReference = new EducationContent.EdFi.EducationContentReference(); - - return _educationContentReference; - } - } - - [DataMember(Name="educationContentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationContent.EdFi.EducationContentReference EducationContentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationContentReference != null - && (_educationContentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) - return ImplicitEducationContentReference; - - return null; - } - set - { - _educationContentReferenceExplicitlyAssigned = true; - _educationContentReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } - - private void SetIntervention(Entities.Common.EdFi.IIntervention value) - { - _intervention = value; - } /// - /// A unique identifier for the education content. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IInterventionEducationContent.ContentIdentifier - { - get - { - if (ImplicitEducationContentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) - return ImplicitEducationContentReference.ContentIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int IndicatorDescriptorId { get; set; } - // EducationContent - _educationContentReferenceExplicitlyAssigned = false; - ImplicitEducationContentReference.ContentIdentifier = value; - } + int IDescriptor.DescriptorId + { + get { return IndicatorDescriptorId; } + set { IndicatorDescriptorId = value; } } // ------------------------------------------------------------- @@ -85825,7 +85165,7 @@ string Entities.Common.EdFi.IInterventionEducationContent.ContentIdentifier /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionEducationContent; + var compareTo = obj as Entities.Common.EdFi.IIndicatorDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -85833,13 +85173,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) + // Derived Property + if (!(this as Entities.Common.EdFi.IIndicatorDescriptor).IndicatorDescriptorId.Equals(compareTo.IndicatorDescriptorId)) return false; @@ -85855,12 +85191,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionEducationContent).ContentIdentifier); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IIndicatorDescriptor).IndicatorDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -85868,6 +85202,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -85893,8 +85276,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionEducationContent")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -85905,6 +85291,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -85917,93 +85310,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionEducationContent)target); + return Entities.Common.EdFi.IndicatorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIndicatorDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IInterventionEducationContent)target, null); + Entities.Common.EdFi.IndicatorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIndicatorDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IInterventionEducationContent.EducationContentResourceId - { - get { return null; } - set { ImplicitEducationContentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IInterventionEducationContent.EducationContentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationContentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -86011,9 +85330,9 @@ string Entities.Common.EdFi.IInterventionEducationContent.EducationContentDiscri // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator + public class IndicatorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -86041,17 +85360,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionInterventionPrescription table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.IndicatorGroupDescriptor table of the IndicatorGroupDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionInterventionPrescription : Entities.Common.EdFi.IInterventionInterventionPrescription, IValidatableObject + public class IndicatorGroupDescriptor : Entities.Common.EdFi.IIndicatorGroupDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionInterventionPrescription"); + private static FullName _fullName = new FullName("edfi", "IndicatorGroupDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionInterventionPrescriptionPutPostRequestValidator _validator = new InterventionInterventionPrescriptionPutPostRequestValidator(); + private static IndicatorGroupDescriptorPutPostRequestValidator _validator = new IndicatorGroupDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -86068,117 +85392,35 @@ public class InterventionInterventionPrescription : Entities.Common.EdFi.IInterv // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the IndicatorGroupDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _interventionPrescriptionReferenceExplicitlyAssigned; - private InterventionPrescription.EdFi.InterventionPrescriptionReference _interventionPrescriptionReference; - private InterventionPrescription.EdFi.InterventionPrescriptionReference ImplicitInterventionPrescriptionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_interventionPrescriptionReference == null && !_interventionPrescriptionReferenceExplicitlyAssigned) - _interventionPrescriptionReference = new InterventionPrescription.EdFi.InterventionPrescriptionReference(); - - return _interventionPrescriptionReference; - } - } - - [DataMember(Name="interventionPrescriptionReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public InterventionPrescription.EdFi.InterventionPrescriptionReference InterventionPrescriptionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitInterventionPrescriptionReference != null - && (_interventionPrescriptionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - return ImplicitInterventionPrescriptionReference; - - return null; - } - set - { - _interventionPrescriptionReferenceExplicitlyAssigned = true; - _interventionPrescriptionReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } - - private void SetIntervention(Entities.Common.EdFi.IIntervention value) - { - _intervention = value; - } /// - /// The identifier assigned to an education organization. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionEducationOrganizationId - { - get - { - if (ImplicitInterventionPrescriptionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - return ImplicitInterventionPrescriptionReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // InterventionPrescription - _interventionPrescriptionReferenceExplicitlyAssigned = false; - ImplicitInterventionPrescriptionReference.EducationOrganizationId = value; - } - } + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int IndicatorGroupDescriptorId { get; set; } - /// - /// A unique number or alphanumeric code assigned to an intervention prescription. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionIdentificationCode + int IDescriptor.DescriptorId { - get - { - if (ImplicitInterventionPrescriptionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - return ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // InterventionPrescription - _interventionPrescriptionReferenceExplicitlyAssigned = false; - ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode = value; - } + get { return IndicatorGroupDescriptorId; } + set { IndicatorGroupDescriptorId = value; } } // ------------------------------------------------------------- @@ -86194,7 +85436,7 @@ string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPr /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionInterventionPrescription; + var compareTo = obj as Entities.Common.EdFi.IIndicatorGroupDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -86202,18 +85444,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionEducationOrganizationId.Equals(compareTo.InterventionPrescriptionEducationOrganizationId)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionIdentificationCode, compareTo.InterventionPrescriptionIdentificationCode)) + // Derived Property + if (!(this as Entities.Common.EdFi.IIndicatorGroupDescriptor).IndicatorGroupDescriptorId.Equals(compareTo.IndicatorGroupDescriptorId)) return false; @@ -86229,15 +85462,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionEducationOrganizationId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IIndicatorGroupDescriptor).IndicatorGroupDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionIdentificationCode); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -86245,6 +85473,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -86270,8 +85547,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionInterventionPrescription")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -86282,6 +85562,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -86294,93 +85581,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionInterventionPrescriptionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionInterventionPrescription)target); + return Entities.Common.EdFi.IndicatorGroupDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIndicatorGroupDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionInterventionPrescriptionMapper.MapTo(this, (Entities.Common.EdFi.IInterventionInterventionPrescription)target, null); + Entities.Common.EdFi.IndicatorGroupDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIndicatorGroupDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionResourceId - { - get { return null; } - set { ImplicitInterventionPrescriptionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitInterventionPrescriptionReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -86388,9 +85601,9 @@ string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPr // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionInterventionPrescriptionPutPostRequestValidator : FluentValidation.AbstractValidator + public class IndicatorGroupDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -86418,17 +85631,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionLearningResourceMetadataURI table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.IndicatorLevelDescriptor table of the IndicatorLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionLearningResourceMetadataURI : Entities.Common.EdFi.IInterventionLearningResourceMetadataURI, IValidatableObject + public class IndicatorLevelDescriptor : Entities.Common.EdFi.IIndicatorLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionLearningResourceMetadataURI"); + private static FullName _fullName = new FullName("edfi", "IndicatorLevelDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionLearningResourceMetadataURIPutPostRequestValidator _validator = new InterventionLearningResourceMetadataURIPutPostRequestValidator(); + private static IndicatorLevelDescriptorPutPostRequestValidator _validator = new IndicatorLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -86445,6 +85663,13 @@ public class InterventionLearningResourceMetadataURI : Entities.Common.EdFi.IInt // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the IndicatorLevelDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -86455,33 +85680,19 @@ public class InterventionLearningResourceMetadataURI : Entities.Common.EdFi.IInt //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } - - private void SetIntervention(Entities.Common.EdFi.IIntervention value) - { - _intervention = value; - } /// - /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="learningResourceMetadataURI")] - public string LearningResourceMetadataURI { get; set; } + [JsonIgnore] + public int IndicatorLevelDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return IndicatorLevelDescriptorId; } + set { IndicatorLevelDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -86496,7 +85707,7 @@ private void SetIntervention(Entities.Common.EdFi.IIntervention value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionLearningResourceMetadataURI; + var compareTo = obj as Entities.Common.EdFi.IIndicatorLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -86504,13 +85715,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionLearningResourceMetadataURI).LearningResourceMetadataURI, compareTo.LearningResourceMetadataURI)) + // Derived Property + if (!(this as Entities.Common.EdFi.IIndicatorLevelDescriptor).IndicatorLevelDescriptorId.Equals(compareTo.IndicatorLevelDescriptorId)) return false; @@ -86526,12 +85733,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionLearningResourceMetadataURI).LearningResourceMetadataURI); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IIndicatorLevelDescriptor).IndicatorLevelDescriptorId); return hash.ToHashCode(); } @@ -86540,6 +85744,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -86565,8 +85818,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionLearningResourceMetadataURI")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -86577,6 +85833,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -86589,12 +85852,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionLearningResourceMetadataURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)target); + return Entities.Common.EdFi.IndicatorLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIndicatorLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionLearningResourceMetadataURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)target, null); + Entities.Common.EdFi.IndicatorLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IIndicatorLevelDescriptor)target, null); } // ------------------------------------------------------------- @@ -86602,66 +85865,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -86669,9 +85872,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class IndicatorLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -86699,17 +85902,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionMeetingTime table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.InstitutionTelephoneNumberTypeDescriptor table of the InstitutionTelephoneNumberTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionMeetingTime : Entities.Common.EdFi.IInterventionMeetingTime, IValidatableObject + public class InstitutionTelephoneNumberTypeDescriptor : Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionMeetingTime"); + private static FullName _fullName = new FullName("edfi", "InstitutionTelephoneNumberTypeDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionMeetingTimePutPostRequestValidator _validator = new InterventionMeetingTimePutPostRequestValidator(); + private static InstitutionTelephoneNumberTypeDescriptorPutPostRequestValidator _validator = new InstitutionTelephoneNumberTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -86726,50 +85934,36 @@ public class InterventionMeetingTime : Entities.Common.EdFi.IInterventionMeeting // ============================================================ // Unique Identifier // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- + + /// + /// The unique identifier for the InstitutionTelephoneNumberTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } - - private void SetIntervention(Entities.Common.EdFi.IIntervention value) - { - _intervention = value; - } /// - /// An indication of the time of day the meeting time ends. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="endTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan EndTime { get; set; } + [JsonIgnore] + public int InstitutionTelephoneNumberTypeDescriptorId { get; set; } - /// - /// An indication of the time of day the meeting time begins. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="startTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan StartTime { get; set; } + int IDescriptor.DescriptorId + { + get { return InstitutionTelephoneNumberTypeDescriptorId; } + set { InstitutionTelephoneNumberTypeDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -86784,7 +85978,7 @@ private void SetIntervention(Entities.Common.EdFi.IIntervention value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionMeetingTime; + var compareTo = obj as Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -86792,18 +85986,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.IInterventionMeetingTime).EndTime.Equals(compareTo.EndTime)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IInterventionMeetingTime).StartTime.Equals(compareTo.StartTime)) + // Derived Property + if (!(this as Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor).InstitutionTelephoneNumberTypeDescriptorId.Equals(compareTo.InstitutionTelephoneNumberTypeDescriptorId)) return false; @@ -86819,16 +86004,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionMeetingTime).EndTime); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionMeetingTime).StartTime); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor).InstitutionTelephoneNumberTypeDescriptorId); return hash.ToHashCode(); } @@ -86837,6 +86015,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -86862,8 +86089,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionMeetingTime")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -86874,6 +86104,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -86886,12 +86123,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionMeetingTimeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionMeetingTime)target); + return Entities.Common.EdFi.InstitutionTelephoneNumberTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionMeetingTimeMapper.MapTo(this, (Entities.Common.EdFi.IInterventionMeetingTime)target, null); + Entities.Common.EdFi.InstitutionTelephoneNumberTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -86899,66 +86136,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -86966,9 +86143,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionMeetingTimePutPostRequestValidator : FluentValidation.AbstractValidator + public class InstitutionTelephoneNumberTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -86996,17 +86173,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPopulationServed table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.InteractivityStyleDescriptor table of the InteractivityStyleDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPopulationServed : Entities.Common.EdFi.IInterventionPopulationServed, IValidatableObject + public class InteractivityStyleDescriptor : Entities.Common.EdFi.IInteractivityStyleDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionPopulationServed"); + private static FullName _fullName = new FullName("edfi", "InteractivityStyleDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionPopulationServedPutPostRequestValidator _validator = new InterventionPopulationServedPutPostRequestValidator(); + private static InteractivityStyleDescriptorPutPostRequestValidator _validator = new InteractivityStyleDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -87023,6 +86205,13 @@ public class InterventionPopulationServed : Entities.Common.EdFi.IInterventionPo // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the InteractivityStyleDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -87033,33 +86222,19 @@ public class InterventionPopulationServed : Entities.Common.EdFi.IInterventionPo //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionPopulationServed.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int InteractivityStyleDescriptorId { get; set; } - private void SetIntervention(Entities.Common.EdFi.IIntervention value) + int IDescriptor.DescriptorId { - _intervention = value; + get { return InteractivityStyleDescriptorId; } + set { InteractivityStyleDescriptorId = value; } } - - /// - /// A subset of students that are the focus of the intervention. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] - public string PopulationServedDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87074,7 +86249,7 @@ private void SetIntervention(Entities.Common.EdFi.IIntervention value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPopulationServed; + var compareTo = obj as Entities.Common.EdFi.IInteractivityStyleDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -87082,13 +86257,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPopulationServed).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IInteractivityStyleDescriptor).InteractivityStyleDescriptorId.Equals(compareTo.InteractivityStyleDescriptorId)) return false; @@ -87104,12 +86275,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPopulationServed).PopulationServedDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IInteractivityStyleDescriptor).InteractivityStyleDescriptorId); return hash.ToHashCode(); } @@ -87118,6 +86286,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87143,8 +86360,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionPopulationServed")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -87155,6 +86375,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -87167,12 +86394,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPopulationServedMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPopulationServed)target); + return Entities.Common.EdFi.InteractivityStyleDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInteractivityStyleDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPopulationServedMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPopulationServed)target, null); + Entities.Common.EdFi.InteractivityStyleDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInteractivityStyleDescriptor)target, null); } // ------------------------------------------------------------- @@ -87180,66 +86407,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -87247,9 +86414,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPopulationServedPutPostRequestValidator : FluentValidation.AbstractValidator + public class InteractivityStyleDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -87277,17 +86444,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStaff table of the Intervention aggregate in the ODS Database. + /// A class which represents the edfi.InternetAccessDescriptor table of the InternetAccessDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStaff : Entities.Common.EdFi.IInterventionStaff, IValidatableObject + public class InternetAccessDescriptor : Entities.Common.EdFi.IInternetAccessDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionStaff"); + private static FullName _fullName = new FullName("edfi", "InternetAccessDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionStaffPutPostRequestValidator _validator = new InterventionStaffPutPostRequestValidator(); + private static InternetAccessDescriptorPutPostRequestValidator _validator = new InternetAccessDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -87304,93 +86476,35 @@ public class InterventionStaff : Entities.Common.EdFi.IInterventionStaff, IValid // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the InternetAccessDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); - - return _staffReference; - } - } - - [DataMember(Name="staffReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; - - return null; - } - set - { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionStaff.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } - - private void SetIntervention(Entities.Common.EdFi.IIntervention value) - { - _intervention = value; - } /// - /// A unique alphanumeric code assigned to a staff. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IInterventionStaff.StaffUniqueId - { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int InternetAccessDescriptorId { get; set; } - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } + int IDescriptor.DescriptorId + { + get { return InternetAccessDescriptorId; } + set { InternetAccessDescriptorId = value; } } // ------------------------------------------------------------- @@ -87406,7 +86520,7 @@ string Entities.Common.EdFi.IInterventionStaff.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStaff; + var compareTo = obj as Entities.Common.EdFi.IInternetAccessDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -87414,13 +86528,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStaff).StaffUniqueId, compareTo.StaffUniqueId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IInternetAccessDescriptor).InternetAccessDescriptorId.Equals(compareTo.InternetAccessDescriptorId)) return false; @@ -87436,12 +86546,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionStaff).StaffUniqueId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IInternetAccessDescriptor).InternetAccessDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -87449,301 +86557,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionStaff")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.InterventionStaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStaff)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.InterventionStaffMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStaff)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IInterventionStaff.StaffResourceId - { - get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IInterventionStaff.StaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStaffReference.Discriminator = value; } - } - - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class InterventionStaffPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.InterventionURI table of the Intervention aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class InterventionURI : Entities.Common.EdFi.IInterventionURI, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "InterventionURI"); - - // Fluent validator instance (threadsafe) - private static InterventionURIPutPostRequestValidator _validator = new InterventionURIPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IIntervention _intervention; - - [IgnoreDataMember] - Entities.Common.EdFi.IIntervention IInterventionURI.Intervention - { - get { return _intervention; } - set { SetIntervention(value); } - } - - public Entities.Common.EdFi.IIntervention Intervention - { - set { SetIntervention(value); } - } - - private void SetIntervention(Entities.Common.EdFi.IIntervention value) - { - _intervention = value; - } /// - /// The URI (typical a URL) pointing to an education content item. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="uri")] - public string URI { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// Determines equality based on the natural key properties of the resource. + /// The description of the descriptor. /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IInterventionURI; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionURI).URI, compareTo.URI)) - return false; - - - return true; - } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// Builds the hash code based on the unique identifying values. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_intervention != null) - hash.Add(_intervention); + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionURI).URI); + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } - return hash.ToHashCode(); - } - // ------------------------------------------------------------- + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -87769,8 +86631,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionURI")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -87781,6 +86646,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -87793,12 +86665,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionURI)target); + return Entities.Common.EdFi.InternetAccessDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInternetAccessDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionURI)target, null); + Entities.Common.EdFi.InternetAccessDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInternetAccessDescriptor)target, null); } // ------------------------------------------------------------- @@ -87806,66 +86678,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -87873,9 +86685,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class InternetAccessDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -87904,21 +86716,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionClassDescriptor table of the InterventionClassDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.InternetAccessTypeInResidenceDescriptor table of the InternetAccessTypeInResidenceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionClassDescriptor : Entities.Common.EdFi.IInterventionClassDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class InternetAccessTypeInResidenceDescriptor : Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionClassDescriptor"); + private static FullName _fullName = new FullName("edfi", "InternetAccessTypeInResidenceDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionClassDescriptorPutPostRequestValidator _validator = new InterventionClassDescriptorPutPostRequestValidator(); + private static InternetAccessTypeInResidenceDescriptorPutPostRequestValidator _validator = new InternetAccessTypeInResidenceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -87937,7 +86749,7 @@ public class InterventionClassDescriptor : Entities.Common.EdFi.IInterventionCla // ------------------------------------------------------------ /// - /// The unique identifier for the InterventionClassDescriptor resource. + /// The unique identifier for the InternetAccessTypeInResidenceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -87958,12 +86770,12 @@ public class InterventionClassDescriptor : Entities.Common.EdFi.IInterventionCla /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int InterventionClassDescriptorId { get; set; } + public int InternetAccessTypeInResidenceDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return InterventionClassDescriptorId; } - set { InterventionClassDescriptorId = value; } + get { return InternetAccessTypeInResidenceDescriptorId; } + set { InternetAccessTypeInResidenceDescriptorId = value; } } // ------------------------------------------------------------- @@ -87979,7 +86791,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionClassDescriptor; + var compareTo = obj as Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -87989,7 +86801,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IInterventionClassDescriptor).InterventionClassDescriptorId.Equals(compareTo.InterventionClassDescriptorId)) + if (!(this as Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor).InternetAccessTypeInResidenceDescriptorId.Equals(compareTo.InternetAccessTypeInResidenceDescriptorId)) return false; @@ -88007,7 +86819,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IInterventionClassDescriptor).InterventionClassDescriptorId); + hash.Add((this as Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor).InternetAccessTypeInResidenceDescriptorId); return hash.ToHashCode(); } @@ -88124,12 +86936,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionClassDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionClassDescriptor)target); + return Entities.Common.EdFi.InternetAccessTypeInResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionClassDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInterventionClassDescriptor)target, null); + Entities.Common.EdFi.InternetAccessTypeInResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor)target, null); } // ------------------------------------------------------------- @@ -88144,9 +86956,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionClassDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class InternetAccessTypeInResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -88175,21 +86987,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionEffectivenessRatingDescriptor table of the InterventionEffectivenessRatingDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.InternetPerformanceInResidenceDescriptor table of the InternetPerformanceInResidenceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionEffectivenessRatingDescriptor : Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class InternetPerformanceInResidenceDescriptor : Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionEffectivenessRatingDescriptor"); + private static FullName _fullName = new FullName("edfi", "InternetPerformanceInResidenceDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionEffectivenessRatingDescriptorPutPostRequestValidator _validator = new InterventionEffectivenessRatingDescriptorPutPostRequestValidator(); + private static InternetPerformanceInResidenceDescriptorPutPostRequestValidator _validator = new InternetPerformanceInResidenceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -88208,7 +87020,7 @@ public class InterventionEffectivenessRatingDescriptor : Entities.Common.EdFi.II // ------------------------------------------------------------ /// - /// The unique identifier for the InterventionEffectivenessRatingDescriptor resource. + /// The unique identifier for the InternetPerformanceInResidenceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -88229,12 +87041,12 @@ public class InterventionEffectivenessRatingDescriptor : Entities.Common.EdFi.II /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int InterventionEffectivenessRatingDescriptorId { get; set; } + public int InternetPerformanceInResidenceDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return InterventionEffectivenessRatingDescriptorId; } - set { InterventionEffectivenessRatingDescriptorId = value; } + get { return InternetPerformanceInResidenceDescriptorId; } + set { InternetPerformanceInResidenceDescriptorId = value; } } // ------------------------------------------------------------- @@ -88250,7 +87062,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor; + var compareTo = obj as Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -88260,7 +87072,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor).InterventionEffectivenessRatingDescriptorId.Equals(compareTo.InterventionEffectivenessRatingDescriptorId)) + if (!(this as Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor).InternetPerformanceInResidenceDescriptorId.Equals(compareTo.InternetPerformanceInResidenceDescriptorId)) return false; @@ -88278,7 +87090,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor).InterventionEffectivenessRatingDescriptorId); + hash.Add((this as Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor).InternetPerformanceInResidenceDescriptorId); return hash.ToHashCode(); } @@ -88395,12 +87207,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionEffectivenessRatingDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor)target); + return Entities.Common.EdFi.InternetPerformanceInResidenceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionEffectivenessRatingDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor)target, null); + Entities.Common.EdFi.InternetPerformanceInResidenceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor)target, null); } // ------------------------------------------------------------- @@ -88415,9 +87227,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionEffectivenessRatingDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class InternetPerformanceInResidenceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -88446,22 +87258,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the InterventionPrescription resource. + /// Represents a reference to the Intervention resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionReference : IResourceReference + public class InterventionReference : IResourceReference { [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } - [DataMember(Name="interventionPrescriptionIdentificationCode")] - public string InterventionPrescriptionIdentificationCode { get; set; } + [DataMember(Name="interventionIdentificationCode")] + public string InterventionIdentificationCode { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -88499,7 +87311,7 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EducationOrganizationId != default(long) && InterventionPrescriptionIdentificationCode != default(string); + return EducationOrganizationId != default(long) && InterventionIdentificationCode != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() @@ -88509,9 +87321,9 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "EducationOrganizationId"; } - if (InterventionPrescriptionIdentificationCode == default) + if (InterventionIdentificationCode == default) { - yield return "InterventionPrescriptionIdentificationCode"; + yield return "InterventionIdentificationCode"; } } @@ -88520,8 +87332,8 @@ private Link CreateLink() { var link = new Link { - Rel = "InterventionPrescription", - Href = $"/ed-fi/interventionPrescriptions/{ResourceId:n}" + Rel = "Intervention", + Href = $"/ed-fi/interventions/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -88548,16 +87360,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.InterventionPrescription table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.Intervention table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescription : Entities.Common.EdFi.IInterventionPrescription, IHasETag, IDateVersionedEntity, IValidatableObject + public class Intervention : Entities.Common.EdFi.IIntervention, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescription"); + private static FullName _fullName = new FullName("edfi", "Intervention"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionPutPostRequestValidator _validator = new InterventionPrescriptionPutPostRequestValidator(); + private static InterventionPutPostRequestValidator _validator = new InterventionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -88568,15 +87380,18 @@ public class InterventionPrescription : Entities.Common.EdFi.IInterventionPrescr // Constructor // ------------------------------------------------------------- - public InterventionPrescription() + public Intervention() { - InterventionPrescriptionAppropriateGradeLevels = new List(); - InterventionPrescriptionAppropriateSexes = new List(); - InterventionPrescriptionDiagnoses = new List(); - InterventionPrescriptionEducationContents = new List(); - InterventionPrescriptionLearningResourceMetadataURIs = new List(); - InterventionPrescriptionPopulationServeds = new List(); - InterventionPrescriptionURIs = new List(); + InterventionAppropriateGradeLevels = new List(); + InterventionAppropriateSexes = new List(); + InterventionDiagnoses = new List(); + InterventionEducationContents = new List(); + InterventionInterventionPrescriptions = new List(); + InterventionLearningResourceMetadataURIs = new List(); + InterventionMeetingTimes = new List(); + InterventionPopulationServeds = new List(); + InterventionStaffs = new List(); + InterventionURIs = new List(); } // ------------------------------------------------------------ @@ -88586,7 +87401,7 @@ public InterventionPrescription() // ------------------------------------------------------------ /// - /// The unique identifier for the InterventionPrescription resource. + /// The unique identifier for the Intervention resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -88640,7 +87455,7 @@ public EducationOrganization.EdFi.EducationOrganizationReference EducationOrgani /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationId + long Entities.Common.EdFi.IIntervention.EducationOrganizationId { get { @@ -88662,13 +87477,13 @@ long Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationId } /// - /// A unique number or alphanumeric code assigned to an intervention prescription. + /// A unique number or alphanumeric code assigned to an intervention. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="interventionPrescriptionIdentificationCode")] - public string InterventionPrescriptionIdentificationCode { get; set; } + [DataMember(Name="interventionIdentificationCode")] + public string InterventionIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -88683,7 +87498,7 @@ long Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescription; + var compareTo = obj as Entities.Common.EdFi.IIntervention; if (ReferenceEquals(this, compareTo)) return true; @@ -88693,12 +87508,12 @@ public override bool Equals(object obj) // Referenced Property - if (!(this as Entities.Common.EdFi.IInterventionPrescription).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!(this as Entities.Common.EdFi.IIntervention).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescription).InterventionPrescriptionIdentificationCode, compareTo.InterventionPrescriptionIdentificationCode)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IIntervention).InterventionIdentificationCode, compareTo.InterventionIdentificationCode)) return false; @@ -88716,10 +87531,10 @@ public override int GetHashCode() var hash = new HashCode(); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescription).EducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IIntervention).EducationOrganizationId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescription).InterventionPrescriptionIdentificationCode); + hash.Add((this as Entities.Common.EdFi.IIntervention).InterventionIdentificationCode); return hash.ToHashCode(); } @@ -88735,7 +87550,15 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The way in which an intervention was implemented: individual, small group, whole class, or whole school. + /// The start date for the intervention implementation. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } + + /// + /// The way in which an intervention was implemented. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] @@ -88743,6 +87566,13 @@ public override int GetHashCode() [DataMember(Name="deliveryMethodDescriptor")][DescriptorExists("DeliveryMethodDescriptor")] public string DeliveryMethodDescriptor { get; set; } + /// + /// The end date for the intervention implementation. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } + /// /// The way in which an intervention is used: curriculum, supplement, or practice. /// @@ -88753,14 +87583,14 @@ public override int GetHashCode() public string InterventionClassDescriptor { get; set; } /// - /// The maximum duration of time in minutes that is recommended for the intervention. + /// The maximum duration of time in minutes that may be assigned for the intervention. /// // NOT in a reference, NOT a lookup column [DataMember(Name="maxDosage")] public int? MaxDosage { get; set; } /// - /// The minimum duration of time in minutes that is recommended for the intervention. + /// The minimum duration of time in minutes that may be assigned for the intervention. /// // NOT in a reference, NOT a lookup column [DataMember(Name="minDosage")] @@ -88793,221 +87623,311 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescription")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "Intervention")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _interventionPrescriptionAppropriateGradeLevels; - private ICollection _interventionPrescriptionAppropriateGradeLevelsCovariant; + private ICollection _interventionAppropriateGradeLevels; + private ICollection _interventionAppropriateGradeLevelsCovariant; [NoDuplicateMembers] [DataMember(Name="appropriateGradeLevels")] - public ICollection InterventionPrescriptionAppropriateGradeLevels + public ICollection InterventionAppropriateGradeLevels { - get { return _interventionPrescriptionAppropriateGradeLevels; } + get { return _interventionAppropriateGradeLevels; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)e.Item).InterventionPrescription = this); - _interventionPrescriptionAppropriateGradeLevels = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateGradeLevel)e.Item).Intervention = this); + _interventionAppropriateGradeLevels = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)e.Item).InterventionPrescription = this; - _interventionPrescriptionAppropriateGradeLevelsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateGradeLevel)e.Item).Intervention = this; + _interventionAppropriateGradeLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateGradeLevels + ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateGradeLevels { - get { return _interventionPrescriptionAppropriateGradeLevelsCovariant; } - set { InterventionPrescriptionAppropriateGradeLevels = new List(value.Cast()); } + get { return _interventionAppropriateGradeLevelsCovariant; } + set { InterventionAppropriateGradeLevels = new List(value.Cast()); } } - private ICollection _interventionPrescriptionAppropriateSexes; - private ICollection _interventionPrescriptionAppropriateSexesCovariant; + private ICollection _interventionAppropriateSexes; + private ICollection _interventionAppropriateSexesCovariant; [NoDuplicateMembers] [DataMember(Name="appropriateSexes")] - public ICollection InterventionPrescriptionAppropriateSexes + public ICollection InterventionAppropriateSexes { - get { return _interventionPrescriptionAppropriateSexes; } + get { return _interventionAppropriateSexes; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)e.Item).InterventionPrescription = this); - _interventionPrescriptionAppropriateSexes = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateSex)e.Item).Intervention = this); + _interventionAppropriateSexes = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)e.Item).InterventionPrescription = this; - _interventionPrescriptionAppropriateSexesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionAppropriateSex)e.Item).Intervention = this; + _interventionAppropriateSexesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateSexes + ICollection Entities.Common.EdFi.IIntervention.InterventionAppropriateSexes { - get { return _interventionPrescriptionAppropriateSexesCovariant; } - set { InterventionPrescriptionAppropriateSexes = new List(value.Cast()); } + get { return _interventionAppropriateSexesCovariant; } + set { InterventionAppropriateSexes = new List(value.Cast()); } } - private ICollection _interventionPrescriptionDiagnoses; - private ICollection _interventionPrescriptionDiagnosesCovariant; + private ICollection _interventionDiagnoses; + private ICollection _interventionDiagnosesCovariant; [NoDuplicateMembers] [DataMember(Name="diagnoses")] - public ICollection InterventionPrescriptionDiagnoses + public ICollection InterventionDiagnoses { - get { return _interventionPrescriptionDiagnoses; } + get { return _interventionDiagnoses; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)e.Item).InterventionPrescription = this); - _interventionPrescriptionDiagnoses = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionDiagnosis)e.Item).Intervention = this); + _interventionDiagnoses = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)e.Item).InterventionPrescription = this; - _interventionPrescriptionDiagnosesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionDiagnosis)e.Item).Intervention = this; + _interventionDiagnosesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionDiagnoses + ICollection Entities.Common.EdFi.IIntervention.InterventionDiagnoses { - get { return _interventionPrescriptionDiagnosesCovariant; } - set { InterventionPrescriptionDiagnoses = new List(value.Cast()); } + get { return _interventionDiagnosesCovariant; } + set { InterventionDiagnoses = new List(value.Cast()); } } - private ICollection _interventionPrescriptionEducationContents; - private ICollection _interventionPrescriptionEducationContentsCovariant; + private ICollection _interventionEducationContents; + private ICollection _interventionEducationContentsCovariant; [NoDuplicateMembers] [DataMember(Name="educationContents")] - public ICollection InterventionPrescriptionEducationContents + public ICollection InterventionEducationContents { - get { return _interventionPrescriptionEducationContents; } + get { return _interventionEducationContents; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionEducationContent)e.Item).InterventionPrescription = this); - _interventionPrescriptionEducationContents = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionEducationContent)e.Item).Intervention = this); + _interventionEducationContents = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionEducationContent)e.Item).InterventionPrescription = this; - _interventionPrescriptionEducationContentsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionEducationContent)e.Item).Intervention = this; + _interventionEducationContentsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionEducationContents + ICollection Entities.Common.EdFi.IIntervention.InterventionEducationContents { - get { return _interventionPrescriptionEducationContentsCovariant; } - set { InterventionPrescriptionEducationContents = new List(value.Cast()); } + get { return _interventionEducationContentsCovariant; } + set { InterventionEducationContents = new List(value.Cast()); } } - private ICollection _interventionPrescriptionLearningResourceMetadataURIs; - private ICollection _interventionPrescriptionLearningResourceMetadataURIsCovariant; + private ICollection _interventionInterventionPrescriptions; + private ICollection _interventionInterventionPrescriptionsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="interventionPrescriptions")] + public ICollection InterventionInterventionPrescriptions + { + get { return _interventionInterventionPrescriptions; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionInterventionPrescription)e.Item).Intervention = this); + _interventionInterventionPrescriptions = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionInterventionPrescription)e.Item).Intervention = this; + _interventionInterventionPrescriptionsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionInterventionPrescriptions + { + get { return _interventionInterventionPrescriptionsCovariant; } + set { InterventionInterventionPrescriptions = new List(value.Cast()); } + } + + private ICollection _interventionLearningResourceMetadataURIs; + private ICollection _interventionLearningResourceMetadataURIsCovariant; [NoDuplicateMembers] [DataMember(Name="learningResourceMetadataURIs")] - public ICollection InterventionPrescriptionLearningResourceMetadataURIs + public ICollection InterventionLearningResourceMetadataURIs { - get { return _interventionPrescriptionLearningResourceMetadataURIs; } + get { return _interventionLearningResourceMetadataURIs; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)e.Item).InterventionPrescription = this); - _interventionPrescriptionLearningResourceMetadataURIs = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)e.Item).Intervention = this); + _interventionLearningResourceMetadataURIs = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)e.Item).InterventionPrescription = this; - _interventionPrescriptionLearningResourceMetadataURIsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)e.Item).Intervention = this; + _interventionLearningResourceMetadataURIsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionLearningResourceMetadataURIs + ICollection Entities.Common.EdFi.IIntervention.InterventionLearningResourceMetadataURIs { - get { return _interventionPrescriptionLearningResourceMetadataURIsCovariant; } - set { InterventionPrescriptionLearningResourceMetadataURIs = new List(value.Cast()); } + get { return _interventionLearningResourceMetadataURIsCovariant; } + set { InterventionLearningResourceMetadataURIs = new List(value.Cast()); } } - private ICollection _interventionPrescriptionPopulationServeds; - private ICollection _interventionPrescriptionPopulationServedsCovariant; + private ICollection _interventionMeetingTimes; + private ICollection _interventionMeetingTimesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="meetingTimes")] + public ICollection InterventionMeetingTimes + { + get { return _interventionMeetingTimes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionMeetingTime)e.Item).Intervention = this); + _interventionMeetingTimes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionMeetingTime)e.Item).Intervention = this; + _interventionMeetingTimesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionMeetingTimes + { + get { return _interventionMeetingTimesCovariant; } + set { InterventionMeetingTimes = new List(value.Cast()); } + } + + private ICollection _interventionPopulationServeds; + private ICollection _interventionPopulationServedsCovariant; [NoDuplicateMembers] [DataMember(Name="populationServeds")] - public ICollection InterventionPrescriptionPopulationServeds + public ICollection InterventionPopulationServeds { - get { return _interventionPrescriptionPopulationServeds; } + get { return _interventionPopulationServeds; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)e.Item).InterventionPrescription = this); - _interventionPrescriptionPopulationServeds = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPopulationServed)e.Item).Intervention = this); + _interventionPopulationServeds = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)e.Item).InterventionPrescription = this; - _interventionPrescriptionPopulationServedsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPopulationServed)e.Item).Intervention = this; + _interventionPopulationServedsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionPopulationServeds + ICollection Entities.Common.EdFi.IIntervention.InterventionPopulationServeds { - get { return _interventionPrescriptionPopulationServedsCovariant; } - set { InterventionPrescriptionPopulationServeds = new List(value.Cast()); } + get { return _interventionPopulationServedsCovariant; } + set { InterventionPopulationServeds = new List(value.Cast()); } } - private ICollection _interventionPrescriptionURIs; - private ICollection _interventionPrescriptionURIsCovariant; + private ICollection _interventionStaffs; + private ICollection _interventionStaffsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="staffs")] + public ICollection InterventionStaffs + { + get { return _interventionStaffs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStaff)e.Item).Intervention = this); + _interventionStaffs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStaff)e.Item).Intervention = this; + _interventionStaffsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IIntervention.InterventionStaffs + { + get { return _interventionStaffsCovariant; } + set { InterventionStaffs = new List(value.Cast()); } + } + + private ICollection _interventionURIs; + private ICollection _interventionURIsCovariant; [NoDuplicateMembers] [DataMember(Name="uris")] - public ICollection InterventionPrescriptionURIs + public ICollection InterventionURIs { - get { return _interventionPrescriptionURIs; } + get { return _interventionURIs; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionURI)e.Item).InterventionPrescription = this); - _interventionPrescriptionURIs = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionURI)e.Item).Intervention = this); + _interventionURIs = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionURI)e.Item).InterventionPrescription = this; - _interventionPrescriptionURIsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionURI)e.Item).Intervention = this; + _interventionURIsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionURIs + ICollection Entities.Common.EdFi.IIntervention.InterventionURIs { - get { return _interventionPrescriptionURIsCovariant; } - set { InterventionPrescriptionURIs = new List(value.Cast()); } + get { return _interventionURIsCovariant; } + set { InterventionURIs = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -89032,39 +87952,54 @@ public ICollection InterventionPrescriptionURIs internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_interventionPrescriptionAppropriateGradeLevels != null) foreach (var item in _interventionPrescriptionAppropriateGradeLevels) + if (_interventionAppropriateGradeLevels != null) foreach (var item in _interventionAppropriateGradeLevels) { - item.InterventionPrescription = this; + item.Intervention = this; } - if (_interventionPrescriptionAppropriateSexes != null) foreach (var item in _interventionPrescriptionAppropriateSexes) + if (_interventionAppropriateSexes != null) foreach (var item in _interventionAppropriateSexes) { - item.InterventionPrescription = this; + item.Intervention = this; } - if (_interventionPrescriptionDiagnoses != null) foreach (var item in _interventionPrescriptionDiagnoses) + if (_interventionDiagnoses != null) foreach (var item in _interventionDiagnoses) { - item.InterventionPrescription = this; + item.Intervention = this; } - if (_interventionPrescriptionEducationContents != null) foreach (var item in _interventionPrescriptionEducationContents) + if (_interventionEducationContents != null) foreach (var item in _interventionEducationContents) { - item.InterventionPrescription = this; + item.Intervention = this; } - if (_interventionPrescriptionLearningResourceMetadataURIs != null) foreach (var item in _interventionPrescriptionLearningResourceMetadataURIs) + if (_interventionInterventionPrescriptions != null) foreach (var item in _interventionInterventionPrescriptions) { - item.InterventionPrescription = this; + item.Intervention = this; } - if (_interventionPrescriptionPopulationServeds != null) foreach (var item in _interventionPrescriptionPopulationServeds) + if (_interventionLearningResourceMetadataURIs != null) foreach (var item in _interventionLearningResourceMetadataURIs) { - item.InterventionPrescription = this; + item.Intervention = this; } - if (_interventionPrescriptionURIs != null) foreach (var item in _interventionPrescriptionURIs) + if (_interventionMeetingTimes != null) foreach (var item in _interventionMeetingTimes) { - item.InterventionPrescription = this; + item.Intervention = this; + } + + if (_interventionPopulationServeds != null) foreach (var item in _interventionPopulationServeds) + { + item.Intervention = this; + } + + if (_interventionStaffs != null) foreach (var item in _interventionStaffs) + { + item.Intervention = this; + } + + if (_interventionURIs != null) foreach (var item in _interventionURIs) + { + item.Intervention = this; } } @@ -89075,25 +88010,25 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescription)target); + return Entities.Common.EdFi.InterventionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IIntervention)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescription)target, null); + Entities.Common.EdFi.InterventionMapper.MapTo(this, (Entities.Common.EdFi.IIntervention)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IIntervention.EducationOrganizationResourceId { get { return null; } set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IIntervention.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } @@ -89123,85 +88058,121 @@ string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscr // ---------------------- // Validate collections // ---------------------- - if (InterventionPrescriptionAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionAppropriateGradeLevels") != false) + if (InterventionAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("InterventionAppropriateGradeLevels") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPrescriptionAppropriateGradeLevels"); + pathBuilder.Append("InterventionAppropriateGradeLevels"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionAppropriateGradeLevels")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("InterventionAppropriateGradeLevels")))) { yield return result; } } - if (InterventionPrescriptionAppropriateSexes.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionAppropriateSexes") != false) + if (InterventionAppropriateSexes.Any() && mappingContract?.IsMemberSupported("InterventionAppropriateSexes") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPrescriptionAppropriateSexes"); + pathBuilder.Append("InterventionAppropriateSexes"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionAppropriateSexes, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionAppropriateSexes")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionAppropriateSexes, validationContext, validationContext.Items.ForCollection("InterventionAppropriateSexes")))) { yield return result; } } - if (InterventionPrescriptionDiagnoses.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionDiagnoses") != false) + if (InterventionDiagnoses.Any() && mappingContract?.IsMemberSupported("InterventionDiagnoses") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPrescriptionDiagnoses"); + pathBuilder.Append("InterventionDiagnoses"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionDiagnoses, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionDiagnoses")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionDiagnoses, validationContext, validationContext.Items.ForCollection("InterventionDiagnoses")))) { yield return result; } } - if (InterventionPrescriptionEducationContents.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionEducationContents") != false) + if (InterventionEducationContents.Any() && mappingContract?.IsMemberSupported("InterventionEducationContents") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPrescriptionEducationContents"); + pathBuilder.Append("InterventionEducationContents"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionEducationContents, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionEducationContents")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionEducationContents, validationContext, validationContext.Items.ForCollection("InterventionEducationContents")))) { yield return result; } } - if (InterventionPrescriptionLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionLearningResourceMetadataURIs") != false) + if (InterventionInterventionPrescriptions.Any() && mappingContract?.IsMemberSupported("InterventionInterventionPrescriptions") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPrescriptionLearningResourceMetadataURIs"); + pathBuilder.Append("InterventionInterventionPrescriptions"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionLearningResourceMetadataURIs")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionInterventionPrescriptions, validationContext, validationContext.Items.ForCollection("InterventionInterventionPrescriptions")))) { yield return result; } } - if (InterventionPrescriptionPopulationServeds.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionPopulationServeds") != false) + if (InterventionLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("InterventionLearningResourceMetadataURIs") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPrescriptionPopulationServeds"); + pathBuilder.Append("InterventionLearningResourceMetadataURIs"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionPopulationServeds, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionPopulationServeds")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("InterventionLearningResourceMetadataURIs")))) { yield return result; } } - if (InterventionPrescriptionURIs.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionURIs") != false) + if (InterventionMeetingTimes.Any() && mappingContract?.IsMemberSupported("InterventionMeetingTimes") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionPrescriptionURIs"); + pathBuilder.Append("InterventionMeetingTimes"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionURIs, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionURIs")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionMeetingTimes, validationContext, validationContext.Items.ForCollection("InterventionMeetingTimes")))) + { + yield return result; + } + } + + if (InterventionPopulationServeds.Any() && mappingContract?.IsMemberSupported("InterventionPopulationServeds") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPopulationServeds"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPopulationServeds, validationContext, validationContext.Items.ForCollection("InterventionPopulationServeds")))) + { + yield return result; + } + } + + if (InterventionStaffs.Any() && mappingContract?.IsMemberSupported("InterventionStaffs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionStaffs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStaffs, validationContext, validationContext.Items.ForCollection("InterventionStaffs")))) + { + yield return result; + } + } + + if (InterventionURIs.Any() && mappingContract?.IsMemberSupported("InterventionURIs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionURIs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionURIs, validationContext, validationContext.Items.ForCollection("InterventionURIs")))) { yield return result; } @@ -89252,20 +88223,23 @@ string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscr // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_InterventionPrescription = new FullName("edfi", "InterventionPrescription"); + private static readonly FullName _fullName_edfi_Intervention = new FullName("edfi", "Intervention"); // Declare collection item validators - private InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator _interventionPrescriptionAppropriateGradeLevelsValidator = new (); - private InterventionPrescriptionAppropriateSexPutPostRequestValidator _interventionPrescriptionAppropriateSexesValidator = new (); - private InterventionPrescriptionDiagnosisPutPostRequestValidator _interventionPrescriptionDiagnosesValidator = new (); - private InterventionPrescriptionEducationContentPutPostRequestValidator _interventionPrescriptionEducationContentsValidator = new (); - private InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator _interventionPrescriptionLearningResourceMetadataURIsValidator = new (); - private InterventionPrescriptionPopulationServedPutPostRequestValidator _interventionPrescriptionPopulationServedsValidator = new (); - private InterventionPrescriptionURIPutPostRequestValidator _interventionPrescriptionURIsValidator = new (); + private InterventionAppropriateGradeLevelPutPostRequestValidator _interventionAppropriateGradeLevelsValidator = new (); + private InterventionAppropriateSexPutPostRequestValidator _interventionAppropriateSexesValidator = new (); + private InterventionDiagnosisPutPostRequestValidator _interventionDiagnosesValidator = new (); + private InterventionEducationContentPutPostRequestValidator _interventionEducationContentsValidator = new (); + private InterventionInterventionPrescriptionPutPostRequestValidator _interventionInterventionPrescriptionsValidator = new (); + private InterventionLearningResourceMetadataURIPutPostRequestValidator _interventionLearningResourceMetadataURIsValidator = new (); + private InterventionMeetingTimePutPostRequestValidator _interventionMeetingTimesValidator = new (); + private InterventionPopulationServedPutPostRequestValidator _interventionPopulationServedsValidator = new (); + private InterventionStaffPutPostRequestValidator _interventionStaffsValidator = new (); + private InterventionURIPutPostRequestValidator _interventionURIsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -89282,85 +88256,118 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsInterventionPrescriptionAppropriateGradeLevelIncluded(x)); + var hasInvalidInterventionAppropriateGradeLevelsItems = instance.InterventionAppropriateGradeLevels.Any(x => !mappingContract.IsInterventionAppropriateGradeLevelIncluded(x)); - if (hasInvalidInterventionPrescriptionAppropriateGradeLevelsItems) + if (hasInvalidInterventionAppropriateGradeLevelsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPrescriptionAppropriateGradeLevels", $"A supplied 'InterventionPrescriptionAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionAppropriateGradeLevels", $"A supplied 'InterventionAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsInterventionPrescriptionAppropriateSexIncluded != null) + if (mappingContract.IsInterventionAppropriateSexIncluded != null) { - var hasInvalidInterventionPrescriptionAppropriateSexesItems = instance.InterventionPrescriptionAppropriateSexes.Any(x => !mappingContract.IsInterventionPrescriptionAppropriateSexIncluded(x)); + var hasInvalidInterventionAppropriateSexesItems = instance.InterventionAppropriateSexes.Any(x => !mappingContract.IsInterventionAppropriateSexIncluded(x)); - if (hasInvalidInterventionPrescriptionAppropriateSexesItems) + if (hasInvalidInterventionAppropriateSexesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPrescriptionAppropriateSexes", $"A supplied 'InterventionPrescriptionAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionAppropriateSexes", $"A supplied 'InterventionAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsInterventionPrescriptionDiagnosisIncluded != null) + if (mappingContract.IsInterventionDiagnosisIncluded != null) { - var hasInvalidInterventionPrescriptionDiagnosesItems = instance.InterventionPrescriptionDiagnoses.Any(x => !mappingContract.IsInterventionPrescriptionDiagnosisIncluded(x)); + var hasInvalidInterventionDiagnosesItems = instance.InterventionDiagnoses.Any(x => !mappingContract.IsInterventionDiagnosisIncluded(x)); - if (hasInvalidInterventionPrescriptionDiagnosesItems) + if (hasInvalidInterventionDiagnosesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPrescriptionDiagnoses", $"A supplied 'InterventionPrescriptionDiagnosis' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionDiagnoses", $"A supplied 'InterventionDiagnosis' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsInterventionPrescriptionEducationContentIncluded != null) + if (mappingContract.IsInterventionEducationContentIncluded != null) { - var hasInvalidInterventionPrescriptionEducationContentsItems = instance.InterventionPrescriptionEducationContents.Any(x => !mappingContract.IsInterventionPrescriptionEducationContentIncluded(x)); + var hasInvalidInterventionEducationContentsItems = instance.InterventionEducationContents.Any(x => !mappingContract.IsInterventionEducationContentIncluded(x)); - if (hasInvalidInterventionPrescriptionEducationContentsItems) + if (hasInvalidInterventionEducationContentsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPrescriptionEducationContents", $"A supplied 'InterventionPrescriptionEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionEducationContents", $"A supplied 'InterventionEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsInterventionPrescriptionLearningResourceMetadataURIIncluded != null) + if (mappingContract.IsInterventionInterventionPrescriptionIncluded != null) { - var hasInvalidInterventionPrescriptionLearningResourceMetadataURIsItems = instance.InterventionPrescriptionLearningResourceMetadataURIs.Any(x => !mappingContract.IsInterventionPrescriptionLearningResourceMetadataURIIncluded(x)); + var hasInvalidInterventionInterventionPrescriptionsItems = instance.InterventionInterventionPrescriptions.Any(x => !mappingContract.IsInterventionInterventionPrescriptionIncluded(x)); - if (hasInvalidInterventionPrescriptionLearningResourceMetadataURIsItems) + if (hasInvalidInterventionInterventionPrescriptionsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPrescriptionLearningResourceMetadataURIs", $"A supplied 'InterventionPrescriptionLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionInterventionPrescriptions", $"A supplied 'InterventionInterventionPrescription' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsInterventionPrescriptionPopulationServedIncluded != null) + if (mappingContract.IsInterventionLearningResourceMetadataURIIncluded != null) { - var hasInvalidInterventionPrescriptionPopulationServedsItems = instance.InterventionPrescriptionPopulationServeds.Any(x => !mappingContract.IsInterventionPrescriptionPopulationServedIncluded(x)); + var hasInvalidInterventionLearningResourceMetadataURIsItems = instance.InterventionLearningResourceMetadataURIs.Any(x => !mappingContract.IsInterventionLearningResourceMetadataURIIncluded(x)); - if (hasInvalidInterventionPrescriptionPopulationServedsItems) + if (hasInvalidInterventionLearningResourceMetadataURIsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPrescriptionPopulationServeds", $"A supplied 'InterventionPrescriptionPopulationServed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionLearningResourceMetadataURIs", $"A supplied 'InterventionLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsInterventionPrescriptionURIIncluded != null) + if (mappingContract.IsInterventionMeetingTimeIncluded != null) { - var hasInvalidInterventionPrescriptionURIsItems = instance.InterventionPrescriptionURIs.Any(x => !mappingContract.IsInterventionPrescriptionURIIncluded(x)); + var hasInvalidInterventionMeetingTimesItems = instance.InterventionMeetingTimes.Any(x => !mappingContract.IsInterventionMeetingTimeIncluded(x)); - if (hasInvalidInterventionPrescriptionURIsItems) + if (hasInvalidInterventionMeetingTimesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionPrescriptionURIs", $"A supplied 'InterventionPrescriptionURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionMeetingTimes", $"A supplied 'InterventionMeetingTime' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionPopulationServedIncluded != null) + { + var hasInvalidInterventionPopulationServedsItems = instance.InterventionPopulationServeds.Any(x => !mappingContract.IsInterventionPopulationServedIncluded(x)); + + if (hasInvalidInterventionPopulationServedsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPopulationServeds", $"A supplied 'InterventionPopulationServed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionStaffIncluded != null) + { + var hasInvalidInterventionStaffsItems = instance.InterventionStaffs.Any(x => !mappingContract.IsInterventionStaffIncluded(x)); + + if (hasInvalidInterventionStaffsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionStaffs", $"A supplied 'InterventionStaff' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionURIIncluded != null) + { + var hasInvalidInterventionURIsItems = instance.InterventionURIs.Any(x => !mappingContract.IsInterventionURIIncluded(x)); + + if (hasInvalidInterventionURIsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionURIs", $"A supplied 'InterventionURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -89382,16 +88389,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPrescriptionAppropriateGradeLevel table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.InterventionAppropriateGradeLevel table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionAppropriateGradeLevel : Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel, IValidatableObject + public class InterventionAppropriateGradeLevel : Entities.Common.EdFi.IInterventionAppropriateGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionAppropriateGradeLevel"); + private static FullName _fullName = new FullName("edfi", "InterventionAppropriateGradeLevel"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator _validator = new InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator(); + private static InterventionAppropriateGradeLevelPutPostRequestValidator _validator = new InterventionAppropriateGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -89418,27 +88425,27 @@ public class InterventionPrescriptionAppropriateGradeLevel : Entities.Common.EdF //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateGradeLevel.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionAppropriateGradeLevel.Intervention { - get { return _interventionPrescription; } - set { SetInterventionPrescription(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionPrescription(value); } + set { SetIntervention(value); } } - private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionPrescription = value; + _intervention = value; } /// - /// Grade levels for the prescribed intervention. If omitted, considered generally applicable. + /// Grade levels for the intervention. If omitted, considered generally applicable. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] @@ -89459,7 +88466,7 @@ private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPresc /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IInterventionAppropriateGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -89468,12 +88475,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -89490,11 +88497,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionPrescription != null) - hash.Add(_interventionPrescription); + if (_intervention != null) + hash.Add(_intervention); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel).GradeLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionAppropriateGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -89528,7 +88535,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionAppropriateGradeLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionAppropriateGradeLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -89552,12 +88559,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)target); + return Entities.Common.EdFi.InterventionAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionAppropriateGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)target, null); + Entities.Common.EdFi.InterventionAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IInterventionAppropriateGradeLevel)target, null); } // ------------------------------------------------------------- @@ -89632,9 +88639,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -89663,16 +88670,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPrescriptionAppropriateSex table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.InterventionAppropriateSex table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionAppropriateSex : Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex, IValidatableObject + public class InterventionAppropriateSex : Entities.Common.EdFi.IInterventionAppropriateSex, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionAppropriateSex"); + private static FullName _fullName = new FullName("edfi", "InterventionAppropriateSex"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionAppropriateSexPutPostRequestValidator _validator = new InterventionPrescriptionAppropriateSexPutPostRequestValidator(); + private static InterventionAppropriateSexPutPostRequestValidator _validator = new InterventionAppropriateSexPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -89699,27 +88706,27 @@ public class InterventionPrescriptionAppropriateSex : Entities.Common.EdFi.IInte //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateSex.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionAppropriateSex.Intervention { - get { return _interventionPrescription; } - set { SetInterventionPrescription(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionPrescription(value); } + set { SetIntervention(value); } } - private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionPrescription = value; + _intervention = value; } /// - /// Sexes for the intervention prescription. If omitted, considered generally applicable. + /// Sexes for the intervention. If omitted, considered generally applicable. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] @@ -89740,7 +88747,7 @@ private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPresc /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex; + var compareTo = obj as Entities.Common.EdFi.IInterventionAppropriateSex; if (ReferenceEquals(this, compareTo)) return true; @@ -89749,12 +88756,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) return false; @@ -89771,11 +88778,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionPrescription != null) - hash.Add(_interventionPrescription); + if (_intervention != null) + hash.Add(_intervention); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex).SexDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionAppropriateSex).SexDescriptor); return hash.ToHashCode(); } @@ -89809,7 +88816,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionAppropriateSex")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionAppropriateSex")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -89833,12 +88840,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)target); + return Entities.Common.EdFi.InterventionAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionAppropriateSex)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)target, null); + Entities.Common.EdFi.InterventionAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IInterventionAppropriateSex)target, null); } // ------------------------------------------------------------- @@ -89913,9 +88920,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -89944,16 +88951,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPrescriptionDiagnosis table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.InterventionDiagnosis table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionDiagnosis : Entities.Common.EdFi.IInterventionPrescriptionDiagnosis, IValidatableObject + public class InterventionDiagnosis : Entities.Common.EdFi.IInterventionDiagnosis, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionDiagnosis"); + private static FullName _fullName = new FullName("edfi", "InterventionDiagnosis"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionDiagnosisPutPostRequestValidator _validator = new InterventionPrescriptionDiagnosisPutPostRequestValidator(); + private static InterventionDiagnosisPutPostRequestValidator _validator = new InterventionDiagnosisPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -89980,27 +88987,27 @@ public class InterventionPrescriptionDiagnosis : Entities.Common.EdFi.IIntervent //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionDiagnosis.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionDiagnosis.Intervention { - get { return _interventionPrescription; } - set { SetInterventionPrescription(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionPrescription(value); } + set { SetIntervention(value); } } - private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionPrescription = value; + _intervention = value; } /// - /// Targeted purpose of the intervention prescription. + /// Targeted purpose of the intervention. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] @@ -90021,7 +89028,7 @@ private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPresc /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionDiagnosis; + var compareTo = obj as Entities.Common.EdFi.IInterventionDiagnosis; if (ReferenceEquals(this, compareTo)) return true; @@ -90030,12 +89037,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionDiagnosis).DiagnosisDescriptor, compareTo.DiagnosisDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionDiagnosis).DiagnosisDescriptor, compareTo.DiagnosisDescriptor)) return false; @@ -90052,11 +89059,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionPrescription != null) - hash.Add(_interventionPrescription); + if (_intervention != null) + hash.Add(_intervention); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionDiagnosis).DiagnosisDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionDiagnosis).DiagnosisDescriptor); return hash.ToHashCode(); } @@ -90090,7 +89097,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionDiagnosis")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionDiagnosis")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -90114,12 +89121,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionDiagnosisMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)target); + return Entities.Common.EdFi.InterventionDiagnosisMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionDiagnosis)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionDiagnosisMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)target, null); + Entities.Common.EdFi.InterventionDiagnosisMapper.MapTo(this, (Entities.Common.EdFi.IInterventionDiagnosis)target, null); } // ------------------------------------------------------------- @@ -90194,9 +89201,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionDiagnosisPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionDiagnosisPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -90225,16 +89232,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPrescriptionEducationContent table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.InterventionEducationContent table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionEducationContent : Entities.Common.EdFi.IInterventionPrescriptionEducationContent, IValidatableObject + public class InterventionEducationContent : Entities.Common.EdFi.IInterventionEducationContent, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionEducationContent"); + private static FullName _fullName = new FullName("edfi", "InterventionEducationContent"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionEducationContentPutPostRequestValidator _validator = new InterventionPrescriptionEducationContentPutPostRequestValidator(); + private static InterventionEducationContentPutPostRequestValidator _validator = new InterventionEducationContentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -90295,30 +89302,30 @@ public EducationContent.EdFi.EducationContentReference EducationContentReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionEducationContent.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention { - get { return _interventionPrescription; } - set { SetInterventionPrescription(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionPrescription(value); } + set { SetIntervention(value); } } - private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionPrescription = value; + _intervention = value; } /// /// A unique identifier for the education content. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.ContentIdentifier + string Entities.Common.EdFi.IInterventionEducationContent.ContentIdentifier { get { @@ -90352,7 +89359,7 @@ string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.ContentIde /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionEducationContent; + var compareTo = obj as Entities.Common.EdFi.IInterventionEducationContent; if (ReferenceEquals(this, compareTo)) return true; @@ -90361,12 +89368,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) return false; @@ -90383,11 +89390,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionPrescription != null) - hash.Add(_interventionPrescription); + if (_intervention != null) + hash.Add(_intervention); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionEducationContent).ContentIdentifier); + hash.Add((this as Entities.Common.EdFi.IInterventionEducationContent).ContentIdentifier); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -90420,7 +89427,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionEducationContent")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionEducationContent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -90444,25 +89451,25 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionEducationContent)target); + return Entities.Common.EdFi.InterventionEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionEducationContent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionEducationContent)target, null); + Entities.Common.EdFi.InterventionEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IInterventionEducationContent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentResourceId + Guid? Entities.Common.EdFi.IInterventionEducationContent.EducationContentResourceId { get { return null; } set { ImplicitEducationContentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentDiscriminator + string Entities.Common.EdFi.IInterventionEducationContent.EducationContentDiscriminator { // Not supported for Resources get { return null; } @@ -90538,9 +89545,9 @@ string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationC // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -90569,16 +89576,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPrescriptionLearningResourceMetadataURI table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.InterventionInterventionPrescription table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionLearningResourceMetadataURI : Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI, IValidatableObject + public class InterventionInterventionPrescription : Entities.Common.EdFi.IInterventionInterventionPrescription, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionLearningResourceMetadataURI"); + private static FullName _fullName = new FullName("edfi", "InterventionInterventionPrescription"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator _validator = new InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator(); + private static InterventionInterventionPrescriptionPutPostRequestValidator _validator = new InterventionInterventionPrescriptionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -90600,38 +89607,113 @@ public class InterventionPrescriptionLearningResourceMetadataURI : Entities.Comm // ============================================================= // References // ------------------------------------------------------------- + + private bool _interventionPrescriptionReferenceExplicitlyAssigned; + private InterventionPrescription.EdFi.InterventionPrescriptionReference _interventionPrescriptionReference; + private InterventionPrescription.EdFi.InterventionPrescriptionReference ImplicitInterventionPrescriptionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_interventionPrescriptionReference == null && !_interventionPrescriptionReferenceExplicitlyAssigned) + _interventionPrescriptionReference = new InterventionPrescription.EdFi.InterventionPrescriptionReference(); + + return _interventionPrescriptionReference; + } + } + + [DataMember(Name="interventionPrescriptionReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public InterventionPrescription.EdFi.InterventionPrescriptionReference InterventionPrescriptionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitInterventionPrescriptionReference != null + && (_interventionPrescriptionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + return ImplicitInterventionPrescriptionReference; + + return null; + } + set + { + _interventionPrescriptionReferenceExplicitlyAssigned = true; + _interventionPrescriptionReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionLearningResourceMetadataURI.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Intervention { - get { return _interventionPrescription; } - set { SetInterventionPrescription(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionPrescription(value); } + set { SetIntervention(value); } } - private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionPrescription = value; + _intervention = value; } /// - /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="learningResourceMetadataURI")] - public string LearningResourceMetadataURI { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionEducationOrganizationId + { + get + { + if (ImplicitInterventionPrescriptionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + return ImplicitInterventionPrescriptionReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // InterventionPrescription + _interventionPrescriptionReferenceExplicitlyAssigned = false; + ImplicitInterventionPrescriptionReference.EducationOrganizationId = value; + } + } + + /// + /// A unique number or alphanumeric code assigned to an intervention prescription. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionIdentificationCode + { + get + { + if (ImplicitInterventionPrescriptionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + return ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // InterventionPrescription + _interventionPrescriptionReferenceExplicitlyAssigned = false; + ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -90646,7 +89728,7 @@ private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPresc /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI; + var compareTo = obj as Entities.Common.EdFi.IInterventionInterventionPrescription; if (ReferenceEquals(this, compareTo)) return true; @@ -90655,12 +89737,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI).LearningResourceMetadataURI, compareTo.LearningResourceMetadataURI)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionEducationOrganizationId.Equals(compareTo.InterventionPrescriptionEducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionIdentificationCode, compareTo.InterventionPrescriptionIdentificationCode)) return false; @@ -90677,12 +89764,14 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionPrescription != null) - hash.Add(_interventionPrescription); + if (_intervention != null) + hash.Add(_intervention); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI).LearningResourceMetadataURI); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionEducationOrganizationId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IInterventionInterventionPrescription).InterventionPrescriptionIdentificationCode); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -90715,7 +89804,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionLearningResourceMetadataURI")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionInterventionPrescription")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -90739,18 +89828,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionLearningResourceMetadataURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)target); + return Entities.Common.EdFi.InterventionInterventionPrescriptionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionInterventionPrescription)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionLearningResourceMetadataURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)target, null); + Entities.Common.EdFi.InterventionInterventionPrescriptionMapper.MapTo(this, (Entities.Common.EdFi.IInterventionInterventionPrescription)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionResourceId + { + get { return null; } + set { ImplicitInterventionPrescriptionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IInterventionInterventionPrescription.InterventionPrescriptionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitInterventionPrescriptionReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -90819,9 +89922,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionInterventionPrescriptionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -90850,16 +89953,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPrescriptionPopulationServed table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.InterventionLearningResourceMetadataURI table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionPopulationServed : Entities.Common.EdFi.IInterventionPrescriptionPopulationServed, IValidatableObject + public class InterventionLearningResourceMetadataURI : Entities.Common.EdFi.IInterventionLearningResourceMetadataURI, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionPopulationServed"); + private static FullName _fullName = new FullName("edfi", "InterventionLearningResourceMetadataURI"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionPopulationServedPutPostRequestValidator _validator = new InterventionPrescriptionPopulationServedPutPostRequestValidator(); + private static InterventionLearningResourceMetadataURIPutPostRequestValidator _validator = new InterventionLearningResourceMetadataURIPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -90886,33 +89989,33 @@ public class InterventionPrescriptionPopulationServed : Entities.Common.EdFi.IIn //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionPopulationServed.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Intervention { - get { return _interventionPrescription; } - set { SetInterventionPrescription(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionPrescription(value); } + set { SetIntervention(value); } } - private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionPrescription = value; + _intervention = value; } /// - /// A subset of students that are the focus of the intervention prescription. + /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] - public string PopulationServedDescriptor { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="learningResourceMetadataURI")] + public string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -90927,7 +90030,7 @@ private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPresc /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionPopulationServed; + var compareTo = obj as Entities.Common.EdFi.IInterventionLearningResourceMetadataURI; if (ReferenceEquals(this, compareTo)) return true; @@ -90936,12 +90039,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionPopulationServed).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionLearningResourceMetadataURI).LearningResourceMetadataURI, compareTo.LearningResourceMetadataURI)) return false; @@ -90958,11 +90061,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionPrescription != null) - hash.Add(_interventionPrescription); + if (_intervention != null) + hash.Add(_intervention); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionPopulationServed).PopulationServedDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionLearningResourceMetadataURI).LearningResourceMetadataURI); return hash.ToHashCode(); } @@ -90996,7 +90099,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionPopulationServed")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionLearningResourceMetadataURI")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -91020,12 +90123,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionPopulationServedMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)target); + return Entities.Common.EdFi.InterventionLearningResourceMetadataURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionPopulationServedMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)target, null); + Entities.Common.EdFi.InterventionLearningResourceMetadataURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionLearningResourceMetadataURI)target, null); } // ------------------------------------------------------------- @@ -91100,9 +90203,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionPopulationServedPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -91131,16 +90234,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionPrescriptionURI table of the InterventionPrescription aggregate in the ODS Database. + /// A class which represents the edfi.InterventionMeetingTime table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionPrescriptionURI : Entities.Common.EdFi.IInterventionPrescriptionURI, IValidatableObject + public class InterventionMeetingTime : Entities.Common.EdFi.IInterventionMeetingTime, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionURI"); + private static FullName _fullName = new FullName("edfi", "InterventionMeetingTime"); // Fluent validator instance (threadsafe) - private static InterventionPrescriptionURIPutPostRequestValidator _validator = new InterventionPrescriptionURIPutPostRequestValidator(); + private static InterventionMeetingTimePutPostRequestValidator _validator = new InterventionMeetingTimePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -91167,33 +90270,40 @@ public class InterventionPrescriptionURI : Entities.Common.EdFi.IInterventionPre //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.InterventionPrescription + Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention { - get { return _interventionPrescription; } - set { SetInterventionPrescription(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionPrescription(value); } + set { SetIntervention(value); } } - private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionPrescription = value; + _intervention = value; } /// - /// The URI (typical a URL) pointing to an education content item. + /// An indication of the time of day the meeting time ends. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="uri")] - public string URI { get; set; } + [DataMember(Name="endTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan EndTime { get; set; } + + /// + /// An indication of the time of day the meeting time begins. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="startTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan StartTime { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -91208,7 +90318,7 @@ private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPresc /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionURI; + var compareTo = obj as Entities.Common.EdFi.IInterventionMeetingTime; if (ReferenceEquals(this, compareTo)) return true; @@ -91217,12 +90327,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionURI).URI, compareTo.URI)) + if (!(this as Entities.Common.EdFi.IInterventionMeetingTime).EndTime.Equals(compareTo.EndTime)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IInterventionMeetingTime).StartTime.Equals(compareTo.StartTime)) return false; @@ -91239,11 +90354,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionPrescription != null) - hash.Add(_interventionPrescription); + if (_intervention != null) + hash.Add(_intervention); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionURI).URI); + hash.Add((this as Entities.Common.EdFi.IInterventionMeetingTime).EndTime); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionMeetingTime).StartTime); return hash.ToHashCode(); } @@ -91277,7 +90396,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionURI")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionMeetingTime")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -91301,12 +90420,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionPrescriptionURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionURI)target); + return Entities.Common.EdFi.InterventionMeetingTimeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionMeetingTime)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionPrescriptionURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionURI)target, null); + Entities.Common.EdFi.InterventionMeetingTimeMapper.MapTo(this, (Entities.Common.EdFi.IInterventionMeetingTime)target, null); } // ------------------------------------------------------------- @@ -91381,9 +90500,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionPrescriptionURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionMeetingTimePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -91411,120 +90530,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the InterventionStudy resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class InterventionStudyReference : IResourceReference - { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="interventionStudyIdentificationCode")] - public string InterventionStudyIdentificationCode { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return EducationOrganizationId != default(long) && InterventionStudyIdentificationCode != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (InterventionStudyIdentificationCode == default) - { - yield return "InterventionStudyIdentificationCode"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "InterventionStudy", - Href = $"/ed-fi/interventionStudies/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.InterventionStudy table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPopulationServed table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class InterventionStudy : Entities.Common.EdFi.IInterventionStudy, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class InterventionPopulationServed : Entities.Common.EdFi.IInterventionPopulationServed, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionStudy"); + private static FullName _fullName = new FullName("edfi", "InterventionPopulationServed"); // Fluent validator instance (threadsafe) - private static InterventionStudyPutPostRequestValidator _validator = new InterventionStudyPutPostRequestValidator(); + private static InterventionPopulationServedPutPostRequestValidator _validator = new InterventionPopulationServedPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -91535,141 +90551,49 @@ public class InterventionStudy : Entities.Common.EdFi.IInterventionStudy, IHasET // Constructor // ------------------------------------------------------------- - public InterventionStudy() - { - InterventionStudyAppropriateGradeLevels = new List(); - InterventionStudyAppropriateSexes = new List(); - InterventionStudyEducationContents = new List(); - InterventionStudyInterventionEffectivenesses = new List(); - InterventionStudyLearningResourceMetadataURIs = new List(); - InterventionStudyPopulationServeds = new List(); - InterventionStudyStateAbbreviations = new List(); - InterventionStudyURIs = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the InterventionStudy resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } - private bool _interventionPrescriptionReferenceExplicitlyAssigned; - private InterventionPrescription.EdFi.InterventionPrescriptionReference _interventionPrescriptionReference; - private InterventionPrescription.EdFi.InterventionPrescriptionReference ImplicitInterventionPrescriptionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_interventionPrescriptionReference == null && !_interventionPrescriptionReferenceExplicitlyAssigned) - _interventionPrescriptionReference = new InterventionPrescription.EdFi.InterventionPrescriptionReference(); - - return _interventionPrescriptionReference; - } - } - - [DataMember(Name="interventionPrescriptionReference")] - [FullyDefinedReference][RequiredReference("edfi", "InterventionStudy")] - public InterventionPrescription.EdFi.InterventionPrescriptionReference InterventionPrescriptionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitInterventionPrescriptionReference != null - && (_interventionPrescriptionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - return ImplicitInterventionPrescriptionReference; - - return null; - } - set - { - _interventionPrescriptionReferenceExplicitlyAssigned = true; - _interventionPrescriptionReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IIntervention _intervention; - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IInterventionStudy.EducationOrganizationId + [IgnoreDataMember] + Entities.Common.EdFi.IIntervention IInterventionPopulationServed.Intervention { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; + get { return _intervention; } + set { SetIntervention(value); } + } - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + public Entities.Common.EdFi.IIntervention Intervention + { + set { SetIntervention(value); } + } - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } + private void SetIntervention(Entities.Common.EdFi.IIntervention value) + { + _intervention = value; } /// - /// A unique number or alphanumeric code assigned to an intervention study. + /// A subset of students that are the focus of the intervention. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="interventionStudyIdentificationCode")] - public string InterventionStudyIdentificationCode { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] + public string PopulationServedDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -91684,7 +90608,7 @@ long Entities.Common.EdFi.IInterventionStudy.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudy; + var compareTo = obj as Entities.Common.EdFi.IInterventionPopulationServed; if (ReferenceEquals(this, compareTo)) return true; @@ -91692,14 +90616,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!(this as Entities.Common.EdFi.IInterventionStudy).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + // Parent Property + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudy).InterventionStudyIdentificationCode, compareTo.InterventionStudyIdentificationCode)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPopulationServed).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) return false; @@ -91715,12 +90638,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudy).EducationOrganizationId); + //Parent Property + if (_intervention != null) + hash.Add(_intervention); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudy).InterventionStudyIdentificationCode); + hash.Add((this as Entities.Common.EdFi.IInterventionPopulationServed).PopulationServedDescriptor); return hash.ToHashCode(); } @@ -91734,107 +90657,8 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The way in which an intervention was implemented: individual, small group, whole class, or whole school. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="deliveryMethodDescriptor")][DescriptorExists("DeliveryMethodDescriptor")] - public string DeliveryMethodDescriptor { get; set; } - - /// - /// The way in which an intervention is used: curriculum, supplement, or practice. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="interventionClassDescriptor")][DescriptorExists("InterventionClassDescriptor")] - public string InterventionClassDescriptor { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionEducationOrganizationId - { - get - { - if (ImplicitInterventionPrescriptionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - { - return ImplicitInterventionPrescriptionReference.EducationOrganizationId; - } - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // InterventionPrescription - _interventionPrescriptionReferenceExplicitlyAssigned = false; - ImplicitInterventionPrescriptionReference.EducationOrganizationId = value; - } - } - - /// - /// A unique number or alphanumeric code assigned to an intervention prescription. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionIdentificationCode - { - get - { - if (ImplicitInterventionPrescriptionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) - { - return ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // InterventionPrescription - _interventionPrescriptionReferenceExplicitlyAssigned = false; - ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode = value; - } - } - - private bool _participantsExplicitlyAssigned = false; - private int _participants; - - /// - /// The number of participants observed in the study. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="participants")] - public int Participants - { - get => _participants; - set - { - _participants = value; - _participantsExplicitlyAssigned = true; - } - } - // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_participantsExplicitlyAssigned) - { - yield return "Participants"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -91853,316 +90677,354 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudy")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionPopulationServed")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _interventionStudyAppropriateGradeLevels; - private ICollection _interventionStudyAppropriateGradeLevelsCovariant; + // ------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="appropriateGradeLevels")] - public ICollection InterventionStudyAppropriateGradeLevels - { - get { return _interventionStudyAppropriateGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)e.Item).InterventionStudy = this); - _interventionStudyAppropriateGradeLevels = list; + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)e.Item).InterventionStudy = this; - _interventionStudyAppropriateGradeLevelsCovariant = covariantList; - } + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.InterventionPopulationServedMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPopulationServed)target); } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateGradeLevels + void IMappable.Map(object target) { - get { return _interventionStudyAppropriateGradeLevelsCovariant; } - set { InterventionStudyAppropriateGradeLevels = new List(value.Cast()); } + Entities.Common.EdFi.InterventionPopulationServedMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPopulationServed)target, null); } + // ------------------------------------------------------------- - private ICollection _interventionStudyAppropriateSexes; - private ICollection _interventionStudyAppropriateSexesCovariant; + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="appropriateSexes")] - public ICollection InterventionStudyAppropriateSexes + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - get { return _interventionStudyAppropriateSexes; } - set + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateSex)e.Item).InterventionStudy = this); - _interventionStudyAppropriateSexes = list; + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateSex)e.Item).InterventionStudy = this; - _interventionStudyAppropriateSexesCovariant = covariantList; - } - } + // ---------------------- + // Validate collections + // ---------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateSexes - { - get { return _interventionStudyAppropriateSexesCovariant; } - set { InterventionStudyAppropriateSexes = new List(value.Cast()); } + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- } + } - private ICollection _interventionStudyEducationContents; - private ICollection _interventionStudyEducationContentsCovariant; + // ================================================================= + // Validators + // ----------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="educationContents")] - public ICollection InterventionStudyEducationContents + [ExcludeFromCodeCoverage] + public class InterventionPopulationServedPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - get { return _interventionStudyEducationContents; } - set + if (context.InstanceToValidate == null) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyEducationContent)e.Item).InterventionStudy = this); - _interventionStudyEducationContents = list; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyEducationContent)e.Item).InterventionStudy = this; - _interventionStudyEducationContentsCovariant = covariantList; + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyEducationContents - { - get { return _interventionStudyEducationContentsCovariant; } - set { InterventionStudyEducationContents = new List(value.Cast()); } - } + var instance = context.InstanceToValidate; - private ICollection _interventionStudyInterventionEffectivenesses; - private ICollection _interventionStudyInterventionEffectivenessesCovariant; + var failures = new List(); - [NoDuplicateMembers] - [DataMember(Name="interventionEffectivenesses")] - public ICollection InterventionStudyInterventionEffectivenesses - { - get { return _interventionStudyInterventionEffectivenesses; } - set + if (failures.Any()) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)e.Item).InterventionStudy = this); - _interventionStudyInterventionEffectivenesses = list; + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)e.Item).InterventionStudy = this; - _interventionStudyInterventionEffectivenessesCovariant = covariantList; + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyInterventionEffectivenesses - { - get { return _interventionStudyInterventionEffectivenessesCovariant; } - set { InterventionStudyInterventionEffectivenesses = new List(value.Cast()); } + return true; } + } + // ----------------------------------------------------------------- - private ICollection _interventionStudyLearningResourceMetadataURIs; - private ICollection _interventionStudyLearningResourceMetadataURIsCovariant; + /// + /// A class which represents the edfi.InterventionStaff table of the Intervention aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class InterventionStaff : Entities.Common.EdFi.IInterventionStaff, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "InterventionStaff"); - [NoDuplicateMembers] - [DataMember(Name="learningResourceMetadataURIs")] - public ICollection InterventionStudyLearningResourceMetadataURIs + // Fluent validator instance (threadsafe) + private static InterventionStaffPutPostRequestValidator _validator = new InterventionStaffPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference { - get { return _interventionStudyLearningResourceMetadataURIs; } - set + get { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)e.Item).InterventionStudy = this); - _interventionStudyLearningResourceMetadataURIs = list; + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)e.Item).InterventionStudy = this; - _interventionStudyLearningResourceMetadataURIsCovariant = covariantList; + return _staffReference; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyLearningResourceMetadataURIs + [DataMember(Name="staffReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Staff.EdFi.StaffReference StaffReference { - get { return _interventionStudyLearningResourceMetadataURIsCovariant; } - set { InterventionStudyLearningResourceMetadataURIs = new List(value.Cast()); } - } - - private ICollection _interventionStudyPopulationServeds; - private ICollection _interventionStudyPopulationServedsCovariant; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; - [NoDuplicateMembers] - [DataMember(Name="populationServeds")] - public ICollection InterventionStudyPopulationServeds - { - get { return _interventionStudyPopulationServeds; } + return null; + } set { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyPopulationServed)e.Item).InterventionStudy = this); - _interventionStudyPopulationServeds = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyPopulationServed)e.Item).InterventionStudy = this; - _interventionStudyPopulationServedsCovariant = covariantList; + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; } } + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyPopulationServeds + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IIntervention _intervention; + + [IgnoreDataMember] + Entities.Common.EdFi.IIntervention IInterventionStaff.Intervention { - get { return _interventionStudyPopulationServedsCovariant; } - set { InterventionStudyPopulationServeds = new List(value.Cast()); } + get { return _intervention; } + set { SetIntervention(value); } } - private ICollection _interventionStudyStateAbbreviations; - private ICollection _interventionStudyStateAbbreviationsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="stateAbbreviations")] - public ICollection InterventionStudyStateAbbreviations + public Entities.Common.EdFi.IIntervention Intervention { - get { return _interventionStudyStateAbbreviations; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyStateAbbreviation)e.Item).InterventionStudy = this); - _interventionStudyStateAbbreviations = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyStateAbbreviation)e.Item).InterventionStudy = this; - _interventionStudyStateAbbreviationsCovariant = covariantList; - } + set { SetIntervention(value); } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyStateAbbreviations + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - get { return _interventionStudyStateAbbreviationsCovariant; } - set { InterventionStudyStateAbbreviations = new List(value.Cast()); } + _intervention = value; } - private ICollection _interventionStudyURIs; - private ICollection _interventionStudyURIsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="uris")] - public ICollection InterventionStudyURIs + /// + /// A unique alphanumeric code assigned to a staff. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IInterventionStaff.StaffUniqueId { - get { return _interventionStudyURIs; } + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; + + return default(string); + } set { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IInterventionStudyURI)e.Item).InterventionStudy = this); - _interventionStudyURIs = list; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyURI)e.Item).InterventionStudy = this; - _interventionStudyURIsCovariant = covariantList; + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); } } + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyURIs + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get { return _interventionStudyURIsCovariant; } - set { InterventionStudyURIs = new List(value.Cast()); } + var compareTo = obj as Entities.Common.EdFi.IInterventionStaff; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStaff).StaffUniqueId, compareTo.StaffUniqueId)) + return false; + + + return true; } + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_intervention != null) + hash.Add(_intervention); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IInterventionStaff).StaffUniqueId); + return hash.ToHashCode(); + } // ------------------------------------------------------------- // ============================================================= - // Versioning + // Inherited Properties // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- + // ============================================================= + // Properties // ------------------------------------------------------------- - // OnDeserialize // ------------------------------------------------------------- - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_interventionStudyAppropriateGradeLevels != null) foreach (var item in _interventionStudyAppropriateGradeLevels) - { - item.InterventionStudy = this; - } - - if (_interventionStudyAppropriateSexes != null) foreach (var item in _interventionStudyAppropriateSexes) - { - item.InterventionStudy = this; - } - - if (_interventionStudyEducationContents != null) foreach (var item in _interventionStudyEducationContents) - { - item.InterventionStudy = this; - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_interventionStudyInterventionEffectivenesses != null) foreach (var item in _interventionStudyInterventionEffectivenesses) - { - item.InterventionStudy = this; - } + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_interventionStudyLearningResourceMetadataURIs != null) foreach (var item in _interventionStudyLearningResourceMetadataURIs) - { - item.InterventionStudy = this; - } + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_interventionStudyPopulationServeds != null) foreach (var item in _interventionStudyPopulationServeds) - { - item.InterventionStudy = this; - } + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionStaff")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- - if (_interventionStudyStateAbbreviations != null) foreach (var item in _interventionStudyStateAbbreviations) - { - item.InterventionStudy = this; - } + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_interventionStudyURIs != null) foreach (var item in _interventionStudyURIs) - { - item.InterventionStudy = this; - } + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- - } + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- // ------------------------------------------------------------ // ============================================================ @@ -92170,43 +91032,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudy)target); + return Entities.Common.EdFi.InterventionStaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStaff)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudy)target, null); + Entities.Common.EdFi.InterventionStaffMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStaff)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IInterventionStudy.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IInterventionStudy.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionResourceId + Guid? Entities.Common.EdFi.IInterventionStaff.StaffResourceId { get { return null; } - set { ImplicitInterventionPrescriptionReference.ResourceId = value ?? default(Guid); } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionDiscriminator + string Entities.Common.EdFi.IInterventionStaff.StaffDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitInterventionPrescriptionReference.Discriminator = value; } + set { ImplicitStaffReference.Discriminator = value; } } @@ -92227,129 +91075,34 @@ string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionDiscrimin try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (InterventionStudyAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("InterventionStudyAppropriateGradeLevels") != false) + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyAppropriateGradeLevels"); + pathBuilder.Append(nameof(Extensions)); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("InterventionStudyAppropriateGradeLevels")))) + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) { yield return result; } } - - if (InterventionStudyAppropriateSexes.Any() && mappingContract?.IsMemberSupported("InterventionStudyAppropriateSexes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyAppropriateSexes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyAppropriateSexes, validationContext, validationContext.Items.ForCollection("InterventionStudyAppropriateSexes")))) - { - yield return result; - } - } - - if (InterventionStudyEducationContents.Any() && mappingContract?.IsMemberSupported("InterventionStudyEducationContents") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyEducationContents"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyEducationContents, validationContext, validationContext.Items.ForCollection("InterventionStudyEducationContents")))) - { - yield return result; - } - } - - if (InterventionStudyInterventionEffectivenesses.Any() && mappingContract?.IsMemberSupported("InterventionStudyInterventionEffectivenesses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyInterventionEffectivenesses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyInterventionEffectivenesses, validationContext, validationContext.Items.ForCollection("InterventionStudyInterventionEffectivenesses")))) - { - yield return result; - } - } - - if (InterventionStudyLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("InterventionStudyLearningResourceMetadataURIs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyLearningResourceMetadataURIs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("InterventionStudyLearningResourceMetadataURIs")))) - { - yield return result; - } - } - - if (InterventionStudyPopulationServeds.Any() && mappingContract?.IsMemberSupported("InterventionStudyPopulationServeds") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyPopulationServeds"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyPopulationServeds, validationContext, validationContext.Items.ForCollection("InterventionStudyPopulationServeds")))) - { - yield return result; - } - } - - if (InterventionStudyStateAbbreviations.Any() && mappingContract?.IsMemberSupported("InterventionStudyStateAbbreviations") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyStateAbbreviations"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyStateAbbreviations, validationContext, validationContext.Items.ForCollection("InterventionStudyStateAbbreviations")))) - { - yield return result; - } - } - - if (InterventionStudyURIs.Any() && mappingContract?.IsMemberSupported("InterventionStudyURIs") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("InterventionStudyURIs"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyURIs, validationContext, validationContext.Items.ForCollection("InterventionStudyURIs")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); if (!fluentValidationResult.IsValid) { @@ -92373,21 +91126,9 @@ string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionDiscrimin // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStaffPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_InterventionStudy = new FullName("edfi", "InterventionStudy"); - - // Declare collection item validators - private InterventionStudyAppropriateGradeLevelPutPostRequestValidator _interventionStudyAppropriateGradeLevelsValidator = new (); - private InterventionStudyAppropriateSexPutPostRequestValidator _interventionStudyAppropriateSexesValidator = new (); - private InterventionStudyEducationContentPutPostRequestValidator _interventionStudyEducationContentsValidator = new (); - private InterventionStudyInterventionEffectivenessPutPostRequestValidator _interventionStudyInterventionEffectivenessesValidator = new (); - private InterventionStudyLearningResourceMetadataURIPutPostRequestValidator _interventionStudyLearningResourceMetadataURIsValidator = new (); - private InterventionStudyPopulationServedPutPostRequestValidator _interventionStudyPopulationServedsValidator = new (); - private InterventionStudyStateAbbreviationPutPostRequestValidator _interventionStudyStateAbbreviationsValidator = new (); - private InterventionStudyURIPutPostRequestValidator _interventionStudyURIsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -92400,105 +91141,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (InterventionStudyMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_InterventionStudy); - - if (mappingContract != null) - { - if (mappingContract.IsInterventionStudyAppropriateGradeLevelIncluded != null) - { - var hasInvalidInterventionStudyAppropriateGradeLevelsItems = instance.InterventionStudyAppropriateGradeLevels.Any(x => !mappingContract.IsInterventionStudyAppropriateGradeLevelIncluded(x)); - - if (hasInvalidInterventionStudyAppropriateGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyAppropriateGradeLevels", $"A supplied 'InterventionStudyAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStudyAppropriateSexIncluded != null) - { - var hasInvalidInterventionStudyAppropriateSexesItems = instance.InterventionStudyAppropriateSexes.Any(x => !mappingContract.IsInterventionStudyAppropriateSexIncluded(x)); - - if (hasInvalidInterventionStudyAppropriateSexesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyAppropriateSexes", $"A supplied 'InterventionStudyAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStudyEducationContentIncluded != null) - { - var hasInvalidInterventionStudyEducationContentsItems = instance.InterventionStudyEducationContents.Any(x => !mappingContract.IsInterventionStudyEducationContentIncluded(x)); - - if (hasInvalidInterventionStudyEducationContentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyEducationContents", $"A supplied 'InterventionStudyEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStudyInterventionEffectivenessIncluded != null) - { - var hasInvalidInterventionStudyInterventionEffectivenessesItems = instance.InterventionStudyInterventionEffectivenesses.Any(x => !mappingContract.IsInterventionStudyInterventionEffectivenessIncluded(x)); - - if (hasInvalidInterventionStudyInterventionEffectivenessesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyInterventionEffectivenesses", $"A supplied 'InterventionStudyInterventionEffectiveness' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStudyLearningResourceMetadataURIIncluded != null) - { - var hasInvalidInterventionStudyLearningResourceMetadataURIsItems = instance.InterventionStudyLearningResourceMetadataURIs.Any(x => !mappingContract.IsInterventionStudyLearningResourceMetadataURIIncluded(x)); - - if (hasInvalidInterventionStudyLearningResourceMetadataURIsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyLearningResourceMetadataURIs", $"A supplied 'InterventionStudyLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStudyPopulationServedIncluded != null) - { - var hasInvalidInterventionStudyPopulationServedsItems = instance.InterventionStudyPopulationServeds.Any(x => !mappingContract.IsInterventionStudyPopulationServedIncluded(x)); - - if (hasInvalidInterventionStudyPopulationServedsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyPopulationServeds", $"A supplied 'InterventionStudyPopulationServed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStudyStateAbbreviationIncluded != null) - { - var hasInvalidInterventionStudyStateAbbreviationsItems = instance.InterventionStudyStateAbbreviations.Any(x => !mappingContract.IsInterventionStudyStateAbbreviationIncluded(x)); - - if (hasInvalidInterventionStudyStateAbbreviationsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyStateAbbreviations", $"A supplied 'InterventionStudyStateAbbreviation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsInterventionStudyURIIncluded != null) - { - var hasInvalidInterventionStudyURIsItems = instance.InterventionStudyURIs.Any(x => !mappingContract.IsInterventionStudyURIIncluded(x)); - - if (hasInvalidInterventionStudyURIsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("InterventionStudyURIs", $"A supplied 'InterventionStudyURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -92515,16 +91157,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyAppropriateGradeLevel table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionURI table of the Intervention aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyAppropriateGradeLevel : Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel, IValidatableObject + public class InterventionURI : Entities.Common.EdFi.IInterventionURI, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionStudyAppropriateGradeLevel"); + private static FullName _fullName = new FullName("edfi", "InterventionURI"); // Fluent validator instance (threadsafe) - private static InterventionStudyAppropriateGradeLevelPutPostRequestValidator _validator = new InterventionStudyAppropriateGradeLevelPutPostRequestValidator(); + private static InterventionURIPutPostRequestValidator _validator = new InterventionURIPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -92551,33 +91193,33 @@ public class InterventionStudyAppropriateGradeLevel : Entities.Common.EdFi.IInte //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; + private Entities.Common.EdFi.IIntervention _intervention; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateGradeLevel.InterventionStudy + Entities.Common.EdFi.IIntervention IInterventionURI.Intervention { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } + get { return _intervention; } + set { SetIntervention(value); } } - public Entities.Common.EdFi.IInterventionStudy InterventionStudy + public Entities.Common.EdFi.IIntervention Intervention { - set { SetInterventionStudy(value); } + set { SetIntervention(value); } } - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + private void SetIntervention(Entities.Common.EdFi.IIntervention value) { - _interventionStudy = value; + _intervention = value; } /// - /// Grade levels participating in this study. + /// The URI (typical a URL) pointing to an education content item. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="uri")] + public string URI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -92592,7 +91234,7 @@ private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IInterventionURI; if (ReferenceEquals(this, compareTo)) return true; @@ -92601,12 +91243,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + if (_intervention == null || !_intervention.Equals(compareTo.Intervention)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionURI).URI, compareTo.URI)) return false; @@ -92623,11 +91265,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); + if (_intervention != null) + hash.Add(_intervention); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel).GradeLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionURI).URI); return hash.ToHashCode(); } @@ -92661,7 +91303,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyAppropriateGradeLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Intervention", "InterventionURI")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -92685,12 +91327,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)target); + return Entities.Common.EdFi.InterventionURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionURI)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)target, null); + Entities.Common.EdFi.InterventionURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionURI)target, null); } // ------------------------------------------------------------- @@ -92765,9 +91407,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionURIPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -92795,17 +91437,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyAppropriateSex table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionClassDescriptor table of the InterventionClassDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyAppropriateSex : Entities.Common.EdFi.IInterventionStudyAppropriateSex, IValidatableObject + public class InterventionClassDescriptor : Entities.Common.EdFi.IInterventionClassDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionStudyAppropriateSex"); + private static FullName _fullName = new FullName("edfi", "InterventionClassDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionStudyAppropriateSexPutPostRequestValidator _validator = new InterventionStudyAppropriateSexPutPostRequestValidator(); + private static InterventionClassDescriptorPutPostRequestValidator _validator = new InterventionClassDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -92822,6 +91469,13 @@ public class InterventionStudyAppropriateSex : Entities.Common.EdFi.IInterventio // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the InterventionClassDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -92832,33 +91486,19 @@ public class InterventionStudyAppropriateSex : Entities.Common.EdFi.IInterventio //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; - - [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateSex.InterventionStudy - { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } - } - public Entities.Common.EdFi.IInterventionStudy InterventionStudy - { - set { SetInterventionStudy(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int InterventionClassDescriptorId { get; set; } - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + int IDescriptor.DescriptorId { - _interventionStudy = value; + get { return InterventionClassDescriptorId; } + set { InterventionClassDescriptorId = value; } } - - /// - /// Sexes participating in this study. If omitted, considered generally applicable. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] - public string SexDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -92873,7 +91513,7 @@ private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyAppropriateSex; + var compareTo = obj as Entities.Common.EdFi.IInterventionClassDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -92881,13 +91521,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IInterventionClassDescriptor).InterventionClassDescriptorId.Equals(compareTo.InterventionClassDescriptorId)) return false; @@ -92903,12 +91539,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyAppropriateSex).SexDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IInterventionClassDescriptor).InterventionClassDescriptorId); return hash.ToHashCode(); } @@ -92917,6 +91550,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -92942,8 +91624,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyAppropriateSex")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -92954,6 +91639,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -92966,12 +91658,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateSex)target); + return Entities.Common.EdFi.InterventionClassDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionClassDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateSex)target, null); + Entities.Common.EdFi.InterventionClassDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInterventionClassDescriptor)target, null); } // ------------------------------------------------------------- @@ -92979,66 +91671,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -93046,9 +91678,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionClassDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -93076,17 +91708,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyEducationContent table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionEffectivenessRatingDescriptor table of the InterventionEffectivenessRatingDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyEducationContent : Entities.Common.EdFi.IInterventionStudyEducationContent, IValidatableObject + public class InterventionEffectivenessRatingDescriptor : Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "InterventionStudyEducationContent"); + private static FullName _fullName = new FullName("edfi", "InterventionEffectivenessRatingDescriptor"); // Fluent validator instance (threadsafe) - private static InterventionStudyEducationContentPutPostRequestValidator _validator = new InterventionStudyEducationContentPutPostRequestValidator(); + private static InterventionEffectivenessRatingDescriptorPutPostRequestValidator _validator = new InterventionEffectivenessRatingDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -93103,92 +91740,35 @@ public class InterventionStudyEducationContent : Entities.Common.EdFi.IIntervent // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the InterventionEffectivenessRatingDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationContentReferenceExplicitlyAssigned; - private EducationContent.EdFi.EducationContentReference _educationContentReference; - private EducationContent.EdFi.EducationContentReference ImplicitEducationContentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationContentReference == null && !_educationContentReferenceExplicitlyAssigned) - _educationContentReference = new EducationContent.EdFi.EducationContentReference(); - - return _educationContentReference; - } - } - - [DataMember(Name="educationContentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationContent.EdFi.EducationContentReference EducationContentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationContentReference != null - && (_educationContentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) - return ImplicitEducationContentReference; - - return null; - } - set - { - _educationContentReferenceExplicitlyAssigned = true; - _educationContentReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; - - [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyEducationContent.InterventionStudy - { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } - } - - public Entities.Common.EdFi.IInterventionStudy InterventionStudy - { - set { SetInterventionStudy(value); } - } - - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) - { - _interventionStudy = value; - } /// - /// A unique identifier for the education content. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IInterventionStudyEducationContent.ContentIdentifier - { - get - { - if (ImplicitEducationContentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) - return ImplicitEducationContentReference.ContentIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int InterventionEffectivenessRatingDescriptorId { get; set; } - // EducationContent - _educationContentReferenceExplicitlyAssigned = false; - ImplicitEducationContentReference.ContentIdentifier = value; - } + int IDescriptor.DescriptorId + { + get { return InterventionEffectivenessRatingDescriptorId; } + set { InterventionEffectivenessRatingDescriptorId = value; } } // ------------------------------------------------------------- @@ -93204,7 +91784,7 @@ string Entities.Common.EdFi.IInterventionStudyEducationContent.ContentIdentifier /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyEducationContent; + var compareTo = obj as Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -93212,13 +91792,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudyEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) + // Derived Property + if (!(this as Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor).InterventionEffectivenessRatingDescriptorId.Equals(compareTo.InterventionEffectivenessRatingDescriptorId)) return false; @@ -93234,12 +91810,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyEducationContent).ContentIdentifier); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor).InterventionEffectivenessRatingDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -93247,6 +91821,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -93272,8 +91895,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyEducationContent")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -93284,6 +91910,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -93296,93 +91929,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyEducationContent)target); + return Entities.Common.EdFi.InterventionEffectivenessRatingDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyEducationContent)target, null); + Entities.Common.EdFi.InterventionEffectivenessRatingDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentResourceId - { - get { return null; } - set { ImplicitEducationContentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationContentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -93390,9 +91949,9 @@ string Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentD // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionEffectivenessRatingDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -93420,17 +91979,119 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyInterventionEffectiveness table of the InterventionStudy aggregate in the ODS Database. + /// Represents a reference to the InterventionPrescription resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class InterventionPrescriptionReference : IResourceReference + { + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="interventionPrescriptionIdentificationCode")] + public string InterventionPrescriptionIdentificationCode { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationId != default(long) && InterventionPrescriptionIdentificationCode != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (InterventionPrescriptionIdentificationCode == default) + { + yield return "InterventionPrescriptionIdentificationCode"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "InterventionPrescription", + Href = $"/ed-fi/interventionPrescriptions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.InterventionPrescription table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyInterventionEffectiveness : Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness, IValidatableObject + public class InterventionPrescription : Entities.Common.EdFi.IInterventionPrescription, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionStudyInterventionEffectiveness"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescription"); // Fluent validator instance (threadsafe) - private static InterventionStudyInterventionEffectivenessPutPostRequestValidator _validator = new InterventionStudyInterventionEffectivenessPutPostRequestValidator(); + private static InterventionPrescriptionPutPostRequestValidator _validator = new InterventionPrescriptionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -93441,67 +92102,107 @@ public class InterventionStudyInterventionEffectiveness : Entities.Common.EdFi.I // Constructor // ------------------------------------------------------------- + public InterventionPrescription() + { + InterventionPrescriptionAppropriateGradeLevels = new List(); + InterventionPrescriptionAppropriateSexes = new List(); + InterventionPrescriptionDiagnoses = new List(); + InterventionPrescriptionEducationContents = new List(); + InterventionPrescriptionLearningResourceMetadataURIs = new List(); + InterventionPrescriptionPopulationServeds = new List(); + InterventionPrescriptionURIs = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the InterventionPrescription resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; - [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyInterventionEffectiveness.InterventionStudy + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } - } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - public Entities.Common.EdFi.IInterventionStudy InterventionStudy - { - set { SetInterventionStudy(value); } + return _educationOrganizationReference; + } } - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { - _interventionStudy = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } } + // ------------------------------------------------------------- - /// - /// Targeted purpose of the intervention (e.g., attendance issue, dropout risk) for which the effectiveness is measured. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="diagnosisDescriptor")][DescriptorExists("DiagnosisDescriptor")] - public string DiagnosisDescriptor { get; set; } + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// Grade level for which effectiveness is measured. + /// The identifier assigned to an education organization. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationId + { + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } /// - /// Population for which effectiveness is measured. + /// A unique number or alphanumeric code assigned to an intervention prescription. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] - public string PopulationServedDescriptor { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="interventionPrescriptionIdentificationCode")] + public string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -93516,7 +92217,7 @@ private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescription; if (ReferenceEquals(this, compareTo)) return true; @@ -93524,23 +92225,14 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).DiagnosisDescriptor, compareTo.DiagnosisDescriptor)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IInterventionPrescription).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescription).InterventionPrescriptionIdentificationCode, compareTo.InterventionPrescriptionIdentificationCode)) return false; @@ -93556,20 +92248,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).DiagnosisDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).GradeLevelDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IInterventionPrescription).EducationOrganizationId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).PopulationServedDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionPrescription).InterventionPrescriptionIdentificationCode); return hash.ToHashCode(); } @@ -93585,33 +92269,57 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Along a percentile distribution of students, the improvement index represents the change in an average student's percentile rank that is considered to be due to the intervention. + /// The way in which an intervention was implemented: individual, small group, whole class, or whole school. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="improvementIndex")] - public int? ImprovementIndex { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="deliveryMethodDescriptor")][DescriptorExists("DeliveryMethodDescriptor")] + public string DeliveryMethodDescriptor { get; set; } /// - /// An intervention demonstrates effectiveness if the research has shown that the program caused an improvement in outcomes. Values: positive effects, potentially positive effects, mixed effects, potentially negative effects, negative effects, and no discernible effects. + /// The way in which an intervention is used: curriculum, supplement, or practice. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="interventionEffectivenessRatingDescriptor")][DescriptorExists("InterventionEffectivenessRatingDescriptor")] - public string InterventionEffectivenessRatingDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DataMember(Name="interventionClassDescriptor")][DescriptorExists("InterventionClassDescriptor")] + public string InterventionClassDescriptor { get; set; } - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + /// + /// The maximum duration of time in minutes that is recommended for the intervention. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="maxDosage")] + public int? MaxDosage { get; set; } - // ============================================================= + /// + /// The minimum duration of time in minutes that is recommended for the intervention. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="minDosage")] + public int? MinDosage { get; set; } + + /// + /// Namespace for the intervention. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= // Inherited Collections // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -93619,23 +92327,281 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyInterventionEffectiveness")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescription")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _interventionPrescriptionAppropriateGradeLevels; + private ICollection _interventionPrescriptionAppropriateGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="appropriateGradeLevels")] + public ICollection InterventionPrescriptionAppropriateGradeLevels + { + get { return _interventionPrescriptionAppropriateGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)e.Item).InterventionPrescription = this); + _interventionPrescriptionAppropriateGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)e.Item).InterventionPrescription = this; + _interventionPrescriptionAppropriateGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateGradeLevels + { + get { return _interventionPrescriptionAppropriateGradeLevelsCovariant; } + set { InterventionPrescriptionAppropriateGradeLevels = new List(value.Cast()); } + } + + private ICollection _interventionPrescriptionAppropriateSexes; + private ICollection _interventionPrescriptionAppropriateSexesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="appropriateSexes")] + public ICollection InterventionPrescriptionAppropriateSexes + { + get { return _interventionPrescriptionAppropriateSexes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)e.Item).InterventionPrescription = this); + _interventionPrescriptionAppropriateSexes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)e.Item).InterventionPrescription = this; + _interventionPrescriptionAppropriateSexesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionAppropriateSexes + { + get { return _interventionPrescriptionAppropriateSexesCovariant; } + set { InterventionPrescriptionAppropriateSexes = new List(value.Cast()); } + } + + private ICollection _interventionPrescriptionDiagnoses; + private ICollection _interventionPrescriptionDiagnosesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="diagnoses")] + public ICollection InterventionPrescriptionDiagnoses + { + get { return _interventionPrescriptionDiagnoses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)e.Item).InterventionPrescription = this); + _interventionPrescriptionDiagnoses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)e.Item).InterventionPrescription = this; + _interventionPrescriptionDiagnosesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionDiagnoses + { + get { return _interventionPrescriptionDiagnosesCovariant; } + set { InterventionPrescriptionDiagnoses = new List(value.Cast()); } + } + + private ICollection _interventionPrescriptionEducationContents; + private ICollection _interventionPrescriptionEducationContentsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="educationContents")] + public ICollection InterventionPrescriptionEducationContents + { + get { return _interventionPrescriptionEducationContents; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionEducationContent)e.Item).InterventionPrescription = this); + _interventionPrescriptionEducationContents = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionEducationContent)e.Item).InterventionPrescription = this; + _interventionPrescriptionEducationContentsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionEducationContents + { + get { return _interventionPrescriptionEducationContentsCovariant; } + set { InterventionPrescriptionEducationContents = new List(value.Cast()); } + } + + private ICollection _interventionPrescriptionLearningResourceMetadataURIs; + private ICollection _interventionPrescriptionLearningResourceMetadataURIsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="learningResourceMetadataURIs")] + public ICollection InterventionPrescriptionLearningResourceMetadataURIs + { + get { return _interventionPrescriptionLearningResourceMetadataURIs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)e.Item).InterventionPrescription = this); + _interventionPrescriptionLearningResourceMetadataURIs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)e.Item).InterventionPrescription = this; + _interventionPrescriptionLearningResourceMetadataURIsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionLearningResourceMetadataURIs + { + get { return _interventionPrescriptionLearningResourceMetadataURIsCovariant; } + set { InterventionPrescriptionLearningResourceMetadataURIs = new List(value.Cast()); } + } + + private ICollection _interventionPrescriptionPopulationServeds; + private ICollection _interventionPrescriptionPopulationServedsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="populationServeds")] + public ICollection InterventionPrescriptionPopulationServeds + { + get { return _interventionPrescriptionPopulationServeds; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)e.Item).InterventionPrescription = this); + _interventionPrescriptionPopulationServeds = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)e.Item).InterventionPrescription = this; + _interventionPrescriptionPopulationServedsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionPopulationServeds + { + get { return _interventionPrescriptionPopulationServedsCovariant; } + set { InterventionPrescriptionPopulationServeds = new List(value.Cast()); } + } + + private ICollection _interventionPrescriptionURIs; + private ICollection _interventionPrescriptionURIsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="uris")] + public ICollection InterventionPrescriptionURIs + { + get { return _interventionPrescriptionURIs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionURI)e.Item).InterventionPrescription = this); + _interventionPrescriptionURIs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionPrescriptionURI)e.Item).InterventionPrescription = this; + _interventionPrescriptionURIsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionPrescription.InterventionPrescriptionURIs + { + get { return _interventionPrescriptionURIsCovariant; } + set { InterventionPrescriptionURIs = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_interventionPrescriptionAppropriateGradeLevels != null) foreach (var item in _interventionPrescriptionAppropriateGradeLevels) + { + item.InterventionPrescription = this; + } + + if (_interventionPrescriptionAppropriateSexes != null) foreach (var item in _interventionPrescriptionAppropriateSexes) + { + item.InterventionPrescription = this; + } + + if (_interventionPrescriptionDiagnoses != null) foreach (var item in _interventionPrescriptionDiagnoses) + { + item.InterventionPrescription = this; + } + + if (_interventionPrescriptionEducationContents != null) foreach (var item in _interventionPrescriptionEducationContents) + { + item.InterventionPrescription = this; + } + + if (_interventionPrescriptionLearningResourceMetadataURIs != null) foreach (var item in _interventionPrescriptionLearningResourceMetadataURIs) + { + item.InterventionPrescription = this; + } + + if (_interventionPrescriptionPopulationServeds != null) foreach (var item in _interventionPrescriptionPopulationServeds) + { + item.InterventionPrescription = this; + } + + if (_interventionPrescriptionURIs != null) foreach (var item in _interventionPrescriptionURIs) + { + item.InterventionPrescription = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -93643,18 +92609,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyInterventionEffectivenessMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)target); + return Entities.Common.EdFi.InterventionPrescriptionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescription)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyInterventionEffectivenessMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)target, null); + Entities.Common.EdFi.InterventionPrescriptionMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescription)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -93672,12 +92652,95 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (InterventionPrescriptionAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionAppropriateGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPrescriptionAppropriateGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionAppropriateGradeLevels")))) + { + yield return result; + } + } + + if (InterventionPrescriptionAppropriateSexes.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionAppropriateSexes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPrescriptionAppropriateSexes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionAppropriateSexes, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionAppropriateSexes")))) + { + yield return result; + } + } + + if (InterventionPrescriptionDiagnoses.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionDiagnoses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPrescriptionDiagnoses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionDiagnoses, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionDiagnoses")))) + { + yield return result; + } + } + + if (InterventionPrescriptionEducationContents.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionEducationContents") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPrescriptionEducationContents"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionEducationContents, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionEducationContents")))) + { + yield return result; + } + } + + if (InterventionPrescriptionLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionLearningResourceMetadataURIs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPrescriptionLearningResourceMetadataURIs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionLearningResourceMetadataURIs")))) + { + yield return result; + } + } + + if (InterventionPrescriptionPopulationServeds.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionPopulationServeds") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPrescriptionPopulationServeds"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionPopulationServeds, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionPopulationServeds")))) + { + yield return result; + } + } + + if (InterventionPrescriptionURIs.Any() && mappingContract?.IsMemberSupported("InterventionPrescriptionURIs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionPrescriptionURIs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionPrescriptionURIs, validationContext, validationContext.Items.ForCollection("InterventionPrescriptionURIs")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -93723,9 +92786,20 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyInterventionEffectivenessPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_InterventionPrescription = new FullName("edfi", "InterventionPrescription"); + + // Declare collection item validators + private InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator _interventionPrescriptionAppropriateGradeLevelsValidator = new (); + private InterventionPrescriptionAppropriateSexPutPostRequestValidator _interventionPrescriptionAppropriateSexesValidator = new (); + private InterventionPrescriptionDiagnosisPutPostRequestValidator _interventionPrescriptionDiagnosesValidator = new (); + private InterventionPrescriptionEducationContentPutPostRequestValidator _interventionPrescriptionEducationContentsValidator = new (); + private InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator _interventionPrescriptionLearningResourceMetadataURIsValidator = new (); + private InterventionPrescriptionPopulationServedPutPostRequestValidator _interventionPrescriptionPopulationServedsValidator = new (); + private InterventionPrescriptionURIPutPostRequestValidator _interventionPrescriptionURIsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -93738,6 +92812,94 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (InterventionPrescriptionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_InterventionPrescription); + + if (mappingContract != null) + { + if (mappingContract.IsInterventionPrescriptionAppropriateGradeLevelIncluded != null) + { + var hasInvalidInterventionPrescriptionAppropriateGradeLevelsItems = instance.InterventionPrescriptionAppropriateGradeLevels.Any(x => !mappingContract.IsInterventionPrescriptionAppropriateGradeLevelIncluded(x)); + + if (hasInvalidInterventionPrescriptionAppropriateGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPrescriptionAppropriateGradeLevels", $"A supplied 'InterventionPrescriptionAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionPrescriptionAppropriateSexIncluded != null) + { + var hasInvalidInterventionPrescriptionAppropriateSexesItems = instance.InterventionPrescriptionAppropriateSexes.Any(x => !mappingContract.IsInterventionPrescriptionAppropriateSexIncluded(x)); + + if (hasInvalidInterventionPrescriptionAppropriateSexesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPrescriptionAppropriateSexes", $"A supplied 'InterventionPrescriptionAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionPrescriptionDiagnosisIncluded != null) + { + var hasInvalidInterventionPrescriptionDiagnosesItems = instance.InterventionPrescriptionDiagnoses.Any(x => !mappingContract.IsInterventionPrescriptionDiagnosisIncluded(x)); + + if (hasInvalidInterventionPrescriptionDiagnosesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPrescriptionDiagnoses", $"A supplied 'InterventionPrescriptionDiagnosis' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionPrescriptionEducationContentIncluded != null) + { + var hasInvalidInterventionPrescriptionEducationContentsItems = instance.InterventionPrescriptionEducationContents.Any(x => !mappingContract.IsInterventionPrescriptionEducationContentIncluded(x)); + + if (hasInvalidInterventionPrescriptionEducationContentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPrescriptionEducationContents", $"A supplied 'InterventionPrescriptionEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionPrescriptionLearningResourceMetadataURIIncluded != null) + { + var hasInvalidInterventionPrescriptionLearningResourceMetadataURIsItems = instance.InterventionPrescriptionLearningResourceMetadataURIs.Any(x => !mappingContract.IsInterventionPrescriptionLearningResourceMetadataURIIncluded(x)); + + if (hasInvalidInterventionPrescriptionLearningResourceMetadataURIsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPrescriptionLearningResourceMetadataURIs", $"A supplied 'InterventionPrescriptionLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionPrescriptionPopulationServedIncluded != null) + { + var hasInvalidInterventionPrescriptionPopulationServedsItems = instance.InterventionPrescriptionPopulationServeds.Any(x => !mappingContract.IsInterventionPrescriptionPopulationServedIncluded(x)); + + if (hasInvalidInterventionPrescriptionPopulationServedsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPrescriptionPopulationServeds", $"A supplied 'InterventionPrescriptionPopulationServed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionPrescriptionURIIncluded != null) + { + var hasInvalidInterventionPrescriptionURIsItems = instance.InterventionPrescriptionURIs.Any(x => !mappingContract.IsInterventionPrescriptionURIIncluded(x)); + + if (hasInvalidInterventionPrescriptionURIsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionPrescriptionURIs", $"A supplied 'InterventionPrescriptionURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -93754,16 +92916,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyLearningResourceMetadataURI table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPrescriptionAppropriateGradeLevel table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyLearningResourceMetadataURI : Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI, IValidatableObject + public class InterventionPrescriptionAppropriateGradeLevel : Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionStudyLearningResourceMetadataURI"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionAppropriateGradeLevel"); // Fluent validator instance (threadsafe) - private static InterventionStudyLearningResourceMetadataURIPutPostRequestValidator _validator = new InterventionStudyLearningResourceMetadataURIPutPostRequestValidator(); + private static InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator _validator = new InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -93790,33 +92952,33 @@ public class InterventionStudyLearningResourceMetadataURI : Entities.Common.EdFi //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; + private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyLearningResourceMetadataURI.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateGradeLevel.InterventionPrescription { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } + get { return _interventionPrescription; } + set { SetInterventionPrescription(value); } } - public Entities.Common.EdFi.IInterventionStudy InterventionStudy + public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription { - set { SetInterventionStudy(value); } + set { SetInterventionPrescription(value); } } - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) { - _interventionStudy = value; + _interventionPrescription = value; } /// - /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. + /// Grade levels for the prescribed intervention. If omitted, considered generally applicable. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="learningResourceMetadataURI")] - public string LearningResourceMetadataURI { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -93831,7 +92993,7 @@ private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -93840,12 +93002,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI).LearningResourceMetadataURI, compareTo.LearningResourceMetadataURI)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -93862,11 +93024,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); + if (_interventionPrescription != null) + hash.Add(_interventionPrescription); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI).LearningResourceMetadataURI); + hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -93900,7 +93062,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyLearningResourceMetadataURI")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionAppropriateGradeLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -93924,12 +93086,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyLearningResourceMetadataURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)target); + return Entities.Common.EdFi.InterventionPrescriptionAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyLearningResourceMetadataURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)target, null); + Entities.Common.EdFi.InterventionPrescriptionAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel)target, null); } // ------------------------------------------------------------- @@ -94004,9 +93166,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -94035,16 +93197,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyPopulationServed table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPrescriptionAppropriateSex table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyPopulationServed : Entities.Common.EdFi.IInterventionStudyPopulationServed, IValidatableObject + public class InterventionPrescriptionAppropriateSex : Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionStudyPopulationServed"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionAppropriateSex"); // Fluent validator instance (threadsafe) - private static InterventionStudyPopulationServedPutPostRequestValidator _validator = new InterventionStudyPopulationServedPutPostRequestValidator(); + private static InterventionPrescriptionAppropriateSexPutPostRequestValidator _validator = new InterventionPrescriptionAppropriateSexPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -94071,33 +93233,33 @@ public class InterventionStudyPopulationServed : Entities.Common.EdFi.IIntervent //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; + private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyPopulationServed.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateSex.InterventionPrescription { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } + get { return _interventionPrescription; } + set { SetInterventionPrescription(value); } } - public Entities.Common.EdFi.IInterventionStudy InterventionStudy + public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription { - set { SetInterventionStudy(value); } + set { SetInterventionPrescription(value); } } - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) { - _interventionStudy = value; + _interventionPrescription = value; } /// - /// A subset of students that are the focus of the intervention study. + /// Sexes for the intervention prescription. If omitted, considered generally applicable. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] - public string PopulationServedDescriptor { get; set; } + [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] + public string SexDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -94112,7 +93274,7 @@ private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyPopulationServed; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex; if (ReferenceEquals(this, compareTo)) return true; @@ -94121,12 +93283,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyPopulationServed).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) return false; @@ -94143,11 +93305,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); + if (_interventionPrescription != null) + hash.Add(_interventionPrescription); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyPopulationServed).PopulationServedDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex).SexDescriptor); return hash.ToHashCode(); } @@ -94181,7 +93343,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyPopulationServed")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionAppropriateSex")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -94205,12 +93367,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyPopulationServedMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyPopulationServed)target); + return Entities.Common.EdFi.InterventionPrescriptionAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyPopulationServedMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyPopulationServed)target, null); + Entities.Common.EdFi.InterventionPrescriptionAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex)target, null); } // ------------------------------------------------------------- @@ -94285,9 +93447,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyPopulationServedPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -94316,16 +93478,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyStateAbbreviation table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPrescriptionDiagnosis table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyStateAbbreviation : Entities.Common.EdFi.IInterventionStudyStateAbbreviation, IValidatableObject + public class InterventionPrescriptionDiagnosis : Entities.Common.EdFi.IInterventionPrescriptionDiagnosis, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionStudyStateAbbreviation"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionDiagnosis"); // Fluent validator instance (threadsafe) - private static InterventionStudyStateAbbreviationPutPostRequestValidator _validator = new InterventionStudyStateAbbreviationPutPostRequestValidator(); + private static InterventionPrescriptionDiagnosisPutPostRequestValidator _validator = new InterventionPrescriptionDiagnosisPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -94352,33 +93514,33 @@ public class InterventionStudyStateAbbreviation : Entities.Common.EdFi.IInterven //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; + private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyStateAbbreviation.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionDiagnosis.InterventionPrescription { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } + get { return _interventionPrescription; } + set { SetInterventionPrescription(value); } } - public Entities.Common.EdFi.IInterventionStudy InterventionStudy + public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription { - set { SetInterventionStudy(value); } + set { SetInterventionPrescription(value); } } - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) { - _interventionStudy = value; + _interventionPrescription = value; } /// - /// The abbreviation for the state (within the United States) or outlying area, the school system of which the participants of the study are considered to be a part. + /// Targeted purpose of the intervention prescription. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string StateAbbreviationDescriptor { get; set; } + [DataMember(Name="diagnosisDescriptor")][DescriptorExists("DiagnosisDescriptor")] + public string DiagnosisDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -94393,7 +93555,7 @@ private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyStateAbbreviation; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionDiagnosis; if (ReferenceEquals(this, compareTo)) return true; @@ -94402,12 +93564,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyStateAbbreviation).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionDiagnosis).DiagnosisDescriptor, compareTo.DiagnosisDescriptor)) return false; @@ -94424,11 +93586,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); + if (_interventionPrescription != null) + hash.Add(_interventionPrescription); // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyStateAbbreviation).StateAbbreviationDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionDiagnosis).DiagnosisDescriptor); return hash.ToHashCode(); } @@ -94462,7 +93624,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyStateAbbreviation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionDiagnosis")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -94486,12 +93648,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyStateAbbreviationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyStateAbbreviation)target); + return Entities.Common.EdFi.InterventionPrescriptionDiagnosisMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyStateAbbreviationMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyStateAbbreviation)target, null); + Entities.Common.EdFi.InterventionPrescriptionDiagnosisMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionDiagnosis)target, null); } // ------------------------------------------------------------- @@ -94566,9 +93728,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyStateAbbreviationPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionDiagnosisPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -94597,16 +93759,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.InterventionStudyURI table of the InterventionStudy aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPrescriptionEducationContent table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class InterventionStudyURI : Entities.Common.EdFi.IInterventionStudyURI, IValidatableObject + public class InterventionPrescriptionEducationContent : Entities.Common.EdFi.IInterventionPrescriptionEducationContent, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "InterventionStudyURI"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionEducationContent"); // Fluent validator instance (threadsafe) - private static InterventionStudyURIPutPostRequestValidator _validator = new InterventionStudyURIPutPostRequestValidator(); + private static InterventionPrescriptionEducationContentPutPostRequestValidator _validator = new InterventionPrescriptionEducationContentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -94628,38 +93790,88 @@ public class InterventionStudyURI : Entities.Common.EdFi.IInterventionStudyURI, // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationContentReferenceExplicitlyAssigned; + private EducationContent.EdFi.EducationContentReference _educationContentReference; + private EducationContent.EdFi.EducationContentReference ImplicitEducationContentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationContentReference == null && !_educationContentReferenceExplicitlyAssigned) + _educationContentReference = new EducationContent.EdFi.EducationContentReference(); + + return _educationContentReference; + } + } + + [DataMember(Name="educationContentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationContent.EdFi.EducationContentReference EducationContentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationContentReference != null + && (_educationContentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) + return ImplicitEducationContentReference; + + return null; + } + set + { + _educationContentReferenceExplicitlyAssigned = true; + _educationContentReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IInterventionStudy _interventionStudy; + private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; [IgnoreDataMember] - Entities.Common.EdFi.IInterventionStudy IInterventionStudyURI.InterventionStudy + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionEducationContent.InterventionPrescription { - get { return _interventionStudy; } - set { SetInterventionStudy(value); } + get { return _interventionPrescription; } + set { SetInterventionPrescription(value); } } - public Entities.Common.EdFi.IInterventionStudy InterventionStudy + public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription { - set { SetInterventionStudy(value); } + set { SetInterventionPrescription(value); } } - private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) { - _interventionStudy = value; + _interventionPrescription = value; } /// - /// The URI (typical a URL) pointing to an education content item. + /// A unique identifier for the education content. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="uri")] - public string URI { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.ContentIdentifier + { + get + { + if (ImplicitEducationContentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) + return ImplicitEducationContentReference.ContentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationContent + _educationContentReferenceExplicitlyAssigned = false; + ImplicitEducationContentReference.ContentIdentifier = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -94674,7 +93886,7 @@ private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IInterventionStudyURI; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionEducationContent; if (ReferenceEquals(this, compareTo)) return true; @@ -94683,12 +93895,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudyURI).URI, compareTo.URI)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) return false; @@ -94705,12 +93917,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_interventionStudy != null) - hash.Add(_interventionStudy); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IInterventionStudyURI).URI); + if (_interventionPrescription != null) + hash.Add(_interventionPrescription); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionEducationContent).ContentIdentifier); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -94743,7 +93954,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyURI")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionEducationContent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -94767,18 +93978,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.InterventionStudyURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyURI)target); + return Entities.Common.EdFi.InterventionPrescriptionEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionEducationContent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.InterventionStudyURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyURI)target, null); + Entities.Common.EdFi.InterventionPrescriptionEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionEducationContent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentResourceId + { + get { return null; } + set { ImplicitEducationContentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IInterventionPrescriptionEducationContent.EducationContentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationContentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -94847,9 +94072,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class InterventionStudyURIPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -94877,22 +94102,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LanguageDescriptor table of the LanguageDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPrescriptionLearningResourceMetadataURI table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LanguageDescriptor : Entities.Common.EdFi.ILanguageDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class InterventionPrescriptionLearningResourceMetadataURI : Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LanguageDescriptor"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionLearningResourceMetadataURI"); // Fluent validator instance (threadsafe) - private static LanguageDescriptorPutPostRequestValidator _validator = new LanguageDescriptorPutPostRequestValidator(); + private static InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator _validator = new InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -94909,13 +94129,6 @@ public class LanguageDescriptor : Entities.Common.EdFi.ILanguageDescriptor, Enti // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LanguageDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -94926,19 +94139,33 @@ public class LanguageDescriptor : Entities.Common.EdFi.ILanguageDescriptor, Enti //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int LanguageDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionLearningResourceMetadataURI.InterventionPrescription + { + get { return _interventionPrescription; } + set { SetInterventionPrescription(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription { - get { return LanguageDescriptorId; } - set { LanguageDescriptorId = value; } + set { SetInterventionPrescription(value); } + } + + private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + { + _interventionPrescription = value; } + + /// + /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="learningResourceMetadataURI")] + public string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -94953,7 +94180,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILanguageDescriptor; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI; if (ReferenceEquals(this, compareTo)) return true; @@ -94961,9 +94188,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ILanguageDescriptor).LanguageDescriptorId.Equals(compareTo.LanguageDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI).LearningResourceMetadataURI, compareTo.LearningResourceMetadataURI)) return false; @@ -94979,9 +94210,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_interventionPrescription != null) + hash.Add(_interventionPrescription); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ILanguageDescriptor).LanguageDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI).LearningResourceMetadataURI); return hash.ToHashCode(); } @@ -94990,55 +94224,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95064,11 +94249,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionLearningResourceMetadataURI")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95079,13 +94261,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -95098,12 +94273,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LanguageDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILanguageDescriptor)target); + return Entities.Common.EdFi.InterventionPrescriptionLearningResourceMetadataURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LanguageDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILanguageDescriptor)target, null); + Entities.Common.EdFi.InterventionPrescriptionLearningResourceMetadataURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI)target, null); } // ------------------------------------------------------------- @@ -95111,6 +94286,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -95118,9 +94353,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LanguageDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -95148,22 +94383,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LanguageInstructionProgramServiceDescriptor table of the LanguageInstructionProgramServiceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPrescriptionPopulationServed table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LanguageInstructionProgramServiceDescriptor : Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class InterventionPrescriptionPopulationServed : Entities.Common.EdFi.IInterventionPrescriptionPopulationServed, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LanguageInstructionProgramServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionPopulationServed"); // Fluent validator instance (threadsafe) - private static LanguageInstructionProgramServiceDescriptorPutPostRequestValidator _validator = new LanguageInstructionProgramServiceDescriptorPutPostRequestValidator(); + private static InterventionPrescriptionPopulationServedPutPostRequestValidator _validator = new InterventionPrescriptionPopulationServedPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -95180,13 +94410,6 @@ public class LanguageInstructionProgramServiceDescriptor : Entities.Common.EdFi. // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LanguageInstructionProgramServiceDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -95197,26 +94420,40 @@ public class LanguageInstructionProgramServiceDescriptor : Entities.Common.EdFi. //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int LanguageInstructionProgramServiceDescriptorId { get; set; } - - int IDescriptor.DescriptorId + [IgnoreDataMember] + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionPopulationServed.InterventionPrescription { - get { return LanguageInstructionProgramServiceDescriptorId; } - set { LanguageInstructionProgramServiceDescriptorId = value; } + get { return _interventionPrescription; } + set { SetInterventionPrescription(value); } } - // ------------------------------------------------------------- - // ============================================================= - // Equality - // ------------------------------------------------------------- + public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription + { + set { SetInterventionPrescription(value); } + } - /// + private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + { + _interventionPrescription = value; + } + + /// + /// A subset of students that are the focus of the intervention prescription. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] + public string PopulationServedDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// /// Determines equality based on the natural key properties of the resource. /// /// @@ -95224,7 +94461,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionPopulationServed; if (ReferenceEquals(this, compareTo)) return true; @@ -95232,9 +94469,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor).LanguageInstructionProgramServiceDescriptorId.Equals(compareTo.LanguageInstructionProgramServiceDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionPopulationServed).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) return false; @@ -95250,9 +94491,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_interventionPrescription != null) + hash.Add(_interventionPrescription); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor).LanguageInstructionProgramServiceDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionPopulationServed).PopulationServedDescriptor); return hash.ToHashCode(); } @@ -95261,55 +94505,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95335,11 +94530,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionPopulationServed")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95350,13 +94542,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -95369,12 +94554,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LanguageInstructionProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor)target); + return Entities.Common.EdFi.InterventionPrescriptionPopulationServedMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LanguageInstructionProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor)target, null); + Entities.Common.EdFi.InterventionPrescriptionPopulationServedMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionPopulationServed)target, null); } // ------------------------------------------------------------- @@ -95382,6 +94567,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -95389,9 +94634,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LanguageInstructionProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionPopulationServedPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -95419,22 +94664,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LanguageUseDescriptor table of the LanguageUseDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.InterventionPrescriptionURI table of the InterventionPrescription aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LanguageUseDescriptor : Entities.Common.EdFi.ILanguageUseDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class InterventionPrescriptionURI : Entities.Common.EdFi.IInterventionPrescriptionURI, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LanguageUseDescriptor"); + private static FullName _fullName = new FullName("edfi", "InterventionPrescriptionURI"); // Fluent validator instance (threadsafe) - private static LanguageUseDescriptorPutPostRequestValidator _validator = new LanguageUseDescriptorPutPostRequestValidator(); + private static InterventionPrescriptionURIPutPostRequestValidator _validator = new InterventionPrescriptionURIPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -95451,13 +94691,6 @@ public class LanguageUseDescriptor : Entities.Common.EdFi.ILanguageUseDescriptor // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LanguageUseDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -95468,19 +94701,33 @@ public class LanguageUseDescriptor : Entities.Common.EdFi.ILanguageUseDescriptor //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IInterventionPrescription _interventionPrescription; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int LanguageUseDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.InterventionPrescription + { + get { return _interventionPrescription; } + set { SetInterventionPrescription(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IInterventionPrescription InterventionPrescription { - get { return LanguageUseDescriptorId; } - set { LanguageUseDescriptorId = value; } + set { SetInterventionPrescription(value); } + } + + private void SetInterventionPrescription(Entities.Common.EdFi.IInterventionPrescription value) + { + _interventionPrescription = value; } + + /// + /// The URI (typical a URL) pointing to an education content item. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="uri")] + public string URI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95495,7 +94742,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILanguageUseDescriptor; + var compareTo = obj as Entities.Common.EdFi.IInterventionPrescriptionURI; if (ReferenceEquals(this, compareTo)) return true; @@ -95503,9 +94750,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_interventionPrescription == null || !_interventionPrescription.Equals(compareTo.InterventionPrescription)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ILanguageUseDescriptor).LanguageUseDescriptorId.Equals(compareTo.LanguageUseDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionPrescriptionURI).URI, compareTo.URI)) return false; @@ -95521,9 +94772,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_interventionPrescription != null) + hash.Add(_interventionPrescription); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ILanguageUseDescriptor).LanguageUseDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionPrescriptionURI).URI); return hash.ToHashCode(); } @@ -95532,55 +94786,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95606,11 +94811,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionPrescription", "InterventionPrescriptionURI")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95621,13 +94823,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -95640,12 +94835,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LanguageUseDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILanguageUseDescriptor)target); + return Entities.Common.EdFi.InterventionPrescriptionURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionPrescriptionURI)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LanguageUseDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILanguageUseDescriptor)target, null); + Entities.Common.EdFi.InterventionPrescriptionURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionPrescriptionURI)target, null); } // ------------------------------------------------------------- @@ -95653,6 +94848,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -95660,9 +94915,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LanguageUseDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionPrescriptionURIPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -95691,19 +94946,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LearningStandard resource. + /// Represents a reference to the InterventionStudy resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardReference : IResourceReference + public class InterventionStudyReference : IResourceReference { - [DataMember(Name="learningStandardId")] - public string LearningStandardId { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="interventionStudyIdentificationCode")] + public string InterventionStudyIdentificationCode { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -95741,14 +94999,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return LearningStandardId != default(string); + return EducationOrganizationId != default(long) && InterventionStudyIdentificationCode != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (LearningStandardId == default) + if (EducationOrganizationId == default) { - yield return "LearningStandardId"; + yield return "EducationOrganizationId"; + } + + if (InterventionStudyIdentificationCode == default) + { + yield return "InterventionStudyIdentificationCode"; } } @@ -95757,8 +95020,8 @@ private Link CreateLink() { var link = new Link { - Rel = "LearningStandard", - Href = $"/ed-fi/learningStandards/{ResourceId:n}" + Rel = "InterventionStudy", + Href = $"/ed-fi/interventionStudies/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -95785,16 +95048,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.LearningStandard table of the LearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudy table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandard : Entities.Common.EdFi.ILearningStandard, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class InterventionStudy : Entities.Common.EdFi.IInterventionStudy, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandard"); + private static FullName _fullName = new FullName("edfi", "InterventionStudy"); // Fluent validator instance (threadsafe) - private static LearningStandardPutPostRequestValidator _validator = new LearningStandardPutPostRequestValidator(); + private static InterventionStudyPutPostRequestValidator _validator = new InterventionStudyPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -95805,11 +95069,16 @@ public class LearningStandard : Entities.Common.EdFi.ILearningStandard, IHasETag // Constructor // ------------------------------------------------------------- - public LearningStandard() + public InterventionStudy() { - LearningStandardAcademicSubjects = new List(); - LearningStandardGradeLevels = new List(); - LearningStandardIdentificationCodes = new List(); + InterventionStudyAppropriateGradeLevels = new List(); + InterventionStudyAppropriateSexes = new List(); + InterventionStudyEducationContents = new List(); + InterventionStudyInterventionEffectivenesses = new List(); + InterventionStudyLearningResourceMetadataURIs = new List(); + InterventionStudyPopulationServeds = new List(); + InterventionStudyStateAbbreviations = new List(); + InterventionStudyURIs = new List(); } // ------------------------------------------------------------ @@ -95819,7 +95088,7 @@ public LearningStandard() // ------------------------------------------------------------ /// - /// The unique identifier for the LearningStandard resource. + /// The unique identifier for the InterventionStudy resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -95830,37 +95099,70 @@ public LearningStandard() // References // ------------------------------------------------------------- - private bool _parentLearningStandardReferenceExplicitlyAssigned; - private LearningStandardReference _parentLearningStandardReference; - private LearningStandardReference ImplicitParentLearningStandardReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_parentLearningStandardReference == null && !_parentLearningStandardReferenceExplicitlyAssigned) - _parentLearningStandardReference = new LearningStandardReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _parentLearningStandardReference; + return _educationOrganizationReference; } } - [DataMember(Name="parentLearningStandardReference")] - [FullyDefinedReference] - public LearningStandardReference ParentLearningStandardReference + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitParentLearningStandardReference != null - && (_parentLearningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitParentLearningStandardReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _parentLearningStandardReferenceExplicitlyAssigned = true; - _parentLearningStandardReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } + private bool _interventionPrescriptionReferenceExplicitlyAssigned; + private InterventionPrescription.EdFi.InterventionPrescriptionReference _interventionPrescriptionReference; + private InterventionPrescription.EdFi.InterventionPrescriptionReference ImplicitInterventionPrescriptionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_interventionPrescriptionReference == null && !_interventionPrescriptionReferenceExplicitlyAssigned) + _interventionPrescriptionReference = new InterventionPrescription.EdFi.InterventionPrescriptionReference(); + + return _interventionPrescriptionReference; + } + } + + [DataMember(Name="interventionPrescriptionReference")] + [FullyDefinedReference][RequiredReference("edfi", "InterventionStudy")] + public InterventionPrescription.EdFi.InterventionPrescriptionReference InterventionPrescriptionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitInterventionPrescriptionReference != null + && (_interventionPrescriptionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + return ImplicitInterventionPrescriptionReference; + + return null; + } + set + { + _interventionPrescriptionReferenceExplicitlyAssigned = true; + _interventionPrescriptionReference = value; } } // ------------------------------------------------------------- @@ -95870,13 +95172,38 @@ public LearningStandardReference ParentLearningStandardReference // ------------------------------------------------------------- /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IInterventionStudy.EducationOrganizationId + { + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } + + /// + /// A unique number or alphanumeric code assigned to an intervention study. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="learningStandardId")] - public string LearningStandardId { get; set; } + [DataMember(Name="interventionStudyIdentificationCode")] + public string InterventionStudyIdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -95891,7 +95218,7 @@ public LearningStandardReference ParentLearningStandardReference /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandard; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudy; if (ReferenceEquals(this, compareTo)) return true; @@ -95900,8 +95227,13 @@ public override bool Equals(object obj) return false; + // Referenced Property + if (!(this as Entities.Common.EdFi.IInterventionStudy).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandard).LearningStandardId, compareTo.LearningStandardId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudy).InterventionStudyIdentificationCode, compareTo.InterventionStudyIdentificationCode)) return false; @@ -95918,8 +95250,11 @@ public override int GetHashCode() { var hash = new HashCode(); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IInterventionStudy).EducationOrganizationId); + // Standard Property - hash.Add((this as Entities.Common.EdFi.ILearningStandard).LearningStandardId); + hash.Add((this as Entities.Common.EdFi.IInterventionStudy).InterventionStudyIdentificationCode); return hash.ToHashCode(); } @@ -95935,67 +95270,62 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The official course title with which this learning standard is associated. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="courseTitle")] - public string CourseTitle { get; set; } - - /// - /// The text of the statement. The textual content that either describes a specific competency such as \"Apply the Pythagorean Theorem to determine unknown side lengths in right triangles in real-world and mathematical problems in two and three dimensions.\" or describes a less granular group of competencies within the taxonomy of the standards document, e.g. \"Understand and apply the Pythagorean Theorem,\" or \"Geometry\". + /// The way in which an intervention was implemented: individual, small group, whole class, or whole school. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="deliveryMethodDescriptor")][DescriptorExists("DeliveryMethodDescriptor")] + public string DeliveryMethodDescriptor { get; set; } /// - /// An additional classification of the type of a specific learning standard. + /// The way in which an intervention is used: curriculum, supplement, or practice. /// // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="learningStandardCategoryDescriptor")][DescriptorExists("LearningStandardCategoryDescriptor")] - public string LearningStandardCategoryDescriptor { get; set; } + [DataMember(Name="interventionClassDescriptor")][DescriptorExists("InterventionClassDescriptor")] + public string InterventionClassDescriptor { get; set; } /// - /// A code designated by the promulgating body to identify the statement, e.g. 1.N.3 (usually not globally unique). + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="learningStandardItemCode")] - public string LearningStandardItemCode { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionEducationOrganizationId + { + get + { + if (ImplicitInterventionPrescriptionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) + { + return ImplicitInterventionPrescriptionReference.EducationOrganizationId; + } - /// - /// Signals the scope of usage the standard. Does not necessarily relate the standard to the governing body. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="learningStandardScopeDescriptor")][DescriptorExists("LearningStandardScopeDescriptor")] - public string LearningStandardScopeDescriptor { get; set; } + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - /// - /// The namespace of the organization or entity who governs the standard. It is recommended the namespaces observe a URI format and begin with a domain name under the governing organization or entity control. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // InterventionPrescription + _interventionPrescriptionReferenceExplicitlyAssigned = false; + ImplicitInterventionPrescriptionReference.EducationOrganizationId = value; + } + } /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// A unique number or alphanumeric code assigned to an intervention prescription. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardId + string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionIdentificationCode { get { - if (ImplicitParentLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitParentLearningStandardReference.IsReferenceFullyDefined())) + if (ImplicitInterventionPrescriptionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitInterventionPrescriptionReference.IsReferenceFullyDefined())) { - return ImplicitParentLearningStandardReference.LearningStandardId; + return ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode; } return default(string); @@ -96005,45 +95335,43 @@ string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ParentLearningStandard - _parentLearningStandardReferenceExplicitlyAssigned = false; - ImplicitParentLearningStandardReference.LearningStandardId = value; + // InterventionPrescription + _interventionPrescriptionReferenceExplicitlyAssigned = false; + ImplicitInterventionPrescriptionReference.InterventionPrescriptionIdentificationCode = value; } } + + private bool _participantsExplicitlyAssigned = false; + private int _participants; /// - /// One or more statements that describes the criteria used by teachers and students to check for attainment of a learning standard. This criteria gives clear indications as to the degree to which learning is moving through the Zone or Proximal Development toward independent achievement of the learning standard. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="successCriteria")] - public string SuccessCriteria { get; set; } - - /// - /// An unambiguous reference to the statement using a network-resolvable URI. + /// The number of participants observed in the study. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="uri")] - public string URI { get; set; } - // ------------------------------------------------------------- + [DataMember(Name="participants")] + public int Participants + { + get => _participants; + set + { + _participants = value; + _participantsExplicitlyAssigned = true; + } + } - // ============================================================= - // One-to-one relationships // ------------------------------------------------------------- - /// - /// contentStandard - /// - [Required(ErrorMessage=ValidationHelpers.RequiredObjectMessageFormat)] - [DataMember(Name = "contentStandard")] - public LearningStandardContentStandard LearningStandardContentStandard { get; set; } - Entities.Common.EdFi.ILearningStandardContentStandard Entities.Common.EdFi.ILearningStandard.LearningStandardContentStandard + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() { - get { return LearningStandardContentStandard; } - set { LearningStandardContentStandard = (LearningStandardContentStandard) value; } + if (!_participantsExplicitlyAssigned) + { + yield return "Participants"; + } } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -96059,101 +95387,251 @@ Entities.Common.EdFi.ILearningStandardContentStandard Entities.Common.EdFi.ILear // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudy")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _learningStandardAcademicSubjects; - private ICollection _learningStandardAcademicSubjectsCovariant; + private ICollection _interventionStudyAppropriateGradeLevels; + private ICollection _interventionStudyAppropriateGradeLevelsCovariant; - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="academicSubjects")] - public ICollection LearningStandardAcademicSubjects + [NoDuplicateMembers] + [DataMember(Name="appropriateGradeLevels")] + public ICollection InterventionStudyAppropriateGradeLevels { - get { return _learningStandardAcademicSubjects; } + get { return _interventionStudyAppropriateGradeLevels; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ILearningStandardAcademicSubject)e.Item).LearningStandard = this); - _learningStandardAcademicSubjects = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)e.Item).InterventionStudy = this); + _interventionStudyAppropriateGradeLevels = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardAcademicSubject)e.Item).LearningStandard = this; - _learningStandardAcademicSubjectsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)e.Item).InterventionStudy = this; + _interventionStudyAppropriateGradeLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardAcademicSubjects + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateGradeLevels { - get { return _learningStandardAcademicSubjectsCovariant; } - set { LearningStandardAcademicSubjects = new List(value.Cast()); } + get { return _interventionStudyAppropriateGradeLevelsCovariant; } + set { InterventionStudyAppropriateGradeLevels = new List(value.Cast()); } } - private ICollection _learningStandardGradeLevels; - private ICollection _learningStandardGradeLevelsCovariant; + private ICollection _interventionStudyAppropriateSexes; + private ICollection _interventionStudyAppropriateSexesCovariant; - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="gradeLevels")] - public ICollection LearningStandardGradeLevels + [NoDuplicateMembers] + [DataMember(Name="appropriateSexes")] + public ICollection InterventionStudyAppropriateSexes { - get { return _learningStandardGradeLevels; } + get { return _interventionStudyAppropriateSexes; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ILearningStandardGradeLevel)e.Item).LearningStandard = this); - _learningStandardGradeLevels = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateSex)e.Item).InterventionStudy = this); + _interventionStudyAppropriateSexes = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardGradeLevel)e.Item).LearningStandard = this; - _learningStandardGradeLevelsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyAppropriateSex)e.Item).InterventionStudy = this; + _interventionStudyAppropriateSexesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardGradeLevels + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyAppropriateSexes { - get { return _learningStandardGradeLevelsCovariant; } - set { LearningStandardGradeLevels = new List(value.Cast()); } + get { return _interventionStudyAppropriateSexesCovariant; } + set { InterventionStudyAppropriateSexes = new List(value.Cast()); } } - private ICollection _learningStandardIdentificationCodes; - private ICollection _learningStandardIdentificationCodesCovariant; + private ICollection _interventionStudyEducationContents; + private ICollection _interventionStudyEducationContentsCovariant; [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection LearningStandardIdentificationCodes + [DataMember(Name="educationContents")] + public ICollection InterventionStudyEducationContents { - get { return _learningStandardIdentificationCodes; } + get { return _interventionStudyEducationContents; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ILearningStandardIdentificationCode)e.Item).LearningStandard = this); - _learningStandardIdentificationCodes = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyEducationContent)e.Item).InterventionStudy = this); + _interventionStudyEducationContents = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardIdentificationCode)e.Item).LearningStandard = this; - _learningStandardIdentificationCodesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyEducationContent)e.Item).InterventionStudy = this; + _interventionStudyEducationContentsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardIdentificationCodes + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyEducationContents { - get { return _learningStandardIdentificationCodesCovariant; } - set { LearningStandardIdentificationCodes = new List(value.Cast()); } + get { return _interventionStudyEducationContentsCovariant; } + set { InterventionStudyEducationContents = new List(value.Cast()); } + } + + private ICollection _interventionStudyInterventionEffectivenesses; + private ICollection _interventionStudyInterventionEffectivenessesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="interventionEffectivenesses")] + public ICollection InterventionStudyInterventionEffectivenesses + { + get { return _interventionStudyInterventionEffectivenesses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)e.Item).InterventionStudy = this); + _interventionStudyInterventionEffectivenesses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)e.Item).InterventionStudy = this; + _interventionStudyInterventionEffectivenessesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyInterventionEffectivenesses + { + get { return _interventionStudyInterventionEffectivenessesCovariant; } + set { InterventionStudyInterventionEffectivenesses = new List(value.Cast()); } + } + + private ICollection _interventionStudyLearningResourceMetadataURIs; + private ICollection _interventionStudyLearningResourceMetadataURIsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="learningResourceMetadataURIs")] + public ICollection InterventionStudyLearningResourceMetadataURIs + { + get { return _interventionStudyLearningResourceMetadataURIs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)e.Item).InterventionStudy = this); + _interventionStudyLearningResourceMetadataURIs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)e.Item).InterventionStudy = this; + _interventionStudyLearningResourceMetadataURIsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyLearningResourceMetadataURIs + { + get { return _interventionStudyLearningResourceMetadataURIsCovariant; } + set { InterventionStudyLearningResourceMetadataURIs = new List(value.Cast()); } + } + + private ICollection _interventionStudyPopulationServeds; + private ICollection _interventionStudyPopulationServedsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="populationServeds")] + public ICollection InterventionStudyPopulationServeds + { + get { return _interventionStudyPopulationServeds; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyPopulationServed)e.Item).InterventionStudy = this); + _interventionStudyPopulationServeds = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyPopulationServed)e.Item).InterventionStudy = this; + _interventionStudyPopulationServedsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyPopulationServeds + { + get { return _interventionStudyPopulationServedsCovariant; } + set { InterventionStudyPopulationServeds = new List(value.Cast()); } + } + + private ICollection _interventionStudyStateAbbreviations; + private ICollection _interventionStudyStateAbbreviationsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="stateAbbreviations")] + public ICollection InterventionStudyStateAbbreviations + { + get { return _interventionStudyStateAbbreviations; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyStateAbbreviation)e.Item).InterventionStudy = this); + _interventionStudyStateAbbreviations = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyStateAbbreviation)e.Item).InterventionStudy = this; + _interventionStudyStateAbbreviationsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyStateAbbreviations + { + get { return _interventionStudyStateAbbreviationsCovariant; } + set { InterventionStudyStateAbbreviations = new List(value.Cast()); } + } + + private ICollection _interventionStudyURIs; + private ICollection _interventionStudyURIsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="uris")] + public ICollection InterventionStudyURIs + { + get { return _interventionStudyURIs; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IInterventionStudyURI)e.Item).InterventionStudy = this); + _interventionStudyURIs = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IInterventionStudyURI)e.Item).InterventionStudy = this; + _interventionStudyURIsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IInterventionStudy.InterventionStudyURIs + { + get { return _interventionStudyURIsCovariant; } + set { InterventionStudyURIs = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -96178,19 +95656,44 @@ public ICollection LearningStandardIdentific internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_learningStandardAcademicSubjects != null) foreach (var item in _learningStandardAcademicSubjects) + if (_interventionStudyAppropriateGradeLevels != null) foreach (var item in _interventionStudyAppropriateGradeLevels) { - item.LearningStandard = this; + item.InterventionStudy = this; } - if (_learningStandardGradeLevels != null) foreach (var item in _learningStandardGradeLevels) + if (_interventionStudyAppropriateSexes != null) foreach (var item in _interventionStudyAppropriateSexes) { - item.LearningStandard = this; + item.InterventionStudy = this; } - if (_learningStandardIdentificationCodes != null) foreach (var item in _learningStandardIdentificationCodes) + if (_interventionStudyEducationContents != null) foreach (var item in _interventionStudyEducationContents) { - item.LearningStandard = this; + item.InterventionStudy = this; + } + + if (_interventionStudyInterventionEffectivenesses != null) foreach (var item in _interventionStudyInterventionEffectivenesses) + { + item.InterventionStudy = this; + } + + if (_interventionStudyLearningResourceMetadataURIs != null) foreach (var item in _interventionStudyLearningResourceMetadataURIs) + { + item.InterventionStudy = this; + } + + if (_interventionStudyPopulationServeds != null) foreach (var item in _interventionStudyPopulationServeds) + { + item.InterventionStudy = this; + } + + if (_interventionStudyStateAbbreviations != null) foreach (var item in _interventionStudyStateAbbreviations) + { + item.InterventionStudy = this; + } + + if (_interventionStudyURIs != null) foreach (var item in _interventionStudyURIs) + { + item.InterventionStudy = this; } } @@ -96201,29 +95704,43 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandard)target); + return Entities.Common.EdFi.InterventionStudyMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudy)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandard)target, null); + Entities.Common.EdFi.InterventionStudyMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudy)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILearningStandard.ParentLearningStandardResourceId + Guid? Entities.Common.EdFi.IInterventionStudy.EducationOrganizationResourceId { get { return null; } - set { ImplicitParentLearningStandardReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardDiscriminator + string Entities.Common.EdFi.IInterventionStudy.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitParentLearningStandardReference.Discriminator = value; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionResourceId + { + get { return null; } + set { ImplicitInterventionPrescriptionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitInterventionPrescriptionReference.Discriminator = value; } } @@ -96249,109 +95766,162 @@ string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardDiscriminato // ---------------------- // Validate collections // ---------------------- - if (LearningStandardAcademicSubjects.Any() && mappingContract?.IsMemberSupported("LearningStandardAcademicSubjects") != false) + if (InterventionStudyAppropriateGradeLevels.Any() && mappingContract?.IsMemberSupported("InterventionStudyAppropriateGradeLevels") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("LearningStandardAcademicSubjects"); + pathBuilder.Append("InterventionStudyAppropriateGradeLevels"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardAcademicSubjects, validationContext, validationContext.Items.ForCollection("LearningStandardAcademicSubjects")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyAppropriateGradeLevels, validationContext, validationContext.Items.ForCollection("InterventionStudyAppropriateGradeLevels")))) { yield return result; } } - if (LearningStandardGradeLevels.Any() && mappingContract?.IsMemberSupported("LearningStandardGradeLevels") != false) + if (InterventionStudyAppropriateSexes.Any() && mappingContract?.IsMemberSupported("InterventionStudyAppropriateSexes") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("LearningStandardGradeLevels"); + pathBuilder.Append("InterventionStudyAppropriateSexes"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardGradeLevels, validationContext, validationContext.Items.ForCollection("LearningStandardGradeLevels")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyAppropriateSexes, validationContext, validationContext.Items.ForCollection("InterventionStudyAppropriateSexes")))) { yield return result; } } - if (LearningStandardIdentificationCodes.Any() && mappingContract?.IsMemberSupported("LearningStandardIdentificationCodes") != false) + if (InterventionStudyEducationContents.Any() && mappingContract?.IsMemberSupported("InterventionStudyEducationContents") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("LearningStandardIdentificationCodes"); + pathBuilder.Append("InterventionStudyEducationContents"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardIdentificationCodes, validationContext, validationContext.Items.ForCollection("LearningStandardIdentificationCodes")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyEducationContents, validationContext, validationContext.Items.ForCollection("InterventionStudyEducationContents")))) { yield return result; } } - - // --------------------------- - // Validate embedded objects - // --------------------------- - if (LearningStandardContentStandard != null && mappingContract?.IsMemberSupported("LearningStandardContentStandard") != false) + if (InterventionStudyInterventionEffectivenesses.Any() && mappingContract?.IsMemberSupported("InterventionStudyInterventionEffectivenesses") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("LearningStandardContentStandard"); - - foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(LearningStandardContentStandard, validationContext, validationContext.Items.ForEmbeddedObject("LearningStandardContentStandard")))) + pathBuilder.Append("InterventionStudyInterventionEffectivenesses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyInterventionEffectivenesses, validationContext, validationContext.Items.ForCollection("InterventionStudyInterventionEffectivenesses")))) { yield return result; } } - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) + if (InterventionStudyLearningResourceMetadataURIs.Any() && mappingContract?.IsMemberSupported("InterventionStudyLearningResourceMetadataURIs") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); + pathBuilder.Append("InterventionStudyLearningResourceMetadataURIs"); - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyLearningResourceMetadataURIs, validationContext, validationContext.Items.ForCollection("InterventionStudyLearningResourceMetadataURIs")))) { yield return result; } } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - if (!fluentValidationResult.IsValid) + if (InterventionStudyPopulationServeds.Any() && mappingContract?.IsMemberSupported("InterventionStudyPopulationServeds") != false) { - foreach (var error in fluentValidationResult.Errors) + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionStudyPopulationServeds"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyPopulationServeds, validationContext, validationContext.Items.ForCollection("InterventionStudyPopulationServeds")))) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + yield return result; } } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - // ================================================================= - // Validators + if (InterventionStudyStateAbbreviations.Any() && mappingContract?.IsMemberSupported("InterventionStudyStateAbbreviations") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionStudyStateAbbreviations"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyStateAbbreviations, validationContext, validationContext.Items.ForCollection("InterventionStudyStateAbbreviations")))) + { + yield return result; + } + } + + if (InterventionStudyURIs.Any() && mappingContract?.IsMemberSupported("InterventionStudyURIs") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("InterventionStudyURIs"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(InterventionStudyURIs, validationContext, validationContext.Items.ForCollection("InterventionStudyURIs")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_LearningStandard = new FullName("edfi", "LearningStandard"); + private static readonly FullName _fullName_edfi_InterventionStudy = new FullName("edfi", "InterventionStudy"); // Declare collection item validators - private LearningStandardAcademicSubjectPutPostRequestValidator _learningStandardAcademicSubjectsValidator = new (); - private LearningStandardGradeLevelPutPostRequestValidator _learningStandardGradeLevelsValidator = new (); - private LearningStandardIdentificationCodePutPostRequestValidator _learningStandardIdentificationCodesValidator = new (); + private InterventionStudyAppropriateGradeLevelPutPostRequestValidator _interventionStudyAppropriateGradeLevelsValidator = new (); + private InterventionStudyAppropriateSexPutPostRequestValidator _interventionStudyAppropriateSexesValidator = new (); + private InterventionStudyEducationContentPutPostRequestValidator _interventionStudyEducationContentsValidator = new (); + private InterventionStudyInterventionEffectivenessPutPostRequestValidator _interventionStudyInterventionEffectivenessesValidator = new (); + private InterventionStudyLearningResourceMetadataURIPutPostRequestValidator _interventionStudyLearningResourceMetadataURIsValidator = new (); + private InterventionStudyPopulationServedPutPostRequestValidator _interventionStudyPopulationServedsValidator = new (); + private InterventionStudyStateAbbreviationPutPostRequestValidator _interventionStudyStateAbbreviationsValidator = new (); + private InterventionStudyURIPutPostRequestValidator _interventionStudyURIsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -96368,41 +95938,96 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsLearningStandardAcademicSubjectIncluded(x)); + var hasInvalidInterventionStudyAppropriateGradeLevelsItems = instance.InterventionStudyAppropriateGradeLevels.Any(x => !mappingContract.IsInterventionStudyAppropriateGradeLevelIncluded(x)); - if (hasInvalidLearningStandardAcademicSubjectsItems) + if (hasInvalidInterventionStudyAppropriateGradeLevelsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("LearningStandardAcademicSubjects", $"A supplied 'LearningStandardAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionStudyAppropriateGradeLevels", $"A supplied 'InterventionStudyAppropriateGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsLearningStandardGradeLevelIncluded != null) + if (mappingContract.IsInterventionStudyAppropriateSexIncluded != null) { - var hasInvalidLearningStandardGradeLevelsItems = instance.LearningStandardGradeLevels.Any(x => !mappingContract.IsLearningStandardGradeLevelIncluded(x)); + var hasInvalidInterventionStudyAppropriateSexesItems = instance.InterventionStudyAppropriateSexes.Any(x => !mappingContract.IsInterventionStudyAppropriateSexIncluded(x)); - if (hasInvalidLearningStandardGradeLevelsItems) + if (hasInvalidInterventionStudyAppropriateSexesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("LearningStandardGradeLevels", $"A supplied 'LearningStandardGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionStudyAppropriateSexes", $"A supplied 'InterventionStudyAppropriateSex' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsLearningStandardIdentificationCodeIncluded != null) + if (mappingContract.IsInterventionStudyEducationContentIncluded != null) { - var hasInvalidLearningStandardIdentificationCodesItems = instance.LearningStandardIdentificationCodes.Any(x => !mappingContract.IsLearningStandardIdentificationCodeIncluded(x)); + var hasInvalidInterventionStudyEducationContentsItems = instance.InterventionStudyEducationContents.Any(x => !mappingContract.IsInterventionStudyEducationContentIncluded(x)); - if (hasInvalidLearningStandardIdentificationCodesItems) + if (hasInvalidInterventionStudyEducationContentsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("LearningStandardIdentificationCodes", $"A supplied 'LearningStandardIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("InterventionStudyEducationContents", $"A supplied 'InterventionStudyEducationContent' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionStudyInterventionEffectivenessIncluded != null) + { + var hasInvalidInterventionStudyInterventionEffectivenessesItems = instance.InterventionStudyInterventionEffectivenesses.Any(x => !mappingContract.IsInterventionStudyInterventionEffectivenessIncluded(x)); + + if (hasInvalidInterventionStudyInterventionEffectivenessesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionStudyInterventionEffectivenesses", $"A supplied 'InterventionStudyInterventionEffectiveness' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionStudyLearningResourceMetadataURIIncluded != null) + { + var hasInvalidInterventionStudyLearningResourceMetadataURIsItems = instance.InterventionStudyLearningResourceMetadataURIs.Any(x => !mappingContract.IsInterventionStudyLearningResourceMetadataURIIncluded(x)); + + if (hasInvalidInterventionStudyLearningResourceMetadataURIsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionStudyLearningResourceMetadataURIs", $"A supplied 'InterventionStudyLearningResourceMetadataURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionStudyPopulationServedIncluded != null) + { + var hasInvalidInterventionStudyPopulationServedsItems = instance.InterventionStudyPopulationServeds.Any(x => !mappingContract.IsInterventionStudyPopulationServedIncluded(x)); + + if (hasInvalidInterventionStudyPopulationServedsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionStudyPopulationServeds", $"A supplied 'InterventionStudyPopulationServed' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionStudyStateAbbreviationIncluded != null) + { + var hasInvalidInterventionStudyStateAbbreviationsItems = instance.InterventionStudyStateAbbreviations.Any(x => !mappingContract.IsInterventionStudyStateAbbreviationIncluded(x)); + + if (hasInvalidInterventionStudyStateAbbreviationsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionStudyStateAbbreviations", $"A supplied 'InterventionStudyStateAbbreviation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsInterventionStudyURIIncluded != null) + { + var hasInvalidInterventionStudyURIsItems = instance.InterventionStudyURIs.Any(x => !mappingContract.IsInterventionStudyURIIncluded(x)); + + if (hasInvalidInterventionStudyURIsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("InterventionStudyURIs", $"A supplied 'InterventionStudyURI' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -96424,16 +96049,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardAcademicSubject table of the LearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudyAppropriateGradeLevel table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardAcademicSubject : Entities.Common.EdFi.ILearningStandardAcademicSubject, IValidatableObject + public class InterventionStudyAppropriateGradeLevel : Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandardAcademicSubject"); + private static FullName _fullName = new FullName("edfi", "InterventionStudyAppropriateGradeLevel"); // Fluent validator instance (threadsafe) - private static LearningStandardAcademicSubjectPutPostRequestValidator _validator = new LearningStandardAcademicSubjectPutPostRequestValidator(); + private static InterventionStudyAppropriateGradeLevelPutPostRequestValidator _validator = new InterventionStudyAppropriateGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -96460,33 +96085,33 @@ public class LearningStandardAcademicSubject : Entities.Common.EdFi.ILearningSta //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILearningStandard _learningStandard; + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; [IgnoreDataMember] - Entities.Common.EdFi.ILearningStandard ILearningStandardAcademicSubject.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateGradeLevel.InterventionStudy { - get { return _learningStandard; } - set { SetLearningStandard(value); } + get { return _interventionStudy; } + set { SetInterventionStudy(value); } } - public Entities.Common.EdFi.ILearningStandard LearningStandard + public Entities.Common.EdFi.IInterventionStudy InterventionStudy { - set { SetLearningStandard(value); } + set { SetInterventionStudy(value); } } - private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) { - _learningStandard = value; + _interventionStudy = value; } /// - /// Subject area for the learning standard. + /// Grade levels participating in this study. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -96501,7 +96126,7 @@ private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardAcademicSubject; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -96510,12 +96135,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ILearningStandardAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -96532,11 +96157,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_learningStandard != null) - hash.Add(_learningStandard); + if (_interventionStudy != null) + hash.Add(_interventionStudy); // Standard Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardAcademicSubject).AcademicSubjectDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -96570,7 +96195,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardAcademicSubject")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyAppropriateGradeLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -96594,12 +96219,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardAcademicSubject)target); + return Entities.Common.EdFi.InterventionStudyAppropriateGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardAcademicSubject)target, null); + Entities.Common.EdFi.InterventionStudyAppropriateGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel)target, null); } // ------------------------------------------------------------- @@ -96674,9 +96299,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyAppropriateGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -96705,16 +96330,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardContentStandard table of the LearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudyAppropriateSex table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardContentStandard : Entities.Common.EdFi.ILearningStandardContentStandard, IValidatableObject + public class InterventionStudyAppropriateSex : Entities.Common.EdFi.IInterventionStudyAppropriateSex, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandardContentStandard"); + private static FullName _fullName = new FullName("edfi", "InterventionStudyAppropriateSex"); // Fluent validator instance (threadsafe) - private static LearningStandardContentStandardPutPostRequestValidator _validator = new LearningStandardContentStandardPutPostRequestValidator(); + private static InterventionStudyAppropriateSexPutPostRequestValidator _validator = new InterventionStudyAppropriateSexPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -96725,10 +96350,6 @@ public class LearningStandardContentStandard : Entities.Common.EdFi.ILearningSta // Constructor // ------------------------------------------------------------- - public LearningStandardContentStandard() - { - LearningStandardContentStandardAuthors = new List(); - } // ------------------------------------------------------------ @@ -96740,63 +96361,38 @@ public LearningStandardContentStandard() // ============================================================= // References // ------------------------------------------------------------- - - private bool _mandatingEducationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _mandatingEducationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitMandatingEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_mandatingEducationOrganizationReference == null && !_mandatingEducationOrganizationReferenceExplicitlyAssigned) - _mandatingEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _mandatingEducationOrganizationReference; - } - } - - [DataMember(Name="mandatingEducationOrganizationReference")] - [FullyDefinedReference] - public EducationOrganization.EdFi.EducationOrganizationReference MandatingEducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitMandatingEducationOrganizationReference != null - && (_mandatingEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitMandatingEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitMandatingEducationOrganizationReference; - - return null; - } - set - { - _mandatingEducationOrganizationReferenceExplicitlyAssigned = true; - _mandatingEducationOrganizationReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILearningStandard _learningStandard; + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; [IgnoreDataMember] - Entities.Common.EdFi.ILearningStandard ILearningStandardContentStandard.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateSex.InterventionStudy { - get { return _learningStandard; } - set { SetLearningStandard(value); } + get { return _interventionStudy; } + set { SetInterventionStudy(value); } } - public Entities.Common.EdFi.ILearningStandard LearningStandard + public Entities.Common.EdFi.IInterventionStudy InterventionStudy { - set { SetLearningStandard(value); } + set { SetInterventionStudy(value); } } - private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) { - _learningStandard = value; + _interventionStudy = value; } + + /// + /// Sexes participating in this study. If omitted, considered generally applicable. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] + public string SexDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -96811,7 +96407,7 @@ private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardContentStandard; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyAppropriateSex; if (ReferenceEquals(this, compareTo)) return true; @@ -96820,7 +96416,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyAppropriateSex).SexDescriptor, compareTo.SexDescriptor)) return false; @@ -96837,8 +96438,12 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_learningStandard != null) - hash.Add(_learningStandard); + if (_interventionStudy != null) + hash.Add(_interventionStudy); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionStudyAppropriateSex).SexDescriptor); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -96851,94 +96456,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The beginning of the period during which this learning standard document is intended for use. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BeginDate { get; set; } - - /// - /// The end of the period during which this learning standard document is intended for use. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationId - { - get - { - if (ImplicitMandatingEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitMandatingEducationOrganizationReference.IsReferenceFullyDefined())) - { - return ImplicitMandatingEducationOrganizationReference.EducationOrganizationId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // MandatingEducationOrganization - _mandatingEducationOrganizationReferenceExplicitlyAssigned = false; - ImplicitMandatingEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); - } - } - - /// - /// The date on which this content was first published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="publicationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? PublicationDate { get; set; } - - /// - /// The publication status of the document (i.e., Adopted, Draft, Published, Deprecated, Unknown). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="publicationStatusDescriptor")][DescriptorExists("PublicationStatusDescriptor")] - public string PublicationStatusDescriptor { get; set; } - - /// - /// The year at which this content was first published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="publicationYear")] - public short? PublicationYear { get; set; } - - /// - /// The name of the content standard, for example Common Core. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="title")] - public string Title { get; set; } - - /// - /// An unambiguous reference to the standards using a network-resolvable URI. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="uri")] - public string URI { get; set; } - - /// - /// The version identifier for the content. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="version")] - public string Version { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -96959,43 +96476,13 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardContentStandard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyAppropriateSex")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _learningStandardContentStandardAuthors; - private ICollection _learningStandardContentStandardAuthorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="authors")] - public ICollection LearningStandardContentStandardAuthors - { - get { return _learningStandardContentStandardAuthors; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ILearningStandardContentStandardAuthor)e.Item).LearningStandardContentStandard = this); - _learningStandardContentStandardAuthors = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardContentStandardAuthor)e.Item).LearningStandardContentStandard = this; - _learningStandardContentStandardAuthorsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILearningStandardContentStandard.LearningStandardContentStandardAuthors - { - get { return _learningStandardContentStandardAuthorsCovariant; } - set { LearningStandardContentStandardAuthors = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -97006,17 +96493,6 @@ public ICollection LearningStandardConten // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_learningStandardContentStandardAuthors != null) foreach (var item in _learningStandardContentStandardAuthors) - { - item.LearningStandardContentStandard = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -97024,32 +96500,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardContentStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardContentStandard)target); + return Entities.Common.EdFi.InterventionStudyAppropriateSexMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateSex)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardContentStandardMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardContentStandard)target, null); + Entities.Common.EdFi.InterventionStudyAppropriateSexMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyAppropriateSex)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationResourceId - { - get { return null; } - set { ImplicitMandatingEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitMandatingEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -97073,18 +96535,6 @@ string Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationO // ---------------------- // Validate collections // ---------------------- - if (LearningStandardContentStandardAuthors.Any() && mappingContract?.IsMemberSupported("LearningStandardContentStandardAuthors") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("LearningStandardContentStandardAuthors"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardContentStandardAuthors, validationContext, validationContext.Items.ForCollection("LearningStandardContentStandardAuthors")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -97130,14 +96580,9 @@ string Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationO // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardContentStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyAppropriateSexPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_LearningStandardContentStandard = new FullName("edfi", "LearningStandardContentStandard"); - - // Declare collection item validators - private LearningStandardContentStandardAuthorPutPostRequestValidator _learningStandardContentStandardAuthorsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -97150,28 +96595,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (LearningStandardContentStandardMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_LearningStandardContentStandard); - - if (mappingContract != null) - { - if (mappingContract.IsLearningStandardContentStandardAuthorIncluded != null) - { - var hasInvalidLearningStandardContentStandardAuthorsItems = instance.LearningStandardContentStandardAuthors.Any(x => !mappingContract.IsLearningStandardContentStandardAuthorIncluded(x)); - - if (hasInvalidLearningStandardContentStandardAuthorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("LearningStandardContentStandardAuthors", $"A supplied 'LearningStandardContentStandardAuthor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -97188,16 +96611,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardContentStandardAuthor table of the LearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudyEducationContent table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardContentStandardAuthor : Entities.Common.EdFi.ILearningStandardContentStandardAuthor, IValidatableObject + public class InterventionStudyEducationContent : Entities.Common.EdFi.IInterventionStudyEducationContent, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandardContentStandardAuthor"); + private static FullName _fullName = new FullName("edfi", "InterventionStudyEducationContent"); // Fluent validator instance (threadsafe) - private static LearningStandardContentStandardAuthorPutPostRequestValidator _validator = new LearningStandardContentStandardAuthorPutPostRequestValidator(); + private static InterventionStudyEducationContentPutPostRequestValidator _validator = new InterventionStudyEducationContentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -97219,38 +96642,88 @@ public class LearningStandardContentStandardAuthor : Entities.Common.EdFi.ILearn // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationContentReferenceExplicitlyAssigned; + private EducationContent.EdFi.EducationContentReference _educationContentReference; + private EducationContent.EdFi.EducationContentReference ImplicitEducationContentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationContentReference == null && !_educationContentReferenceExplicitlyAssigned) + _educationContentReference = new EducationContent.EdFi.EducationContentReference(); + + return _educationContentReference; + } + } + + [DataMember(Name="educationContentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationContent.EdFi.EducationContentReference EducationContentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationContentReference != null + && (_educationContentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) + return ImplicitEducationContentReference; + + return null; + } + set + { + _educationContentReferenceExplicitlyAssigned = true; + _educationContentReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILearningStandardContentStandard _learningStandardContentStandard; + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; [IgnoreDataMember] - Entities.Common.EdFi.ILearningStandardContentStandard ILearningStandardContentStandardAuthor.LearningStandardContentStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyEducationContent.InterventionStudy { - get { return _learningStandardContentStandard; } - set { SetLearningStandardContentStandard(value); } + get { return _interventionStudy; } + set { SetInterventionStudy(value); } } - public Entities.Common.EdFi.ILearningStandardContentStandard LearningStandardContentStandard + public Entities.Common.EdFi.IInterventionStudy InterventionStudy { - set { SetLearningStandardContentStandard(value); } + set { SetInterventionStudy(value); } } - private void SetLearningStandardContentStandard(Entities.Common.EdFi.ILearningStandardContentStandard value) + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) { - _learningStandardContentStandard = value; + _interventionStudy = value; } /// - /// The person or organization chiefly responsible for the intellectual content of the standard. + /// A unique identifier for the education content. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="author")] - public string Author { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IInterventionStudyEducationContent.ContentIdentifier + { + get + { + if (ImplicitEducationContentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationContentReference.IsReferenceFullyDefined())) + return ImplicitEducationContentReference.ContentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationContent + _educationContentReferenceExplicitlyAssigned = false; + ImplicitEducationContentReference.ContentIdentifier = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -97265,7 +96738,7 @@ private void SetLearningStandardContentStandard(Entities.Common.EdFi.ILearningSt /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardContentStandardAuthor; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyEducationContent; if (ReferenceEquals(this, compareTo)) return true; @@ -97274,12 +96747,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_learningStandardContentStandard == null || !_learningStandardContentStandard.Equals(compareTo.LearningStandardContentStandard)) + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardContentStandardAuthor).Author, compareTo.Author)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudyEducationContent).ContentIdentifier, compareTo.ContentIdentifier)) return false; @@ -97296,12 +96769,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_learningStandardContentStandard != null) - hash.Add(_learningStandardContentStandard); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardContentStandardAuthor).Author); + if (_interventionStudy != null) + hash.Add(_interventionStudy); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IInterventionStudyEducationContent).ContentIdentifier); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -97334,7 +96806,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardContentStandardAuthor")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyEducationContent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -97358,18 +96830,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardContentStandardAuthorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardContentStandardAuthor)target); + return Entities.Common.EdFi.InterventionStudyEducationContentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyEducationContent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardContentStandardAuthorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardContentStandardAuthor)target, null); + Entities.Common.EdFi.InterventionStudyEducationContentMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyEducationContent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentResourceId + { + get { return null; } + set { ImplicitEducationContentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IInterventionStudyEducationContent.EducationContentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationContentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -97438,9 +96924,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardContentStandardAuthorPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyEducationContentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -97469,16 +96955,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardGradeLevel table of the LearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudyInterventionEffectiveness table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardGradeLevel : Entities.Common.EdFi.ILearningStandardGradeLevel, IValidatableObject + public class InterventionStudyInterventionEffectiveness : Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandardGradeLevel"); + private static FullName _fullName = new FullName("edfi", "InterventionStudyInterventionEffectiveness"); // Fluent validator instance (threadsafe) - private static LearningStandardGradeLevelPutPostRequestValidator _validator = new LearningStandardGradeLevelPutPostRequestValidator(); + private static InterventionStudyInterventionEffectivenessPutPostRequestValidator _validator = new InterventionStudyInterventionEffectivenessPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -97505,33 +96991,51 @@ public class LearningStandardGradeLevel : Entities.Common.EdFi.ILearningStandard //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILearningStandard _learningStandard; + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; [IgnoreDataMember] - Entities.Common.EdFi.ILearningStandard ILearningStandardGradeLevel.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyInterventionEffectiveness.InterventionStudy { - get { return _learningStandard; } - set { SetLearningStandard(value); } + get { return _interventionStudy; } + set { SetInterventionStudy(value); } } - public Entities.Common.EdFi.ILearningStandard LearningStandard + public Entities.Common.EdFi.IInterventionStudy InterventionStudy { - set { SetLearningStandard(value); } + set { SetInterventionStudy(value); } } - private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) { - _learningStandard = value; + _interventionStudy = value; } /// - /// The grade levels for the specific learning standard. + /// Targeted purpose of the intervention (e.g., attendance issue, dropout risk) for which the effectiveness is measured. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="diagnosisDescriptor")][DescriptorExists("DiagnosisDescriptor")] + public string DiagnosisDescriptor { get; set; } + + /// + /// Grade level for which effectiveness is measured. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] public string GradeLevelDescriptor { get; set; } + + /// + /// Population for which effectiveness is measured. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] + public string PopulationServedDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -97546,7 +97050,7 @@ private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness; if (ReferenceEquals(this, compareTo)) return true; @@ -97555,12 +97059,22 @@ public override bool Equals(object obj) return false; // Parent Property - if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ILearningStandardGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).DiagnosisDescriptor, compareTo.DiagnosisDescriptor)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) return false; @@ -97577,11 +97091,19 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_learningStandard != null) - hash.Add(_learningStandard); + if (_interventionStudy != null) + hash.Add(_interventionStudy); // Standard Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardGradeLevel).GradeLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).DiagnosisDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).GradeLevelDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness).PopulationServedDescriptor); return hash.ToHashCode(); } @@ -97595,6 +97117,22 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// Along a percentile distribution of students, the improvement index represents the change in an average student's percentile rank that is considered to be due to the intervention. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="improvementIndex")] + public int? ImprovementIndex { get; set; } + + /// + /// An intervention demonstrates effectiveness if the research has shown that the program caused an improvement in outcomes. Values: positive effects, potentially positive effects, mixed effects, potentially negative effects, negative effects, and no discernible effects. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="interventionEffectivenessRatingDescriptor")][DescriptorExists("InterventionEffectivenessRatingDescriptor")] + public string InterventionEffectivenessRatingDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -97615,7 +97153,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardGradeLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyInterventionEffectiveness")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -97639,12 +97177,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardGradeLevel)target); + return Entities.Common.EdFi.InterventionStudyInterventionEffectivenessMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardGradeLevel)target, null); + Entities.Common.EdFi.InterventionStudyInterventionEffectivenessMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness)target, null); } // ------------------------------------------------------------- @@ -97719,9 +97257,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyInterventionEffectivenessPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -97750,16 +97288,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardIdentificationCode table of the LearningStandard aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudyLearningResourceMetadataURI table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardIdentificationCode : Entities.Common.EdFi.ILearningStandardIdentificationCode, IValidatableObject + public class InterventionStudyLearningResourceMetadataURI : Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandardIdentificationCode"); + private static FullName _fullName = new FullName("edfi", "InterventionStudyLearningResourceMetadataURI"); // Fluent validator instance (threadsafe) - private static LearningStandardIdentificationCodePutPostRequestValidator _validator = new LearningStandardIdentificationCodePutPostRequestValidator(); + private static InterventionStudyLearningResourceMetadataURIPutPostRequestValidator _validator = new InterventionStudyLearningResourceMetadataURIPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -97786,42 +97324,33 @@ public class LearningStandardIdentificationCode : Entities.Common.EdFi.ILearning //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILearningStandard _learningStandard; + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; [IgnoreDataMember] - Entities.Common.EdFi.ILearningStandard ILearningStandardIdentificationCode.LearningStandard + Entities.Common.EdFi.IInterventionStudy IInterventionStudyLearningResourceMetadataURI.InterventionStudy { - get { return _learningStandard; } - set { SetLearningStandard(value); } + get { return _interventionStudy; } + set { SetInterventionStudy(value); } } - public Entities.Common.EdFi.ILearningStandard LearningStandard + public Entities.Common.EdFi.IInterventionStudy InterventionStudy { - set { SetLearningStandard(value); } + set { SetInterventionStudy(value); } } - private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) { - _learningStandard = value; + _interventionStudy = value; } /// - /// The name of the content standard, for example Common Core. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(65, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="contentStandardName")] - public string ContentStandardName { get; set; } - - /// - /// A unique number or alphanumeric code assigned to a Learning Standard. + /// The URI (typical a URL) pointing to the metadata entry in a LRMI metadata repository, which describes this content item. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="learningResourceMetadataURI")] + public string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -97836,7 +97365,7 @@ private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardIdentificationCode; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI; if (ReferenceEquals(this, compareTo)) return true; @@ -97845,17 +97374,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).ContentStandardName, compareTo.ContentStandardName)) + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).IdentificationCode, compareTo.IdentificationCode)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI).LearningResourceMetadataURI, compareTo.LearningResourceMetadataURI)) return false; @@ -97872,15 +97396,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_learningStandard != null) - hash.Add(_learningStandard); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).ContentStandardName); - + if (_interventionStudy != null) + hash.Add(_interventionStudy); // Standard Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).IdentificationCode); + hash.Add((this as Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI).LearningResourceMetadataURI); return hash.ToHashCode(); } @@ -97914,7 +97434,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardIdentificationCode")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyLearningResourceMetadataURI")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -97938,12 +97458,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardIdentificationCode)target); + return Entities.Common.EdFi.InterventionStudyLearningResourceMetadataURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardIdentificationCode)target, null); + Entities.Common.EdFi.InterventionStudyLearningResourceMetadataURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI)target, null); } // ------------------------------------------------------------- @@ -98018,9 +97538,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyLearningResourceMetadataURIPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -98048,22 +97568,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardCategoryDescriptor table of the LearningStandardCategoryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudyPopulationServed table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardCategoryDescriptor : Entities.Common.EdFi.ILearningStandardCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class InterventionStudyPopulationServed : Entities.Common.EdFi.IInterventionStudyPopulationServed, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandardCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "InterventionStudyPopulationServed"); // Fluent validator instance (threadsafe) - private static LearningStandardCategoryDescriptorPutPostRequestValidator _validator = new LearningStandardCategoryDescriptorPutPostRequestValidator(); + private static InterventionStudyPopulationServedPutPostRequestValidator _validator = new InterventionStudyPopulationServedPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -98080,13 +97595,6 @@ public class LearningStandardCategoryDescriptor : Entities.Common.EdFi.ILearning // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LearningStandardCategoryDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -98097,19 +97605,33 @@ public class LearningStandardCategoryDescriptor : Entities.Common.EdFi.ILearning //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int LearningStandardCategoryDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IInterventionStudy IInterventionStudyPopulationServed.InterventionStudy + { + get { return _interventionStudy; } + set { SetInterventionStudy(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IInterventionStudy InterventionStudy { - get { return LearningStandardCategoryDescriptorId; } - set { LearningStandardCategoryDescriptorId = value; } + set { SetInterventionStudy(value); } } + + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + { + _interventionStudy = value; + } + + /// + /// A subset of students that are the focus of the intervention study. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] + public string PopulationServedDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -98124,7 +97646,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyPopulationServed; if (ReferenceEquals(this, compareTo)) return true; @@ -98132,9 +97654,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ILearningStandardCategoryDescriptor).LearningStandardCategoryDescriptorId.Equals(compareTo.LearningStandardCategoryDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyPopulationServed).PopulationServedDescriptor, compareTo.PopulationServedDescriptor)) return false; @@ -98150,9 +97676,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_interventionStudy != null) + hash.Add(_interventionStudy); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardCategoryDescriptor).LearningStandardCategoryDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionStudyPopulationServed).PopulationServedDescriptor); return hash.ToHashCode(); } @@ -98161,55 +97690,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -98235,11 +97715,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyPopulationServed")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -98250,13 +97727,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -98269,12 +97739,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardCategoryDescriptor)target); + return Entities.Common.EdFi.InterventionStudyPopulationServedMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyPopulationServed)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardCategoryDescriptor)target, null); + Entities.Common.EdFi.InterventionStudyPopulationServedMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyPopulationServed)target, null); } // ------------------------------------------------------------- @@ -98282,6 +97752,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -98289,9 +97819,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyPopulationServedPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -98319,127 +97849,298 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LearningStandardEquivalenceAssociation resource. + /// A class which represents the edfi.InterventionStudyStateAbbreviation table of the InterventionStudy aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardEquivalenceAssociationReference : IResourceReference + public class InterventionStudyStateAbbreviation : Entities.Common.EdFi.IInterventionStudyStateAbbreviation, IValidatableObject { - [DataMember(Name="namespace")] - public string Namespace { get; set; } + private static FullName _fullName = new FullName("edfi", "InterventionStudyStateAbbreviation"); - [DataMember(Name="sourceLearningStandardId")] - public string SourceLearningStandardId { get; set; } + // Fluent validator instance (threadsafe) + private static InterventionStudyStateAbbreviationPutPostRequestValidator _validator = new InterventionStudyStateAbbreviationPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - [DataMember(Name="targetLearningStandardId")] - public string TargetLearningStandardId { get; set; } + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; + + [IgnoreDataMember] + Entities.Common.EdFi.IInterventionStudy IInterventionStudyStateAbbreviation.InterventionStudy + { + get { return _interventionStudy; } + set { SetInterventionStudy(value); } + } + + public Entities.Common.EdFi.IInterventionStudy InterventionStudy + { + set { SetInterventionStudy(value); } + } + + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) + { + _interventionStudy = value; + } /// - /// Gets or sets the resource identifier of the referenced resource. + /// The abbreviation for the state (within the United States) or outlying area, the school system of which the participants of the study are considered to be a part. /// - public Guid ResourceId { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string StateAbbreviationDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + /// Determines equality based on the natural key properties of the resource. /// - public string Discriminator { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyStateAbbreviation; + if (ReferenceEquals(this, compareTo)) + return true; - private Link _link; + if (compareTo == null) + return false; - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + // Parent Property + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) + return false; - return _link; - } + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IInterventionStudyStateAbbreviation).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) + return false; + + + return true; } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Builds the hash code based on the unique identifying values. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - return Namespace != default(string) && SourceLearningStandardId != default(string) && TargetLearningStandardId != default(string); + var hash = new HashCode(); + //Parent Property + if (_interventionStudy != null) + hash.Add(_interventionStudy); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IInterventionStudyStateAbbreviation).StateAbbreviationDescriptor); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - IEnumerable IResourceReference.GetUndefinedProperties() + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyStateAbbreviation")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - if (Namespace == default) - { - yield return "Namespace"; - } + return Entities.Common.EdFi.InterventionStudyStateAbbreviationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyStateAbbreviation)target); + } - if (SourceLearningStandardId == default) + void IMappable.Map(object target) + { + Entities.Common.EdFi.InterventionStudyStateAbbreviationMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyStateAbbreviation)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - yield return "SourceLearningStandardId"; - } + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - if (TargetLearningStandardId == default) + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally { - yield return "TargetLearningStandardId"; + // Restore original length + pathBuilder.Length = originalLength; } - + // ---------------------------------- } + } - private Link CreateLink() + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class InterventionStudyStateAbbreviationPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - var link = new Link + if (context.InstanceToValidate == null) { - Rel = "LearningStandardEquivalenceAssociation", - Href = $"/ed-fi/learningStandardEquivalenceAssociations/{ResourceId:n}" - }; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - if (string.IsNullOrEmpty(Discriminator)) - return link; + return false; + } - string[] linkParts = Discriminator.Split('.'); + var instance = context.InstanceToValidate; - if (linkParts.Length < 2) - return link; + var failures = new List(); - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.LearningStandardEquivalenceAssociation table of the LearningStandardEquivalenceAssociation aggregate in the ODS Database. + /// A class which represents the edfi.InterventionStudyURI table of the InterventionStudy aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardEquivalenceAssociation : Entities.Common.EdFi.ILearningStandardEquivalenceAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class InterventionStudyURI : Entities.Common.EdFi.IInterventionStudyURI, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LearningStandardEquivalenceAssociation"); + private static FullName _fullName = new FullName("edfi", "InterventionStudyURI"); // Fluent validator instance (threadsafe) - private static LearningStandardEquivalenceAssociationPutPostRequestValidator _validator = new LearningStandardEquivalenceAssociationPutPostRequestValidator(); + private static InterventionStudyURIPutPostRequestValidator _validator = new InterventionStudyURIPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -98456,149 +98157,43 @@ public class LearningStandardEquivalenceAssociation : Entities.Common.EdFi.ILear // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LearningStandardEquivalenceAssociation resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _sourceLearningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _sourceLearningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitSourceLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sourceLearningStandardReference == null && !_sourceLearningStandardReferenceExplicitlyAssigned) - _sourceLearningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _sourceLearningStandardReference; - } - } + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IInterventionStudy _interventionStudy; - [DataMember(Name="sourceLearningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference SourceLearningStandardReference + [IgnoreDataMember] + Entities.Common.EdFi.IInterventionStudy IInterventionStudyURI.InterventionStudy { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSourceLearningStandardReference != null - && (_sourceLearningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSourceLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitSourceLearningStandardReference; - - return null; - } - set - { - _sourceLearningStandardReferenceExplicitlyAssigned = true; - _sourceLearningStandardReference = value; - } + get { return _interventionStudy; } + set { SetInterventionStudy(value); } } - private bool _targetLearningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _targetLearningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitTargetLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_targetLearningStandardReference == null && !_targetLearningStandardReferenceExplicitlyAssigned) - _targetLearningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - return _targetLearningStandardReference; - } + public Entities.Common.EdFi.IInterventionStudy InterventionStudy + { + set { SetInterventionStudy(value); } } - [DataMember(Name="targetLearningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference TargetLearningStandardReference + private void SetInterventionStudy(Entities.Common.EdFi.IInterventionStudy value) { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitTargetLearningStandardReference != null - && (_targetLearningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitTargetLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitTargetLearningStandardReference; - - return null; - } - set - { - _targetLearningStandardReferenceExplicitlyAssigned = true; - _targetLearningStandardReference = value; - } + _interventionStudy = value; } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- /// - /// The namespace of the organization that has created and owns the association. + /// The URI (typical a URL) pointing to an education content item. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardId - { - get - { - if (ImplicitSourceLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSourceLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitSourceLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // SourceLearningStandard - _sourceLearningStandardReferenceExplicitlyAssigned = false; - ImplicitSourceLearningStandardReference.LearningStandardId = value; - } - } - - /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardId - { - get - { - if (ImplicitTargetLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitTargetLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitTargetLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // TargetLearningStandard - _targetLearningStandardReferenceExplicitlyAssigned = false; - ImplicitTargetLearningStandardReference.LearningStandardId = value; - } - } + [DataMember(Name="uri")] + public string URI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -98613,7 +98208,7 @@ string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearni /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation; + var compareTo = obj as Entities.Common.EdFi.IInterventionStudyURI; if (ReferenceEquals(this, compareTo)) return true; @@ -98621,19 +98216,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).Namespace, compareTo.Namespace)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).SourceLearningStandardId, compareTo.SourceLearningStandardId)) + // Parent Property + if (_interventionStudy == null || !_interventionStudy.Equals(compareTo.InterventionStudy)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).TargetLearningStandardId, compareTo.TargetLearningStandardId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IInterventionStudyURI).URI, compareTo.URI)) return false; @@ -98649,16 +98238,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_interventionStudy != null) + hash.Add(_interventionStudy); // Standard Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).Namespace); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).SourceLearningStandardId); + hash.Add((this as Entities.Common.EdFi.IInterventionStudyURI).URI); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).TargetLearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -98671,29 +98257,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The date that the association is considered to be applicable or effective. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveDate { get; set; } - - /// - /// Captures supplemental information on the relationship. Recommended for use only when the match is partial. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="learningStandardEquivalenceStrengthDescription")] - public string LearningStandardEquivalenceStrengthDescription { get; set; } - - /// - /// A measure that indicates the strength or quality of the equivalence relationship. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="learningStandardEquivalenceStrengthDescriptor")][DescriptorExists("LearningStandardEquivalenceStrengthDescriptor")] - public string LearningStandardEquivalenceStrengthDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -98714,7 +98277,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandardEquivalenceAssociation", "LearningStandardEquivalenceAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "InterventionStudy", "InterventionStudyURI")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -98726,13 +98289,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -98745,46 +98301,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardEquivalenceAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceAssociation)target); + return Entities.Common.EdFi.InterventionStudyURIMapper.SynchronizeTo(this, (Entities.Common.EdFi.IInterventionStudyURI)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardEquivalenceAssociationMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceAssociation)target, null); + Entities.Common.EdFi.InterventionStudyURIMapper.MapTo(this, (Entities.Common.EdFi.IInterventionStudyURI)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardResourceId - { - get { return null; } - set { ImplicitSourceLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitSourceLearningStandardReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardResourceId - { - get { return null; } - set { ImplicitTargetLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitTargetLearningStandardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -98802,6 +98330,7 @@ string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearni try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -98852,9 +98381,9 @@ string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearni // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardEquivalenceAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class InterventionStudyURIPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -98883,21 +98412,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardEquivalenceStrengthDescriptor table of the LearningStandardEquivalenceStrengthDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LanguageDescriptor table of the LanguageDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardEquivalenceStrengthDescriptor : Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LanguageDescriptor : Entities.Common.EdFi.ILanguageDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LearningStandardEquivalenceStrengthDescriptor"); + private static FullName _fullName = new FullName("edfi", "LanguageDescriptor"); // Fluent validator instance (threadsafe) - private static LearningStandardEquivalenceStrengthDescriptorPutPostRequestValidator _validator = new LearningStandardEquivalenceStrengthDescriptorPutPostRequestValidator(); + private static LanguageDescriptorPutPostRequestValidator _validator = new LanguageDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -98916,7 +98445,7 @@ public class LearningStandardEquivalenceStrengthDescriptor : Entities.Common.EdF // ------------------------------------------------------------ /// - /// The unique identifier for the LearningStandardEquivalenceStrengthDescriptor resource. + /// The unique identifier for the LanguageDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -98937,12 +98466,12 @@ public class LearningStandardEquivalenceStrengthDescriptor : Entities.Common.EdF /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int LearningStandardEquivalenceStrengthDescriptorId { get; set; } + public int LanguageDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return LearningStandardEquivalenceStrengthDescriptorId; } - set { LearningStandardEquivalenceStrengthDescriptorId = value; } + get { return LanguageDescriptorId; } + set { LanguageDescriptorId = value; } } // ------------------------------------------------------------- @@ -98958,7 +98487,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILanguageDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -98968,7 +98497,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor).LearningStandardEquivalenceStrengthDescriptorId.Equals(compareTo.LearningStandardEquivalenceStrengthDescriptorId)) + if (!(this as Entities.Common.EdFi.ILanguageDescriptor).LanguageDescriptorId.Equals(compareTo.LanguageDescriptorId)) return false; @@ -98986,7 +98515,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor).LearningStandardEquivalenceStrengthDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILanguageDescriptor).LanguageDescriptorId); return hash.ToHashCode(); } @@ -99103,12 +98632,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardEquivalenceStrengthDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor)target); + return Entities.Common.EdFi.LanguageDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILanguageDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardEquivalenceStrengthDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor)target, null); + Entities.Common.EdFi.LanguageDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILanguageDescriptor)target, null); } // ------------------------------------------------------------- @@ -99123,9 +98652,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardEquivalenceStrengthDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LanguageDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -99154,21 +98683,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LearningStandardScopeDescriptor table of the LearningStandardScopeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LanguageInstructionProgramServiceDescriptor table of the LanguageInstructionProgramServiceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LearningStandardScopeDescriptor : Entities.Common.EdFi.ILearningStandardScopeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LanguageInstructionProgramServiceDescriptor : Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LearningStandardScopeDescriptor"); + private static FullName _fullName = new FullName("edfi", "LanguageInstructionProgramServiceDescriptor"); // Fluent validator instance (threadsafe) - private static LearningStandardScopeDescriptorPutPostRequestValidator _validator = new LearningStandardScopeDescriptorPutPostRequestValidator(); + private static LanguageInstructionProgramServiceDescriptorPutPostRequestValidator _validator = new LanguageInstructionProgramServiceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -99187,7 +98716,7 @@ public class LearningStandardScopeDescriptor : Entities.Common.EdFi.ILearningSta // ------------------------------------------------------------ /// - /// The unique identifier for the LearningStandardScopeDescriptor resource. + /// The unique identifier for the LanguageInstructionProgramServiceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -99208,12 +98737,12 @@ public class LearningStandardScopeDescriptor : Entities.Common.EdFi.ILearningSta /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int LearningStandardScopeDescriptorId { get; set; } + public int LanguageInstructionProgramServiceDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return LearningStandardScopeDescriptorId; } - set { LearningStandardScopeDescriptorId = value; } + get { return LanguageInstructionProgramServiceDescriptorId; } + set { LanguageInstructionProgramServiceDescriptorId = value; } } // ------------------------------------------------------------- @@ -99229,7 +98758,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILearningStandardScopeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -99239,7 +98768,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ILearningStandardScopeDescriptor).LearningStandardScopeDescriptorId.Equals(compareTo.LearningStandardScopeDescriptorId)) + if (!(this as Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor).LanguageInstructionProgramServiceDescriptorId.Equals(compareTo.LanguageInstructionProgramServiceDescriptorId)) return false; @@ -99257,7 +98786,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ILearningStandardScopeDescriptor).LearningStandardScopeDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor).LanguageInstructionProgramServiceDescriptorId); return hash.ToHashCode(); } @@ -99374,12 +98903,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LearningStandardScopeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardScopeDescriptor)target); + return Entities.Common.EdFi.LanguageInstructionProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LearningStandardScopeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardScopeDescriptor)target, null); + Entities.Common.EdFi.LanguageInstructionProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor)target, null); } // ------------------------------------------------------------- @@ -99394,9 +98923,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LearningStandardScopeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LanguageInstructionProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -99425,21 +98954,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LevelOfEducationDescriptor table of the LevelOfEducationDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LanguageUseDescriptor table of the LanguageUseDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LevelOfEducationDescriptor : Entities.Common.EdFi.ILevelOfEducationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LanguageUseDescriptor : Entities.Common.EdFi.ILanguageUseDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LevelOfEducationDescriptor"); + private static FullName _fullName = new FullName("edfi", "LanguageUseDescriptor"); // Fluent validator instance (threadsafe) - private static LevelOfEducationDescriptorPutPostRequestValidator _validator = new LevelOfEducationDescriptorPutPostRequestValidator(); + private static LanguageUseDescriptorPutPostRequestValidator _validator = new LanguageUseDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -99458,7 +98987,7 @@ public class LevelOfEducationDescriptor : Entities.Common.EdFi.ILevelOfEducation // ------------------------------------------------------------ /// - /// The unique identifier for the LevelOfEducationDescriptor resource. + /// The unique identifier for the LanguageUseDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -99479,12 +99008,12 @@ public class LevelOfEducationDescriptor : Entities.Common.EdFi.ILevelOfEducation /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int LevelOfEducationDescriptorId { get; set; } + public int LanguageUseDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return LevelOfEducationDescriptorId; } - set { LevelOfEducationDescriptorId = value; } + get { return LanguageUseDescriptorId; } + set { LanguageUseDescriptorId = value; } } // ------------------------------------------------------------- @@ -99500,7 +99029,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILevelOfEducationDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILanguageUseDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -99510,7 +99039,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ILevelOfEducationDescriptor).LevelOfEducationDescriptorId.Equals(compareTo.LevelOfEducationDescriptorId)) + if (!(this as Entities.Common.EdFi.ILanguageUseDescriptor).LanguageUseDescriptorId.Equals(compareTo.LanguageUseDescriptorId)) return false; @@ -99528,7 +99057,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ILevelOfEducationDescriptor).LevelOfEducationDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILanguageUseDescriptor).LanguageUseDescriptorId); return hash.ToHashCode(); } @@ -99645,12 +99174,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LevelOfEducationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILevelOfEducationDescriptor)target); + return Entities.Common.EdFi.LanguageUseDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILanguageUseDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LevelOfEducationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILevelOfEducationDescriptor)target, null); + Entities.Common.EdFi.LanguageUseDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILanguageUseDescriptor)target, null); } // ------------------------------------------------------------- @@ -99665,9 +99194,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LevelOfEducationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LanguageUseDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -99696,21 +99225,110 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LicenseStatusDescriptor table of the LicenseStatusDescriptor aggregate in the ODS Database. + /// Represents a reference to the LearningStandard resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class LearningStandardReference : IResourceReference + { + [DataMember(Name="learningStandardId")] + public string LearningStandardId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return LearningStandardId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (LearningStandardId == default) + { + yield return "LearningStandardId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "LearningStandard", + Href = $"/ed-fi/learningStandards/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.LearningStandard table of the LearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LicenseStatusDescriptor : Entities.Common.EdFi.ILicenseStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LearningStandard : Entities.Common.EdFi.ILearningStandard, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LicenseStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "LearningStandard"); // Fluent validator instance (threadsafe) - private static LicenseStatusDescriptorPutPostRequestValidator _validator = new LicenseStatusDescriptorPutPostRequestValidator(); + private static LearningStandardPutPostRequestValidator _validator = new LearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -99721,6 +99339,12 @@ public class LicenseStatusDescriptor : Entities.Common.EdFi.ILicenseStatusDescri // Constructor // ------------------------------------------------------------- + public LearningStandard() + { + LearningStandardAcademicSubjects = new List(); + LearningStandardGradeLevels = new List(); + LearningStandardIdentificationCodes = new List(); + } // ------------------------------------------------------------ @@ -99729,7 +99353,7 @@ public class LicenseStatusDescriptor : Entities.Common.EdFi.ILicenseStatusDescri // ------------------------------------------------------------ /// - /// The unique identifier for the LicenseStatusDescriptor resource. + /// The unique identifier for the LearningStandard resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -99739,6 +99363,40 @@ public class LicenseStatusDescriptor : Entities.Common.EdFi.ILicenseStatusDescri // ============================================================= // References // ------------------------------------------------------------- + + private bool _parentLearningStandardReferenceExplicitlyAssigned; + private LearningStandardReference _parentLearningStandardReference; + private LearningStandardReference ImplicitParentLearningStandardReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_parentLearningStandardReference == null && !_parentLearningStandardReferenceExplicitlyAssigned) + _parentLearningStandardReference = new LearningStandardReference(); + + return _parentLearningStandardReference; + } + } + + [DataMember(Name="parentLearningStandardReference")] + [FullyDefinedReference] + public LearningStandardReference ParentLearningStandardReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitParentLearningStandardReference != null + && (_parentLearningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitParentLearningStandardReference; + + return null; + } + set + { + _parentLearningStandardReferenceExplicitlyAssigned = true; + _parentLearningStandardReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -99746,17 +99404,13 @@ public class LicenseStatusDescriptor : Entities.Common.EdFi.ILicenseStatusDescri // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int LicenseStatusDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return LicenseStatusDescriptorId; } - set { LicenseStatusDescriptorId = value; } - } + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="learningStandardId")] + public string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -99771,7 +99425,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILicenseStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -99780,8 +99434,8 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ILicenseStatusDescriptor).LicenseStatusDescriptorId.Equals(compareTo.LicenseStatusDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandard).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -99798,8 +99452,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ILicenseStatusDescriptor).LicenseStatusDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILearningStandard).LearningStandardId); return hash.ToHashCode(); } @@ -99808,65 +99462,122 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The official course title with which this learning standard is associated. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="courseTitle")] + public string CourseTitle { get; set; } /// - /// The description of the descriptor. + /// The text of the statement. The textual content that either describes a specific competency such as \"Apply the Pythagorean Theorem to determine unknown side lengths in right triangles in real-world and mathematical problems in two and three dimensions.\" or describes a less granular group of competencies within the taxonomy of the standards document, e.g. \"Understand and apply the Pythagorean Theorem,\" or \"Geometry\". /// // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] [DataMember(Name="description")] public string Description { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// An additional classification of the type of a specific learning standard. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="learningStandardCategoryDescriptor")][DescriptorExists("LearningStandardCategoryDescriptor")] + public string LearningStandardCategoryDescriptor { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// A code designated by the promulgating body to identify the statement, e.g. 1.N.3 (usually not globally unique). /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="learningStandardItemCode")] + public string LearningStandardItemCode { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// Signals the scope of usage the standard. Does not necessarily relate the standard to the governing body. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="learningStandardScopeDescriptor")][DescriptorExists("LearningStandardScopeDescriptor")] + public string LearningStandardScopeDescriptor { get; set; } + + /// + /// The namespace of the organization or entity who governs the standard. It is recommended the namespaces observe a URI format and begin with a domain name under the governing organization or entity control. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] [DataMember(Name="namespace")] public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardId + { + get + { + if (ImplicitParentLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitParentLearningStandardReference.IsReferenceFullyDefined())) + { + return ImplicitParentLearningStandardReference.LearningStandardId; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ParentLearningStandard + _parentLearningStandardReferenceExplicitlyAssigned = false; + ImplicitParentLearningStandardReference.LearningStandardId = value; + } + } + + /// + /// One or more statements that describes the criteria used by teachers and students to check for attainment of a learning standard. This criteria gives clear indications as to the degree to which learning is moving through the Zone or Proximal Development toward independent achievement of the learning standard. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="successCriteria")] + public string SuccessCriteria { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// An unambiguous reference to the statement using a network-resolvable URI. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="uri")] + public string URI { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + /// + /// contentStandard + /// + [Required(ErrorMessage=ValidationHelpers.RequiredObjectMessageFormat)] + [DataMember(Name = "contentStandard")] + public LearningStandardContentStandard LearningStandardContentStandard { get; set; } + + Entities.Common.EdFi.ILearningStandardContentStandard Entities.Common.EdFi.ILearningStandard.LearningStandardContentStandard + { + get { return LearningStandardContentStandard; } + set { LearningStandardContentStandard = (LearningStandardContentStandard) value; } + } + // ------------------------------------------------------------- // ============================================================= @@ -99882,16 +99593,103 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandard")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _learningStandardAcademicSubjects; + private ICollection _learningStandardAcademicSubjectsCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="academicSubjects")] + public ICollection LearningStandardAcademicSubjects + { + get { return _learningStandardAcademicSubjects; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ILearningStandardAcademicSubject)e.Item).LearningStandard = this); + _learningStandardAcademicSubjects = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardAcademicSubject)e.Item).LearningStandard = this; + _learningStandardAcademicSubjectsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardAcademicSubjects + { + get { return _learningStandardAcademicSubjectsCovariant; } + set { LearningStandardAcademicSubjects = new List(value.Cast()); } + } + + private ICollection _learningStandardGradeLevels; + private ICollection _learningStandardGradeLevelsCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="gradeLevels")] + public ICollection LearningStandardGradeLevels + { + get { return _learningStandardGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ILearningStandardGradeLevel)e.Item).LearningStandard = this); + _learningStandardGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardGradeLevel)e.Item).LearningStandard = this; + _learningStandardGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardGradeLevels + { + get { return _learningStandardGradeLevelsCovariant; } + set { LearningStandardGradeLevels = new List(value.Cast()); } + } + + private ICollection _learningStandardIdentificationCodes; + private ICollection _learningStandardIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection LearningStandardIdentificationCodes + { + get { return _learningStandardIdentificationCodes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ILearningStandardIdentificationCode)e.Item).LearningStandard = this); + _learningStandardIdentificationCodes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardIdentificationCode)e.Item).LearningStandard = this; + _learningStandardIdentificationCodesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandard.LearningStandardIdentificationCodes + { + get { return _learningStandardIdentificationCodesCovariant; } + set { LearningStandardIdentificationCodes = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -99909,6 +99707,27 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_learningStandardAcademicSubjects != null) foreach (var item in _learningStandardAcademicSubjects) + { + item.LearningStandard = this; + } + + if (_learningStandardGradeLevels != null) foreach (var item in _learningStandardGradeLevels) + { + item.LearningStandard = this; + } + + if (_learningStandardIdentificationCodes != null) foreach (var item in _learningStandardIdentificationCodes) + { + item.LearningStandard = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -99916,19 +99735,140 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LicenseStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILicenseStatusDescriptor)target); + return Entities.Common.EdFi.LearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LicenseStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILicenseStatusDescriptor)target, null); + Entities.Common.EdFi.LearningStandardMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ILearningStandard.ParentLearningStandardResourceId + { + get { return null; } + set { ImplicitParentLearningStandardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitParentLearningStandardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (LearningStandardAcademicSubjects.Any() && mappingContract?.IsMemberSupported("LearningStandardAcademicSubjects") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LearningStandardAcademicSubjects"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardAcademicSubjects, validationContext, validationContext.Items.ForCollection("LearningStandardAcademicSubjects")))) + { + yield return result; + } + } + + if (LearningStandardGradeLevels.Any() && mappingContract?.IsMemberSupported("LearningStandardGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LearningStandardGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardGradeLevels, validationContext, validationContext.Items.ForCollection("LearningStandardGradeLevels")))) + { + yield return result; + } + } + + if (LearningStandardIdentificationCodes.Any() && mappingContract?.IsMemberSupported("LearningStandardIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LearningStandardIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardIdentificationCodes, validationContext, validationContext.Items.ForCollection("LearningStandardIdentificationCodes")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + if (LearningStandardContentStandard != null && mappingContract?.IsMemberSupported("LearningStandardContentStandard") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LearningStandardContentStandard"); + + foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(LearningStandardContentStandard, validationContext, validationContext.Items.ForEmbeddedObject("LearningStandardContentStandard")))) + { + yield return result; + } + } + + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -99936,9 +99876,16 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LicenseStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_LearningStandard = new FullName("edfi", "LearningStandard"); + + // Declare collection item validators + private LearningStandardAcademicSubjectPutPostRequestValidator _learningStandardAcademicSubjectsValidator = new (); + private LearningStandardGradeLevelPutPostRequestValidator _learningStandardGradeLevelsValidator = new (); + private LearningStandardIdentificationCodePutPostRequestValidator _learningStandardIdentificationCodesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -99951,6 +99898,50 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (LearningStandardMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_LearningStandard); + + if (mappingContract != null) + { + if (mappingContract.IsLearningStandardAcademicSubjectIncluded != null) + { + var hasInvalidLearningStandardAcademicSubjectsItems = instance.LearningStandardAcademicSubjects.Any(x => !mappingContract.IsLearningStandardAcademicSubjectIncluded(x)); + + if (hasInvalidLearningStandardAcademicSubjectsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("LearningStandardAcademicSubjects", $"A supplied 'LearningStandardAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsLearningStandardGradeLevelIncluded != null) + { + var hasInvalidLearningStandardGradeLevelsItems = instance.LearningStandardGradeLevels.Any(x => !mappingContract.IsLearningStandardGradeLevelIncluded(x)); + + if (hasInvalidLearningStandardGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("LearningStandardGradeLevels", $"A supplied 'LearningStandardGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsLearningStandardIdentificationCodeIncluded != null) + { + var hasInvalidLearningStandardIdentificationCodesItems = instance.LearningStandardIdentificationCodes.Any(x => !mappingContract.IsLearningStandardIdentificationCodeIncluded(x)); + + if (hasInvalidLearningStandardIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("LearningStandardIdentificationCodes", $"A supplied 'LearningStandardIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -99966,22 +99957,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LicenseTypeDescriptor table of the LicenseTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardAcademicSubject table of the LearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LicenseTypeDescriptor : Entities.Common.EdFi.ILicenseTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LearningStandardAcademicSubject : Entities.Common.EdFi.ILearningStandardAcademicSubject, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LicenseTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "LearningStandardAcademicSubject"); // Fluent validator instance (threadsafe) - private static LicenseTypeDescriptorPutPostRequestValidator _validator = new LicenseTypeDescriptorPutPostRequestValidator(); + private static LearningStandardAcademicSubjectPutPostRequestValidator _validator = new LearningStandardAcademicSubjectPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -99998,13 +99984,6 @@ public class LicenseTypeDescriptor : Entities.Common.EdFi.ILicenseTypeDescriptor // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LicenseTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -100015,19 +99994,33 @@ public class LicenseTypeDescriptor : Entities.Common.EdFi.ILicenseTypeDescriptor //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ILearningStandard _learningStandard; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int LicenseTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ILearningStandard ILearningStandardAcademicSubject.LearningStandard + { + get { return _learningStandard; } + set { SetLearningStandard(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ILearningStandard LearningStandard { - get { return LicenseTypeDescriptorId; } - set { LicenseTypeDescriptorId = value; } + set { SetLearningStandard(value); } } + + private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) + { + _learningStandard = value; + } + + /// + /// Subject area for the learning standard. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -100042,7 +100035,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILicenseTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardAcademicSubject; if (ReferenceEquals(this, compareTo)) return true; @@ -100050,9 +100043,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ILicenseTypeDescriptor).LicenseTypeDescriptorId.Equals(compareTo.LicenseTypeDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ILearningStandardAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) return false; @@ -100068,9 +100065,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_learningStandard != null) + hash.Add(_learningStandard); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ILicenseTypeDescriptor).LicenseTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILearningStandardAcademicSubject).AcademicSubjectDescriptor); return hash.ToHashCode(); } @@ -100079,55 +100079,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -100153,11 +100104,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardAcademicSubject")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -100168,13 +100116,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -100187,12 +100128,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LicenseTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILicenseTypeDescriptor)target); + return Entities.Common.EdFi.LearningStandardAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardAcademicSubject)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LicenseTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILicenseTypeDescriptor)target, null); + Entities.Common.EdFi.LearningStandardAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardAcademicSubject)target, null); } // ------------------------------------------------------------- @@ -100200,6 +100141,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -100207,9 +100208,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LicenseTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -100237,22 +100238,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LimitedEnglishProficiencyDescriptor table of the LimitedEnglishProficiencyDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardContentStandard table of the LearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LimitedEnglishProficiencyDescriptor : Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LearningStandardContentStandard : Entities.Common.EdFi.ILearningStandardContentStandard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LimitedEnglishProficiencyDescriptor"); + private static FullName _fullName = new FullName("edfi", "LearningStandardContentStandard"); // Fluent validator instance (threadsafe) - private static LimitedEnglishProficiencyDescriptorPutPostRequestValidator _validator = new LimitedEnglishProficiencyDescriptorPutPostRequestValidator(); + private static LearningStandardContentStandardPutPostRequestValidator _validator = new LearningStandardContentStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -100263,41 +100259,77 @@ public class LimitedEnglishProficiencyDescriptor : Entities.Common.EdFi.ILimited // Constructor // ------------------------------------------------------------- + public LearningStandardContentStandard() + { + LearningStandardContentStandardAuthors = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LimitedEnglishProficiencyDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _mandatingEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _mandatingEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitMandatingEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_mandatingEducationOrganizationReference == null && !_mandatingEducationOrganizationReferenceExplicitlyAssigned) + _mandatingEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _mandatingEducationOrganizationReference; + } + } + + [DataMember(Name="mandatingEducationOrganizationReference")] + [FullyDefinedReference] + public EducationOrganization.EdFi.EducationOrganizationReference MandatingEducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitMandatingEducationOrganizationReference != null + && (_mandatingEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitMandatingEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitMandatingEducationOrganizationReference; + + return null; + } + set + { + _mandatingEducationOrganizationReferenceExplicitlyAssigned = true; + _mandatingEducationOrganizationReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ILearningStandard _learningStandard; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int LimitedEnglishProficiencyDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ILearningStandard ILearningStandardContentStandard.LearningStandard + { + get { return _learningStandard; } + set { SetLearningStandard(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ILearningStandard LearningStandard { - get { return LimitedEnglishProficiencyDescriptorId; } - set { LimitedEnglishProficiencyDescriptorId = value; } + set { SetLearningStandard(value); } + } + + private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) + { + _learningStandard = value; } // ------------------------------------------------------------- @@ -100313,7 +100345,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardContentStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -100321,9 +100353,8 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Derived Property - if (!(this as Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor).LimitedEnglishProficiencyDescriptorId.Equals(compareTo.LimitedEnglishProficiencyDescriptorId)) + // Parent Property + if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) return false; @@ -100339,10 +100370,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor).LimitedEnglishProficiencyDescriptorId); - + //Parent Property + if (_learningStandard != null) + hash.Add(_learningStandard); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -100350,60 +100380,99 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The beginning of the period during which this learning standard document is intended for use. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BeginDate { get; set; } /// - /// The description of the descriptor. + /// The end of the period during which this learning standard document is intended for use. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationId + { + get + { + if (ImplicitMandatingEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitMandatingEducationOrganizationReference.IsReferenceFullyDefined())) + { + return ImplicitMandatingEducationOrganizationReference.EducationOrganizationId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // MandatingEducationOrganization + _mandatingEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitMandatingEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); + } + } /// - /// The end date of the period when the descriptor is in effect. + /// The date on which this content was first published. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [DataMember(Name="publicationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? PublicationDate { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The publication status of the document (i.e., Adopted, Draft, Published, Deprecated, Unknown). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="publicationStatusDescriptor")][DescriptorExists("PublicationStatusDescriptor")] + public string PublicationStatusDescriptor { get; set; } + + /// + /// The year at which this content was first published. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="publicationYear")] + public short? PublicationYear { get; set; } /// - /// A shortened description for the descriptor. + /// The name of the content standard, for example Common Core. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [DataMember(Name="title")] + public string Title { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// An unambiguous reference to the standards using a network-resolvable URI. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="uri")] + public string URI { get; set; } + + /// + /// The version identifier for the content. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="version")] + public string Version { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -100424,33 +100493,64 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardContentStandard")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _learningStandardContentStandardAuthors; + private ICollection _learningStandardContentStandardAuthorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="authors")] + public ICollection LearningStandardContentStandardAuthors + { + get { return _learningStandardContentStandardAuthors; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ILearningStandardContentStandardAuthor)e.Item).LearningStandardContentStandard = this); + _learningStandardContentStandardAuthors = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILearningStandardContentStandardAuthor)e.Item).LearningStandardContentStandard = this; + _learningStandardContentStandardAuthorsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILearningStandardContentStandard.LearningStandardContentStandardAuthors + { + get { return _learningStandardContentStandardAuthorsCovariant; } + set { LearningStandardContentStandardAuthors = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_learningStandardContentStandardAuthors != null) foreach (var item in _learningStandardContentStandardAuthors) + { + item.LearningStandardContentStandard = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -100458,178 +100558,180 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LimitedEnglishProficiencyDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor)target); + return Entities.Common.EdFi.LearningStandardContentStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardContentStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LimitedEnglishProficiencyDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor)target, null); + Entities.Common.EdFi.LearningStandardContentStandardMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardContentStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } + Guid? Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationResourceId + { + get { return null; } + set { ImplicitMandatingEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } - // ================================================================= - // Validators - // ----------------------------------------------------------------- + string Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitMandatingEducationOrganizationReference.Discriminator = value; } + } - [ExcludeFromCodeCoverage] - public class LimitedEnglishProficiencyDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - if (context.InstanceToValidate == null) + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - return false; - } + // ---------------------- + // Validate collections + // ---------------------- + if (LearningStandardContentStandardAuthors.Any() && mappingContract?.IsMemberSupported("LearningStandardContentStandardAuthors") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LearningStandardContentStandardAuthors"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LearningStandardContentStandardAuthors, validationContext, validationContext.Items.ForCollection("LearningStandardContentStandardAuthors")))) + { + yield return result; + } + } - var instance = context.InstanceToValidate; - var failures = new List(); + // --------------------------- + // Validate embedded objects + // --------------------------- - if (failures.Any()) - { - foreach (var failure in failures) + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) { - result.Errors.Add(failure); + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); - return false; + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } } - - return true; + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- } } - // ----------------------------------------------------------------- -} -// Aggregate: LocalAccount + // ================================================================= + // Validators + // ----------------------------------------------------------------- -namespace EdFi.Ods.Api.Common.Models.Resources.LocalAccount.EdFi -{ - /// - /// Represents a reference to the LocalAccount resource. - /// - [DataContract] [ExcludeFromCodeCoverage] - public class LocalAccountReference : IResourceReference + public class LearningStandardContentStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } + private static readonly FullName _fullName_edfi_LearningStandardContentStandard = new FullName("edfi", "LearningStandardContentStandard"); - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + // Declare collection item validators + private LearningStandardContentStandardAuthorPutPostRequestValidator _learningStandardContentStandardAuthorsValidator = new (); - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } + return false; + } - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } + var instance = context.InstanceToValidate; + var failures = new List(); - private Link _link; + // Profile-based collection item filter validation + string profileName = null; - [DataMember(Name="link")] - public Link Link - { - get + // Get the current mapping contract + var mappingContract = (LearningStandardContentStandardMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_LearningStandardContentStandard); + + if (mappingContract != null) { - if (_link == null) + if (mappingContract.IsLearningStandardContentStandardAuthorIncluded != null) { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); + var hasInvalidLearningStandardContentStandardAuthorsItems = instance.LearningStandardContentStandardAuthors.Any(x => !mappingContract.IsLearningStandardContentStandardAuthorIncluded(x)); + + if (hasInvalidLearningStandardContentStandardAuthorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("LearningStandardContentStandardAuthors", $"A supplied 'LearningStandardContentStandardAuthor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } } - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return AccountIdentifier != default(string) && EducationOrganizationId != default(long) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (AccountIdentifier == default) - { - yield return "AccountIdentifier"; } - if (EducationOrganizationId == default) + if (failures.Any()) { - yield return "EducationOrganizationId"; - } + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - if (FiscalYear == default) - { - yield return "FiscalYear"; + return false; } + return true; } - - private Link CreateLink() - { - var link = new Link - { - Rel = "LocalAccount", - Href = $"/ed-fi/localAccounts/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.LocalAccount table of the LocalAccount aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardContentStandardAuthor table of the LearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class LocalAccount : Entities.Common.EdFi.ILocalAccount, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class LearningStandardContentStandardAuthor : Entities.Common.EdFi.ILearningStandardContentStandardAuthor, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LocalAccount"); + private static FullName _fullName = new FullName("edfi", "LearningStandardContentStandardAuthor"); // Fluent validator instance (threadsafe) - private static LocalAccountPutPostRequestValidator _validator = new LocalAccountPutPostRequestValidator(); + private static LearningStandardContentStandardAuthorPutPostRequestValidator _validator = new LearningStandardContentStandardAuthorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -100640,163 +100742,49 @@ public class LocalAccount : Entities.Common.EdFi.ILocalAccount, IHasETag, IDateV // Constructor // ------------------------------------------------------------- - public LocalAccount() - { - LocalAccountReportingTags = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LocalAccount resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _chartOfAccountReferenceExplicitlyAssigned; - private ChartOfAccount.EdFi.ChartOfAccountReference _chartOfAccountReference; - private ChartOfAccount.EdFi.ChartOfAccountReference ImplicitChartOfAccountReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_chartOfAccountReference == null && !_chartOfAccountReferenceExplicitlyAssigned) - _chartOfAccountReference = new ChartOfAccount.EdFi.ChartOfAccountReference(); - - return _chartOfAccountReference; - } - } + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ILearningStandardContentStandard _learningStandardContentStandard; - [DataMember(Name="chartOfAccountReference")] - [FullyDefinedReference][RequiredReference("edfi", "LocalAccount")] - public ChartOfAccount.EdFi.ChartOfAccountReference ChartOfAccountReference + [IgnoreDataMember] + Entities.Common.EdFi.ILearningStandardContentStandard ILearningStandardContentStandardAuthor.LearningStandardContentStandard { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitChartOfAccountReference != null - && (_chartOfAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitChartOfAccountReference.IsReferenceFullyDefined())) - return ImplicitChartOfAccountReference; - - return null; - } - set - { - _chartOfAccountReferenceExplicitlyAssigned = true; - _chartOfAccountReference = value; - } + get { return _learningStandardContentStandard; } + set { SetLearningStandardContentStandard(value); } } - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _educationOrganizationReference; - } + public Entities.Common.EdFi.ILearningStandardContentStandard LearningStandardContentStandard + { + set { SetLearningStandardContentStandard(value); } } - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + private void SetLearningStandardContentStandard(Entities.Common.EdFi.ILearningStandardContentStandard value) { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } + _learningStandardContentStandard = value; } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- /// - /// Code value for the valid combination of account dimensions by LEA under which financials are reported. + /// The person or organization chiefly responsible for the intellectual content of the standard. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocalAccount.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } - - private int _fiscalYear; - private bool _fiscalYearExplicitlyAssigned = false; - - /// - /// The fiscal year for the account. - /// - // IS in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get - { - return _fiscalYear; - } - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; - - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ChartOfAccount - _chartOfAccountReferenceExplicitlyAssigned = false; - ImplicitChartOfAccountReference.FiscalYear = value; - } - } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="author")] + public string Author { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -100811,7 +100799,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalAccount; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardContentStandardAuthor; if (ReferenceEquals(this, compareTo)) return true; @@ -100819,19 +100807,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalAccount).AccountIdentifier, compareTo.AccountIdentifier)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalAccount).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + // Parent Property + if (_learningStandardContentStandard == null || !_learningStandardContentStandard.Equals(compareTo.LearningStandardContentStandard)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalAccount).FiscalYear.Equals(compareTo.FiscalYear)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardContentStandardAuthor).Author, compareTo.Author)) return false; @@ -100847,16 +100829,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_learningStandardContentStandard != null) + hash.Add(_learningStandardContentStandard); // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalAccount).AccountIdentifier); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalAccount).EducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.ILearningStandardContentStandardAuthor).Author); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalAccount).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -100869,78 +100848,8 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// A descriptive name for the account. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="accountName")] - public string AccountName { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocalAccount.ChartOfAccountEducationOrganizationId - { - get - { - if (ImplicitChartOfAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitChartOfAccountReference.IsReferenceFullyDefined())) - { - return ImplicitChartOfAccountReference.EducationOrganizationId; - } - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ChartOfAccount - _chartOfAccountReferenceExplicitlyAssigned = false; - ImplicitChartOfAccountReference.EducationOrganizationId = value; - } - } - - /// - /// SEA populated code value for the valid combination of account dimensions under which financials are reported. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalAccount.ChartOfAccountIdentifier - { - get - { - if (ImplicitChartOfAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitChartOfAccountReference.IsReferenceFullyDefined())) - { - return ImplicitChartOfAccountReference.AccountIdentifier; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ChartOfAccount - _chartOfAccountReferenceExplicitlyAssigned = false; - ImplicitChartOfAccountReference.AccountIdentifier = value; - } - } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -100959,71 +100868,23 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalAccount", "LocalAccount")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardContentStandardAuthor")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _localAccountReportingTags; - private ICollection _localAccountReportingTagsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection LocalAccountReportingTags - { - get { return _localAccountReportingTags; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ILocalAccountReportingTag)e.Item).LocalAccount = this); - _localAccountReportingTags = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILocalAccountReportingTag)e.Item).LocalAccount = this; - _localAccountReportingTagsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILocalAccount.LocalAccountReportingTags - { - get { return _localAccountReportingTagsCovariant; } - set { LocalAccountReportingTags = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_localAccountReportingTags != null) foreach (var item in _localAccountReportingTags) - { - item.LocalAccount = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -101031,46 +100892,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalAccountMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalAccount)target); + return Entities.Common.EdFi.LearningStandardContentStandardAuthorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardContentStandardAuthor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalAccountMapper.MapTo(this, (Entities.Common.EdFi.ILocalAccount)target, null); + Entities.Common.EdFi.LearningStandardContentStandardAuthorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardContentStandardAuthor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalAccount.ChartOfAccountResourceId - { - get { return null; } - set { ImplicitChartOfAccountReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILocalAccount.ChartOfAccountDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitChartOfAccountReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ILocalAccount.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -101088,23 +100921,12 @@ string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (LocalAccountReportingTags.Any() && mappingContract?.IsMemberSupported("LocalAccountReportingTags") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("LocalAccountReportingTags"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LocalAccountReportingTags, validationContext, validationContext.Items.ForCollection("LocalAccountReportingTags")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -101124,40 +100946,6 @@ string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForFiscalYear = GetFiscalYearSources().ToArray(); - - if (!sourcesForFiscalYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForFiscalYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForFiscalYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'fiscalYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForFiscalYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, int value)> GetFiscalYearSources() - { - // Obtain value from the locally defined property - yield return ("FiscalYear", this.FiscalYear); - - // Obtain value from other references - var valueFromChartOfAccountReference = this.ChartOfAccountReference?.FiscalYear; - - if (valueFromChartOfAccountReference != null) - { - yield return ("chartOfAccountReference.fiscalYear", this.ChartOfAccountReference.FiscalYear); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -101184,14 +100972,9 @@ string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalAccountPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardContentStandardAuthorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_LocalAccount = new FullName("edfi", "LocalAccount"); - - // Declare collection item validators - private LocalAccountReportingTagPutPostRequestValidator _localAccountReportingTagsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -101204,28 +100987,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (LocalAccountMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_LocalAccount); - - if (mappingContract != null) - { - if (mappingContract.IsLocalAccountReportingTagIncluded != null) - { - var hasInvalidLocalAccountReportingTagsItems = instance.LocalAccountReportingTags.Any(x => !mappingContract.IsLocalAccountReportingTagIncluded(x)); - - if (hasInvalidLocalAccountReportingTagsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("LocalAccountReportingTags", $"A supplied 'LocalAccountReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -101242,16 +101003,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LocalAccountReportingTag table of the LocalAccount aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardGradeLevel table of the LearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LocalAccountReportingTag : Entities.Common.EdFi.ILocalAccountReportingTag, IValidatableObject + public class LearningStandardGradeLevel : Entities.Common.EdFi.ILearningStandardGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LocalAccountReportingTag"); + private static FullName _fullName = new FullName("edfi", "LearningStandardGradeLevel"); // Fluent validator instance (threadsafe) - private static LocalAccountReportingTagPutPostRequestValidator _validator = new LocalAccountReportingTagPutPostRequestValidator(); + private static LearningStandardGradeLevelPutPostRequestValidator _validator = new LearningStandardGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -101278,33 +101039,33 @@ public class LocalAccountReportingTag : Entities.Common.EdFi.ILocalAccountReport //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILocalAccount _localAccount; + private Entities.Common.EdFi.ILearningStandard _learningStandard; [IgnoreDataMember] - Entities.Common.EdFi.ILocalAccount ILocalAccountReportingTag.LocalAccount + Entities.Common.EdFi.ILearningStandard ILearningStandardGradeLevel.LearningStandard { - get { return _localAccount; } - set { SetLocalAccount(value); } + get { return _learningStandard; } + set { SetLearningStandard(value); } } - public Entities.Common.EdFi.ILocalAccount LocalAccount + public Entities.Common.EdFi.ILearningStandard LearningStandard { - set { SetLocalAccount(value); } + set { SetLearningStandard(value); } } - private void SetLocalAccount(Entities.Common.EdFi.ILocalAccount value) + private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) { - _localAccount = value; + _learningStandard = value; } /// - /// A descriptor used at the dimension and/or chart of account levels to demote specific state needs for reporting. + /// The grade levels for the specific learning standard. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -101319,7 +101080,7 @@ private void SetLocalAccount(Entities.Common.EdFi.ILocalAccount value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalAccountReportingTag; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -101328,12 +101089,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_localAccount == null || !_localAccount.Equals(compareTo.LocalAccount)) + if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ILocalAccountReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ILearningStandardGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -101350,11 +101111,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_localAccount != null) - hash.Add(_localAccount); + if (_learningStandard != null) + hash.Add(_learningStandard); // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalAccountReportingTag).ReportingTagDescriptor); + hash.Add((this as Entities.Common.EdFi.ILearningStandardGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -101368,14 +101129,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The value associated with the reporting tag. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="tagValue")] - public string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -101396,7 +101149,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalAccount", "LocalAccountReportingTag")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardGradeLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -101420,12 +101173,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalAccountReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalAccountReportingTag)target); + return Entities.Common.EdFi.LearningStandardGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalAccountReportingTagMapper.MapTo(this, (Entities.Common.EdFi.ILocalAccountReportingTag)target, null); + Entities.Common.EdFi.LearningStandardGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardGradeLevel)target, null); } // ------------------------------------------------------------- @@ -101500,9 +101253,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalAccountReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -101530,136 +101283,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LocalActual resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class LocalActualReference : IResourceReference - { - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } - - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (AccountIdentifier == default) - { - yield return "AccountIdentifier"; - } - - if (AsOfDate == default) - { - yield return "AsOfDate"; - } - - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (FiscalYear == default) - { - yield return "FiscalYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "LocalActual", - Href = $"/ed-fi/localActuals/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.LocalActual table of the LocalActual aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardIdentificationCode table of the LearningStandard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class LocalActual : Entities.Common.EdFi.ILocalActual, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class LearningStandardIdentificationCode : Entities.Common.EdFi.ILearningStandardIdentificationCode, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LocalActual"); + private static FullName _fullName = new FullName("edfi", "LearningStandardIdentificationCode"); // Fluent validator instance (threadsafe) - private static LocalActualPutPostRequestValidator _validator = new LocalActualPutPostRequestValidator(); + private static LearningStandardIdentificationCodePutPostRequestValidator _validator = new LearningStandardIdentificationCodePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -101676,140 +101310,52 @@ public class LocalActual : Entities.Common.EdFi.ILocalActual, IHasETag, IDateVer // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the LocalActual resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _localAccountReferenceExplicitlyAssigned; - private LocalAccount.EdFi.LocalAccountReference _localAccountReference; - private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) - _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); - - return _localAccountReference; - } - } - - [DataMember(Name="localAccountReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LocalAccount.EdFi.LocalAccountReference LocalAccountReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocalAccountReference != null - && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference; - - return null; - } - set - { - _localAccountReferenceExplicitlyAssigned = true; - _localAccountReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ILearningStandard _learningStandard; - /// - /// Code value for the valid combination of account dimensions by LEA under which financials are reported. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalActual.AccountIdentifier + [IgnoreDataMember] + Entities.Common.EdFi.ILearningStandard ILearningStandardIdentificationCode.LearningStandard { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.AccountIdentifier; + get { return _learningStandard; } + set { SetLearningStandard(value); } + } - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + public Entities.Common.EdFi.ILearningStandard LearningStandard + { + set { SetLearningStandard(value); } + } - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.AccountIdentifier = value; - } + private void SetLearningStandard(Entities.Common.EdFi.ILearningStandard value) + { + _learningStandard = value; } /// - /// The date of the reported amount for the account. + /// The name of the content standard, for example Common Core. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocalActual.EducationOrganizationId - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.EducationOrganizationId = value; - } - } + [NonDefaultStringLength(65, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="contentStandardName")] + public string ContentStandardName { get; set; } /// - /// The fiscal year for the account. + /// A unique number or alphanumeric code assigned to a Learning Standard. /// - // IS in a reference, NOT a lookup column - int Entities.Common.EdFi.ILocalActual.FiscalYear - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.FiscalYear; - - return default(int); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.FiscalYear = value; - } - } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -101824,7 +101370,7 @@ int Entities.Common.EdFi.ILocalActual.FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalActual; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardIdentificationCode; if (ReferenceEquals(this, compareTo)) return true; @@ -101832,24 +101378,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalActual).AccountIdentifier, compareTo.AccountIdentifier)) + // Parent Property + if (_learningStandard == null || !_learningStandard.Equals(compareTo.LearningStandard)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.ILocalActual).AsOfDate.Equals(compareTo.AsOfDate)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalActual).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).ContentStandardName, compareTo.ContentStandardName)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalActual).FiscalYear.Equals(compareTo.FiscalYear)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).IdentificationCode, compareTo.IdentificationCode)) return false; @@ -101865,19 +101405,17 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalActual).AccountIdentifier); + //Parent Property + if (_learningStandard != null) + hash.Add(_learningStandard); // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalActual).AsOfDate); + hash.Add((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).ContentStandardName); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalActual).EducationOrganizationId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILearningStandardIdentificationCode).IdentificationCode); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalActual).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -101890,53 +101428,17 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - private bool _amountExplicitlyAssigned = false; - private decimal _amount; + // ------------------------------------------------------------- - /// - /// Current balance for the account. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="amount")] - public decimal Amount - { - get => _amount; - set - { - _amount = value; - _amountExplicitlyAssigned = true; - } - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - - /// - /// The accounting period or grouping for which the amount is collected. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] - public string FinancialCollectionDescriptor { get; set; } - // ------------------------------------------------------------- - - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_amountExplicitlyAssigned) - { - yield return "Amount"; - } - } - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // Inherited Collections @@ -101946,7 +101448,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalActual", "LocalActual")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandard", "LearningStandardIdentificationCode")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -101958,13 +101460,6 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -101977,32 +101472,18 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalActualMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalActual)target); + return Entities.Common.EdFi.LearningStandardIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardIdentificationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalActualMapper.MapTo(this, (Entities.Common.EdFi.ILocalActual)target, null); + Entities.Common.EdFi.LearningStandardIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardIdentificationCode)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalActual.LocalAccountResourceId - { - get { return null; } - set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILocalActual.LocalAccountDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLocalAccountReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -102020,6 +101501,7 @@ string Entities.Common.EdFi.ILocalActual.LocalAccountDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -102070,9 +101552,9 @@ string Entities.Common.EdFi.ILocalActual.LocalAccountDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalActualPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -102101,135 +101583,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LocalBudget resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class LocalBudgetReference : IResourceReference - { - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } - - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (AccountIdentifier == default) - { - yield return "AccountIdentifier"; - } - - if (AsOfDate == default) - { - yield return "AsOfDate"; - } - - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (FiscalYear == default) - { - yield return "FiscalYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "LocalBudget", - Href = $"/ed-fi/localBudgets/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.LocalBudget table of the LocalBudget aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardCategoryDescriptor table of the LearningStandardCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class LocalBudget : Entities.Common.EdFi.ILocalBudget, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class LearningStandardCategoryDescriptor : Entities.Common.EdFi.ILearningStandardCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LocalBudget"); + private static FullName _fullName = new FullName("edfi", "LearningStandardCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static LocalBudgetPutPostRequestValidator _validator = new LocalBudgetPutPostRequestValidator(); + private static LearningStandardCategoryDescriptorPutPostRequestValidator _validator = new LearningStandardCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -102248,7 +101616,7 @@ public class LocalBudget : Entities.Common.EdFi.ILocalBudget, IHasETag, IDateVer // ------------------------------------------------------------ /// - /// The unique identifier for the LocalBudget resource. + /// The unique identifier for the LearningStandardCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -102258,40 +101626,6 @@ public class LocalBudget : Entities.Common.EdFi.ILocalBudget, IHasETag, IDateVer // ============================================================= // References // ------------------------------------------------------------- - - private bool _localAccountReferenceExplicitlyAssigned; - private LocalAccount.EdFi.LocalAccountReference _localAccountReference; - private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) - _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); - - return _localAccountReference; - } - } - - [DataMember(Name="localAccountReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LocalAccount.EdFi.LocalAccountReference LocalAccountReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocalAccountReference != null - && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference; - - return null; - } - set - { - _localAccountReferenceExplicitlyAssigned = true; - _localAccountReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -102299,86 +101633,16 @@ public LocalAccount.EdFi.LocalAccountReference LocalAccountReference // ------------------------------------------------------------- /// - /// Code value for the valid combination of account dimensions by LEA under which financials are reported. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalBudget.AccountIdentifier - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.AccountIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.AccountIdentifier = value; - } - } - - /// - /// The date of the reported amount for the account. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocalBudget.EducationOrganizationId - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.EducationOrganizationId = value; - } - } + [JsonIgnore] + public int LearningStandardCategoryDescriptorId { get; set; } - /// - /// The fiscal year for the account. - /// - // IS in a reference, NOT a lookup column - int Entities.Common.EdFi.ILocalBudget.FiscalYear + int IDescriptor.DescriptorId { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.FiscalYear; - - return default(int); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.FiscalYear = value; - } + get { return LearningStandardCategoryDescriptorId; } + set { LearningStandardCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -102394,7 +101658,7 @@ int Entities.Common.EdFi.ILocalBudget.FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalBudget; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -102403,23 +101667,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalBudget).AccountIdentifier, compareTo.AccountIdentifier)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.ILocalBudget).AsOfDate.Equals(compareTo.AsOfDate)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalBudget).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalBudget).FiscalYear.Equals(compareTo.FiscalYear)) + // Derived Property + if (!(this as Entities.Common.EdFi.ILearningStandardCategoryDescriptor).LearningStandardCategoryDescriptorId.Equals(compareTo.LearningStandardCategoryDescriptorId)) return false; @@ -102436,18 +101685,9 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalBudget).AccountIdentifier); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalBudget).AsOfDate); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalBudget).EducationOrganizationId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ILearningStandardCategoryDescriptor).LearningStandardCategoryDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalBudget).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -102455,48 +101695,61 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - - private bool _amountExplicitlyAssigned = false; - private decimal _amount; + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// Current balance for the account. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="amount")] - public decimal Amount - { - get => _amount; - set - { - _amount = value; - _amountExplicitlyAssigned = true; - } - } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The accounting period or grouping for which the amount is collected. + /// The end date of the period when the descriptor is in effect. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] - public string FinancialCollectionDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_amountExplicitlyAssigned) - { - yield return "Amount"; - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -102516,8 +101769,11 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalBudget", "LocalBudget")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -102547,92 +101803,19 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalBudgetMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalBudget)target); + return Entities.Common.EdFi.LearningStandardCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalBudgetMapper.MapTo(this, (Entities.Common.EdFi.ILocalBudget)target, null); + Entities.Common.EdFi.LearningStandardCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardCategoryDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalBudget.LocalAccountResourceId - { - get { return null; } - set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILocalBudget.LocalAccountDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLocalAccountReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -102640,9 +101823,9 @@ string Entities.Common.EdFi.ILocalBudget.LocalAccountDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalBudgetPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -102671,40 +101854,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LocalContractedStaff resource. + /// Represents a reference to the LearningStandardEquivalenceAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class LocalContractedStaffReference : IResourceReference + public class LearningStandardEquivalenceAssociationReference : IResourceReference { - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } - - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + [DataMember(Name="namespace")] + public string Namespace { get; set; } - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + [DataMember(Name="sourceLearningStandardId")] + public string SourceLearningStandardId { get; set; } - [DataMember(Name="staffUniqueId")] - public string StaffUniqueId - { - get => _staffUniqueId; - set - { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } - private string _staffUniqueId; + [DataMember(Name="targetLearningStandardId")] + public string TargetLearningStandardId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -102742,34 +101910,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int) && StaffUniqueId != default(string); + return Namespace != default(string) && SourceLearningStandardId != default(string) && TargetLearningStandardId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (AccountIdentifier == default) - { - yield return "AccountIdentifier"; - } - - if (AsOfDate == default) - { - yield return "AsOfDate"; - } - - if (EducationOrganizationId == default) + if (Namespace == default) { - yield return "EducationOrganizationId"; + yield return "Namespace"; } - if (FiscalYear == default) + if (SourceLearningStandardId == default) { - yield return "FiscalYear"; + yield return "SourceLearningStandardId"; } - if (StaffUniqueId == default) + if (TargetLearningStandardId == default) { - yield return "StaffUniqueId"; + yield return "TargetLearningStandardId"; } } @@ -102778,8 +101936,8 @@ private Link CreateLink() { var link = new Link { - Rel = "LocalContractedStaff", - Href = $"/ed-fi/localContractedStaffs/{ResourceId:n}" + Rel = "LearningStandardEquivalenceAssociation", + Href = $"/ed-fi/learningStandardEquivalenceAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -102806,17 +101964,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.LocalContractedStaff table of the LocalContractedStaff aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardEquivalenceAssociation table of the LearningStandardEquivalenceAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class LocalContractedStaff : Entities.Common.EdFi.ILocalContractedStaff, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class LearningStandardEquivalenceAssociation : Entities.Common.EdFi.ILearningStandardEquivalenceAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LocalContractedStaff"); + private static FullName _fullName = new FullName("edfi", "LearningStandardEquivalenceAssociation"); // Fluent validator instance (threadsafe) - private static LocalContractedStaffPutPostRequestValidator _validator = new LocalContractedStaffPutPostRequestValidator(); + private static LearningStandardEquivalenceAssociationPutPostRequestValidator _validator = new LearningStandardEquivalenceAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -102835,7 +101992,7 @@ public class LocalContractedStaff : Entities.Common.EdFi.ILocalContractedStaff, // ------------------------------------------------------------ /// - /// The unique identifier for the LocalContractedStaff resource. + /// The unique identifier for the LearningStandardEquivalenceAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -102846,70 +102003,70 @@ public class LocalContractedStaff : Entities.Common.EdFi.ILocalContractedStaff, // References // ------------------------------------------------------------- - private bool _localAccountReferenceExplicitlyAssigned; - private LocalAccount.EdFi.LocalAccountReference _localAccountReference; - private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference + private bool _sourceLearningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _sourceLearningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitSourceLearningStandardReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) - _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); + if (_sourceLearningStandardReference == null && !_sourceLearningStandardReferenceExplicitlyAssigned) + _sourceLearningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - return _localAccountReference; + return _sourceLearningStandardReference; } } - [DataMember(Name="localAccountReference")] + [DataMember(Name="sourceLearningStandardReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LocalAccount.EdFi.LocalAccountReference LocalAccountReference + public LearningStandard.EdFi.LearningStandardReference SourceLearningStandardReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocalAccountReference != null - && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference; + if (ImplicitSourceLearningStandardReference != null + && (_sourceLearningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSourceLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitSourceLearningStandardReference; return null; } set { - _localAccountReferenceExplicitlyAssigned = true; - _localAccountReference = value; + _sourceLearningStandardReferenceExplicitlyAssigned = true; + _sourceLearningStandardReference = value; } } - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference + private bool _targetLearningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _targetLearningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitTargetLearningStandardReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); + if (_targetLearningStandardReference == null && !_targetLearningStandardReferenceExplicitlyAssigned) + _targetLearningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - return _staffReference; + return _targetLearningStandardReference; } } - [DataMember(Name="staffReference")] + [DataMember(Name="targetLearningStandardReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference + public LearningStandard.EdFi.LearningStandardReference TargetLearningStandardReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; + if (ImplicitTargetLearningStandardReference != null + && (_targetLearningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitTargetLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitTargetLearningStandardReference; return null; } set { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; + _targetLearningStandardReferenceExplicitlyAssigned = true; + _targetLearningStandardReference = value; } } // ------------------------------------------------------------- @@ -102919,99 +102076,50 @@ public Staff.EdFi.StaffReference StaffReference // ------------------------------------------------------------- /// - /// Code value for the valid combination of account dimensions by LEA under which financials are reported. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalContractedStaff.AccountIdentifier - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.AccountIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.AccountIdentifier = value; - } - } - - /// - /// The date of the reported amount for the account. + /// The namespace of the organization that has created and owns the association. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocalContractedStaff.EducationOrganizationId - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.EducationOrganizationId = value; - } - } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The fiscal year for the account. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// // IS in a reference, NOT a lookup column - int Entities.Common.EdFi.ILocalContractedStaff.FiscalYear + string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardId { get { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.FiscalYear; + if (ImplicitSourceLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSourceLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitSourceLearningStandardReference.LearningStandardId; - return default(int); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.FiscalYear = value; + // SourceLearningStandard + _sourceLearningStandardReferenceExplicitlyAssigned = false; + ImplicitSourceLearningStandardReference.LearningStandardId = value; } } /// - /// A unique alphanumeric code assigned to a staff. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalContractedStaff.StaffUniqueId + string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardId { get { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; + if (ImplicitTargetLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitTargetLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitTargetLearningStandardReference.LearningStandardId; return default(string); } @@ -103020,10 +102128,9 @@ string Entities.Common.EdFi.ILocalContractedStaff.StaffUniqueId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + // TargetLearningStandard + _targetLearningStandardReferenceExplicitlyAssigned = false; + ImplicitTargetLearningStandardReference.LearningStandardId = value; } } // ------------------------------------------------------------- @@ -103040,7 +102147,7 @@ string Entities.Common.EdFi.ILocalContractedStaff.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalContractedStaff; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -103049,28 +102156,18 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalContractedStaff).AccountIdentifier, compareTo.AccountIdentifier)) - return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.ILocalContractedStaff).AsOfDate.Equals(compareTo.AsOfDate)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalContractedStaff).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).Namespace, compareTo.Namespace)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalContractedStaff).FiscalYear.Equals(compareTo.FiscalYear)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).SourceLearningStandardId, compareTo.SourceLearningStandardId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalContractedStaff).StaffUniqueId, compareTo.StaffUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).TargetLearningStandardId, compareTo.TargetLearningStandardId)) return false; @@ -103087,21 +102184,15 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).AccountIdentifier); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).AsOfDate); - + hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).Namespace); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).FiscalYear); + hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).SourceLearningStandardId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceAssociation).TargetLearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -103114,44 +102205,31 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - private bool _amountExplicitlyAssigned = false; - private decimal _amount; /// - /// Current balance for the account. + /// The date that the association is considered to be applicable or effective. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="amount")] - public decimal Amount - { - get => _amount; - set - { - _amount = value; - _amountExplicitlyAssigned = true; - } - } + [DataMember(Name="effectiveDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveDate { get; set; } + /// + /// Captures supplemental information on the relationship. Recommended for use only when the match is partial. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="learningStandardEquivalenceStrengthDescription")] + public string LearningStandardEquivalenceStrengthDescription { get; set; } /// - /// The accounting period or grouping for which the amount is collected. + /// A measure that indicates the strength or quality of the equivalence relationship. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] - public string FinancialCollectionDescriptor { get; set; } + [DataMember(Name="learningStandardEquivalenceStrengthDescriptor")][DescriptorExists("LearningStandardEquivalenceStrengthDescriptor")] + public string LearningStandardEquivalenceStrengthDescriptor { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_amountExplicitlyAssigned) - { - yield return "Amount"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -103170,7 +102248,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalContractedStaff", "LocalContractedStaff")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LearningStandardEquivalenceAssociation", "LearningStandardEquivalenceAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -103201,43 +102279,43 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalContractedStaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalContractedStaff)target); + return Entities.Common.EdFi.LearningStandardEquivalenceAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalContractedStaffMapper.MapTo(this, (Entities.Common.EdFi.ILocalContractedStaff)target, null); + Entities.Common.EdFi.LearningStandardEquivalenceAssociationMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalContractedStaff.LocalAccountResourceId + Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardResourceId { get { return null; } - set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } + set { ImplicitSourceLearningStandardReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ILocalContractedStaff.LocalAccountDiscriminator + string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearningStandardDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitLocalAccountReference.Discriminator = value; } + set { ImplicitSourceLearningStandardReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.ILocalContractedStaff.StaffResourceId + Guid? Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardResourceId { get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + set { ImplicitTargetLearningStandardReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ILocalContractedStaff.StaffDiscriminator + string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.TargetLearningStandardDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitStaffReference.Discriminator = value; } + set { ImplicitTargetLearningStandardReference.Discriminator = value; } } @@ -103308,9 +102386,9 @@ string Entities.Common.EdFi.ILocalContractedStaff.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalContractedStaffPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardEquivalenceAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -103339,21 +102417,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LocaleDescriptor table of the LocaleDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardEquivalenceStrengthDescriptor table of the LearningStandardEquivalenceStrengthDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LocaleDescriptor : Entities.Common.EdFi.ILocaleDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LearningStandardEquivalenceStrengthDescriptor : Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LocaleDescriptor"); + private static FullName _fullName = new FullName("edfi", "LearningStandardEquivalenceStrengthDescriptor"); // Fluent validator instance (threadsafe) - private static LocaleDescriptorPutPostRequestValidator _validator = new LocaleDescriptorPutPostRequestValidator(); + private static LearningStandardEquivalenceStrengthDescriptorPutPostRequestValidator _validator = new LearningStandardEquivalenceStrengthDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -103372,7 +102450,7 @@ public class LocaleDescriptor : Entities.Common.EdFi.ILocaleDescriptor, Entities // ------------------------------------------------------------ /// - /// The unique identifier for the LocaleDescriptor resource. + /// The unique identifier for the LearningStandardEquivalenceStrengthDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -103393,12 +102471,12 @@ public class LocaleDescriptor : Entities.Common.EdFi.ILocaleDescriptor, Entities /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int LocaleDescriptorId { get; set; } + public int LearningStandardEquivalenceStrengthDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return LocaleDescriptorId; } - set { LocaleDescriptorId = value; } + get { return LearningStandardEquivalenceStrengthDescriptorId; } + set { LearningStandardEquivalenceStrengthDescriptorId = value; } } // ------------------------------------------------------------- @@ -103414,7 +102492,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocaleDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -103424,7 +102502,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ILocaleDescriptor).LocaleDescriptorId.Equals(compareTo.LocaleDescriptorId)) + if (!(this as Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor).LearningStandardEquivalenceStrengthDescriptorId.Equals(compareTo.LearningStandardEquivalenceStrengthDescriptorId)) return false; @@ -103442,7 +102520,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ILocaleDescriptor).LocaleDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor).LearningStandardEquivalenceStrengthDescriptorId); return hash.ToHashCode(); } @@ -103559,12 +102637,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocaleDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocaleDescriptor)target); + return Entities.Common.EdFi.LearningStandardEquivalenceStrengthDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocaleDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILocaleDescriptor)target, null); + Entities.Common.EdFi.LearningStandardEquivalenceStrengthDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor)target, null); } // ------------------------------------------------------------- @@ -103579,9 +102657,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocaleDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardEquivalenceStrengthDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -103610,85 +102688,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LocalEducationAgency resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class LocalEducationAgencyReference : IResourceReference - { - [DataMember(Name="localEducationAgencyId")] - public long LocalEducationAgencyId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return LocalEducationAgencyId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (LocalEducationAgencyId == default) - { - yield return "LocalEducationAgencyId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "LocalEducationAgency", - Href = $"/ed-fi/localEducationAgencies/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.LocalEducationAgency table of the LocalEducationAgency aggregate in the ODS Database. + /// A class which represents the edfi.LearningStandardScopeDescriptor table of the LearningStandardScopeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LocalEducationAgency : Entities.Common.EdFi.ILocalEducationAgency, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + public class LearningStandardScopeDescriptor : Entities.Common.EdFi.ILearningStandardScopeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LocalEducationAgency"); + private static FullName _fullName = new FullName("edfi", "LearningStandardScopeDescriptor"); // Fluent validator instance (threadsafe) - private static LocalEducationAgencyPutPostRequestValidator _validator = new LocalEducationAgencyPutPostRequestValidator(); + private static LearningStandardScopeDescriptorPutPostRequestValidator _validator = new LearningStandardScopeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -103699,19 +102713,6 @@ public class LocalEducationAgency : Entities.Common.EdFi.ILocalEducationAgency, // Constructor // ------------------------------------------------------------- - public LocalEducationAgency() - { - LocalEducationAgencyAccountabilities = new List(); - LocalEducationAgencyFederalFunds = new List(); - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); - } // ------------------------------------------------------------ @@ -103720,7 +102721,7 @@ public LocalEducationAgency() // ------------------------------------------------------------ /// - /// The unique identifier for the LocalEducationAgency resource. + /// The unique identifier for the LearningStandardScopeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -103730,140 +102731,39 @@ public LocalEducationAgency() // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _educationServiceCenterReferenceExplicitlyAssigned; - private EducationServiceCenter.EdFi.EducationServiceCenterReference _educationServiceCenterReference; - private EducationServiceCenter.EdFi.EducationServiceCenterReference ImplicitEducationServiceCenterReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationServiceCenterReference == null && !_educationServiceCenterReferenceExplicitlyAssigned) - _educationServiceCenterReference = new EducationServiceCenter.EdFi.EducationServiceCenterReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- - return _educationServiceCenterReference; - } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int LearningStandardScopeDescriptorId { get; set; } - [DataMember(Name="educationServiceCenterReference")] - [FullyDefinedReference] - public EducationServiceCenter.EdFi.EducationServiceCenterReference EducationServiceCenterReference + int IDescriptor.DescriptorId { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationServiceCenterReference != null - && (_educationServiceCenterReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationServiceCenterReference.IsReferenceFullyDefined())) - return ImplicitEducationServiceCenterReference; - - return null; - } - set - { - _educationServiceCenterReferenceExplicitlyAssigned = true; - _educationServiceCenterReference = value; - } + get { return LearningStandardScopeDescriptorId; } + set { LearningStandardScopeDescriptorId = value; } } - private bool _parentLocalEducationAgencyReferenceExplicitlyAssigned; - private LocalEducationAgencyReference _parentLocalEducationAgencyReference; - private LocalEducationAgencyReference ImplicitParentLocalEducationAgencyReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_parentLocalEducationAgencyReference == null && !_parentLocalEducationAgencyReferenceExplicitlyAssigned) - _parentLocalEducationAgencyReference = new LocalEducationAgencyReference(); + // ------------------------------------------------------------- - return _parentLocalEducationAgencyReference; - } - } + // ============================================================= + // Equality + // ------------------------------------------------------------- - [DataMember(Name="parentLocalEducationAgencyReference")] - [FullyDefinedReference] - public LocalEducationAgencyReference ParentLocalEducationAgencyReference + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitParentLocalEducationAgencyReference != null - && (_parentLocalEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentLocalEducationAgencyReference.IsReferenceFullyDefined())) - return ImplicitParentLocalEducationAgencyReference; - - return null; - } - set - { - _parentLocalEducationAgencyReferenceExplicitlyAssigned = true; - _parentLocalEducationAgencyReference = value; - } - } - private bool _stateEducationAgencyReferenceExplicitlyAssigned; - private StateEducationAgency.EdFi.StateEducationAgencyReference _stateEducationAgencyReference; - private StateEducationAgency.EdFi.StateEducationAgencyReference ImplicitStateEducationAgencyReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_stateEducationAgencyReference == null && !_stateEducationAgencyReferenceExplicitlyAssigned) - _stateEducationAgencyReference = new StateEducationAgency.EdFi.StateEducationAgencyReference(); - - return _stateEducationAgencyReference; - } - } - - [DataMember(Name="stateEducationAgencyReference")] - [FullyDefinedReference] - public StateEducationAgency.EdFi.StateEducationAgencyReference StateEducationAgencyReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStateEducationAgencyReference != null - && (_stateEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) - return ImplicitStateEducationAgencyReference; - - return null; - } - set - { - _stateEducationAgencyReferenceExplicitlyAssigned = true; - _stateEducationAgencyReference = value; - } - } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// The identifier assigned to a local education agency. It must be distinct from any other identifier assigned to educational organizations, such as a SchoolId, to prevent duplication. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="localEducationAgencyId")] - public long LocalEducationAgencyId { get; set; } - - long IEducationOrganization.EducationOrganizationId - { - get { return LocalEducationAgencyId; } - set { LocalEducationAgencyId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgency; + var compareTo = obj as Entities.Common.EdFi.ILearningStandardScopeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -103873,7 +102773,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ILocalEducationAgency).LocalEducationAgencyId.Equals(compareTo.LocalEducationAgencyId)) + if (!(this as Entities.Common.EdFi.ILearningStandardScopeDescriptor).LearningStandardScopeDescriptorId.Equals(compareTo.LearningStandardScopeDescriptorId)) return false; @@ -103891,7 +102791,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ILocalEducationAgency).LocalEducationAgencyId); + hash.Add((this as Entities.Common.EdFi.ILearningStandardScopeDescriptor).LearningStandardScopeDescriptorId); return hash.ToHashCode(); } @@ -103902,140 +102802,58 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The full, legally accepted name of the institution. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } - - /// - /// The current operational status of the education organization (e.g., active, inactive). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// A short name for the institution. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The public web site address (URL) for the education organization. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// A school or agency providing free public elementary or secondary education to eligible students under a specific charter granted by the state legislature or other appropriate authority and designated by such authority to be a charter school. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="charterStatusDescriptor")][DescriptorExists("CharterStatusDescriptor")] - public string CharterStatusDescriptor { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The identifier assigned to an education service center. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The end date of the period when the descriptor is in effect. /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ILocalEducationAgency.EducationServiceCenterId - { - get - { - if (ImplicitEducationServiceCenterReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationServiceCenterReference.IsReferenceFullyDefined())) - { - return ImplicitEducationServiceCenterReference.EducationServiceCenterId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationServiceCenter - _educationServiceCenterReferenceExplicitlyAssigned = false; - ImplicitEducationServiceCenterReference.EducationServiceCenterId = value.GetValueOrDefault(); - } - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The category of local education agency/district. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="localEducationAgencyCategoryDescriptor")][DescriptorExists("LocalEducationAgencyCategoryDescriptor")] - public string LocalEducationAgencyCategoryDescriptor { get; set; } - - /// - /// The identifier assigned to a local education agency. It must be distinct from any other identifier assigned to educational organizations, such as a SchoolId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ILocalEducationAgency.ParentLocalEducationAgencyId - { - get - { - if (ImplicitParentLocalEducationAgencyReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitParentLocalEducationAgencyReference.IsReferenceFullyDefined())) - { - return ImplicitParentLocalEducationAgencyReference.LocalEducationAgencyId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ParentLocalEducationAgency - _parentLocalEducationAgencyReferenceExplicitlyAssigned = false; - ImplicitParentLocalEducationAgencyReference.LocalEducationAgencyId = value.GetValueOrDefault(); - } - } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The identifier assigned to a state education agency. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// A shortened description for the descriptor. /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ILocalEducationAgency.StateEducationAgencyId - { - get - { - if (ImplicitStateEducationAgencyReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) - { - return ImplicitStateEducationAgencyReference.StateEducationAgencyId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - // StateEducationAgency - _stateEducationAgencyReferenceExplicitlyAssigned = false; - ImplicitStateEducationAgencyReference.StateEducationAgencyId = value.GetValueOrDefault(); - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -104051,204 +102869,21 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses - { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses - { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } - set - { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodes; } - set - { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } - set - { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators - { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } - } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephones; } - set - { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } - } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddresses; } - set - { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } - } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEducationAgency", "LocalEducationAgency")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _localEducationAgencyAccountabilities; - private ICollection _localEducationAgencyAccountabilitiesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="accountabilities")] - public ICollection LocalEducationAgencyAccountabilities - { - get { return _localEducationAgencyAccountabilities; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyAccountability)e.Item).LocalEducationAgency = this); - _localEducationAgencyAccountabilities = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyAccountability)e.Item).LocalEducationAgency = this; - _localEducationAgencyAccountabilitiesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyAccountabilities - { - get { return _localEducationAgencyAccountabilitiesCovariant; } - set { LocalEducationAgencyAccountabilities = new List(value.Cast()); } - } - - private ICollection _localEducationAgencyFederalFunds; - private ICollection _localEducationAgencyFederalFundsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="federalFunds")] - public ICollection LocalEducationAgencyFederalFunds - { - get { return _localEducationAgencyFederalFunds; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)e.Item).LocalEducationAgency = this); - _localEducationAgencyFederalFunds = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)e.Item).LocalEducationAgency = this; - _localEducationAgencyFederalFundsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyFederalFunds - { - get { return _localEducationAgencyFederalFundsCovariant; } - set { LocalEducationAgencyFederalFunds = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -104266,52 +102901,6 @@ public ICollection LocalEducationAgencyFederal // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) - { - item.EducationOrganization = this; - } - - if (_localEducationAgencyAccountabilities != null) foreach (var item in _localEducationAgencyAccountabilities) - { - item.LocalEducationAgency = this; - } - - if (_localEducationAgencyFederalFunds != null) foreach (var item in _localEducationAgencyFederalFunds) - { - item.LocalEducationAgency = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -104319,195 +102908,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalEducationAgencyMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgency)target); + return Entities.Common.EdFi.LearningStandardScopeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILearningStandardScopeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalEducationAgencyMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgency)target, null); + Entities.Common.EdFi.LearningStandardScopeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILearningStandardScopeDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalEducationAgency.EducationServiceCenterResourceId - { - get { return null; } - set { ImplicitEducationServiceCenterReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.ILocalEducationAgency.ParentLocalEducationAgencyResourceId - { - get { return null; } - set { ImplicitParentLocalEducationAgencyReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.ILocalEducationAgency.StateEducationAgencyResourceId - { - get { return null; } - set { ImplicitStateEducationAgencyReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) - { - yield return result; - } - } - - if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationCategories"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) - { - yield return result; - } - } - - if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIdentificationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) - { - yield return result; - } - } - - if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIndicators"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) - { - yield return result; - } - } - - if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInstitutionTelephones"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) - { - yield return result; - } - } - - if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInternationalAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) - { - yield return result; - } - } - - if (LocalEducationAgencyAccountabilities.Any() && mappingContract?.IsMemberSupported("LocalEducationAgencyAccountabilities") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("LocalEducationAgencyAccountabilities"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LocalEducationAgencyAccountabilities, validationContext, validationContext.Items.ForCollection("LocalEducationAgencyAccountabilities")))) - { - yield return result; - } - } - - if (LocalEducationAgencyFederalFunds.Any() && mappingContract?.IsMemberSupported("LocalEducationAgencyFederalFunds") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("LocalEducationAgencyFederalFunds"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LocalEducationAgencyFederalFunds, validationContext, validationContext.Items.ForCollection("LocalEducationAgencyFederalFunds")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -104515,21 +102928,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalEducationAgencyPutPostRequestValidator : FluentValidation.AbstractValidator + public class LearningStandardScopeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_LocalEducationAgency = new FullName("edfi", "LocalEducationAgency"); - - // Declare collection item validators - private LocalEducationAgencyAccountabilityPutPostRequestValidator _localEducationAgencyAccountabilitiesValidator = new (); - private LocalEducationAgencyFederalFundsPutPostRequestValidator _localEducationAgencyFederalFundsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -104542,105 +102943,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (LocalEducationAgencyMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_LocalEducationAgency); - - if (mappingContract != null) - { - if (mappingContract.IsLocalEducationAgencyAccountabilityIncluded != null) - { - var hasInvalidLocalEducationAgencyAccountabilitiesItems = instance.LocalEducationAgencyAccountabilities.Any(x => !mappingContract.IsLocalEducationAgencyAccountabilityIncluded(x)); - - if (hasInvalidLocalEducationAgencyAccountabilitiesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("LocalEducationAgencyAccountabilities", $"A supplied 'LocalEducationAgencyAccountability' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsLocalEducationAgencyFederalFundsIncluded != null) - { - var hasInvalidLocalEducationAgencyFederalFundsItems = instance.LocalEducationAgencyFederalFunds.Any(x => !mappingContract.IsLocalEducationAgencyFederalFundsIncluded(x)); - - if (hasInvalidLocalEducationAgencyFederalFundsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("LocalEducationAgencyFederalFunds", $"A supplied 'LocalEducationAgencyFederalFunds' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationAddressIncluded != null) - { - var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); - - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) - { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - - if (hasInvalidEducationOrganizationInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -104656,17 +102958,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LocalEducationAgencyAccountability table of the LocalEducationAgency aggregate in the ODS Database. + /// A class which represents the edfi.LevelOfEducationDescriptor table of the LevelOfEducationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LocalEducationAgencyAccountability : Entities.Common.EdFi.ILocalEducationAgencyAccountability, IValidatableObject + public class LevelOfEducationDescriptor : Entities.Common.EdFi.ILevelOfEducationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LocalEducationAgencyAccountability"); + private static FullName _fullName = new FullName("edfi", "LevelOfEducationDescriptor"); // Fluent validator instance (threadsafe) - private static LocalEducationAgencyAccountabilityPutPostRequestValidator _validator = new LocalEducationAgencyAccountabilityPutPostRequestValidator(); + private static LevelOfEducationDescriptorPutPostRequestValidator _validator = new LevelOfEducationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -104683,92 +102990,35 @@ public class LocalEducationAgencyAccountability : Entities.Common.EdFi.ILocalEdu // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the LevelOfEducationDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _schoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) - _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - - return _schoolYearTypeReference; - } - } - - [DataMember(Name="schoolYearTypeReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolYearTypeReference != null - && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference; - - return null; - } - set - { - _schoolYearTypeReferenceExplicitlyAssigned = true; - _schoolYearTypeReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILocalEducationAgency _localEducationAgency; - - [IgnoreDataMember] - Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyAccountability.LocalEducationAgency - { - get { return _localEducationAgency; } - set { SetLocalEducationAgency(value); } - } - - public Entities.Common.EdFi.ILocalEducationAgency LocalEducationAgency - { - set { SetLocalEducationAgency(value); } - } - - private void SetLocalEducationAgency(Entities.Common.EdFi.ILocalEducationAgency value) - { - _localEducationAgency = value; - } /// - /// The school year for which the accountability is reported. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ILocalEducationAgencyAccountability.SchoolYear - { - get - { - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int LevelOfEducationDescriptorId { get; set; } - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value; - } + int IDescriptor.DescriptorId + { + get { return LevelOfEducationDescriptorId; } + set { LevelOfEducationDescriptorId = value; } } // ------------------------------------------------------------- @@ -104784,7 +103034,7 @@ short Entities.Common.EdFi.ILocalEducationAgencyAccountability.SchoolYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgencyAccountability; + var compareTo = obj as Entities.Common.EdFi.ILevelOfEducationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -104792,13 +103042,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_localEducationAgency == null || !_localEducationAgency.Equals(compareTo.LocalEducationAgency)) - return false; - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalEducationAgencyAccountability).SchoolYear.Equals(compareTo.SchoolYear)) + // Derived Property + if (!(this as Entities.Common.EdFi.ILevelOfEducationDescriptor).LevelOfEducationDescriptorId.Equals(compareTo.LevelOfEducationDescriptorId)) return false; @@ -104814,12 +103060,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_localEducationAgency != null) - hash.Add(_localEducationAgency); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalEducationAgencyAccountability).SchoolYear); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ILevelOfEducationDescriptor).LevelOfEducationDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -104827,27 +103071,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// An indication of whether the school or Local Education Agency (LEA) submitted a Gun-Free Schools Act (GFSA) of 1994 report to the state, as defined by Title 18, Section 921. + /// The description of the descriptor. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="gunFreeSchoolsActReportingStatusDescriptor")][DescriptorExists("GunFreeSchoolsActReportingStatusDescriptor")] - public string GunFreeSchoolsActReportingStatusDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// An indication of whether the LEA was able to implement the provisions for public school choice under Title I, Part A, Section 1116 of ESEA as amended. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="schoolChoiceImplementStatusDescriptor")][DescriptorExists("SchoolChoiceImplementStatusDescriptor")] - public string SchoolChoiceImplementStatusDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -104868,8 +103145,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEducationAgency", "LocalEducationAgencyAccountability")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -104880,6 +103160,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -104892,86 +103179,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalEducationAgencyAccountabilityMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgencyAccountability)target); + return Entities.Common.EdFi.LevelOfEducationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILevelOfEducationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalEducationAgencyAccountabilityMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgencyAccountability)target, null); + Entities.Common.EdFi.LevelOfEducationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILevelOfEducationDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalEducationAgencyAccountability.SchoolYearTypeResourceId - { - get { return null; } - set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -104979,9 +103199,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalEducationAgencyAccountabilityPutPostRequestValidator : FluentValidation.AbstractValidator + public class LevelOfEducationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -105009,17 +103229,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LocalEducationAgencyFederalFunds table of the LocalEducationAgency aggregate in the ODS Database. + /// A class which represents the edfi.LicenseStatusDescriptor table of the LicenseStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LocalEducationAgencyFederalFunds : Entities.Common.EdFi.ILocalEducationAgencyFederalFunds, IValidatableObject + public class LicenseStatusDescriptor : Entities.Common.EdFi.ILicenseStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LocalEducationAgencyFederalFunds"); + private static FullName _fullName = new FullName("edfi", "LicenseStatusDescriptor"); // Fluent validator instance (threadsafe) - private static LocalEducationAgencyFederalFundsPutPostRequestValidator _validator = new LocalEducationAgencyFederalFundsPutPostRequestValidator(); + private static LicenseStatusDescriptorPutPostRequestValidator _validator = new LicenseStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -105036,6 +103261,13 @@ public class LocalEducationAgencyFederalFunds : Entities.Common.EdFi.ILocalEduca // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the LicenseStatusDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -105046,32 +103278,19 @@ public class LocalEducationAgencyFederalFunds : Entities.Common.EdFi.ILocalEduca //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ILocalEducationAgency _localEducationAgency; - - [IgnoreDataMember] - Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.LocalEducationAgency - { - get { return _localEducationAgency; } - set { SetLocalEducationAgency(value); } - } - - public Entities.Common.EdFi.ILocalEducationAgency LocalEducationAgency - { - set { SetLocalEducationAgency(value); } - } - - private void SetLocalEducationAgency(Entities.Common.EdFi.ILocalEducationAgency value) - { - _localEducationAgency = value; - } /// - /// The fiscal year for which the federal funds are received. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + [JsonIgnore] + public int LicenseStatusDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return LicenseStatusDescriptorId; } + set { LicenseStatusDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -105086,7 +103305,7 @@ private void SetLocalEducationAgency(Entities.Common.EdFi.ILocalEducationAgency /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgencyFederalFunds; + var compareTo = obj as Entities.Common.EdFi.ILicenseStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -105094,13 +103313,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_localEducationAgency == null || !_localEducationAgency.Equals(compareTo.LocalEducationAgency)) - return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.ILocalEducationAgencyFederalFunds).FiscalYear.Equals(compareTo.FiscalYear)) + // Derived Property + if (!(this as Entities.Common.EdFi.ILicenseStatusDescriptor).LicenseStatusDescriptorId.Equals(compareTo.LicenseStatusDescriptorId)) return false; @@ -105116,12 +103331,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_localEducationAgency != null) - hash.Add(_localEducationAgency); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalEducationAgencyFederalFunds).FiscalYear); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ILicenseStatusDescriptor).LicenseStatusDescriptorId); return hash.ToHashCode(); } @@ -105130,75 +103342,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The total Title V, Part A funds expended by LEAs. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="innovativeDollarsSpent")] - public decimal? InnovativeDollarsSpent { get; set; } /// - /// The total amount of Title V, Part A funds expended by LEAs for the four strategic priorities. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="innovativeDollarsSpentStrategicPriorities")] - public decimal? InnovativeDollarsSpentStrategicPriorities { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The total Title V, Part A funds received by LEAs. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="innovativeProgramsFundsReceived")] - public decimal? InnovativeProgramsFundsReceived { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The amount of Section 1003(a) and 1003(g) allocations to LEAs. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="schoolImprovementAllocation")] - public decimal? SchoolImprovementAllocation { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// An indication of the percentage of the Title I, Part A allocation that the SEA reserved in accordance with Section 1003(a) of ESEA and 200.100(a) of ED's regulations governing the reservation of funds for school improvement under Section 1003(a) of ESEA. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="schoolImprovementReservedFundsPercentage")] - public decimal? SchoolImprovementReservedFundsPercentage { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The percentage of funds used to administer assessments required by Section 1111(b) or to carry out other activities described in Section 6111 and other activities related to ensuring that the state's schools and LEAs are held accountable for results. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="stateAssessmentAdministrationFunding")] - public decimal? StateAssessmentAdministrationFunding { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The dollar amount spent on supplemental educational services during the school year under Title I, Part A, Section 1116 of ESEA as amended. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="supplementalEducationalServicesFundsSpent")] - public decimal? SupplementalEducationalServicesFundsSpent { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - /// - /// The maximum dollar amount that may be spent per child for expenditures related to supplemental educational services under Title I of the ESEA. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="supplementalEducationalServicesPerPupilExpenditure")] - public decimal? SupplementalEducationalServicesPerPupilExpenditure { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -105219,8 +103416,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEducationAgency", "LocalEducationAgencyFederalFunds")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -105231,6 +103431,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -105243,12 +103450,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalEducationAgencyFederalFundsMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)target); + return Entities.Common.EdFi.LicenseStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILicenseStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalEducationAgencyFederalFundsMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)target, null); + Entities.Common.EdFi.LicenseStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILicenseStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -105256,66 +103463,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -105323,9 +103470,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalEducationAgencyFederalFundsPutPostRequestValidator : FluentValidation.AbstractValidator + public class LicenseStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -105354,21 +103501,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.LocalEducationAgencyCategoryDescriptor table of the LocalEducationAgencyCategoryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LicenseTypeDescriptor table of the LicenseTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class LocalEducationAgencyCategoryDescriptor : Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LicenseTypeDescriptor : Entities.Common.EdFi.ILicenseTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LocalEducationAgencyCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "LicenseTypeDescriptor"); // Fluent validator instance (threadsafe) - private static LocalEducationAgencyCategoryDescriptorPutPostRequestValidator _validator = new LocalEducationAgencyCategoryDescriptorPutPostRequestValidator(); + private static LicenseTypeDescriptorPutPostRequestValidator _validator = new LicenseTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -105387,7 +103534,7 @@ public class LocalEducationAgencyCategoryDescriptor : Entities.Common.EdFi.ILoca // ------------------------------------------------------------ /// - /// The unique identifier for the LocalEducationAgencyCategoryDescriptor resource. + /// The unique identifier for the LicenseTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -105408,12 +103555,12 @@ public class LocalEducationAgencyCategoryDescriptor : Entities.Common.EdFi.ILoca /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int LocalEducationAgencyCategoryDescriptorId { get; set; } + public int LicenseTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return LocalEducationAgencyCategoryDescriptorId; } - set { LocalEducationAgencyCategoryDescriptorId = value; } + get { return LicenseTypeDescriptorId; } + set { LicenseTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -105429,7 +103576,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILicenseTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -105439,7 +103586,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor).LocalEducationAgencyCategoryDescriptorId.Equals(compareTo.LocalEducationAgencyCategoryDescriptorId)) + if (!(this as Entities.Common.EdFi.ILicenseTypeDescriptor).LicenseTypeDescriptorId.Equals(compareTo.LicenseTypeDescriptorId)) return false; @@ -105457,7 +103604,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor).LocalEducationAgencyCategoryDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILicenseTypeDescriptor).LicenseTypeDescriptorId); return hash.ToHashCode(); } @@ -105574,12 +103721,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalEducationAgencyCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor)target); + return Entities.Common.EdFi.LicenseTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILicenseTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalEducationAgencyCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor)target, null); + Entities.Common.EdFi.LicenseTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILicenseTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -105594,9 +103741,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalEducationAgencyCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LicenseTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -105625,135 +103772,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LocalEncumbrance resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class LocalEncumbranceReference : IResourceReference - { - [DataMember(Name="accountIdentifier")] - public string AccountIdentifier { get; set; } - - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (AccountIdentifier == default) - { - yield return "AccountIdentifier"; - } - - if (AsOfDate == default) - { - yield return "AsOfDate"; - } - - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (FiscalYear == default) - { - yield return "FiscalYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "LocalEncumbrance", - Href = $"/ed-fi/localEncumbrances/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.LocalEncumbrance table of the LocalEncumbrance aggregate in the ODS Database. + /// A class which represents the edfi.LimitedEnglishProficiencyDescriptor table of the LimitedEnglishProficiencyDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class LocalEncumbrance : Entities.Common.EdFi.ILocalEncumbrance, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class LimitedEnglishProficiencyDescriptor : Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "LocalEncumbrance"); + private static FullName _fullName = new FullName("edfi", "LimitedEnglishProficiencyDescriptor"); // Fluent validator instance (threadsafe) - private static LocalEncumbrancePutPostRequestValidator _validator = new LocalEncumbrancePutPostRequestValidator(); + private static LimitedEnglishProficiencyDescriptorPutPostRequestValidator _validator = new LimitedEnglishProficiencyDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -105772,7 +103805,7 @@ public class LocalEncumbrance : Entities.Common.EdFi.ILocalEncumbrance, IHasETag // ------------------------------------------------------------ /// - /// The unique identifier for the LocalEncumbrance resource. + /// The unique identifier for the LimitedEnglishProficiencyDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -105782,40 +103815,6 @@ public class LocalEncumbrance : Entities.Common.EdFi.ILocalEncumbrance, IHasETag // ============================================================= // References // ------------------------------------------------------------- - - private bool _localAccountReferenceExplicitlyAssigned; - private LocalAccount.EdFi.LocalAccountReference _localAccountReference; - private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) - _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); - - return _localAccountReference; - } - } - - [DataMember(Name="localAccountReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LocalAccount.EdFi.LocalAccountReference LocalAccountReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocalAccountReference != null - && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference; - - return null; - } - set - { - _localAccountReferenceExplicitlyAssigned = true; - _localAccountReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -105823,86 +103822,16 @@ public LocalAccount.EdFi.LocalAccountReference LocalAccountReference // ------------------------------------------------------------- /// - /// Code value for the valid combination of account dimensions by LEA under which financials are reported. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalEncumbrance.AccountIdentifier - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.AccountIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.AccountIdentifier = value; - } - } - - /// - /// The date of the reported amount for the account. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocalEncumbrance.EducationOrganizationId - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.EducationOrganizationId = value; - } - } + [JsonIgnore] + public int LimitedEnglishProficiencyDescriptorId { get; set; } - /// - /// The fiscal year for the account. - /// - // IS in a reference, NOT a lookup column - int Entities.Common.EdFi.ILocalEncumbrance.FiscalYear + int IDescriptor.DescriptorId { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.FiscalYear; - - return default(int); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.FiscalYear = value; - } + get { return LimitedEnglishProficiencyDescriptorId; } + set { LimitedEnglishProficiencyDescriptorId = value; } } // ------------------------------------------------------------- @@ -105918,7 +103847,7 @@ int Entities.Common.EdFi.ILocalEncumbrance.FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalEncumbrance; + var compareTo = obj as Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -105927,23 +103856,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalEncumbrance).AccountIdentifier, compareTo.AccountIdentifier)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.ILocalEncumbrance).AsOfDate.Equals(compareTo.AsOfDate)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalEncumbrance).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalEncumbrance).FiscalYear.Equals(compareTo.FiscalYear)) + // Derived Property + if (!(this as Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor).LimitedEnglishProficiencyDescriptorId.Equals(compareTo.LimitedEnglishProficiencyDescriptorId)) return false; @@ -105960,18 +103874,9 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).AccountIdentifier); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).AsOfDate); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).EducationOrganizationId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor).LimitedEnglishProficiencyDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -105979,48 +103884,61 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - - private bool _amountExplicitlyAssigned = false; - private decimal _amount; + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// Current balance for the account. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="amount")] - public decimal Amount - { - get => _amount; - set - { - _amount = value; - _amountExplicitlyAssigned = true; - } - } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The accounting period or grouping for which the amount is collected. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] - public string FinancialCollectionDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_amountExplicitlyAssigned) - { - yield return "Amount"; - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -106040,8 +103958,11 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEncumbrance", "LocalEncumbrance")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -106071,92 +103992,19 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalEncumbranceMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEncumbrance)target); + return Entities.Common.EdFi.LimitedEnglishProficiencyDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalEncumbranceMapper.MapTo(this, (Entities.Common.EdFi.ILocalEncumbrance)target, null); + Entities.Common.EdFi.LimitedEnglishProficiencyDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalEncumbrance.LocalAccountResourceId - { - get { return null; } - set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ILocalEncumbrance.LocalAccountDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLocalAccountReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -106164,9 +104012,9 @@ string Entities.Common.EdFi.ILocalEncumbrance.LocalAccountDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalEncumbrancePutPostRequestValidator : FluentValidation.AbstractValidator + public class LimitedEnglishProficiencyDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -106195,41 +104043,26 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the LocalPayroll resource. + /// Represents a reference to the LocalAccount resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class LocalPayrollReference : IResourceReference + public class LocalAccountReference : IResourceReference { [DataMember(Name="accountIdentifier")] public string AccountIdentifier { get; set; } - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } - [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } [DataMember(Name="fiscalYear")] public int FiscalYear { get; set; } - [DataMember(Name="staffUniqueId")] - public string StaffUniqueId - { - get => _staffUniqueId; - set - { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } - private string _staffUniqueId; - /// /// Gets or sets the resource identifier of the referenced resource. /// @@ -106266,7 +104099,7 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int) && StaffUniqueId != default(string); + return AccountIdentifier != default(string) && EducationOrganizationId != default(long) && FiscalYear != default(int); } IEnumerable IResourceReference.GetUndefinedProperties() @@ -106276,11 +104109,6 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "AccountIdentifier"; } - if (AsOfDate == default) - { - yield return "AsOfDate"; - } - if (EducationOrganizationId == default) { yield return "EducationOrganizationId"; @@ -106291,19 +104119,14 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "FiscalYear"; } - if (StaffUniqueId == default) - { - yield return "StaffUniqueId"; - } - } private Link CreateLink() { var link = new Link { - Rel = "LocalPayroll", - Href = $"/ed-fi/localPayrolls/{ResourceId:n}" + Rel = "LocalAccount", + Href = $"/ed-fi/localAccounts/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -106330,17 +104153,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.LocalPayroll table of the LocalPayroll aggregate in the ODS Database. + /// A class which represents the edfi.LocalAccount table of the LocalAccount aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class LocalPayroll : Entities.Common.EdFi.ILocalPayroll, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class LocalAccount : Entities.Common.EdFi.ILocalAccount, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "LocalPayroll"); + private static FullName _fullName = new FullName("edfi", "LocalAccount"); // Fluent validator instance (threadsafe) - private static LocalPayrollPutPostRequestValidator _validator = new LocalPayrollPutPostRequestValidator(); + private static LocalAccountPutPostRequestValidator _validator = new LocalAccountPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -106351,6 +104174,10 @@ public class LocalPayroll : Entities.Common.EdFi.ILocalPayroll, IHasETag, IDateV // Constructor // ------------------------------------------------------------- + public LocalAccount() + { + LocalAccountReportingTags = new List(); + } // ------------------------------------------------------------ @@ -106359,7 +104186,7 @@ public class LocalPayroll : Entities.Common.EdFi.ILocalPayroll, IHasETag, IDateV // ------------------------------------------------------------ /// - /// The unique identifier for the LocalPayroll resource. + /// The unique identifier for the LocalAccount resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -106370,70 +104197,70 @@ public class LocalPayroll : Entities.Common.EdFi.ILocalPayroll, IHasETag, IDateV // References // ------------------------------------------------------------- - private bool _localAccountReferenceExplicitlyAssigned; - private LocalAccount.EdFi.LocalAccountReference _localAccountReference; - private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference + private bool _chartOfAccountReferenceExplicitlyAssigned; + private ChartOfAccount.EdFi.ChartOfAccountReference _chartOfAccountReference; + private ChartOfAccount.EdFi.ChartOfAccountReference ImplicitChartOfAccountReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) - _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); + if (_chartOfAccountReference == null && !_chartOfAccountReferenceExplicitlyAssigned) + _chartOfAccountReference = new ChartOfAccount.EdFi.ChartOfAccountReference(); - return _localAccountReference; + return _chartOfAccountReference; } } - [DataMember(Name="localAccountReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LocalAccount.EdFi.LocalAccountReference LocalAccountReference + [DataMember(Name="chartOfAccountReference")] + [FullyDefinedReference][RequiredReference("edfi", "LocalAccount")] + public ChartOfAccount.EdFi.ChartOfAccountReference ChartOfAccountReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocalAccountReference != null - && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference; + if (ImplicitChartOfAccountReference != null + && (_chartOfAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitChartOfAccountReference.IsReferenceFullyDefined())) + return ImplicitChartOfAccountReference; return null; } set { - _localAccountReferenceExplicitlyAssigned = true; - _localAccountReference = value; + _chartOfAccountReferenceExplicitlyAssigned = true; + _chartOfAccountReference = value; } } - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _staffReference; + return _educationOrganizationReference; } } - [DataMember(Name="staffReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } // ------------------------------------------------------------- @@ -106445,47 +104272,23 @@ public Staff.EdFi.StaffReference StaffReference /// /// Code value for the valid combination of account dimensions by LEA under which financials are reported. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalPayroll.AccountIdentifier - { - get - { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.AccountIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.AccountIdentifier = value; - } - } - - /// - /// The date of the reported amount for the account. - /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime AsOfDate { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } /// /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocalPayroll.EducationOrganizationId + long Entities.Common.EdFi.ILocalAccount.EducationOrganizationId { get { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.EducationOrganizationId; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -106494,60 +104297,38 @@ long Entities.Common.EdFi.ILocalPayroll.EducationOrganizationId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.EducationOrganizationId = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } + private int _fiscalYear; + private bool _fiscalYearExplicitlyAssigned = false; + /// /// The fiscal year for the account. /// // IS in a reference, NOT a lookup column - int Entities.Common.EdFi.ILocalPayroll.FiscalYear + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear { get { - if (ImplicitLocalAccountReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) - return ImplicitLocalAccountReference.FiscalYear; - - return default(int); + return _fiscalYear; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalAccount - _localAccountReferenceExplicitlyAssigned = false; - ImplicitLocalAccountReference.FiscalYear = value; - } - } - - /// - /// A unique alphanumeric code assigned to a staff. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ILocalPayroll.StaffUniqueId - { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; - return default(string); - } - set - { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + // ChartOfAccount + _chartOfAccountReferenceExplicitlyAssigned = false; + ImplicitChartOfAccountReference.FiscalYear = value; } } // ------------------------------------------------------------- @@ -106564,7 +104345,7 @@ string Entities.Common.EdFi.ILocalPayroll.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocalPayroll; + var compareTo = obj as Entities.Common.EdFi.ILocalAccount; if (ReferenceEquals(this, compareTo)) return true; @@ -106573,28 +104354,18 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalPayroll).AccountIdentifier, compareTo.AccountIdentifier)) - return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.ILocalPayroll).AsOfDate.Equals(compareTo.AsOfDate)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalPayroll).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalAccount).AccountIdentifier, compareTo.AccountIdentifier)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.ILocalPayroll).FiscalYear.Equals(compareTo.FiscalYear)) + if (!(this as Entities.Common.EdFi.ILocalAccount).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalPayroll).StaffUniqueId, compareTo.StaffUniqueId)) + if (!(this as Entities.Common.EdFi.ILocalAccount).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -106611,21 +104382,15 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalPayroll).AccountIdentifier); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocalPayroll).AsOfDate); - + hash.Add((this as Entities.Common.EdFi.ILocalAccount).AccountIdentifier); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalPayroll).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalPayroll).FiscalYear); + hash.Add((this as Entities.Common.EdFi.ILocalAccount).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocalPayroll).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.ILocalAccount).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -106638,41 +104403,75 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - private bool _amountExplicitlyAssigned = false; - private decimal _amount; /// - /// Current balance for the account. + /// A descriptive name for the account. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="amount")] - public decimal Amount - { - get => _amount; - set - { - _amount = value; - _amountExplicitlyAssigned = true; + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="accountName")] + public string AccountName { get; set; } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ILocalAccount.ChartOfAccountEducationOrganizationId + { + get + { + if (ImplicitChartOfAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitChartOfAccountReference.IsReferenceFullyDefined())) + { + return ImplicitChartOfAccountReference.EducationOrganizationId; + } + + return default(long); } - } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + // ChartOfAccount + _chartOfAccountReferenceExplicitlyAssigned = false; + ImplicitChartOfAccountReference.EducationOrganizationId = value; + } + } /// - /// The accounting period or grouping for which the amount is collected. + /// SEA populated code value for the valid combination of account dimensions under which financials are reported. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] - public string FinancialCollectionDescriptor { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalAccount.ChartOfAccountIdentifier + { + get + { + if (ImplicitChartOfAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitChartOfAccountReference.IsReferenceFullyDefined())) + { + return ImplicitChartOfAccountReference.AccountIdentifier; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ChartOfAccount + _chartOfAccountReferenceExplicitlyAssigned = false; + ImplicitChartOfAccountReference.AccountIdentifier = value; + } + } // ------------------------------------------------------------- IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() { - if (!_amountExplicitlyAssigned) + if (!_fiscalYearExplicitlyAssigned) { - yield return "Amount"; + yield return "FiscalYear"; } } @@ -106694,13 +104493,43 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalPayroll", "LocalPayroll")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalAccount", "LocalAccount")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _localAccountReportingTags; + private ICollection _localAccountReportingTagsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportingTags")] + public ICollection LocalAccountReportingTags + { + get { return _localAccountReportingTags; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ILocalAccountReportingTag)e.Item).LocalAccount = this); + _localAccountReportingTags = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILocalAccountReportingTag)e.Item).LocalAccount = this; + _localAccountReportingTagsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILocalAccount.LocalAccountReportingTags + { + get { return _localAccountReportingTagsCovariant; } + set { LocalAccountReportingTags = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -106718,50 +104547,61 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - // ------------------------------------------------------------ - // ============================================================ + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_localAccountReportingTags != null) foreach (var item in _localAccountReportingTags) + { + item.LocalAccount = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ // Data Synchronization // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocalPayrollMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalPayroll)target); + return Entities.Common.EdFi.LocalAccountMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalAccount)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocalPayrollMapper.MapTo(this, (Entities.Common.EdFi.ILocalPayroll)target, null); + Entities.Common.EdFi.LocalAccountMapper.MapTo(this, (Entities.Common.EdFi.ILocalAccount)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocalPayroll.LocalAccountResourceId + Guid? Entities.Common.EdFi.ILocalAccount.ChartOfAccountResourceId { get { return null; } - set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } + set { ImplicitChartOfAccountReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ILocalPayroll.LocalAccountDiscriminator + string Entities.Common.EdFi.ILocalAccount.ChartOfAccountDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitLocalAccountReference.Discriminator = value; } + set { ImplicitChartOfAccountReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.ILocalPayroll.StaffResourceId + Guid? Entities.Common.EdFi.ILocalAccount.EducationOrganizationResourceId { get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ILocalPayroll.StaffDiscriminator + string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitStaffReference.Discriminator = value; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } } @@ -106787,6 +104627,18 @@ string Entities.Common.EdFi.ILocalPayroll.StaffDiscriminator // ---------------------- // Validate collections // ---------------------- + if (LocalAccountReportingTags.Any() && mappingContract?.IsMemberSupported("LocalAccountReportingTags") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LocalAccountReportingTags"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LocalAccountReportingTags, validationContext, validationContext.Items.ForCollection("LocalAccountReportingTags")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -106806,6 +104658,40 @@ string Entities.Common.EdFi.ILocalPayroll.StaffDiscriminator yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForFiscalYear = GetFiscalYearSources().ToArray(); + + if (!sourcesForFiscalYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForFiscalYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForFiscalYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'fiscalYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForFiscalYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, int value)> GetFiscalYearSources() + { + // Obtain value from the locally defined property + yield return ("FiscalYear", this.FiscalYear); + + // Obtain value from other references + var valueFromChartOfAccountReference = this.ChartOfAccountReference?.FiscalYear; + + if (valueFromChartOfAccountReference != null) + { + yield return ("chartOfAccountReference.fiscalYear", this.ChartOfAccountReference.FiscalYear); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -106832,9 +104718,325 @@ string Entities.Common.EdFi.ILocalPayroll.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocalPayrollPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalAccountPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_LocalAccount = new FullName("edfi", "LocalAccount"); + + // Declare collection item validators + private LocalAccountReportingTagPutPostRequestValidator _localAccountReportingTagsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (LocalAccountMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_LocalAccount); + + if (mappingContract != null) + { + if (mappingContract.IsLocalAccountReportingTagIncluded != null) + { + var hasInvalidLocalAccountReportingTagsItems = instance.LocalAccountReportingTags.Any(x => !mappingContract.IsLocalAccountReportingTagIncluded(x)); + + if (hasInvalidLocalAccountReportingTagsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("LocalAccountReportingTags", $"A supplied 'LocalAccountReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.LocalAccountReportingTag table of the LocalAccount aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class LocalAccountReportingTag : Entities.Common.EdFi.ILocalAccountReportingTag, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "LocalAccountReportingTag"); + + // Fluent validator instance (threadsafe) + private static LocalAccountReportingTagPutPostRequestValidator _validator = new LocalAccountReportingTagPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ILocalAccount _localAccount; + + [IgnoreDataMember] + Entities.Common.EdFi.ILocalAccount ILocalAccountReportingTag.LocalAccount + { + get { return _localAccount; } + set { SetLocalAccount(value); } + } + + public Entities.Common.EdFi.ILocalAccount LocalAccount + { + set { SetLocalAccount(value); } + } + + private void SetLocalAccount(Entities.Common.EdFi.ILocalAccount value) + { + _localAccount = value; + } + + /// + /// A descriptor used at the dimension and/or chart of account levels to demote specific state needs for reporting. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ILocalAccountReportingTag; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_localAccount == null || !_localAccount.Equals(compareTo.LocalAccount)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ILocalAccountReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_localAccount != null) + hash.Add(_localAccount); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILocalAccountReportingTag).ReportingTagDescriptor); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The value associated with the reporting tag. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="tagValue")] + public string TagValue { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalAccount", "LocalAccountReportingTag")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.LocalAccountReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalAccountReportingTag)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.LocalAccountReportingTagMapper.MapTo(this, (Entities.Common.EdFi.ILocalAccountReportingTag)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class LocalAccountReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -106863,22 +105065,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Location resource. + /// Represents a reference to the LocalActual resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class LocationReference : IResourceReference + public class LocalActualReference : IResourceReference { - [DataMember(Name="classroomIdentificationCode")] - public string ClassroomIdentificationCode { get; set; } + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -106916,19 +105124,29 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return ClassroomIdentificationCode != default(string) && SchoolId != default(long); + return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (ClassroomIdentificationCode == default) + if (AccountIdentifier == default) { - yield return "ClassroomIdentificationCode"; + yield return "AccountIdentifier"; } - if (SchoolId == default) + if (AsOfDate == default) { - yield return "SchoolId"; + yield return "AsOfDate"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; } } @@ -106937,8 +105155,8 @@ private Link CreateLink() { var link = new Link { - Rel = "Location", - Href = $"/ed-fi/locations/{ResourceId:n}" + Rel = "LocalActual", + Href = $"/ed-fi/localActuals/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -106965,16 +105183,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.Location table of the Location aggregate in the ODS Database. + /// A class which represents the edfi.LocalActual table of the LocalActual aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Location : Entities.Common.EdFi.ILocation, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class LocalActual : Entities.Common.EdFi.ILocalActual, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Location"); + private static FullName _fullName = new FullName("edfi", "LocalActual"); // Fluent validator instance (threadsafe) - private static LocationPutPostRequestValidator _validator = new LocationPutPostRequestValidator(); + private static LocalActualPutPostRequestValidator _validator = new LocalActualPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -106993,7 +105212,7 @@ public class Location : Entities.Common.EdFi.ILocation, IHasETag, IDateVersioned // ------------------------------------------------------------ /// - /// The unique identifier for the Location resource. + /// The unique identifier for the LocalActual resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -107004,37 +105223,37 @@ public class Location : Entities.Common.EdFi.ILocation, IHasETag, IDateVersioned // References // ------------------------------------------------------------- - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference + private bool _localAccountReferenceExplicitlyAssigned; + private LocalAccount.EdFi.LocalAccountReference _localAccountReference; + private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); + if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) + _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); - return _schoolReference; + return _localAccountReference; } } - [DataMember(Name="schoolReference")] + [DataMember(Name="localAccountReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference + public LocalAccount.EdFi.LocalAccountReference LocalAccountReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; + if (ImplicitLocalAccountReference != null + && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference; return null; } set { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; + _localAccountReferenceExplicitlyAssigned = true; + _localAccountReference = value; } } // ------------------------------------------------------------- @@ -107044,25 +105263,49 @@ public School.EdFi.SchoolReference SchoolReference // ------------------------------------------------------------- /// - /// A unique number or alphanumeric code assigned to a room by a school, school system, state, or other agency or entity. + /// Code value for the valid combination of account dimensions by LEA under which financials are reported. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalActual.AccountIdentifier + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.AccountIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.AccountIdentifier = value; + } + } + + /// + /// The date of the reported amount for the account. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="classroomIdentificationCode")] - public string ClassroomIdentificationCode { get; set; } + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ILocation.SchoolId + long Entities.Common.EdFi.ILocalActual.EducationOrganizationId { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.EducationOrganizationId; return default(long); } @@ -107071,9 +105314,34 @@ long Entities.Common.EdFi.ILocation.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.EducationOrganizationId = value; + } + } + + /// + /// The fiscal year for the account. + /// + // IS in a reference, NOT a lookup column + int Entities.Common.EdFi.ILocalActual.FiscalYear + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.FiscalYear; + + return default(int); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.FiscalYear = value; } } // ------------------------------------------------------------- @@ -107090,7 +105358,7 @@ long Entities.Common.EdFi.ILocation.SchoolId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ILocation; + var compareTo = obj as Entities.Common.EdFi.ILocalActual; if (ReferenceEquals(this, compareTo)) return true; @@ -107099,13 +105367,23 @@ public override bool Equals(object obj) return false; + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalActual).AccountIdentifier, compareTo.AccountIdentifier)) + return false; + + // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocation).ClassroomIdentificationCode, compareTo.ClassroomIdentificationCode)) + if (!(this as Entities.Common.EdFi.ILocalActual).AsOfDate.Equals(compareTo.AsOfDate)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.ILocation).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.ILocalActual).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalActual).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -107122,12 +105400,18 @@ public override int GetHashCode() { var hash = new HashCode(); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalActual).AccountIdentifier); + // Standard Property - hash.Add((this as Entities.Common.EdFi.ILocation).ClassroomIdentificationCode); + hash.Add((this as Entities.Common.EdFi.ILocalActual).AsOfDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ILocation).SchoolId); + hash.Add((this as Entities.Common.EdFi.ILocalActual).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalActual).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -107140,22 +105424,44 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + private bool _amountExplicitlyAssigned = false; + private decimal _amount; /// - /// The most number of seats the class can maintain. + /// Current balance for the account. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="maximumNumberOfSeats")] - public int? MaximumNumberOfSeats { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="amount")] + public decimal Amount + { + get => _amount; + set + { + _amount = value; + _amountExplicitlyAssigned = true; + } + } + /// - /// The number of seats that is most favorable to the class. + /// The accounting period or grouping for which the amount is collected. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="optimalNumberOfSeats")] - public int? OptimalNumberOfSeats { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] + public string FinancialCollectionDescriptor { get; set; } // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_amountExplicitlyAssigned) + { + yield return "Amount"; + } + } + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -107174,7 +105480,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Location", "Location")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalActual", "LocalActual")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -107205,22 +105511,29 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.LocationMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocation)target); + return Entities.Common.EdFi.LocalActualMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalActual)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.LocationMapper.MapTo(this, (Entities.Common.EdFi.ILocation)target, null); + Entities.Common.EdFi.LocalActualMapper.MapTo(this, (Entities.Common.EdFi.ILocalActual)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ILocation.SchoolResourceId + Guid? Entities.Common.EdFi.ILocalActual.LocalAccountResourceId { get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ILocalActual.LocalAccountDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLocalAccountReference.Discriminator = value; } } @@ -107291,9 +105604,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class LocationPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalActualPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -107322,21 +105635,135 @@ protected override bool PreValidate(FluentValidation.ValidationContext // ----------------------------------------------------------------- } -// Aggregate: MagnetSpecialProgramEmphasisSchoolDescriptor +// Aggregate: LocalBudget -namespace EdFi.Ods.Api.Common.Models.Resources.MagnetSpecialProgramEmphasisSchoolDescriptor.EdFi +namespace EdFi.Ods.Api.Common.Models.Resources.LocalBudget.EdFi { /// - /// A class which represents the edfi.MagnetSpecialProgramEmphasisSchoolDescriptor table of the MagnetSpecialProgramEmphasisSchoolDescriptor aggregate in the ODS Database. + /// Represents a reference to the LocalBudget resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class LocalBudgetReference : IResourceReference + { + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } + + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AccountIdentifier == default) + { + yield return "AccountIdentifier"; + } + + if (AsOfDate == default) + { + yield return "AsOfDate"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "LocalBudget", + Href = $"/ed-fi/localBudgets/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.LocalBudget table of the LocalBudget aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class MagnetSpecialProgramEmphasisSchoolDescriptor : Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class LocalBudget : Entities.Common.EdFi.ILocalBudget, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "MagnetSpecialProgramEmphasisSchoolDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalBudget"); // Fluent validator instance (threadsafe) - private static MagnetSpecialProgramEmphasisSchoolDescriptorPutPostRequestValidator _validator = new MagnetSpecialProgramEmphasisSchoolDescriptorPutPostRequestValidator(); + private static LocalBudgetPutPostRequestValidator _validator = new LocalBudgetPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -107355,7 +105782,7 @@ public class MagnetSpecialProgramEmphasisSchoolDescriptor : Entities.Common.EdFi // ------------------------------------------------------------ /// - /// The unique identifier for the MagnetSpecialProgramEmphasisSchoolDescriptor resource. + /// The unique identifier for the LocalBudget resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -107365,6 +105792,40 @@ public class MagnetSpecialProgramEmphasisSchoolDescriptor : Entities.Common.EdFi // ============================================================= // References // ------------------------------------------------------------- + + private bool _localAccountReferenceExplicitlyAssigned; + private LocalAccount.EdFi.LocalAccountReference _localAccountReference; + private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) + _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); + + return _localAccountReference; + } + } + + [DataMember(Name="localAccountReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LocalAccount.EdFi.LocalAccountReference LocalAccountReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLocalAccountReference != null + && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference; + + return null; + } + set + { + _localAccountReferenceExplicitlyAssigned = true; + _localAccountReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -107372,16 +105833,86 @@ public class MagnetSpecialProgramEmphasisSchoolDescriptor : Entities.Common.EdFi // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Code value for the valid combination of account dimensions by LEA under which financials are reported. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalBudget.AccountIdentifier + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.AccountIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.AccountIdentifier = value; + } + } + + /// + /// The date of the reported amount for the account. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int MagnetSpecialProgramEmphasisSchoolDescriptorId { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } - int IDescriptor.DescriptorId + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ILocalBudget.EducationOrganizationId { - get { return MagnetSpecialProgramEmphasisSchoolDescriptorId; } - set { MagnetSpecialProgramEmphasisSchoolDescriptorId = value; } + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.EducationOrganizationId = value; + } + } + + /// + /// The fiscal year for the account. + /// + // IS in a reference, NOT a lookup column + int Entities.Common.EdFi.ILocalBudget.FiscalYear + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.FiscalYear; + + return default(int); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.FiscalYear = value; + } } // ------------------------------------------------------------- @@ -107397,7 +105928,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalBudget; if (ReferenceEquals(this, compareTo)) return true; @@ -107406,8 +105937,23 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor).MagnetSpecialProgramEmphasisSchoolDescriptorId.Equals(compareTo.MagnetSpecialProgramEmphasisSchoolDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalBudget).AccountIdentifier, compareTo.AccountIdentifier)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.ILocalBudget).AsOfDate.Equals(compareTo.AsOfDate)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalBudget).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalBudget).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -107424,9 +105970,18 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor).MagnetSpecialProgramEmphasisSchoolDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalBudget).AccountIdentifier); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILocalBudget).AsOfDate); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalBudget).EducationOrganizationId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalBudget).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -107434,61 +105989,48 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _amountExplicitlyAssigned = false; + private decimal _amount; /// - /// The end date of the period when the descriptor is in effect. + /// Current balance for the account. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="amount")] + public decimal Amount + { + get => _amount; + set + { + _amount = value; + _amountExplicitlyAssigned = true; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The accounting period or grouping for which the amount is collected. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] + public string FinancialCollectionDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_amountExplicitlyAssigned) + { + yield return "Amount"; + } + } // ============================================================= // One-to-one relationships @@ -107508,11 +106050,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalBudget", "LocalBudget")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -107542,38 +106081,111 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.MagnetSpecialProgramEmphasisSchoolDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor)target); + return Entities.Common.EdFi.LocalBudgetMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalBudget)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.MagnetSpecialProgramEmphasisSchoolDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor)target, null); + Entities.Common.EdFi.LocalBudgetMapper.MapTo(this, (Entities.Common.EdFi.ILocalBudget)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class MagnetSpecialProgramEmphasisSchoolDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + Guid? Entities.Common.EdFi.ILocalBudget.LocalAccountResourceId { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } + get { return null; } + set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } + } - var instance = context.InstanceToValidate; + string Entities.Common.EdFi.ILocalBudget.LocalAccountDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLocalAccountReference.Discriminator = value; } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class LocalBudgetPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; var failures = new List(); @@ -107593,21 +106205,152 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.MediumOfInstructionDescriptor table of the MediumOfInstructionDescriptor aggregate in the ODS Database. + /// Represents a reference to the LocalContractedStaff resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class LocalContractedStaffReference : IResourceReference + { + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } + + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + [DataMember(Name="staffUniqueId")] + public string StaffUniqueId + { + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + private string _staffUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int) && StaffUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AccountIdentifier == default) + { + yield return "AccountIdentifier"; + } + + if (AsOfDate == default) + { + yield return "AsOfDate"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + if (StaffUniqueId == default) + { + yield return "StaffUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "LocalContractedStaff", + Href = $"/ed-fi/localContractedStaffs/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.LocalContractedStaff table of the LocalContractedStaff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class MediumOfInstructionDescriptor : Entities.Common.EdFi.IMediumOfInstructionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class LocalContractedStaff : Entities.Common.EdFi.ILocalContractedStaff, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "MediumOfInstructionDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalContractedStaff"); // Fluent validator instance (threadsafe) - private static MediumOfInstructionDescriptorPutPostRequestValidator _validator = new MediumOfInstructionDescriptorPutPostRequestValidator(); + private static LocalContractedStaffPutPostRequestValidator _validator = new LocalContractedStaffPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -107626,7 +106369,7 @@ public class MediumOfInstructionDescriptor : Entities.Common.EdFi.IMediumOfInstr // ------------------------------------------------------------ /// - /// The unique identifier for the MediumOfInstructionDescriptor resource. + /// The unique identifier for the LocalContractedStaff resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -107636,6 +106379,73 @@ public class MediumOfInstructionDescriptor : Entities.Common.EdFi.IMediumOfInstr // ============================================================= // References // ------------------------------------------------------------- + + private bool _localAccountReferenceExplicitlyAssigned; + private LocalAccount.EdFi.LocalAccountReference _localAccountReference; + private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) + _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); + + return _localAccountReference; + } + } + + [DataMember(Name="localAccountReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LocalAccount.EdFi.LocalAccountReference LocalAccountReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLocalAccountReference != null + && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference; + + return null; + } + set + { + _localAccountReferenceExplicitlyAssigned = true; + _localAccountReference = value; + } + } + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); + + return _staffReference; + } + } + + [DataMember(Name="staffReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Staff.EdFi.StaffReference StaffReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; + + return null; + } + set + { + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -107643,16 +106453,112 @@ public class MediumOfInstructionDescriptor : Entities.Common.EdFi.IMediumOfInstr // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Code value for the valid combination of account dimensions by LEA under which financials are reported. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalContractedStaff.AccountIdentifier + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.AccountIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.AccountIdentifier = value; + } + } + + /// + /// The date of the reported amount for the account. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int MediumOfInstructionDescriptorId { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } - int IDescriptor.DescriptorId + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ILocalContractedStaff.EducationOrganizationId { - get { return MediumOfInstructionDescriptorId; } - set { MediumOfInstructionDescriptorId = value; } + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.EducationOrganizationId = value; + } + } + + /// + /// The fiscal year for the account. + /// + // IS in a reference, NOT a lookup column + int Entities.Common.EdFi.ILocalContractedStaff.FiscalYear + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.FiscalYear; + + return default(int); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.FiscalYear = value; + } + } + + /// + /// A unique alphanumeric code assigned to a staff. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalContractedStaff.StaffUniqueId + { + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } } // ------------------------------------------------------------- @@ -107668,7 +106574,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IMediumOfInstructionDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalContractedStaff; if (ReferenceEquals(this, compareTo)) return true; @@ -107677,8 +106583,28 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IMediumOfInstructionDescriptor).MediumOfInstructionDescriptorId.Equals(compareTo.MediumOfInstructionDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalContractedStaff).AccountIdentifier, compareTo.AccountIdentifier)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.ILocalContractedStaff).AsOfDate.Equals(compareTo.AsOfDate)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalContractedStaff).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalContractedStaff).FiscalYear.Equals(compareTo.FiscalYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalContractedStaff).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -107695,9 +106621,21 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IMediumOfInstructionDescriptor).MediumOfInstructionDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).AccountIdentifier); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).AsOfDate); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).FiscalYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalContractedStaff).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -107705,61 +106643,48 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _amountExplicitlyAssigned = false; + private decimal _amount; /// - /// The end date of the period when the descriptor is in effect. + /// Current balance for the account. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="amount")] + public decimal Amount + { + get => _amount; + set + { + _amount = value; + _amountExplicitlyAssigned = true; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The accounting period or grouping for which the amount is collected. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] + public string FinancialCollectionDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_amountExplicitlyAssigned) + { + yield return "Amount"; + } + } // ============================================================= // One-to-one relationships @@ -107779,11 +106704,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalContractedStaff", "LocalContractedStaff")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -107813,19 +106735,106 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.MediumOfInstructionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMediumOfInstructionDescriptor)target); + return Entities.Common.EdFi.LocalContractedStaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalContractedStaff)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.MediumOfInstructionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMediumOfInstructionDescriptor)target, null); + Entities.Common.EdFi.LocalContractedStaffMapper.MapTo(this, (Entities.Common.EdFi.ILocalContractedStaff)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ILocalContractedStaff.LocalAccountResourceId + { + get { return null; } + set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ILocalContractedStaff.LocalAccountDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLocalAccountReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ILocalContractedStaff.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ILocalContractedStaff.StaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -107833,9 +106842,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class MediumOfInstructionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalContractedStaffPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -107864,21 +106873,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.MethodCreditEarnedDescriptor table of the MethodCreditEarnedDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LocaleDescriptor table of the LocaleDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class MethodCreditEarnedDescriptor : Entities.Common.EdFi.IMethodCreditEarnedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LocaleDescriptor : Entities.Common.EdFi.ILocaleDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "MethodCreditEarnedDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocaleDescriptor"); // Fluent validator instance (threadsafe) - private static MethodCreditEarnedDescriptorPutPostRequestValidator _validator = new MethodCreditEarnedDescriptorPutPostRequestValidator(); + private static LocaleDescriptorPutPostRequestValidator _validator = new LocaleDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -107897,7 +106906,7 @@ public class MethodCreditEarnedDescriptor : Entities.Common.EdFi.IMethodCreditEa // ------------------------------------------------------------ /// - /// The unique identifier for the MethodCreditEarnedDescriptor resource. + /// The unique identifier for the LocaleDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -107918,12 +106927,12 @@ public class MethodCreditEarnedDescriptor : Entities.Common.EdFi.IMethodCreditEa /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int MethodCreditEarnedDescriptorId { get; set; } + public int LocaleDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return MethodCreditEarnedDescriptorId; } - set { MethodCreditEarnedDescriptorId = value; } + get { return LocaleDescriptorId; } + set { LocaleDescriptorId = value; } } // ------------------------------------------------------------- @@ -107939,7 +106948,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IMethodCreditEarnedDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocaleDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -107949,7 +106958,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IMethodCreditEarnedDescriptor).MethodCreditEarnedDescriptorId.Equals(compareTo.MethodCreditEarnedDescriptorId)) + if (!(this as Entities.Common.EdFi.ILocaleDescriptor).LocaleDescriptorId.Equals(compareTo.LocaleDescriptorId)) return false; @@ -107967,7 +106976,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IMethodCreditEarnedDescriptor).MethodCreditEarnedDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILocaleDescriptor).LocaleDescriptorId); return hash.ToHashCode(); } @@ -108084,12 +107093,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.MethodCreditEarnedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMethodCreditEarnedDescriptor)target); + return Entities.Common.EdFi.LocaleDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocaleDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.MethodCreditEarnedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMethodCreditEarnedDescriptor)target, null); + Entities.Common.EdFi.LocaleDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILocaleDescriptor)target, null); } // ------------------------------------------------------------- @@ -108104,9 +107113,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class MethodCreditEarnedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocaleDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -108135,21 +107144,85 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.MigrantEducationProgramServiceDescriptor table of the MigrantEducationProgramServiceDescriptor aggregate in the ODS Database. + /// Represents a reference to the LocalEducationAgency resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class LocalEducationAgencyReference : IResourceReference + { + [DataMember(Name="localEducationAgencyId")] + public long LocalEducationAgencyId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return LocalEducationAgencyId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (LocalEducationAgencyId == default) + { + yield return "LocalEducationAgencyId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "LocalEducationAgency", + Href = $"/ed-fi/localEducationAgencies/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.LocalEducationAgency table of the LocalEducationAgency aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class MigrantEducationProgramServiceDescriptor : Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LocalEducationAgency : Entities.Common.EdFi.ILocalEducationAgency, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "MigrantEducationProgramServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalEducationAgency"); // Fluent validator instance (threadsafe) - private static MigrantEducationProgramServiceDescriptorPutPostRequestValidator _validator = new MigrantEducationProgramServiceDescriptorPutPostRequestValidator(); + private static LocalEducationAgencyPutPostRequestValidator _validator = new LocalEducationAgencyPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -108160,6 +107233,19 @@ public class MigrantEducationProgramServiceDescriptor : Entities.Common.EdFi.IMi // Constructor // ------------------------------------------------------------- + public LocalEducationAgency() + { + LocalEducationAgencyAccountabilities = new List(); + LocalEducationAgencyFederalFunds = new List(); + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); + } // ------------------------------------------------------------ @@ -108168,7 +107254,7 @@ public class MigrantEducationProgramServiceDescriptor : Entities.Common.EdFi.IMi // ------------------------------------------------------------ /// - /// The unique identifier for the MigrantEducationProgramServiceDescriptor resource. + /// The unique identifier for the LocalEducationAgency resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -108178,6 +107264,106 @@ public class MigrantEducationProgramServiceDescriptor : Entities.Common.EdFi.IMi // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationServiceCenterReferenceExplicitlyAssigned; + private EducationServiceCenter.EdFi.EducationServiceCenterReference _educationServiceCenterReference; + private EducationServiceCenter.EdFi.EducationServiceCenterReference ImplicitEducationServiceCenterReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationServiceCenterReference == null && !_educationServiceCenterReferenceExplicitlyAssigned) + _educationServiceCenterReference = new EducationServiceCenter.EdFi.EducationServiceCenterReference(); + + return _educationServiceCenterReference; + } + } + + [DataMember(Name="educationServiceCenterReference")] + [FullyDefinedReference] + public EducationServiceCenter.EdFi.EducationServiceCenterReference EducationServiceCenterReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationServiceCenterReference != null + && (_educationServiceCenterReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationServiceCenterReference.IsReferenceFullyDefined())) + return ImplicitEducationServiceCenterReference; + + return null; + } + set + { + _educationServiceCenterReferenceExplicitlyAssigned = true; + _educationServiceCenterReference = value; + } + } + private bool _parentLocalEducationAgencyReferenceExplicitlyAssigned; + private LocalEducationAgencyReference _parentLocalEducationAgencyReference; + private LocalEducationAgencyReference ImplicitParentLocalEducationAgencyReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_parentLocalEducationAgencyReference == null && !_parentLocalEducationAgencyReferenceExplicitlyAssigned) + _parentLocalEducationAgencyReference = new LocalEducationAgencyReference(); + + return _parentLocalEducationAgencyReference; + } + } + + [DataMember(Name="parentLocalEducationAgencyReference")] + [FullyDefinedReference] + public LocalEducationAgencyReference ParentLocalEducationAgencyReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitParentLocalEducationAgencyReference != null + && (_parentLocalEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentLocalEducationAgencyReference.IsReferenceFullyDefined())) + return ImplicitParentLocalEducationAgencyReference; + + return null; + } + set + { + _parentLocalEducationAgencyReferenceExplicitlyAssigned = true; + _parentLocalEducationAgencyReference = value; + } + } + private bool _stateEducationAgencyReferenceExplicitlyAssigned; + private StateEducationAgency.EdFi.StateEducationAgencyReference _stateEducationAgencyReference; + private StateEducationAgency.EdFi.StateEducationAgencyReference ImplicitStateEducationAgencyReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_stateEducationAgencyReference == null && !_stateEducationAgencyReferenceExplicitlyAssigned) + _stateEducationAgencyReference = new StateEducationAgency.EdFi.StateEducationAgencyReference(); + + return _stateEducationAgencyReference; + } + } + + [DataMember(Name="stateEducationAgencyReference")] + [FullyDefinedReference] + public StateEducationAgency.EdFi.StateEducationAgencyReference StateEducationAgencyReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStateEducationAgencyReference != null + && (_stateEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) + return ImplicitStateEducationAgencyReference; + + return null; + } + set + { + _stateEducationAgencyReferenceExplicitlyAssigned = true; + _stateEducationAgencyReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -108185,16 +107371,17 @@ public class MigrantEducationProgramServiceDescriptor : Entities.Common.EdFi.IMi // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier assigned to a local education agency. It must be distinct from any other identifier assigned to educational organizations, such as a SchoolId, to prevent duplication. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int MigrantEducationProgramServiceDescriptorId { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="localEducationAgencyId")] + public long LocalEducationAgencyId { get; set; } - int IDescriptor.DescriptorId + long IEducationOrganization.EducationOrganizationId { - get { return MigrantEducationProgramServiceDescriptorId; } - set { MigrantEducationProgramServiceDescriptorId = value; } + get { return LocalEducationAgencyId; } + set { LocalEducationAgencyId = value; } } // ------------------------------------------------------------- @@ -108210,7 +107397,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgency; if (ReferenceEquals(this, compareTo)) return true; @@ -108220,7 +107407,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor).MigrantEducationProgramServiceDescriptorId.Equals(compareTo.MigrantEducationProgramServiceDescriptorId)) + if (!(this as Entities.Common.EdFi.ILocalEducationAgency).LocalEducationAgencyId.Equals(compareTo.LocalEducationAgencyId)) return false; @@ -108238,7 +107425,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor).MigrantEducationProgramServiceDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILocalEducationAgency).LocalEducationAgencyId); return hash.ToHashCode(); } @@ -108249,58 +107436,140 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The full, legally accepted name of the institution. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } /// - /// The description of the descriptor. + /// The current operational status of the education organization (e.g., active, inactive). /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// A short name for the institution. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The public web site address (URL) for the education organization. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// A school or agency providing free public elementary or secondary education to eligible students under a specific charter granted by the state legislature or other appropriate authority and designated by such authority to be a charter school. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="charterStatusDescriptor")][DescriptorExists("CharterStatusDescriptor")] + public string CharterStatusDescriptor { get; set; } /// - /// A shortened description for the descriptor. + /// The identifier assigned to an education service center. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, NOT a lookup column + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ILocalEducationAgency.EducationServiceCenterId + { + get + { + if (ImplicitEducationServiceCenterReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationServiceCenterReference.IsReferenceFullyDefined())) + { + return ImplicitEducationServiceCenterReference.EducationServiceCenterId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationServiceCenter + _educationServiceCenterReferenceExplicitlyAssigned = false; + ImplicitEducationServiceCenterReference.EducationServiceCenterId = value.GetValueOrDefault(); + } + } + + /// + /// The category of local education agency/district. + /// + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="localEducationAgencyCategoryDescriptor")][DescriptorExists("LocalEducationAgencyCategoryDescriptor")] + public string LocalEducationAgencyCategoryDescriptor { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// The identifier assigned to a local education agency. It must be distinct from any other identifier assigned to educational organizations, such as a SchoolId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ILocalEducationAgency.ParentLocalEducationAgencyId + { + get + { + if (ImplicitParentLocalEducationAgencyReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitParentLocalEducationAgencyReference.IsReferenceFullyDefined())) + { + return ImplicitParentLocalEducationAgencyReference.LocalEducationAgencyId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ParentLocalEducationAgency + _parentLocalEducationAgencyReferenceExplicitlyAssigned = false; + ImplicitParentLocalEducationAgencyReference.LocalEducationAgencyId = value.GetValueOrDefault(); + } + } + + /// + /// The identifier assigned to a state education agency. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ILocalEducationAgency.StateEducationAgencyId + { + get + { + if (ImplicitStateEducationAgencyReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStateEducationAgencyReference.IsReferenceFullyDefined())) + { + return ImplicitStateEducationAgencyReference.StateEducationAgencyId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StateEducationAgency + _stateEducationAgencyReferenceExplicitlyAssigned = false; + ImplicitStateEducationAgencyReference.StateEducationAgencyId = value.GetValueOrDefault(); + } + } // ------------------------------------------------------------- // ============================================================= @@ -108316,21 +107585,204 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses + { + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories + { + get { return _educationOrganizationCategories; } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators + { + get { return _educationOrganizationIndicators; } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + } + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEducationAgency", "LocalEducationAgency")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _localEducationAgencyAccountabilities; + private ICollection _localEducationAgencyAccountabilitiesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="accountabilities")] + public ICollection LocalEducationAgencyAccountabilities + { + get { return _localEducationAgencyAccountabilities; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyAccountability)e.Item).LocalEducationAgency = this); + _localEducationAgencyAccountabilities = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyAccountability)e.Item).LocalEducationAgency = this; + _localEducationAgencyAccountabilitiesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyAccountabilities + { + get { return _localEducationAgencyAccountabilitiesCovariant; } + set { LocalEducationAgencyAccountabilities = new List(value.Cast()); } + } + + private ICollection _localEducationAgencyFederalFunds; + private ICollection _localEducationAgencyFederalFundsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="federalFunds")] + public ICollection LocalEducationAgencyFederalFunds + { + get { return _localEducationAgencyFederalFunds; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)e.Item).LocalEducationAgency = this); + _localEducationAgencyFederalFunds = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)e.Item).LocalEducationAgency = this; + _localEducationAgencyFederalFundsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ILocalEducationAgency.LocalEducationAgencyFederalFunds + { + get { return _localEducationAgencyFederalFundsCovariant; } + set { LocalEducationAgencyFederalFunds = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -108348,6 +107800,52 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; + } + + if (_localEducationAgencyAccountabilities != null) foreach (var item in _localEducationAgencyAccountabilities) + { + item.LocalEducationAgency = this; + } + + if (_localEducationAgencyFederalFunds != null) foreach (var item in _localEducationAgencyFederalFunds) + { + item.LocalEducationAgency = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -108355,19 +107853,195 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.MigrantEducationProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor)target); + return Entities.Common.EdFi.LocalEducationAgencyMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgency)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.MigrantEducationProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor)target, null); + Entities.Common.EdFi.LocalEducationAgencyMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgency)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ILocalEducationAgency.EducationServiceCenterResourceId + { + get { return null; } + set { ImplicitEducationServiceCenterReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.ILocalEducationAgency.ParentLocalEducationAgencyResourceId + { + get { return null; } + set { ImplicitParentLocalEducationAgencyReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.ILocalEducationAgency.StateEducationAgencyResourceId + { + get { return null; } + set { ImplicitStateEducationAgencyReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + { + yield return result; + } + } + + if (LocalEducationAgencyAccountabilities.Any() && mappingContract?.IsMemberSupported("LocalEducationAgencyAccountabilities") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LocalEducationAgencyAccountabilities"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LocalEducationAgencyAccountabilities, validationContext, validationContext.Items.ForCollection("LocalEducationAgencyAccountabilities")))) + { + yield return result; + } + } + + if (LocalEducationAgencyFederalFunds.Any() && mappingContract?.IsMemberSupported("LocalEducationAgencyFederalFunds") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("LocalEducationAgencyFederalFunds"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(LocalEducationAgencyFederalFunds, validationContext, validationContext.Items.ForCollection("LocalEducationAgencyFederalFunds")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -108375,9 +108049,21 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class MigrantEducationProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalEducationAgencyPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_LocalEducationAgency = new FullName("edfi", "LocalEducationAgency"); + + // Declare collection item validators + private LocalEducationAgencyAccountabilityPutPostRequestValidator _localEducationAgencyAccountabilitiesValidator = new (); + private LocalEducationAgencyFederalFundsPutPostRequestValidator _localEducationAgencyFederalFundsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -108390,6 +108076,105 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (LocalEducationAgencyMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_LocalEducationAgency); + + if (mappingContract != null) + { + if (mappingContract.IsLocalEducationAgencyAccountabilityIncluded != null) + { + var hasInvalidLocalEducationAgencyAccountabilitiesItems = instance.LocalEducationAgencyAccountabilities.Any(x => !mappingContract.IsLocalEducationAgencyAccountabilityIncluded(x)); + + if (hasInvalidLocalEducationAgencyAccountabilitiesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("LocalEducationAgencyAccountabilities", $"A supplied 'LocalEducationAgencyAccountability' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsLocalEducationAgencyFederalFundsIncluded != null) + { + var hasInvalidLocalEducationAgencyFederalFundsItems = instance.LocalEducationAgencyFederalFunds.Any(x => !mappingContract.IsLocalEducationAgencyFederalFundsIncluded(x)); + + if (hasInvalidLocalEducationAgencyFederalFundsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("LocalEducationAgencyFederalFunds", $"A supplied 'LocalEducationAgencyFederalFunds' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationAddressIncluded != null) + { + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); + + if (hasInvalidEducationOrganizationAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -108405,22 +108190,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ModelEntityDescriptor table of the ModelEntityDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LocalEducationAgencyAccountability table of the LocalEducationAgency aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ModelEntityDescriptor : Entities.Common.EdFi.IModelEntityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LocalEducationAgencyAccountability : Entities.Common.EdFi.ILocalEducationAgencyAccountability, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ModelEntityDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalEducationAgencyAccountability"); // Fluent validator instance (threadsafe) - private static ModelEntityDescriptorPutPostRequestValidator _validator = new ModelEntityDescriptorPutPostRequestValidator(); + private static LocalEducationAgencyAccountabilityPutPostRequestValidator _validator = new LocalEducationAgencyAccountabilityPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -108437,35 +108217,92 @@ public class ModelEntityDescriptor : Entities.Common.EdFi.IModelEntityDescriptor // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ModelEntityDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _schoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) + _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + + return _schoolYearTypeReference; + } + } + + [DataMember(Name="schoolYearTypeReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolYearTypeReference != null + && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference; + + return null; + } + set + { + _schoolYearTypeReferenceExplicitlyAssigned = true; + _schoolYearTypeReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ILocalEducationAgency _localEducationAgency; + + [IgnoreDataMember] + Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyAccountability.LocalEducationAgency + { + get { return _localEducationAgency; } + set { SetLocalEducationAgency(value); } + } + + public Entities.Common.EdFi.ILocalEducationAgency LocalEducationAgency + { + set { SetLocalEducationAgency(value); } + } + + private void SetLocalEducationAgency(Entities.Common.EdFi.ILocalEducationAgency value) + { + _localEducationAgency = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The school year for which the accountability is reported. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ModelEntityDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.ILocalEducationAgencyAccountability.SchoolYear { - get { return ModelEntityDescriptorId; } - set { ModelEntityDescriptorId = value; } + get + { + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value; + } } // ------------------------------------------------------------- @@ -108481,7 +108318,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IModelEntityDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgencyAccountability; if (ReferenceEquals(this, compareTo)) return true; @@ -108489,9 +108326,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_localEducationAgency == null || !_localEducationAgency.Equals(compareTo.LocalEducationAgency)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IModelEntityDescriptor).ModelEntityDescriptorId.Equals(compareTo.ModelEntityDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalEducationAgencyAccountability).SchoolYear.Equals(compareTo.SchoolYear)) return false; @@ -108507,10 +108348,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_localEducationAgency != null) + hash.Add(_localEducationAgency); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IModelEntityDescriptor).ModelEntityDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalEducationAgencyAccountability).SchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -108518,60 +108361,27 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// An indication of whether the school or Local Education Agency (LEA) submitted a Gun-Free Schools Act (GFSA) of 1994 report to the state, as defined by Title 18, Section 921. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="gunFreeSchoolsActReportingStatusDescriptor")][DescriptorExists("GunFreeSchoolsActReportingStatusDescriptor")] + public string GunFreeSchoolsActReportingStatusDescriptor { get; set; } /// - /// A shortened description for the descriptor. + /// An indication of whether the LEA was able to implement the provisions for public school choice under Title I, Part A, Section 1116 of ESEA as amended. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="schoolChoiceImplementStatusDescriptor")][DescriptorExists("SchoolChoiceImplementStatusDescriptor")] + public string SchoolChoiceImplementStatusDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -108592,11 +108402,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEducationAgency", "LocalEducationAgencyAccountability")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -108607,13 +108414,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -108626,19 +108426,86 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ModelEntityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IModelEntityDescriptor)target); + return Entities.Common.EdFi.LocalEducationAgencyAccountabilityMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgencyAccountability)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ModelEntityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IModelEntityDescriptor)target, null); + Entities.Common.EdFi.LocalEducationAgencyAccountabilityMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgencyAccountability)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ILocalEducationAgencyAccountability.SchoolYearTypeResourceId + { + get { return null; } + set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -108646,9 +108513,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ModelEntityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalEducationAgencyAccountabilityPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -108676,22 +108543,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.MonitoredDescriptor table of the MonitoredDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LocalEducationAgencyFederalFunds table of the LocalEducationAgency aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class MonitoredDescriptor : Entities.Common.EdFi.IMonitoredDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LocalEducationAgencyFederalFunds : Entities.Common.EdFi.ILocalEducationAgencyFederalFunds, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "MonitoredDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalEducationAgencyFederalFunds"); // Fluent validator instance (threadsafe) - private static MonitoredDescriptorPutPostRequestValidator _validator = new MonitoredDescriptorPutPostRequestValidator(); + private static LocalEducationAgencyFederalFundsPutPostRequestValidator _validator = new LocalEducationAgencyFederalFundsPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -108708,13 +108570,6 @@ public class MonitoredDescriptor : Entities.Common.EdFi.IMonitoredDescriptor, En // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the MonitoredDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -108725,19 +108580,32 @@ public class MonitoredDescriptor : Entities.Common.EdFi.IMonitoredDescriptor, En //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ILocalEducationAgency _localEducationAgency; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int MonitoredDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.LocalEducationAgency + { + get { return _localEducationAgency; } + set { SetLocalEducationAgency(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ILocalEducationAgency LocalEducationAgency { - get { return MonitoredDescriptorId; } - set { MonitoredDescriptorId = value; } + set { SetLocalEducationAgency(value); } + } + + private void SetLocalEducationAgency(Entities.Common.EdFi.ILocalEducationAgency value) + { + _localEducationAgency = value; } + + /// + /// The fiscal year for which the federal funds are received. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -108752,7 +108620,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IMonitoredDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgencyFederalFunds; if (ReferenceEquals(this, compareTo)) return true; @@ -108760,9 +108628,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_localEducationAgency == null || !_localEducationAgency.Equals(compareTo.LocalEducationAgency)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IMonitoredDescriptor).MonitoredDescriptorId.Equals(compareTo.MonitoredDescriptorId)) + // Standard Property + if (!(this as Entities.Common.EdFi.ILocalEducationAgencyFederalFunds).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -108778,9 +108650,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_localEducationAgency != null) + hash.Add(_localEducationAgency); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IMonitoredDescriptor).MonitoredDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILocalEducationAgencyFederalFunds).FiscalYear); return hash.ToHashCode(); } @@ -108789,60 +108664,75 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The total Title V, Part A funds expended by LEAs. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="innovativeDollarsSpent")] + public decimal? InnovativeDollarsSpent { get; set; } /// - /// The description of the descriptor. + /// The total amount of Title V, Part A funds expended by LEAs for the four strategic priorities. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="innovativeDollarsSpentStrategicPriorities")] + public decimal? InnovativeDollarsSpentStrategicPriorities { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The total Title V, Part A funds received by LEAs. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="innovativeProgramsFundsReceived")] + public decimal? InnovativeProgramsFundsReceived { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The amount of Section 1003(a) and 1003(g) allocations to LEAs. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="schoolImprovementAllocation")] + public decimal? SchoolImprovementAllocation { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// An indication of the percentage of the Title I, Part A allocation that the SEA reserved in accordance with Section 1003(a) of ESEA and 200.100(a) of ED's regulations governing the reservation of funds for school improvement under Section 1003(a) of ESEA. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="schoolImprovementReservedFundsPercentage")] + public decimal? SchoolImprovementReservedFundsPercentage { get; set; } /// - /// A shortened description for the descriptor. + /// The percentage of funds used to administer assessments required by Section 1111(b) or to carry out other activities described in Section 6111 and other activities related to ensuring that the state's schools and LEAs are held accountable for results. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="stateAssessmentAdministrationFunding")] + public decimal? StateAssessmentAdministrationFunding { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// The dollar amount spent on supplemental educational services during the school year under Title I, Part A, Section 1116 of ESEA as amended. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="supplementalEducationalServicesFundsSpent")] + public decimal? SupplementalEducationalServicesFundsSpent { get; set; } + + /// + /// The maximum dollar amount that may be spent per child for expenditures related to supplemental educational services under Title I of the ESEA. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="supplementalEducationalServicesPerPupilExpenditure")] + public decimal? SupplementalEducationalServicesPerPupilExpenditure { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -108863,11 +108753,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEducationAgency", "LocalEducationAgencyFederalFunds")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -108878,13 +108765,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -108897,12 +108777,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.MonitoredDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMonitoredDescriptor)target); + return Entities.Common.EdFi.LocalEducationAgencyFederalFundsMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.MonitoredDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMonitoredDescriptor)target, null); + Entities.Common.EdFi.LocalEducationAgencyFederalFundsMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgencyFederalFunds)target, null); } // ------------------------------------------------------------- @@ -108910,6 +108790,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -108917,9 +108857,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class MonitoredDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalEducationAgencyFederalFundsPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -108948,21 +108888,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.NeglectedOrDelinquentProgramDescriptor table of the NeglectedOrDelinquentProgramDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.LocalEducationAgencyCategoryDescriptor table of the LocalEducationAgencyCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class NeglectedOrDelinquentProgramDescriptor : Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LocalEducationAgencyCategoryDescriptor : Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "NeglectedOrDelinquentProgramDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalEducationAgencyCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static NeglectedOrDelinquentProgramDescriptorPutPostRequestValidator _validator = new NeglectedOrDelinquentProgramDescriptorPutPostRequestValidator(); + private static LocalEducationAgencyCategoryDescriptorPutPostRequestValidator _validator = new LocalEducationAgencyCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -108981,7 +108921,7 @@ public class NeglectedOrDelinquentProgramDescriptor : Entities.Common.EdFi.INegl // ------------------------------------------------------------ /// - /// The unique identifier for the NeglectedOrDelinquentProgramDescriptor resource. + /// The unique identifier for the LocalEducationAgencyCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -109002,12 +108942,12 @@ public class NeglectedOrDelinquentProgramDescriptor : Entities.Common.EdFi.INegl /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int NeglectedOrDelinquentProgramDescriptorId { get; set; } + public int LocalEducationAgencyCategoryDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return NeglectedOrDelinquentProgramDescriptorId; } - set { NeglectedOrDelinquentProgramDescriptorId = value; } + get { return LocalEducationAgencyCategoryDescriptorId; } + set { LocalEducationAgencyCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -109023,7 +108963,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -109033,7 +108973,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor).NeglectedOrDelinquentProgramDescriptorId.Equals(compareTo.NeglectedOrDelinquentProgramDescriptorId)) + if (!(this as Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor).LocalEducationAgencyCategoryDescriptorId.Equals(compareTo.LocalEducationAgencyCategoryDescriptorId)) return false; @@ -109051,7 +108991,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor).NeglectedOrDelinquentProgramDescriptorId); + hash.Add((this as Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor).LocalEducationAgencyCategoryDescriptorId); return hash.ToHashCode(); } @@ -109168,12 +109108,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.NeglectedOrDelinquentProgramDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor)target); + return Entities.Common.EdFi.LocalEducationAgencyCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.NeglectedOrDelinquentProgramDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor)target, null); + Entities.Common.EdFi.LocalEducationAgencyCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor)target, null); } // ------------------------------------------------------------- @@ -109188,9 +109128,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class NeglectedOrDelinquentProgramDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalEducationAgencyCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -109219,21 +109159,135 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.NeglectedOrDelinquentProgramServiceDescriptor table of the NeglectedOrDelinquentProgramServiceDescriptor aggregate in the ODS Database. + /// Represents a reference to the LocalEncumbrance resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class LocalEncumbranceReference : IResourceReference + { + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } + + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AccountIdentifier == default) + { + yield return "AccountIdentifier"; + } + + if (AsOfDate == default) + { + yield return "AsOfDate"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "LocalEncumbrance", + Href = $"/ed-fi/localEncumbrances/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.LocalEncumbrance table of the LocalEncumbrance aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class NeglectedOrDelinquentProgramServiceDescriptor : Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class LocalEncumbrance : Entities.Common.EdFi.ILocalEncumbrance, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "NeglectedOrDelinquentProgramServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalEncumbrance"); // Fluent validator instance (threadsafe) - private static NeglectedOrDelinquentProgramServiceDescriptorPutPostRequestValidator _validator = new NeglectedOrDelinquentProgramServiceDescriptorPutPostRequestValidator(); + private static LocalEncumbrancePutPostRequestValidator _validator = new LocalEncumbrancePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -109252,7 +109306,7 @@ public class NeglectedOrDelinquentProgramServiceDescriptor : Entities.Common.EdF // ------------------------------------------------------------ /// - /// The unique identifier for the NeglectedOrDelinquentProgramServiceDescriptor resource. + /// The unique identifier for the LocalEncumbrance resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -109262,6 +109316,40 @@ public class NeglectedOrDelinquentProgramServiceDescriptor : Entities.Common.EdF // ============================================================= // References // ------------------------------------------------------------- + + private bool _localAccountReferenceExplicitlyAssigned; + private LocalAccount.EdFi.LocalAccountReference _localAccountReference; + private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) + _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); + + return _localAccountReference; + } + } + + [DataMember(Name="localAccountReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LocalAccount.EdFi.LocalAccountReference LocalAccountReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLocalAccountReference != null + && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference; + + return null; + } + set + { + _localAccountReferenceExplicitlyAssigned = true; + _localAccountReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -109269,16 +109357,86 @@ public class NeglectedOrDelinquentProgramServiceDescriptor : Entities.Common.EdF // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Code value for the valid combination of account dimensions by LEA under which financials are reported. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalEncumbrance.AccountIdentifier + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.AccountIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.AccountIdentifier = value; + } + } + + /// + /// The date of the reported amount for the account. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int NeglectedOrDelinquentProgramServiceDescriptorId { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } - int IDescriptor.DescriptorId + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ILocalEncumbrance.EducationOrganizationId { - get { return NeglectedOrDelinquentProgramServiceDescriptorId; } - set { NeglectedOrDelinquentProgramServiceDescriptorId = value; } + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.EducationOrganizationId = value; + } + } + + /// + /// The fiscal year for the account. + /// + // IS in a reference, NOT a lookup column + int Entities.Common.EdFi.ILocalEncumbrance.FiscalYear + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.FiscalYear; + + return default(int); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.FiscalYear = value; + } } // ------------------------------------------------------------- @@ -109294,7 +109452,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalEncumbrance; if (ReferenceEquals(this, compareTo)) return true; @@ -109303,8 +109461,23 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor).NeglectedOrDelinquentProgramServiceDescriptorId.Equals(compareTo.NeglectedOrDelinquentProgramServiceDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalEncumbrance).AccountIdentifier, compareTo.AccountIdentifier)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.ILocalEncumbrance).AsOfDate.Equals(compareTo.AsOfDate)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalEncumbrance).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalEncumbrance).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -109321,9 +109494,18 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor).NeglectedOrDelinquentProgramServiceDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).AccountIdentifier); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).AsOfDate); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).EducationOrganizationId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalEncumbrance).FiscalYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -109331,61 +109513,48 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _amountExplicitlyAssigned = false; + private decimal _amount; /// - /// The end date of the period when the descriptor is in effect. + /// Current balance for the account. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="amount")] + public decimal Amount + { + get => _amount; + set + { + _amount = value; + _amountExplicitlyAssigned = true; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The accounting period or grouping for which the amount is collected. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] + public string FinancialCollectionDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_amountExplicitlyAssigned) + { + yield return "Amount"; + } + } // ============================================================= // One-to-one relationships @@ -109405,11 +109574,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalEncumbrance", "LocalEncumbrance")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -109439,19 +109605,92 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.NeglectedOrDelinquentProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor)target); + return Entities.Common.EdFi.LocalEncumbranceMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalEncumbrance)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.NeglectedOrDelinquentProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor)target, null); + Entities.Common.EdFi.LocalEncumbranceMapper.MapTo(this, (Entities.Common.EdFi.ILocalEncumbrance)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ILocalEncumbrance.LocalAccountResourceId + { + get { return null; } + set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ILocalEncumbrance.LocalAccountDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLocalAccountReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -109459,9 +109698,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class NeglectedOrDelinquentProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalEncumbrancePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -109490,21 +109729,152 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.NetworkPurposeDescriptor table of the NetworkPurposeDescriptor aggregate in the ODS Database. + /// Represents a reference to the LocalPayroll resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class LocalPayrollReference : IResourceReference + { + [DataMember(Name="accountIdentifier")] + public string AccountIdentifier { get; set; } + + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + [DataMember(Name="staffUniqueId")] + public string StaffUniqueId + { + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + private string _staffUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AccountIdentifier != default(string) && AsOfDate != default(DateTime) && EducationOrganizationId != default(long) && FiscalYear != default(int) && StaffUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AccountIdentifier == default) + { + yield return "AccountIdentifier"; + } + + if (AsOfDate == default) + { + yield return "AsOfDate"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + if (StaffUniqueId == default) + { + yield return "StaffUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "LocalPayroll", + Href = $"/ed-fi/localPayrolls/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.LocalPayroll table of the LocalPayroll aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class NetworkPurposeDescriptor : Entities.Common.EdFi.INetworkPurposeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class LocalPayroll : Entities.Common.EdFi.ILocalPayroll, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "NetworkPurposeDescriptor"); + private static FullName _fullName = new FullName("edfi", "LocalPayroll"); // Fluent validator instance (threadsafe) - private static NetworkPurposeDescriptorPutPostRequestValidator _validator = new NetworkPurposeDescriptorPutPostRequestValidator(); + private static LocalPayrollPutPostRequestValidator _validator = new LocalPayrollPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -109523,7 +109893,7 @@ public class NetworkPurposeDescriptor : Entities.Common.EdFi.INetworkPurposeDesc // ------------------------------------------------------------ /// - /// The unique identifier for the NetworkPurposeDescriptor resource. + /// The unique identifier for the LocalPayroll resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -109533,6 +109903,73 @@ public class NetworkPurposeDescriptor : Entities.Common.EdFi.INetworkPurposeDesc // ============================================================= // References // ------------------------------------------------------------- + + private bool _localAccountReferenceExplicitlyAssigned; + private LocalAccount.EdFi.LocalAccountReference _localAccountReference; + private LocalAccount.EdFi.LocalAccountReference ImplicitLocalAccountReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_localAccountReference == null && !_localAccountReferenceExplicitlyAssigned) + _localAccountReference = new LocalAccount.EdFi.LocalAccountReference(); + + return _localAccountReference; + } + } + + [DataMember(Name="localAccountReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LocalAccount.EdFi.LocalAccountReference LocalAccountReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLocalAccountReference != null + && (_localAccountReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference; + + return null; + } + set + { + _localAccountReferenceExplicitlyAssigned = true; + _localAccountReference = value; + } + } + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); + + return _staffReference; + } + } + + [DataMember(Name="staffReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Staff.EdFi.StaffReference StaffReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; + + return null; + } + set + { + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -109540,16 +109977,112 @@ public class NetworkPurposeDescriptor : Entities.Common.EdFi.INetworkPurposeDesc // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Code value for the valid combination of account dimensions by LEA under which financials are reported. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalPayroll.AccountIdentifier + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.AccountIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.AccountIdentifier = value; + } + } + + /// + /// The date of the reported amount for the account. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int NetworkPurposeDescriptorId { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="asOfDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime AsOfDate { get; set; } - int IDescriptor.DescriptorId + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ILocalPayroll.EducationOrganizationId { - get { return NetworkPurposeDescriptorId; } - set { NetworkPurposeDescriptorId = value; } + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.EducationOrganizationId = value; + } + } + + /// + /// The fiscal year for the account. + /// + // IS in a reference, NOT a lookup column + int Entities.Common.EdFi.ILocalPayroll.FiscalYear + { + get + { + if (ImplicitLocalAccountReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalAccountReference.IsReferenceFullyDefined())) + return ImplicitLocalAccountReference.FiscalYear; + + return default(int); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalAccount + _localAccountReferenceExplicitlyAssigned = false; + ImplicitLocalAccountReference.FiscalYear = value; + } + } + + /// + /// A unique alphanumeric code assigned to a staff. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ILocalPayroll.StaffUniqueId + { + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } } // ------------------------------------------------------------- @@ -109565,7 +110098,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.INetworkPurposeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ILocalPayroll; if (ReferenceEquals(this, compareTo)) return true; @@ -109574,8 +110107,28 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.INetworkPurposeDescriptor).NetworkPurposeDescriptorId.Equals(compareTo.NetworkPurposeDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalPayroll).AccountIdentifier, compareTo.AccountIdentifier)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.ILocalPayroll).AsOfDate.Equals(compareTo.AsOfDate)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalPayroll).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocalPayroll).FiscalYear.Equals(compareTo.FiscalYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocalPayroll).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -109592,9 +110145,21 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.INetworkPurposeDescriptor).NetworkPurposeDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalPayroll).AccountIdentifier); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ILocalPayroll).AsOfDate); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalPayroll).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalPayroll).FiscalYear); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocalPayroll).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -109602,61 +110167,48 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _amountExplicitlyAssigned = false; + private decimal _amount; /// - /// The end date of the period when the descriptor is in effect. + /// Current balance for the account. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="amount")] + public decimal Amount + { + get => _amount; + set + { + _amount = value; + _amountExplicitlyAssigned = true; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The accounting period or grouping for which the amount is collected. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="financialCollectionDescriptor")][DescriptorExists("FinancialCollectionDescriptor")] + public string FinancialCollectionDescriptor { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_amountExplicitlyAssigned) + { + yield return "Amount"; + } + } // ============================================================= // One-to-one relationships @@ -109676,11 +110228,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "LocalPayroll", "LocalPayroll")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -109710,19 +110259,106 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.NetworkPurposeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INetworkPurposeDescriptor)target); + return Entities.Common.EdFi.LocalPayrollMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocalPayroll)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.NetworkPurposeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INetworkPurposeDescriptor)target, null); + Entities.Common.EdFi.LocalPayrollMapper.MapTo(this, (Entities.Common.EdFi.ILocalPayroll)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ILocalPayroll.LocalAccountResourceId + { + get { return null; } + set { ImplicitLocalAccountReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ILocalPayroll.LocalAccountDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLocalAccountReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ILocalPayroll.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ILocalPayroll.StaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -109730,9 +110366,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class NetworkPurposeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocalPayrollPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -109761,293 +110397,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.NonMedicalImmunizationExemptionDescriptor table of the NonMedicalImmunizationExemptionDescriptor aggregate in the ODS Database. + /// Represents a reference to the Location resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class NonMedicalImmunizationExemptionDescriptor : Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class LocationReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "NonMedicalImmunizationExemptionDescriptor"); - - // Fluent validator instance (threadsafe) - private static NonMedicalImmunizationExemptionDescriptorPutPostRequestValidator _validator = new NonMedicalImmunizationExemptionDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the NonMedicalImmunizationExemptionDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int NonMedicalImmunizationExemptionDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return NonMedicalImmunizationExemptionDescriptorId; } - set { NonMedicalImmunizationExemptionDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor).NonMedicalImmunizationExemptionDescriptorId.Equals(compareTo.NonMedicalImmunizationExemptionDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor).NonMedicalImmunizationExemptionDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.NonMedicalImmunizationExemptionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.NonMedicalImmunizationExemptionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class NonMedicalImmunizationExemptionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: ObjectDimension - -namespace EdFi.Ods.Api.Common.Models.Resources.ObjectDimension.EdFi -{ - /// - /// Represents a reference to the ObjectDimension resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ObjectDimensionReference : IResourceReference - { - [DataMember(Name="code")] - public string Code { get; set; } + [DataMember(Name="classroomIdentificationCode")] + public string ClassroomIdentificationCode { get; set; } - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -110085,19 +110450,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return Code != default(string) && FiscalYear != default(int); + return ClassroomIdentificationCode != default(string) && SchoolId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (Code == default) + if (ClassroomIdentificationCode == default) { - yield return "Code"; + yield return "ClassroomIdentificationCode"; } - if (FiscalYear == default) + if (SchoolId == default) { - yield return "FiscalYear"; + yield return "SchoolId"; } } @@ -110106,8 +110471,8 @@ private Link CreateLink() { var link = new Link { - Rel = "ObjectDimension", - Href = $"/ed-fi/objectDimensions/{ResourceId:n}" + Rel = "Location", + Href = $"/ed-fi/locations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -110134,17 +110499,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.ObjectDimension table of the ObjectDimension aggregate in the ODS Database. + /// A class which represents the edfi.Location table of the Location aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class ObjectDimension : Entities.Common.EdFi.IObjectDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class Location : Entities.Common.EdFi.ILocation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ObjectDimension"); + private static FullName _fullName = new FullName("edfi", "Location"); // Fluent validator instance (threadsafe) - private static ObjectDimensionPutPostRequestValidator _validator = new ObjectDimensionPutPostRequestValidator(); + private static LocationPutPostRequestValidator _validator = new LocationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -110155,10 +110519,6 @@ public class ObjectDimension : Entities.Common.EdFi.IObjectDimension, IHasETag, // Constructor // ------------------------------------------------------------- - public ObjectDimension() - { - ObjectDimensionReportingTags = new List(); - } // ------------------------------------------------------------ @@ -110167,7 +110527,7 @@ public ObjectDimension() // ------------------------------------------------------------ /// - /// The unique identifier for the ObjectDimension resource. + /// The unique identifier for the Location resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -110177,6 +110537,40 @@ public ObjectDimension() // ============================================================= // References // ------------------------------------------------------------- + + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); + + return _schoolReference; + } + } + + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; + + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -110184,33 +110578,38 @@ public ObjectDimension() // ------------------------------------------------------------- /// - /// The code representation of the account object dimension. + /// A unique number or alphanumeric code assigned to a room by a school, school system, state, or other agency or entity. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="code")] - public string Code { get; set; } - - private bool _fiscalYearExplicitlyAssigned = false; - private int _fiscalYear; + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="classroomIdentificationCode")] + public string ClassroomIdentificationCode { get; set; } /// - /// The fiscal year for which the account object dimension is valid. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get => _fiscalYear; - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ILocation.SchoolId + { + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; + + return default(long); } - } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -110225,7 +110624,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IObjectDimension; + var compareTo = obj as Entities.Common.EdFi.ILocation; if (ReferenceEquals(this, compareTo)) return true; @@ -110235,12 +110634,12 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectDimension).Code, compareTo.Code)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ILocation).ClassroomIdentificationCode, compareTo.ClassroomIdentificationCode)) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IObjectDimension).FiscalYear.Equals(compareTo.FiscalYear)) + // Referenced Property + if (!(this as Entities.Common.EdFi.ILocation).SchoolId.Equals(compareTo.SchoolId)) return false; @@ -110258,12 +110657,11 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IObjectDimension).Code); - + hash.Add((this as Entities.Common.EdFi.ILocation).ClassroomIdentificationCode); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IObjectDimension).FiscalYear); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ILocation).SchoolId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -110278,21 +110676,19 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A description of the account object dimension. + /// The most number of seats the class can maintain. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeName")] - public string CodeName { get; set; } - // ------------------------------------------------------------- + [DataMember(Name="maximumNumberOfSeats")] + public int? MaximumNumberOfSeats { get; set; } - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } - } + /// + /// The number of seats that is most favorable to the class. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="optimalNumberOfSeats")] + public int? OptimalNumberOfSeats { get; set; } + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -110312,43 +110708,13 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectDimension", "ObjectDimension")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Location", "Location")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _objectDimensionReportingTags; - private ICollection _objectDimensionReportingTagsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection ObjectDimensionReportingTags - { - get { return _objectDimensionReportingTags; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IObjectDimensionReportingTag)e.Item).ObjectDimension = this); - _objectDimensionReportingTags = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectDimensionReportingTag)e.Item).ObjectDimension = this; - _objectDimensionReportingTagsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectDimension.ObjectDimensionReportingTags - { - get { return _objectDimensionReportingTagsCovariant; } - set { ObjectDimensionReportingTags = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -110366,17 +110732,6 @@ public ICollection ObjectDimensionReportingTags // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_objectDimensionReportingTags != null) foreach (var item in _objectDimensionReportingTags) - { - item.ObjectDimension = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -110384,18 +110739,25 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ObjectDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectDimension)target); + return Entities.Common.EdFi.LocationMapper.SynchronizeTo(this, (Entities.Common.EdFi.ILocation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ObjectDimensionMapper.MapTo(this, (Entities.Common.EdFi.IObjectDimension)target, null); + Entities.Common.EdFi.LocationMapper.MapTo(this, (Entities.Common.EdFi.ILocation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ILocation.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- // ================================== @@ -110418,18 +110780,6 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (ObjectDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("ObjectDimensionReportingTags") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ObjectDimensionReportingTags"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ObjectDimensionReportingTags, validationContext, validationContext.Items.ForCollection("ObjectDimensionReportingTags")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -110475,14 +110825,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ObjectDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class LocationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ObjectDimension = new FullName("edfi", "ObjectDimension"); - - // Declare collection item validators - private ObjectDimensionReportingTagPutPostRequestValidator _objectDimensionReportingTagsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -110495,28 +110840,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ObjectDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_ObjectDimension); - - if (mappingContract != null) - { - if (mappingContract.IsObjectDimensionReportingTagIncluded != null) - { - var hasInvalidObjectDimensionReportingTagsItems = instance.ObjectDimensionReportingTags.Any(x => !mappingContract.IsObjectDimensionReportingTagIncluded(x)); - - if (hasInvalidObjectDimensionReportingTagsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ObjectDimensionReportingTags", $"A supplied 'ObjectDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -110532,17 +110855,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ObjectDimensionReportingTag table of the ObjectDimension aggregate in the ODS Database. + /// A class which represents the edfi.MagnetSpecialProgramEmphasisSchoolDescriptor table of the MagnetSpecialProgramEmphasisSchoolDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ObjectDimensionReportingTag : Entities.Common.EdFi.IObjectDimensionReportingTag, IValidatableObject + public class MagnetSpecialProgramEmphasisSchoolDescriptor : Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ObjectDimensionReportingTag"); + private static FullName _fullName = new FullName("edfi", "MagnetSpecialProgramEmphasisSchoolDescriptor"); // Fluent validator instance (threadsafe) - private static ObjectDimensionReportingTagPutPostRequestValidator _validator = new ObjectDimensionReportingTagPutPostRequestValidator(); + private static MagnetSpecialProgramEmphasisSchoolDescriptorPutPostRequestValidator _validator = new MagnetSpecialProgramEmphasisSchoolDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -110559,6 +110887,13 @@ public class ObjectDimensionReportingTag : Entities.Common.EdFi.IObjectDimension // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the MagnetSpecialProgramEmphasisSchoolDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -110569,33 +110904,19 @@ public class ObjectDimensionReportingTag : Entities.Common.EdFi.IObjectDimension //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IObjectDimension _objectDimension; - - [IgnoreDataMember] - Entities.Common.EdFi.IObjectDimension IObjectDimensionReportingTag.ObjectDimension - { - get { return _objectDimension; } - set { SetObjectDimension(value); } - } - public Entities.Common.EdFi.IObjectDimension ObjectDimension - { - set { SetObjectDimension(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int MagnetSpecialProgramEmphasisSchoolDescriptorId { get; set; } - private void SetObjectDimension(Entities.Common.EdFi.IObjectDimension value) + int IDescriptor.DescriptorId { - _objectDimension = value; + get { return MagnetSpecialProgramEmphasisSchoolDescriptorId; } + set { MagnetSpecialProgramEmphasisSchoolDescriptorId = value; } } - - /// - /// Optional tag for accountability reporting. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -110610,7 +110931,7 @@ private void SetObjectDimension(Entities.Common.EdFi.IObjectDimension value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IObjectDimensionReportingTag; + var compareTo = obj as Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -110618,13 +110939,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_objectDimension == null || !_objectDimension.Equals(compareTo.ObjectDimension)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor).MagnetSpecialProgramEmphasisSchoolDescriptorId.Equals(compareTo.MagnetSpecialProgramEmphasisSchoolDescriptorId)) return false; @@ -110640,12 +110957,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_objectDimension != null) - hash.Add(_objectDimension); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IObjectDimensionReportingTag).ReportingTagDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor).MagnetSpecialProgramEmphasisSchoolDescriptorId); return hash.ToHashCode(); } @@ -110654,6 +110968,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -110679,8 +111042,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectDimension", "ObjectDimensionReportingTag")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -110691,6 +111057,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -110703,12 +111076,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ObjectDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectDimensionReportingTag)target); + return Entities.Common.EdFi.MagnetSpecialProgramEmphasisSchoolDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ObjectDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IObjectDimensionReportingTag)target, null); + Entities.Common.EdFi.MagnetSpecialProgramEmphasisSchoolDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor)target, null); } // ------------------------------------------------------------- @@ -110716,66 +111089,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -110783,9 +111096,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ObjectDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class MagnetSpecialProgramEmphasisSchoolDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -110814,126 +111127,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ObjectiveAssessment resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentReference : IResourceReference - { - [DataMember(Name="assessmentIdentifier")] - public string AssessmentIdentifier { get; set; } - - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } - - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return AssessmentIdentifier != default(string) && IdentificationCode != default(string) && Namespace != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (AssessmentIdentifier == default) - { - yield return "AssessmentIdentifier"; - } - - if (IdentificationCode == default) - { - yield return "IdentificationCode"; - } - - if (Namespace == default) - { - yield return "Namespace"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "ObjectiveAssessment", - Href = $"/ed-fi/objectiveAssessments/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.ObjectiveAssessment table of the ObjectiveAssessment aggregate in the ODS Database. + /// A class which represents the edfi.MediumOfInstructionDescriptor table of the MediumOfInstructionDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ObjectiveAssessment : Entities.Common.EdFi.IObjectiveAssessment, IHasETag, IDateVersionedEntity, IValidatableObject + public class MediumOfInstructionDescriptor : Entities.Common.EdFi.IMediumOfInstructionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ObjectiveAssessment"); + private static FullName _fullName = new FullName("edfi", "MediumOfInstructionDescriptor"); // Fluent validator instance (threadsafe) - private static ObjectiveAssessmentPutPostRequestValidator _validator = new ObjectiveAssessmentPutPostRequestValidator(); + private static MediumOfInstructionDescriptorPutPostRequestValidator _validator = new MediumOfInstructionDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -110944,13 +111152,6 @@ public class ObjectiveAssessment : Entities.Common.EdFi.IObjectiveAssessment, IH // Constructor // ------------------------------------------------------------- - public ObjectiveAssessment() - { - ObjectiveAssessmentAssessmentItems = new List(); - ObjectiveAssessmentLearningStandards = new List(); - ObjectiveAssessmentPerformanceLevels = new List(); - ObjectiveAssessmentScores = new List(); - } // ------------------------------------------------------------ @@ -110959,7 +111160,7 @@ public ObjectiveAssessment() // ------------------------------------------------------------ /// - /// The unique identifier for the ObjectiveAssessment resource. + /// The unique identifier for the MediumOfInstructionDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -110969,73 +111170,6 @@ public ObjectiveAssessment() // ============================================================= // References // ------------------------------------------------------------- - - private bool _assessmentReferenceExplicitlyAssigned; - private Assessment.EdFi.AssessmentReference _assessmentReference; - private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) - _assessmentReference = new Assessment.EdFi.AssessmentReference(); - - return _assessmentReference; - } - } - - [DataMember(Name="assessmentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Assessment.EdFi.AssessmentReference AssessmentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitAssessmentReference != null - && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference; - - return null; - } - set - { - _assessmentReferenceExplicitlyAssigned = true; - _assessmentReference = value; - } - } - private bool _parentObjectiveAssessmentReferenceExplicitlyAssigned; - private ObjectiveAssessmentReference _parentObjectiveAssessmentReference; - private ObjectiveAssessmentReference ImplicitParentObjectiveAssessmentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_parentObjectiveAssessmentReference == null && !_parentObjectiveAssessmentReferenceExplicitlyAssigned) - _parentObjectiveAssessmentReference = new ObjectiveAssessmentReference(); - - return _parentObjectiveAssessmentReference; - } - } - - [DataMember(Name="parentObjectiveAssessmentReference")] - [FullyDefinedReference] - public ObjectiveAssessmentReference ParentObjectiveAssessmentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitParentObjectiveAssessmentReference != null - && (_parentObjectiveAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentObjectiveAssessmentReference.IsReferenceFullyDefined())) - return ImplicitParentObjectiveAssessmentReference; - - return null; - } - set - { - _parentObjectiveAssessmentReferenceExplicitlyAssigned = true; - _parentObjectiveAssessmentReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -111043,70 +111177,16 @@ public ObjectiveAssessmentReference ParentObjectiveAssessmentReference // ------------------------------------------------------------- /// - /// A unique number or alphanumeric code assigned to an assessment. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IObjectiveAssessment.AssessmentIdentifier - { - get - { - if (ImplicitAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference.AssessmentIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Assessment - _assessmentReferenceExplicitlyAssigned = false; - ImplicitAssessmentReference.AssessmentIdentifier = value; - - // ParentObjectiveAssessment - _parentObjectiveAssessmentReferenceExplicitlyAssigned = false; - ImplicitParentObjectiveAssessmentReference.AssessmentIdentifier = value; - } - } - - /// - /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } + [JsonIgnore] + public int MediumOfInstructionDescriptorId { get; set; } - /// - /// Namespace for the assessment. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IObjectiveAssessment.Namespace + int IDescriptor.DescriptorId { - get - { - if (ImplicitAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference.Namespace; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Assessment - _assessmentReferenceExplicitlyAssigned = false; - ImplicitAssessmentReference.Namespace = value; - - // ParentObjectiveAssessment - _parentObjectiveAssessmentReferenceExplicitlyAssigned = false; - ImplicitParentObjectiveAssessmentReference.Namespace = value; - } + get { return MediumOfInstructionDescriptorId; } + set { MediumOfInstructionDescriptorId = value; } } // ------------------------------------------------------------- @@ -111122,7 +111202,7 @@ string Entities.Common.EdFi.IObjectiveAssessment.Namespace /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessment; + var compareTo = obj as Entities.Common.EdFi.IMediumOfInstructionDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -111131,18 +111211,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessment).AssessmentIdentifier, compareTo.AssessmentIdentifier)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessment).IdentificationCode, compareTo.IdentificationCode)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessment).Namespace, compareTo.Namespace)) + // Derived Property + if (!(this as Entities.Common.EdFi.IMediumOfInstructionDescriptor).MediumOfInstructionDescriptorId.Equals(compareTo.MediumOfInstructionDescriptorId)) return false; @@ -111159,15 +111229,9 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessment).AssessmentIdentifier); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessment).IdentificationCode); - + //Derived Property + hash.Add((this as Entities.Common.EdFi.IMediumOfInstructionDescriptor).MediumOfInstructionDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessment).Namespace); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -111175,22 +111239,18 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// The subject area of the objective assessment. + /// A code or abbreviation that is used to refer to the descriptor. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The description of the objective assessment (e.g., vocabulary, measurement, or geometry). + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] @@ -111198,55 +111258,41 @@ public override int GetHashCode() public string Description { get; set; } /// - /// The maximum raw score achievable across all assessment items that are correct and scored at the maximum. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999999.99999", "9999999999.99999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxRawScore")] - public decimal? MaxRawScore { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// Reflects the specific nomenclature used for this level of objective assessment. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nomenclature")] - public string Nomenclature { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IObjectiveAssessment.ParentIdentificationCode - { - get - { - if (ImplicitParentObjectiveAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitParentObjectiveAssessmentReference.IsReferenceFullyDefined())) - { - return ImplicitParentObjectiveAssessmentReference.IdentificationCode; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ParentObjectiveAssessment - _parentObjectiveAssessmentReferenceExplicitlyAssigned = false; - ImplicitParentObjectiveAssessmentReference.IdentificationCode = value; - } - } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The percentage of the assessment that tests this objective. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="percentOfAssessment")] - public decimal? PercentOfAssessment { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -111267,133 +111313,16 @@ string Entities.Common.EdFi.IObjectiveAssessment.ParentIdentificationCode // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessment")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _objectiveAssessmentAssessmentItems; - private ICollection _objectiveAssessmentAssessmentItemsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="assessmentItems")] - public ICollection ObjectiveAssessmentAssessmentItems - { - get { return _objectiveAssessmentAssessmentItems; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)e.Item).ObjectiveAssessment = this); - _objectiveAssessmentAssessmentItems = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)e.Item).ObjectiveAssessment = this; - _objectiveAssessmentAssessmentItemsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentAssessmentItems - { - get { return _objectiveAssessmentAssessmentItemsCovariant; } - set { ObjectiveAssessmentAssessmentItems = new List(value.Cast()); } - } - - private ICollection _objectiveAssessmentLearningStandards; - private ICollection _objectiveAssessmentLearningStandardsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="learningStandards")] - public ICollection ObjectiveAssessmentLearningStandards - { - get { return _objectiveAssessmentLearningStandards; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)e.Item).ObjectiveAssessment = this); - _objectiveAssessmentLearningStandards = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)e.Item).ObjectiveAssessment = this; - _objectiveAssessmentLearningStandardsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentLearningStandards - { - get { return _objectiveAssessmentLearningStandardsCovariant; } - set { ObjectiveAssessmentLearningStandards = new List(value.Cast()); } - } - - private ICollection _objectiveAssessmentPerformanceLevels; - private ICollection _objectiveAssessmentPerformanceLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="performanceLevels")] - public ICollection ObjectiveAssessmentPerformanceLevels - { - get { return _objectiveAssessmentPerformanceLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)e.Item).ObjectiveAssessment = this); - _objectiveAssessmentPerformanceLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)e.Item).ObjectiveAssessment = this; - _objectiveAssessmentPerformanceLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentPerformanceLevels - { - get { return _objectiveAssessmentPerformanceLevelsCovariant; } - set { ObjectiveAssessmentPerformanceLevels = new List(value.Cast()); } - } - - private ICollection _objectiveAssessmentScores; - private ICollection _objectiveAssessmentScoresCovariant; - - [NoDuplicateMembers] - [DataMember(Name="scores")] - public ICollection ObjectiveAssessmentScores - { - get { return _objectiveAssessmentScores; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentScore)e.Item).ObjectiveAssessment = this); - _objectiveAssessmentScores = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentScore)e.Item).ObjectiveAssessment = this; - _objectiveAssessmentScoresCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentScores - { - get { return _objectiveAssessmentScoresCovariant; } - set { ObjectiveAssessmentScores = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -111411,32 +111340,6 @@ public ICollection ObjectiveAssessmentScores // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_objectiveAssessmentAssessmentItems != null) foreach (var item in _objectiveAssessmentAssessmentItems) - { - item.ObjectiveAssessment = this; - } - - if (_objectiveAssessmentLearningStandards != null) foreach (var item in _objectiveAssessmentLearningStandards) - { - item.ObjectiveAssessment = this; - } - - if (_objectiveAssessmentPerformanceLevels != null) foreach (var item in _objectiveAssessmentPerformanceLevels) - { - item.ObjectiveAssessment = this; - } - - if (_objectiveAssessmentScores != null) foreach (var item in _objectiveAssessmentScores) - { - item.ObjectiveAssessment = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -111444,225 +111347,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ObjectiveAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessment)target); + return Entities.Common.EdFi.MediumOfInstructionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMediumOfInstructionDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ObjectiveAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessment)target, null); + Entities.Common.EdFi.MediumOfInstructionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMediumOfInstructionDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IObjectiveAssessment.AssessmentResourceId - { - get { return null; } - set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IObjectiveAssessment.AssessmentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitAssessmentReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentResourceId - { - get { return null; } - set { ImplicitParentObjectiveAssessmentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitParentObjectiveAssessmentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (ObjectiveAssessmentAssessmentItems.Any() && mappingContract?.IsMemberSupported("ObjectiveAssessmentAssessmentItems") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ObjectiveAssessmentAssessmentItems"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ObjectiveAssessmentAssessmentItems, validationContext, validationContext.Items.ForCollection("ObjectiveAssessmentAssessmentItems")))) - { - yield return result; - } - } - - if (ObjectiveAssessmentLearningStandards.Any() && mappingContract?.IsMemberSupported("ObjectiveAssessmentLearningStandards") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ObjectiveAssessmentLearningStandards"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ObjectiveAssessmentLearningStandards, validationContext, validationContext.Items.ForCollection("ObjectiveAssessmentLearningStandards")))) - { - yield return result; - } - } - - if (ObjectiveAssessmentPerformanceLevels.Any() && mappingContract?.IsMemberSupported("ObjectiveAssessmentPerformanceLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ObjectiveAssessmentPerformanceLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ObjectiveAssessmentPerformanceLevels, validationContext, validationContext.Items.ForCollection("ObjectiveAssessmentPerformanceLevels")))) - { - yield return result; - } - } - - if (ObjectiveAssessmentScores.Any() && mappingContract?.IsMemberSupported("ObjectiveAssessmentScores") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ObjectiveAssessmentScores"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ObjectiveAssessmentScores, validationContext, validationContext.Items.ForCollection("ObjectiveAssessmentScores")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); - - if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() - { - // Obtain value from other references - var valueFromAssessmentReference = this.AssessmentReference?.AssessmentIdentifier; - - if (valueFromAssessmentReference != null) - { - yield return ("assessmentReference.assessmentIdentifier", this.AssessmentReference.AssessmentIdentifier); - } - - // Obtain value from other references - var valueFromParentObjectiveAssessmentReference = this.ParentObjectiveAssessmentReference?.AssessmentIdentifier; - - if (valueFromParentObjectiveAssessmentReference != null) - { - yield return ("parentObjectiveAssessmentReference.assessmentIdentifier", this.ParentObjectiveAssessmentReference.AssessmentIdentifier); - } - - } - var sourcesForNamespace = GetNamespaceSources().ToArray(); - - if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetNamespaceSources() - { - // Obtain value from other references - var valueFromAssessmentReference = this.AssessmentReference?.Namespace; - - if (valueFromAssessmentReference != null) - { - yield return ("assessmentReference.namespace", this.AssessmentReference.Namespace); - } - - // Obtain value from other references - var valueFromParentObjectiveAssessmentReference = this.ParentObjectiveAssessmentReference?.Namespace; - - if (valueFromParentObjectiveAssessmentReference != null) - { - yield return ("parentObjectiveAssessmentReference.namespace", this.ParentObjectiveAssessmentReference.Namespace); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -111670,17 +111367,9 @@ string Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentDiscri // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator + public class MediumOfInstructionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ObjectiveAssessment = new FullName("edfi", "ObjectiveAssessment"); - - // Declare collection item validators - private ObjectiveAssessmentAssessmentItemPutPostRequestValidator _objectiveAssessmentAssessmentItemsValidator = new (); - private ObjectiveAssessmentLearningStandardPutPostRequestValidator _objectiveAssessmentLearningStandardsValidator = new (); - private ObjectiveAssessmentPerformanceLevelPutPostRequestValidator _objectiveAssessmentPerformanceLevelsValidator = new (); - private ObjectiveAssessmentScorePutPostRequestValidator _objectiveAssessmentScoresValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -111693,61 +111382,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_ObjectiveAssessment); - - if (mappingContract != null) - { - if (mappingContract.IsObjectiveAssessmentAssessmentItemIncluded != null) - { - var hasInvalidObjectiveAssessmentAssessmentItemsItems = instance.ObjectiveAssessmentAssessmentItems.Any(x => !mappingContract.IsObjectiveAssessmentAssessmentItemIncluded(x)); - - if (hasInvalidObjectiveAssessmentAssessmentItemsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ObjectiveAssessmentAssessmentItems", $"A supplied 'ObjectiveAssessmentAssessmentItem' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsObjectiveAssessmentLearningStandardIncluded != null) - { - var hasInvalidObjectiveAssessmentLearningStandardsItems = instance.ObjectiveAssessmentLearningStandards.Any(x => !mappingContract.IsObjectiveAssessmentLearningStandardIncluded(x)); - - if (hasInvalidObjectiveAssessmentLearningStandardsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ObjectiveAssessmentLearningStandards", $"A supplied 'ObjectiveAssessmentLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsObjectiveAssessmentPerformanceLevelIncluded != null) - { - var hasInvalidObjectiveAssessmentPerformanceLevelsItems = instance.ObjectiveAssessmentPerformanceLevels.Any(x => !mappingContract.IsObjectiveAssessmentPerformanceLevelIncluded(x)); - - if (hasInvalidObjectiveAssessmentPerformanceLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ObjectiveAssessmentPerformanceLevels", $"A supplied 'ObjectiveAssessmentPerformanceLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsObjectiveAssessmentScoreIncluded != null) - { - var hasInvalidObjectiveAssessmentScoresItems = instance.ObjectiveAssessmentScores.Any(x => !mappingContract.IsObjectiveAssessmentScoreIncluded(x)); - - if (hasInvalidObjectiveAssessmentScoresItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ObjectiveAssessmentScores", $"A supplied 'ObjectiveAssessmentScore' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -111763,17 +111397,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ObjectiveAssessmentAssessmentItem table of the ObjectiveAssessment aggregate in the ODS Database. + /// A class which represents the edfi.MethodCreditEarnedDescriptor table of the MethodCreditEarnedDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentAssessmentItem : Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem, IValidatableObject + public class MethodCreditEarnedDescriptor : Entities.Common.EdFi.IMethodCreditEarnedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentAssessmentItem"); + private static FullName _fullName = new FullName("edfi", "MethodCreditEarnedDescriptor"); // Fluent validator instance (threadsafe) - private static ObjectiveAssessmentAssessmentItemPutPostRequestValidator _validator = new ObjectiveAssessmentAssessmentItemPutPostRequestValidator(); + private static MethodCreditEarnedDescriptorPutPostRequestValidator _validator = new MethodCreditEarnedDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -111790,99 +111429,35 @@ public class ObjectiveAssessmentAssessmentItem : Entities.Common.EdFi.IObjective // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the MethodCreditEarnedDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _assessmentItemReferenceExplicitlyAssigned; - private AssessmentItem.EdFi.AssessmentItemReference _assessmentItemReference; - private AssessmentItem.EdFi.AssessmentItemReference ImplicitAssessmentItemReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_assessmentItemReference == null && !_assessmentItemReferenceExplicitlyAssigned) - _assessmentItemReference = new AssessmentItem.EdFi.AssessmentItemReference(); - - return _assessmentItemReference; - } - } - - [DataMember(Name="assessmentItemReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public AssessmentItem.EdFi.AssessmentItemReference AssessmentItemReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitAssessmentItemReference != null - && (_assessmentItemReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) - return ImplicitAssessmentItemReference; - - return null; - } - set - { - _assessmentItemReferenceExplicitlyAssigned = true; - _assessmentItemReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; - - [IgnoreDataMember] - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.ObjectiveAssessment - { - get { return _objectiveAssessment; } - set { SetObjectiveAssessment(value); } - } - - public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment - { - set { SetObjectiveAssessment(value); } - } - - private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) - { - _objectiveAssessment = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_assessmentItemReferenceExplicitlyAssigned) - { - ImplicitAssessmentItemReference.AssessmentIdentifier = _objectiveAssessment.AssessmentIdentifier; - ImplicitAssessmentItemReference.Namespace = _objectiveAssessment.Namespace; - } - } /// - /// A unique number or alphanumeric code assigned to a space, room, site, building, individual, organization, program, or institution by a school, school system, state, or other agency or entity. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemIdentificationCode - { - get - { - if (ImplicitAssessmentItemReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) - return ImplicitAssessmentItemReference.IdentificationCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int MethodCreditEarnedDescriptorId { get; set; } - // AssessmentItem - _assessmentItemReferenceExplicitlyAssigned = false; - ImplicitAssessmentItemReference.IdentificationCode = value; - } + int IDescriptor.DescriptorId + { + get { return MethodCreditEarnedDescriptorId; } + set { MethodCreditEarnedDescriptorId = value; } } // ------------------------------------------------------------- @@ -111898,7 +111473,7 @@ string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemIde /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem; + var compareTo = obj as Entities.Common.EdFi.IMethodCreditEarnedDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -111906,13 +111481,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).AssessmentItemIdentificationCode, compareTo.AssessmentItemIdentificationCode)) + // Derived Property + if (!(this as Entities.Common.EdFi.IMethodCreditEarnedDescriptor).MethodCreditEarnedDescriptorId.Equals(compareTo.MethodCreditEarnedDescriptorId)) return false; @@ -111928,12 +111499,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_objectiveAssessment != null) - hash.Add(_objectiveAssessment); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).AssessmentItemIdentificationCode); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IMethodCreditEarnedDescriptor).MethodCreditEarnedDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -111941,6 +111510,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -111966,8 +111584,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentAssessmentItem")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -111978,17 +111599,18 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -111996,154 +111618,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ObjectiveAssessmentAssessmentItemMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)target); + return Entities.Common.EdFi.MethodCreditEarnedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMethodCreditEarnedDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ObjectiveAssessmentAssessmentItemMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)target, null); + Entities.Common.EdFi.MethodCreditEarnedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMethodCreditEarnedDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemResourceId - { - get { return null; } - set { ImplicitAssessmentItemReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitAssessmentItemReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); - - if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).ObjectiveAssessment.AssessmentIdentifier); - - // Obtain value from other references - var valueFromAssessmentItemReference = this.AssessmentItemReference?.AssessmentIdentifier; - - if (valueFromAssessmentItemReference != null) - { - yield return ("assessmentItemReference.assessmentIdentifier", this.AssessmentItemReference.AssessmentIdentifier); - } - - } - var sourcesForNamespace = GetNamespaceSources().ToArray(); - - if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetNamespaceSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).ObjectiveAssessment.Namespace); - - // Obtain value from other references - var valueFromAssessmentItemReference = this.AssessmentItemReference?.Namespace; - - if (valueFromAssessmentItemReference != null) - { - yield return ("assessmentItemReference.namespace", this.AssessmentItemReference.Namespace); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -112151,9 +111638,9 @@ string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemDis // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentAssessmentItemPutPostRequestValidator : FluentValidation.AbstractValidator + public class MethodCreditEarnedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -112181,17 +111668,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ObjectiveAssessmentLearningStandard table of the ObjectiveAssessment aggregate in the ODS Database. + /// A class which represents the edfi.MigrantEducationProgramServiceDescriptor table of the MigrantEducationProgramServiceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentLearningStandard : Entities.Common.EdFi.IObjectiveAssessmentLearningStandard, IValidatableObject + public class MigrantEducationProgramServiceDescriptor : Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentLearningStandard"); + private static FullName _fullName = new FullName("edfi", "MigrantEducationProgramServiceDescriptor"); // Fluent validator instance (threadsafe) - private static ObjectiveAssessmentLearningStandardPutPostRequestValidator _validator = new ObjectiveAssessmentLearningStandardPutPostRequestValidator(); + private static MigrantEducationProgramServiceDescriptorPutPostRequestValidator _validator = new MigrantEducationProgramServiceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -112208,92 +111700,35 @@ public class ObjectiveAssessmentLearningStandard : Entities.Common.EdFi.IObjecti // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the MigrantEducationProgramServiceDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _learningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) - _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _learningStandardReference; - } - } - - [DataMember(Name="learningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference LearningStandardReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLearningStandardReference != null - && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference; - - return null; - } - set - { - _learningStandardReferenceExplicitlyAssigned = true; - _learningStandardReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; - - [IgnoreDataMember] - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.ObjectiveAssessment - { - get { return _objectiveAssessment; } - set { SetObjectiveAssessment(value); } - } - - public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment - { - set { SetObjectiveAssessment(value); } - } - - private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) - { - _objectiveAssessment = value; - } /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardId - { - get - { - if (ImplicitLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int MigrantEducationProgramServiceDescriptorId { get; set; } - // LearningStandard - _learningStandardReferenceExplicitlyAssigned = false; - ImplicitLearningStandardReference.LearningStandardId = value; - } + int IDescriptor.DescriptorId + { + get { return MigrantEducationProgramServiceDescriptorId; } + set { MigrantEducationProgramServiceDescriptorId = value; } } // ------------------------------------------------------------- @@ -112309,7 +111744,7 @@ string Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandar /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentLearningStandard; + var compareTo = obj as Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -112317,13 +111752,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentLearningStandard).LearningStandardId, compareTo.LearningStandardId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor).MigrantEducationProgramServiceDescriptorId.Equals(compareTo.MigrantEducationProgramServiceDescriptorId)) return false; @@ -112339,12 +111770,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_objectiveAssessment != null) - hash.Add(_objectiveAssessment); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentLearningStandard).LearningStandardId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor).MigrantEducationProgramServiceDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -112352,6 +111781,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -112377,8 +111855,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentLearningStandard")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -112389,6 +111870,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -112401,103 +111889,29 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ObjectiveAssessmentLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)target); + return Entities.Common.EdFi.MigrantEducationProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ObjectiveAssessmentLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)target, null); + Entities.Common.EdFi.MigrantEducationProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardResourceId - { - get { return null; } - set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLearningStandardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } + } // ================================================================= // Validators // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class MigrantEducationProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -112525,17 +111939,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ObjectiveAssessmentPerformanceLevel table of the ObjectiveAssessment aggregate in the ODS Database. + /// A class which represents the edfi.ModelEntityDescriptor table of the ModelEntityDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentPerformanceLevel : Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel, IValidatableObject + public class ModelEntityDescriptor : Entities.Common.EdFi.IModelEntityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentPerformanceLevel"); + private static FullName _fullName = new FullName("edfi", "ModelEntityDescriptor"); // Fluent validator instance (threadsafe) - private static ObjectiveAssessmentPerformanceLevelPutPostRequestValidator _validator = new ObjectiveAssessmentPerformanceLevelPutPostRequestValidator(); + private static ModelEntityDescriptorPutPostRequestValidator _validator = new ModelEntityDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -112552,6 +111971,13 @@ public class ObjectiveAssessmentPerformanceLevel : Entities.Common.EdFi.IObjecti // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ModelEntityDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -112562,42 +111988,19 @@ public class ObjectiveAssessmentPerformanceLevel : Entities.Common.EdFi.IObjecti //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; - - [IgnoreDataMember] - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentPerformanceLevel.ObjectiveAssessment - { - get { return _objectiveAssessment; } - set { SetObjectiveAssessment(value); } - } - - public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment - { - set { SetObjectiveAssessment(value); } - } - - private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) - { - _objectiveAssessment = value; - } /// - /// The method that the instructor of the class uses to report the performance and achievement of all students. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ModelEntityDescriptorId { get; set; } - /// - /// The performance level(s) defined for the assessment. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] - public string PerformanceLevelDescriptor { get; set; } + int IDescriptor.DescriptorId + { + get { return ModelEntityDescriptorId; } + set { ModelEntityDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -112612,7 +112015,7 @@ private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment va /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel; + var compareTo = obj as Entities.Common.EdFi.IModelEntityDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -112620,18 +112023,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor, compareTo.PerformanceLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IModelEntityDescriptor).ModelEntityDescriptorId.Equals(compareTo.ModelEntityDescriptorId)) return false; @@ -112647,16 +112041,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_objectiveAssessment != null) - hash.Add(_objectiveAssessment); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IModelEntityDescriptor).ModelEntityDescriptorId); return hash.ToHashCode(); } @@ -112665,43 +112052,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The maximum score to make the indicated level of performance. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maximumScore")] - public string MaximumScore { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The minimum score required to make the indicated level of performance. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="minimumScore")] - public string MinimumScore { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The name of the indicator being measured for a collection of performance level values. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="performanceLevelIndicatorName")] - public string PerformanceLevelIndicatorName { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] - public string ResultDatatypeTypeDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -112722,8 +112126,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentPerformanceLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -112734,6 +112141,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -112746,12 +112160,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ObjectiveAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)target); + return Entities.Common.EdFi.ModelEntityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IModelEntityDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ObjectiveAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)target, null); + Entities.Common.EdFi.ModelEntityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IModelEntityDescriptor)target, null); } // ------------------------------------------------------------- @@ -112759,66 +112173,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -112826,9 +112180,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class ModelEntityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -112856,17 +112210,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ObjectiveAssessmentScore table of the ObjectiveAssessment aggregate in the ODS Database. + /// A class which represents the edfi.MonitoredDescriptor table of the MonitoredDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentScore : Entities.Common.EdFi.IObjectiveAssessmentScore, IValidatableObject + public class MonitoredDescriptor : Entities.Common.EdFi.IMonitoredDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentScore"); + private static FullName _fullName = new FullName("edfi", "MonitoredDescriptor"); // Fluent validator instance (threadsafe) - private static ObjectiveAssessmentScorePutPostRequestValidator _validator = new ObjectiveAssessmentScorePutPostRequestValidator(); + private static MonitoredDescriptorPutPostRequestValidator _validator = new MonitoredDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -112883,6 +112242,13 @@ public class ObjectiveAssessmentScore : Entities.Common.EdFi.IObjectiveAssessmen // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the MonitoredDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -112893,33 +112259,19 @@ public class ObjectiveAssessmentScore : Entities.Common.EdFi.IObjectiveAssessmen //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; - [IgnoreDataMember] - Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentScore.ObjectiveAssessment - { - get { return _objectiveAssessment; } - set { SetObjectiveAssessment(value); } - } - - public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment - { - set { SetObjectiveAssessment(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int MonitoredDescriptorId { get; set; } - private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) + int IDescriptor.DescriptorId { - _objectiveAssessment = value; + get { return MonitoredDescriptorId; } + set { MonitoredDescriptorId = value; } } - - /// - /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -112934,7 +112286,7 @@ private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment va /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentScore; + var compareTo = obj as Entities.Common.EdFi.IMonitoredDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -112942,13 +112294,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentScore).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IMonitoredDescriptor).MonitoredDescriptorId.Equals(compareTo.MonitoredDescriptorId)) return false; @@ -112964,12 +112312,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_objectiveAssessment != null) - hash.Add(_objectiveAssessment); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentScore).AssessmentReportingMethodDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IMonitoredDescriptor).MonitoredDescriptorId); return hash.ToHashCode(); } @@ -112978,35 +112323,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The maximum score possible on the assessment. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maximumScore")] - public string MaximumScore { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The minimum score possible on the assessment. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="minimumScore")] - public string MinimumScore { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. + /// The end date of the period when the descriptor is in effect. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] - public string ResultDatatypeTypeDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -113027,8 +112397,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentScore")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -113039,6 +112412,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -113051,12 +112431,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ObjectiveAssessmentScoreMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentScore)target); + return Entities.Common.EdFi.MonitoredDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IMonitoredDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ObjectiveAssessmentScoreMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentScore)target, null); + Entities.Common.EdFi.MonitoredDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IMonitoredDescriptor)target, null); } // ------------------------------------------------------------- @@ -113064,66 +112444,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -113131,9 +112451,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ObjectiveAssessmentScorePutPostRequestValidator : FluentValidation.AbstractValidator + public class MonitoredDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -113162,118 +112482,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the OpenStaffPosition resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class OpenStaffPositionReference : IResourceReference - { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="requisitionNumber")] - public string RequisitionNumber { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return EducationOrganizationId != default(long) && RequisitionNumber != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (RequisitionNumber == default) - { - yield return "RequisitionNumber"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "OpenStaffPosition", - Href = $"/ed-fi/openStaffPositions/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.OpenStaffPosition table of the OpenStaffPosition aggregate in the ODS Database. + /// A class which represents the edfi.NeglectedOrDelinquentProgramDescriptor table of the NeglectedOrDelinquentProgramDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class OpenStaffPosition : Entities.Common.EdFi.IOpenStaffPosition, IHasETag, IDateVersionedEntity, IValidatableObject + public class NeglectedOrDelinquentProgramDescriptor : Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "OpenStaffPosition"); + private static FullName _fullName = new FullName("edfi", "NeglectedOrDelinquentProgramDescriptor"); // Fluent validator instance (threadsafe) - private static OpenStaffPositionPutPostRequestValidator _validator = new OpenStaffPositionPutPostRequestValidator(); + private static NeglectedOrDelinquentProgramDescriptorPutPostRequestValidator _validator = new NeglectedOrDelinquentProgramDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -113284,11 +112507,6 @@ public class OpenStaffPosition : Entities.Common.EdFi.IOpenStaffPosition, IHasET // Constructor // ------------------------------------------------------------- - public OpenStaffPosition() - { - OpenStaffPositionAcademicSubjects = new List(); - OpenStaffPositionInstructionalGradeLevels = new List(); - } // ------------------------------------------------------------ @@ -113297,7 +112515,7 @@ public OpenStaffPosition() // ------------------------------------------------------------ /// - /// The unique identifier for the OpenStaffPosition resource. + /// The unique identifier for the NeglectedOrDelinquentProgramDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -113307,40 +112525,6 @@ public OpenStaffPosition() // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -113348,38 +112532,17 @@ public EducationOrganization.EdFi.EducationOrganizationReference EducationOrgani // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int NeglectedOrDelinquentProgramDescriptorId { get; set; } - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } + int IDescriptor.DescriptorId + { + get { return NeglectedOrDelinquentProgramDescriptorId; } + set { NeglectedOrDelinquentProgramDescriptorId = value; } } - - /// - /// The number or identifier assigned to an open staff position, typically a requisition number assigned by Human Resources. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="requisitionNumber")] - public string RequisitionNumber { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -113394,7 +112557,7 @@ long Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOpenStaffPosition; + var compareTo = obj as Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -113403,13 +112566,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IOpenStaffPosition).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IOpenStaffPosition).RequisitionNumber, compareTo.RequisitionNumber)) + // Derived Property + if (!(this as Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor).NeglectedOrDelinquentProgramDescriptorId.Equals(compareTo.NeglectedOrDelinquentProgramDescriptorId)) return false; @@ -113426,11 +112584,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IOpenStaffPosition).EducationOrganizationId); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IOpenStaffPosition).RequisitionNumber); + //Derived Property + hash.Add((this as Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor).NeglectedOrDelinquentProgramDescriptorId); return hash.ToHashCode(); } @@ -113439,68 +112594,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// Date the open staff position was posted. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="datePosted")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime DatePosted { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The date the posting was removed or filled. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="datePostingRemoved")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DatePostingRemoved { get; set; } - - /// - /// Reflects the type of employment or contract desired for the position. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="employmentStatusDescriptor")][DescriptorExists("EmploymentStatusDescriptor")] - public string EmploymentStatusDescriptor { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The descriptive name of an individual's position. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="positionTitle")] - public string PositionTitle { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// Indication of whether the OpenStaffPosition was filled or retired without filling. + /// The end date of the period when the descriptor is in effect. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="postingResultDescriptor")][DescriptorExists("PostingResultDescriptor")] - public string PostingResultDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The name of the program for which the open staff position will be assigned. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="programAssignmentDescriptor")][DescriptorExists("ProgramAssignmentDescriptor")] - public string ProgramAssignmentDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The titles of employment, official status, or rank of education staff. + /// A shortened description for the descriptor. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="staffClassificationDescriptor")][DescriptorExists("StaffClassificationDescriptor")] - public string StaffClassificationDescriptor { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -113521,73 +112668,16 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OpenStaffPosition", "OpenStaffPosition")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _openStaffPositionAcademicSubjects; - private ICollection _openStaffPositionAcademicSubjectsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="academicSubjects")] - public ICollection OpenStaffPositionAcademicSubjects - { - get { return _openStaffPositionAcademicSubjects; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)e.Item).OpenStaffPosition = this); - _openStaffPositionAcademicSubjects = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)e.Item).OpenStaffPosition = this; - _openStaffPositionAcademicSubjectsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionAcademicSubjects - { - get { return _openStaffPositionAcademicSubjectsCovariant; } - set { OpenStaffPositionAcademicSubjects = new List(value.Cast()); } - } - - private ICollection _openStaffPositionInstructionalGradeLevels; - private ICollection _openStaffPositionInstructionalGradeLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="instructionalGradeLevels")] - public ICollection OpenStaffPositionInstructionalGradeLevels - { - get { return _openStaffPositionInstructionalGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)e.Item).OpenStaffPosition = this); - _openStaffPositionInstructionalGradeLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)e.Item).OpenStaffPosition = this; - _openStaffPositionInstructionalGradeLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionInstructionalGradeLevels - { - get { return _openStaffPositionInstructionalGradeLevelsCovariant; } - set { OpenStaffPositionInstructionalGradeLevels = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -113605,22 +112695,6 @@ public ICollection OpenStaffPositionIn // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_openStaffPositionAcademicSubjects != null) foreach (var item in _openStaffPositionAcademicSubjects) - { - item.OpenStaffPosition = this; - } - - if (_openStaffPositionInstructionalGradeLevels != null) foreach (var item in _openStaffPositionInstructionalGradeLevels) - { - item.OpenStaffPosition = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -113628,116 +112702,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.OpenStaffPositionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOpenStaffPosition)target); + return Entities.Common.EdFi.NeglectedOrDelinquentProgramDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.OpenStaffPositionMapper.MapTo(this, (Entities.Common.EdFi.IOpenStaffPosition)target, null); + Entities.Common.EdFi.NeglectedOrDelinquentProgramDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (OpenStaffPositionAcademicSubjects.Any() && mappingContract?.IsMemberSupported("OpenStaffPositionAcademicSubjects") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("OpenStaffPositionAcademicSubjects"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(OpenStaffPositionAcademicSubjects, validationContext, validationContext.Items.ForCollection("OpenStaffPositionAcademicSubjects")))) - { - yield return result; - } - } - - if (OpenStaffPositionInstructionalGradeLevels.Any() && mappingContract?.IsMemberSupported("OpenStaffPositionInstructionalGradeLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("OpenStaffPositionInstructionalGradeLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(OpenStaffPositionInstructionalGradeLevels, validationContext, validationContext.Items.ForCollection("OpenStaffPositionInstructionalGradeLevels")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -113745,15 +112722,9 @@ string Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationDiscriminato // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OpenStaffPositionPutPostRequestValidator : FluentValidation.AbstractValidator + public class NeglectedOrDelinquentProgramDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_OpenStaffPosition = new FullName("edfi", "OpenStaffPosition"); - - // Declare collection item validators - private OpenStaffPositionAcademicSubjectPutPostRequestValidator _openStaffPositionAcademicSubjectsValidator = new (); - private OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator _openStaffPositionInstructionalGradeLevelsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -113766,39 +112737,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (OpenStaffPositionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_OpenStaffPosition); - - if (mappingContract != null) - { - if (mappingContract.IsOpenStaffPositionAcademicSubjectIncluded != null) - { - var hasInvalidOpenStaffPositionAcademicSubjectsItems = instance.OpenStaffPositionAcademicSubjects.Any(x => !mappingContract.IsOpenStaffPositionAcademicSubjectIncluded(x)); - - if (hasInvalidOpenStaffPositionAcademicSubjectsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("OpenStaffPositionAcademicSubjects", $"A supplied 'OpenStaffPositionAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsOpenStaffPositionInstructionalGradeLevelIncluded != null) - { - var hasInvalidOpenStaffPositionInstructionalGradeLevelsItems = instance.OpenStaffPositionInstructionalGradeLevels.Any(x => !mappingContract.IsOpenStaffPositionInstructionalGradeLevelIncluded(x)); - - if (hasInvalidOpenStaffPositionInstructionalGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("OpenStaffPositionInstructionalGradeLevels", $"A supplied 'OpenStaffPositionInstructionalGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -113814,17 +112752,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.OpenStaffPositionAcademicSubject table of the OpenStaffPosition aggregate in the ODS Database. + /// A class which represents the edfi.NeglectedOrDelinquentProgramServiceDescriptor table of the NeglectedOrDelinquentProgramServiceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class OpenStaffPositionAcademicSubject : Entities.Common.EdFi.IOpenStaffPositionAcademicSubject, IValidatableObject + public class NeglectedOrDelinquentProgramServiceDescriptor : Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "OpenStaffPositionAcademicSubject"); + private static FullName _fullName = new FullName("edfi", "NeglectedOrDelinquentProgramServiceDescriptor"); // Fluent validator instance (threadsafe) - private static OpenStaffPositionAcademicSubjectPutPostRequestValidator _validator = new OpenStaffPositionAcademicSubjectPutPostRequestValidator(); + private static NeglectedOrDelinquentProgramServiceDescriptorPutPostRequestValidator _validator = new NeglectedOrDelinquentProgramServiceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -113841,6 +112784,13 @@ public class OpenStaffPositionAcademicSubject : Entities.Common.EdFi.IOpenStaffP // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the NeglectedOrDelinquentProgramServiceDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -113851,33 +112801,19 @@ public class OpenStaffPositionAcademicSubject : Entities.Common.EdFi.IOpenStaffP //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IOpenStaffPosition _openStaffPosition; - [IgnoreDataMember] - Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionAcademicSubject.OpenStaffPosition - { - get { return _openStaffPosition; } - set { SetOpenStaffPosition(value); } - } - - public Entities.Common.EdFi.IOpenStaffPosition OpenStaffPosition - { - set { SetOpenStaffPosition(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int NeglectedOrDelinquentProgramServiceDescriptorId { get; set; } - private void SetOpenStaffPosition(Entities.Common.EdFi.IOpenStaffPosition value) + int IDescriptor.DescriptorId { - _openStaffPosition = value; + get { return NeglectedOrDelinquentProgramServiceDescriptorId; } + set { NeglectedOrDelinquentProgramServiceDescriptorId = value; } } - - /// - /// The teaching field required for the open staff position. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -113892,7 +112828,7 @@ private void SetOpenStaffPosition(Entities.Common.EdFi.IOpenStaffPosition value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOpenStaffPositionAcademicSubject; + var compareTo = obj as Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -113900,13 +112836,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_openStaffPosition == null || !_openStaffPosition.Equals(compareTo.OpenStaffPosition)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IOpenStaffPositionAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor).NeglectedOrDelinquentProgramServiceDescriptorId.Equals(compareTo.NeglectedOrDelinquentProgramServiceDescriptorId)) return false; @@ -113922,12 +112854,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_openStaffPosition != null) - hash.Add(_openStaffPosition); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IOpenStaffPositionAcademicSubject).AcademicSubjectDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor).NeglectedOrDelinquentProgramServiceDescriptorId); return hash.ToHashCode(); } @@ -113936,6 +112865,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -113961,8 +112939,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OpenStaffPosition", "OpenStaffPositionAcademicSubject")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -113973,6 +112954,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -113985,12 +112973,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.OpenStaffPositionAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)target); + return Entities.Common.EdFi.NeglectedOrDelinquentProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.OpenStaffPositionAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)target, null); + Entities.Common.EdFi.NeglectedOrDelinquentProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor)target, null); } // ------------------------------------------------------------- @@ -113998,66 +112986,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -114065,9 +112993,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OpenStaffPositionAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator + public class NeglectedOrDelinquentProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -114095,17 +113023,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.OpenStaffPositionInstructionalGradeLevel table of the OpenStaffPosition aggregate in the ODS Database. + /// A class which represents the edfi.NetworkPurposeDescriptor table of the NetworkPurposeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class OpenStaffPositionInstructionalGradeLevel : Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel, IValidatableObject + public class NetworkPurposeDescriptor : Entities.Common.EdFi.INetworkPurposeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "OpenStaffPositionInstructionalGradeLevel"); + private static FullName _fullName = new FullName("edfi", "NetworkPurposeDescriptor"); // Fluent validator instance (threadsafe) - private static OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator _validator = new OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator(); + private static NetworkPurposeDescriptorPutPostRequestValidator _validator = new NetworkPurposeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -114122,6 +113055,13 @@ public class OpenStaffPositionInstructionalGradeLevel : Entities.Common.EdFi.IOp // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the NetworkPurposeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -114132,33 +113072,19 @@ public class OpenStaffPositionInstructionalGradeLevel : Entities.Common.EdFi.IOp //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IOpenStaffPosition _openStaffPosition; - [IgnoreDataMember] - Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionInstructionalGradeLevel.OpenStaffPosition - { - get { return _openStaffPosition; } - set { SetOpenStaffPosition(value); } - } - - public Entities.Common.EdFi.IOpenStaffPosition OpenStaffPosition - { - set { SetOpenStaffPosition(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int NetworkPurposeDescriptorId { get; set; } - private void SetOpenStaffPosition(Entities.Common.EdFi.IOpenStaffPosition value) + int IDescriptor.DescriptorId { - _openStaffPosition = value; + get { return NetworkPurposeDescriptorId; } + set { NetworkPurposeDescriptorId = value; } } - - /// - /// The set of grade levels for which the position's assignment is responsible. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -114173,7 +113099,7 @@ private void SetOpenStaffPosition(Entities.Common.EdFi.IOpenStaffPosition value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel; + var compareTo = obj as Entities.Common.EdFi.INetworkPurposeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -114181,13 +113107,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_openStaffPosition == null || !_openStaffPosition.Equals(compareTo.OpenStaffPosition)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.INetworkPurposeDescriptor).NetworkPurposeDescriptorId.Equals(compareTo.NetworkPurposeDescriptorId)) return false; @@ -114203,12 +113125,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_openStaffPosition != null) - hash.Add(_openStaffPosition); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel).GradeLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.INetworkPurposeDescriptor).NetworkPurposeDescriptorId); return hash.ToHashCode(); } @@ -114217,6 +113136,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -114242,8 +113210,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OpenStaffPosition", "OpenStaffPositionInstructionalGradeLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -114254,6 +113225,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -114266,12 +113244,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.OpenStaffPositionInstructionalGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)target); + return Entities.Common.EdFi.NetworkPurposeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INetworkPurposeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.OpenStaffPositionInstructionalGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)target, null); + Entities.Common.EdFi.NetworkPurposeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INetworkPurposeDescriptor)target, null); } // ------------------------------------------------------------- @@ -114279,66 +113257,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -114346,9 +113264,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class NetworkPurposeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -114377,21 +113295,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.OperationalStatusDescriptor table of the OperationalStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.NonMedicalImmunizationExemptionDescriptor table of the NonMedicalImmunizationExemptionDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class OperationalStatusDescriptor : Entities.Common.EdFi.IOperationalStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class NonMedicalImmunizationExemptionDescriptor : Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "OperationalStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "NonMedicalImmunizationExemptionDescriptor"); // Fluent validator instance (threadsafe) - private static OperationalStatusDescriptorPutPostRequestValidator _validator = new OperationalStatusDescriptorPutPostRequestValidator(); + private static NonMedicalImmunizationExemptionDescriptorPutPostRequestValidator _validator = new NonMedicalImmunizationExemptionDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -114410,7 +113328,7 @@ public class OperationalStatusDescriptor : Entities.Common.EdFi.IOperationalStat // ------------------------------------------------------------ /// - /// The unique identifier for the OperationalStatusDescriptor resource. + /// The unique identifier for the NonMedicalImmunizationExemptionDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -114431,12 +113349,12 @@ public class OperationalStatusDescriptor : Entities.Common.EdFi.IOperationalStat /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int OperationalStatusDescriptorId { get; set; } + public int NonMedicalImmunizationExemptionDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return OperationalStatusDescriptorId; } - set { OperationalStatusDescriptorId = value; } + get { return NonMedicalImmunizationExemptionDescriptorId; } + set { NonMedicalImmunizationExemptionDescriptorId = value; } } // ------------------------------------------------------------- @@ -114452,7 +113370,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOperationalStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -114462,7 +113380,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IOperationalStatusDescriptor).OperationalStatusDescriptorId.Equals(compareTo.OperationalStatusDescriptorId)) + if (!(this as Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor).NonMedicalImmunizationExemptionDescriptorId.Equals(compareTo.NonMedicalImmunizationExemptionDescriptorId)) return false; @@ -114480,7 +113398,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IOperationalStatusDescriptor).OperationalStatusDescriptorId); + hash.Add((this as Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor).NonMedicalImmunizationExemptionDescriptorId); return hash.ToHashCode(); } @@ -114597,12 +113515,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.OperationalStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOperationalStatusDescriptor)target); + return Entities.Common.EdFi.NonMedicalImmunizationExemptionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.OperationalStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IOperationalStatusDescriptor)target, null); + Entities.Common.EdFi.NonMedicalImmunizationExemptionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor)target, null); } // ------------------------------------------------------------- @@ -114617,9 +113535,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OperationalStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class NonMedicalImmunizationExemptionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -114648,16 +113566,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the OperationalUnitDimension resource. + /// Represents a reference to the ObjectDimension resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class OperationalUnitDimensionReference : IResourceReference + public class ObjectDimensionReference : IResourceReference { [DataMember(Name="code")] public string Code { get; set; } @@ -114722,8 +113640,8 @@ private Link CreateLink() { var link = new Link { - Rel = "OperationalUnitDimension", - Href = $"/ed-fi/operationalUnitDimensions/{ResourceId:n}" + Rel = "ObjectDimension", + Href = $"/ed-fi/objectDimensions/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -114750,17 +113668,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.OperationalUnitDimension table of the OperationalUnitDimension aggregate in the ODS Database. + /// A class which represents the edfi.ObjectDimension table of the ObjectDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class OperationalUnitDimension : Entities.Common.EdFi.IOperationalUnitDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class ObjectDimension : Entities.Common.EdFi.IObjectDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "OperationalUnitDimension"); + private static FullName _fullName = new FullName("edfi", "ObjectDimension"); // Fluent validator instance (threadsafe) - private static OperationalUnitDimensionPutPostRequestValidator _validator = new OperationalUnitDimensionPutPostRequestValidator(); + private static ObjectDimensionPutPostRequestValidator _validator = new ObjectDimensionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -114771,9 +113689,9 @@ public class OperationalUnitDimension : Entities.Common.EdFi.IOperationalUnitDim // Constructor // ------------------------------------------------------------- - public OperationalUnitDimension() + public ObjectDimension() { - OperationalUnitDimensionReportingTags = new List(); + ObjectDimensionReportingTags = new List(); } // ------------------------------------------------------------ @@ -114783,7 +113701,7 @@ public OperationalUnitDimension() // ------------------------------------------------------------ /// - /// The unique identifier for the OperationalUnitDimension resource. + /// The unique identifier for the ObjectDimension resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -114800,7 +113718,7 @@ public OperationalUnitDimension() // ------------------------------------------------------------- /// - /// The code representation of the account operational unit dimension. + /// The code representation of the account object dimension. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] @@ -114812,7 +113730,7 @@ public OperationalUnitDimension() private int _fiscalYear; /// - /// The fiscal year for which the account operational unit dimension is valid. + /// The fiscal year for which the account object dimension is valid. /// // NOT in a reference, NOT a lookup column [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] @@ -114841,7 +113759,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOperationalUnitDimension; + var compareTo = obj as Entities.Common.EdFi.IObjectDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -114851,12 +113769,12 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IOperationalUnitDimension).Code, compareTo.Code)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectDimension).Code, compareTo.Code)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.IOperationalUnitDimension).FiscalYear.Equals(compareTo.FiscalYear)) + if (!(this as Entities.Common.EdFi.IObjectDimension).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -114874,11 +113792,11 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IOperationalUnitDimension).Code); + hash.Add((this as Entities.Common.EdFi.IObjectDimension).Code); // Standard Property - hash.Add((this as Entities.Common.EdFi.IOperationalUnitDimension).FiscalYear); + hash.Add((this as Entities.Common.EdFi.IObjectDimension).FiscalYear); return hash.ToHashCode(); } @@ -114894,7 +113812,7 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A description of the account operational unit dimension. + /// A description of the account object dimension. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] @@ -114928,41 +113846,41 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OperationalUnitDimension", "OperationalUnitDimension")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectDimension", "ObjectDimension")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _operationalUnitDimensionReportingTags; - private ICollection _operationalUnitDimensionReportingTagsCovariant; + private ICollection _objectDimensionReportingTags; + private ICollection _objectDimensionReportingTagsCovariant; [NoDuplicateMembers] [DataMember(Name="reportingTags")] - public ICollection OperationalUnitDimensionReportingTags + public ICollection ObjectDimensionReportingTags { - get { return _operationalUnitDimensionReportingTags; } + get { return _objectDimensionReportingTags; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)e.Item).OperationalUnitDimension = this); - _operationalUnitDimensionReportingTags = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IObjectDimensionReportingTag)e.Item).ObjectDimension = this); + _objectDimensionReportingTags = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)e.Item).OperationalUnitDimension = this; - _operationalUnitDimensionReportingTagsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectDimensionReportingTag)e.Item).ObjectDimension = this; + _objectDimensionReportingTagsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IOperationalUnitDimension.OperationalUnitDimensionReportingTags + ICollection Entities.Common.EdFi.IObjectDimension.ObjectDimensionReportingTags { - get { return _operationalUnitDimensionReportingTagsCovariant; } - set { OperationalUnitDimensionReportingTags = new List(value.Cast()); } + get { return _objectDimensionReportingTagsCovariant; } + set { ObjectDimensionReportingTags = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -114987,9 +113905,9 @@ public ICollection OperationalUnitDimensio internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_operationalUnitDimensionReportingTags != null) foreach (var item in _operationalUnitDimensionReportingTags) + if (_objectDimensionReportingTags != null) foreach (var item in _objectDimensionReportingTags) { - item.OperationalUnitDimension = this; + item.ObjectDimension = this; } } @@ -115000,12 +113918,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.OperationalUnitDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOperationalUnitDimension)target); + return Entities.Common.EdFi.ObjectDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.OperationalUnitDimensionMapper.MapTo(this, (Entities.Common.EdFi.IOperationalUnitDimension)target, null); + Entities.Common.EdFi.ObjectDimensionMapper.MapTo(this, (Entities.Common.EdFi.IObjectDimension)target, null); } // ------------------------------------------------------------- @@ -115034,13 +113952,13 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (OperationalUnitDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("OperationalUnitDimensionReportingTags") != false) + if (ObjectDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("ObjectDimensionReportingTags") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("OperationalUnitDimensionReportingTags"); + pathBuilder.Append("ObjectDimensionReportingTags"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(OperationalUnitDimensionReportingTags, validationContext, validationContext.Items.ForCollection("OperationalUnitDimensionReportingTags")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ObjectDimensionReportingTags, validationContext, validationContext.Items.ForCollection("ObjectDimensionReportingTags")))) { yield return result; } @@ -115091,14 +114009,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OperationalUnitDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class ObjectDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_OperationalUnitDimension = new FullName("edfi", "OperationalUnitDimension"); + private static readonly FullName _fullName_edfi_ObjectDimension = new FullName("edfi", "ObjectDimension"); // Declare collection item validators - private OperationalUnitDimensionReportingTagPutPostRequestValidator _operationalUnitDimensionReportingTagsValidator = new (); + private ObjectDimensionReportingTagPutPostRequestValidator _objectDimensionReportingTagsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -115115,19 +114033,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsOperationalUnitDimensionReportingTagIncluded(x)); + var hasInvalidObjectDimensionReportingTagsItems = instance.ObjectDimensionReportingTags.Any(x => !mappingContract.IsObjectDimensionReportingTagIncluded(x)); - if (hasInvalidOperationalUnitDimensionReportingTagsItems) + if (hasInvalidObjectDimensionReportingTagsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("OperationalUnitDimensionReportingTags", $"A supplied 'OperationalUnitDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ObjectDimensionReportingTags", $"A supplied 'ObjectDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -115149,16 +114067,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.OperationalUnitDimensionReportingTag table of the OperationalUnitDimension aggregate in the ODS Database. + /// A class which represents the edfi.ObjectDimensionReportingTag table of the ObjectDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class OperationalUnitDimensionReportingTag : Entities.Common.EdFi.IOperationalUnitDimensionReportingTag, IValidatableObject + public class ObjectDimensionReportingTag : Entities.Common.EdFi.IObjectDimensionReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "OperationalUnitDimensionReportingTag"); + private static FullName _fullName = new FullName("edfi", "ObjectDimensionReportingTag"); // Fluent validator instance (threadsafe) - private static OperationalUnitDimensionReportingTagPutPostRequestValidator _validator = new OperationalUnitDimensionReportingTagPutPostRequestValidator(); + private static ObjectDimensionReportingTagPutPostRequestValidator _validator = new ObjectDimensionReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -115185,23 +114103,23 @@ public class OperationalUnitDimensionReportingTag : Entities.Common.EdFi.IOperat //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IOperationalUnitDimension _operationalUnitDimension; + private Entities.Common.EdFi.IObjectDimension _objectDimension; [IgnoreDataMember] - Entities.Common.EdFi.IOperationalUnitDimension IOperationalUnitDimensionReportingTag.OperationalUnitDimension + Entities.Common.EdFi.IObjectDimension IObjectDimensionReportingTag.ObjectDimension { - get { return _operationalUnitDimension; } - set { SetOperationalUnitDimension(value); } + get { return _objectDimension; } + set { SetObjectDimension(value); } } - public Entities.Common.EdFi.IOperationalUnitDimension OperationalUnitDimension + public Entities.Common.EdFi.IObjectDimension ObjectDimension { - set { SetOperationalUnitDimension(value); } + set { SetObjectDimension(value); } } - private void SetOperationalUnitDimension(Entities.Common.EdFi.IOperationalUnitDimension value) + private void SetObjectDimension(Entities.Common.EdFi.IObjectDimension value) { - _operationalUnitDimension = value; + _objectDimension = value; } /// @@ -115226,7 +114144,7 @@ private void SetOperationalUnitDimension(Entities.Common.EdFi.IOperationalUnitDi /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOperationalUnitDimensionReportingTag; + var compareTo = obj as Entities.Common.EdFi.IObjectDimensionReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -115235,12 +114153,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_operationalUnitDimension == null || !_operationalUnitDimension.Equals(compareTo.OperationalUnitDimension)) + if (_objectDimension == null || !_objectDimension.Equals(compareTo.ObjectDimension)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IOperationalUnitDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -115257,11 +114175,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_operationalUnitDimension != null) - hash.Add(_operationalUnitDimension); + if (_objectDimension != null) + hash.Add(_objectDimension); // Standard Property - hash.Add((this as Entities.Common.EdFi.IOperationalUnitDimensionReportingTag).ReportingTagDescriptor); + hash.Add((this as Entities.Common.EdFi.IObjectDimensionReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -115295,7 +114213,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OperationalUnitDimension", "OperationalUnitDimensionReportingTag")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectDimension", "ObjectDimensionReportingTag")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -115319,12 +114237,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.OperationalUnitDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)target); + return Entities.Common.EdFi.ObjectDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectDimensionReportingTag)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.OperationalUnitDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)target, null); + Entities.Common.EdFi.ObjectDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IObjectDimensionReportingTag)target, null); } // ------------------------------------------------------------- @@ -115399,9 +114317,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OperationalUnitDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class ObjectDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -115430,25 +114348,37 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the OrganizationDepartment resource. + /// Represents a reference to the ObjectiveAssessment resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class OrganizationDepartmentReference : IResourceReference + public class ObjectiveAssessmentReference : IResourceReference { - [DataMember(Name="organizationDepartmentId")] - public long OrganizationDepartmentId { get; set; } + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } + + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } + + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. /// public Guid ResourceId { get; set; } + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + private Link _link; @@ -115474,14 +114404,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return OrganizationDepartmentId != default(long); + return AssessmentIdentifier != default(string) && IdentificationCode != default(string) && Namespace != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (OrganizationDepartmentId == default) + if (AssessmentIdentifier == default) { - yield return "OrganizationDepartmentId"; + yield return "AssessmentIdentifier"; + } + + if (IdentificationCode == default) + { + yield return "IdentificationCode"; + } + + if (Namespace == default) + { + yield return "Namespace"; } } @@ -115490,25 +114430,44 @@ private Link CreateLink() { var link = new Link { - Rel = "OrganizationDepartment", - Href = $"/ed-fi/organizationDepartments/{ResourceId:n}" + Rel = "ObjectiveAssessment", + Href = $"/ed-fi/objectiveAssessments/{ResourceId:n}" }; - return link; + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } } // Aggregate reference /// - /// A class which represents the edfi.OrganizationDepartment table of the OrganizationDepartment aggregate in the ODS Database. + /// A class which represents the edfi.ObjectiveAssessment table of the ObjectiveAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class OrganizationDepartment : Entities.Common.EdFi.IOrganizationDepartment, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + public class ObjectiveAssessment : Entities.Common.EdFi.IObjectiveAssessment, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "OrganizationDepartment"); + private static FullName _fullName = new FullName("edfi", "ObjectiveAssessment"); // Fluent validator instance (threadsafe) - private static OrganizationDepartmentPutPostRequestValidator _validator = new OrganizationDepartmentPutPostRequestValidator(); + private static ObjectiveAssessmentPutPostRequestValidator _validator = new ObjectiveAssessmentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -115519,16 +114478,12 @@ public class OrganizationDepartment : Entities.Common.EdFi.IOrganizationDepartme // Constructor // ------------------------------------------------------------- - public OrganizationDepartment() + public ObjectiveAssessment() { - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); + ObjectiveAssessmentAssessmentItems = new List(); + ObjectiveAssessmentLearningStandards = new List(); + ObjectiveAssessmentPerformanceLevels = new List(); + ObjectiveAssessmentScores = new List(); } // ------------------------------------------------------------ @@ -115538,7 +114493,7 @@ public OrganizationDepartment() // ------------------------------------------------------------ /// - /// The unique identifier for the OrganizationDepartment resource. + /// The unique identifier for the ObjectiveAssessment resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -115549,37 +114504,70 @@ public OrganizationDepartment() // References // ------------------------------------------------------------- - private bool _parentEducationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _parentEducationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitParentEducationOrganizationReference + private bool _assessmentReferenceExplicitlyAssigned; + private Assessment.EdFi.AssessmentReference _assessmentReference; + private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_parentEducationOrganizationReference == null && !_parentEducationOrganizationReferenceExplicitlyAssigned) - _parentEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) + _assessmentReference = new Assessment.EdFi.AssessmentReference(); - return _parentEducationOrganizationReference; + return _assessmentReference; } } - [DataMember(Name="parentEducationOrganizationReference")] + [DataMember(Name="assessmentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Assessment.EdFi.AssessmentReference AssessmentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssessmentReference != null + && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference; + + return null; + } + set + { + _assessmentReferenceExplicitlyAssigned = true; + _assessmentReference = value; + } + } + private bool _parentObjectiveAssessmentReferenceExplicitlyAssigned; + private ObjectiveAssessmentReference _parentObjectiveAssessmentReference; + private ObjectiveAssessmentReference ImplicitParentObjectiveAssessmentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_parentObjectiveAssessmentReference == null && !_parentObjectiveAssessmentReferenceExplicitlyAssigned) + _parentObjectiveAssessmentReference = new ObjectiveAssessmentReference(); + + return _parentObjectiveAssessmentReference; + } + } + + [DataMember(Name="parentObjectiveAssessmentReference")] [FullyDefinedReference] - public EducationOrganization.EdFi.EducationOrganizationReference ParentEducationOrganizationReference + public ObjectiveAssessmentReference ParentObjectiveAssessmentReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitParentEducationOrganizationReference != null - && (_parentEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitParentEducationOrganizationReference; + if (ImplicitParentObjectiveAssessmentReference != null + && (_parentObjectiveAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentObjectiveAssessmentReference.IsReferenceFullyDefined())) + return ImplicitParentObjectiveAssessmentReference; return null; } set { - _parentEducationOrganizationReferenceExplicitlyAssigned = true; - _parentEducationOrganizationReference = value; + _parentObjectiveAssessmentReferenceExplicitlyAssigned = true; + _parentObjectiveAssessmentReference = value; } } // ------------------------------------------------------------- @@ -115589,17 +114577,70 @@ public EducationOrganization.EdFi.EducationOrganizationReference ParentEducation // ------------------------------------------------------------- /// - /// The unique identification code for the organization department. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// A unique number or alphanumeric code assigned to an assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IObjectiveAssessment.AssessmentIdentifier + { + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.AssessmentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.AssessmentIdentifier = value; + + // ParentObjectiveAssessment + _parentObjectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitParentObjectiveAssessmentReference.AssessmentIdentifier = value; + } + } + + /// + /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="organizationDepartmentId")] - public long OrganizationDepartmentId { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } - long IEducationOrganization.EducationOrganizationId + /// + /// Namespace for the assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IObjectiveAssessment.Namespace { - get { return OrganizationDepartmentId; } - set { OrganizationDepartmentId = value; } + get + { + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.Namespace; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.Namespace = value; + + // ParentObjectiveAssessment + _parentObjectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitParentObjectiveAssessmentReference.Namespace = value; + } } // ------------------------------------------------------------- @@ -115615,7 +114656,7 @@ long IEducationOrganization.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOrganizationDepartment; + var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessment; if (ReferenceEquals(this, compareTo)) return true; @@ -115624,8 +114665,18 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IOrganizationDepartment).OrganizationDepartmentId.Equals(compareTo.OrganizationDepartmentId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessment).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessment).IdentificationCode, compareTo.IdentificationCode)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessment).Namespace, compareTo.Namespace)) return false; @@ -115642,9 +114693,15 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IOrganizationDepartment).OrganizationDepartmentId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessment).AssessmentIdentifier); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessment).IdentificationCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessment).Namespace); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -115652,79 +114709,78 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The full, legally accepted name of the institution. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The current operational status of the education organization (e.g., active, inactive). + /// The subject area of the objective assessment. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } /// - /// A short name for the institution. + /// The description of the objective assessment (e.g., vocabulary, measurement, or geometry). /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The public web site address (URL) for the education organization. + /// The maximum raw score achievable across all assessment items that are correct and scored at the maximum. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [Range(typeof(decimal), "-9999999999.99999", "9999999999.99999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxRawScore")] + public decimal? MaxRawScore { get; set; } /// - /// The intended major subject area of the department. + /// Reflects the specific nomenclature used for this level of objective assessment. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nomenclature")] + public string Nomenclature { get; set; } /// - /// The identifier assigned to an education organization. + /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. /// // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationId + string Entities.Common.EdFi.IObjectiveAssessment.ParentIdentificationCode { get { - if (ImplicitParentEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitParentEducationOrganizationReference.IsReferenceFullyDefined())) + if (ImplicitParentObjectiveAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitParentObjectiveAssessmentReference.IsReferenceFullyDefined())) { - return ImplicitParentEducationOrganizationReference.EducationOrganizationId; + return ImplicitParentObjectiveAssessmentReference.IdentificationCode; } - return default(long?); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ParentEducationOrganization - _parentEducationOrganizationReferenceExplicitlyAssigned = false; - ImplicitParentEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); + // ParentObjectiveAssessment + _parentObjectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitParentObjectiveAssessmentReference.IdentificationCode = value; } } + + /// + /// The percentage of the assessment that tests this objective. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="percentOfAssessment")] + public decimal? PercentOfAssessment { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -115740,144 +114796,138 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses - { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses - { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; + // ------------------------------------------------------------- - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } - set - { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessment")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _objectiveAssessmentAssessmentItems; + private ICollection _objectiveAssessmentAssessmentItemsCovariant; [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes + [DataMember(Name="assessmentItems")] + public ICollection ObjectiveAssessmentAssessmentItems { - get { return _educationOrganizationIdentificationCodes; } + get { return _objectiveAssessmentAssessmentItems; } set { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)e.Item).ObjectiveAssessment = this); + _objectiveAssessmentAssessmentItems = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)e.Item).ObjectiveAssessment = this; + _objectiveAssessmentAssessmentItemsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentAssessmentItems { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + get { return _objectiveAssessmentAssessmentItemsCovariant; } + set { ObjectiveAssessmentAssessmentItems = new List(value.Cast()); } } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; + + private ICollection _objectiveAssessmentLearningStandards; + private ICollection _objectiveAssessmentLearningStandardsCovariant; [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators + [DataMember(Name="learningStandards")] + public ICollection ObjectiveAssessmentLearningStandards { - get { return _educationOrganizationIndicators; } + get { return _objectiveAssessmentLearningStandards; } set { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)e.Item).ObjectiveAssessment = this); + _objectiveAssessmentLearningStandards = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)e.Item).ObjectiveAssessment = this; + _objectiveAssessmentLearningStandardsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentLearningStandards { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } + get { return _objectiveAssessmentLearningStandardsCovariant; } + set { ObjectiveAssessmentLearningStandards = new List(value.Cast()); } } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; + + private ICollection _objectiveAssessmentPerformanceLevels; + private ICollection _objectiveAssessmentPerformanceLevelsCovariant; [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones + [DataMember(Name="performanceLevels")] + public ICollection ObjectiveAssessmentPerformanceLevels { - get { return _educationOrganizationInstitutionTelephones; } + get { return _objectiveAssessmentPerformanceLevels; } set { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)e.Item).ObjectiveAssessment = this); + _objectiveAssessmentPerformanceLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)e.Item).ObjectiveAssessment = this; + _objectiveAssessmentPerformanceLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentPerformanceLevels { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + get { return _objectiveAssessmentPerformanceLevelsCovariant; } + set { ObjectiveAssessmentPerformanceLevels = new List(value.Cast()); } } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; + + private ICollection _objectiveAssessmentScores; + private ICollection _objectiveAssessmentScoresCovariant; [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses + [DataMember(Name="scores")] + public ICollection ObjectiveAssessmentScores { - get { return _educationOrganizationInternationalAddresses; } + get { return _objectiveAssessmentScores; } set { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentScore)e.Item).ObjectiveAssessment = this); + _objectiveAssessmentScores = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IObjectiveAssessmentScore)e.Item).ObjectiveAssessment = this; + _objectiveAssessmentScoresCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + ICollection Entities.Common.EdFi.IObjectiveAssessment.ObjectiveAssessmentScores { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + get { return _objectiveAssessmentScoresCovariant; } + set { ObjectiveAssessmentScores = new List(value.Cast()); } } - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OrganizationDepartment", "OrganizationDepartment")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - // ============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -115900,34 +114950,24 @@ public ICollection t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInternationalAddresses"); + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + { + // Obtain value from other references + var valueFromAssessmentReference = this.AssessmentReference?.AssessmentIdentifier; + + if (valueFromAssessmentReference != null) { - yield return result; + yield return ("assessmentReference.assessmentIdentifier", this.AssessmentReference.AssessmentIdentifier); + } + + // Obtain value from other references + var valueFromParentObjectiveAssessmentReference = this.ParentObjectiveAssessmentReference?.AssessmentIdentifier; + + if (valueFromParentObjectiveAssessmentReference != null) + { + yield return ("parentObjectiveAssessmentReference.assessmentIdentifier", this.ParentObjectiveAssessmentReference.AssessmentIdentifier); } + } + var sourcesForNamespace = GetNamespaceSources().ToArray(); + if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); - // --------------------------- - // Validate embedded objects - // --------------------------- + string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetNamespaceSources() { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); + // Obtain value from other references + var valueFromAssessmentReference = this.AssessmentReference?.Namespace; - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + if (valueFromAssessmentReference != null) { - yield return result; + yield return ("assessmentReference.namespace", this.AssessmentReference.Namespace); } + + // Obtain value from other references + var valueFromParentObjectiveAssessmentReference = this.ParentObjectiveAssessmentReference?.Namespace; + + if (valueFromParentObjectiveAssessmentReference != null) + { + yield return ("parentObjectiveAssessmentReference.namespace", this.ParentObjectiveAssessmentReference.Namespace); + } + } // Execute the resource's fluent validator @@ -116103,19 +115204,17 @@ string Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationD // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OrganizationDepartmentPutPostRequestValidator : FluentValidation.AbstractValidator + public class ObjectiveAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_OrganizationDepartment = new FullName("edfi", "OrganizationDepartment"); + private static readonly FullName _fullName_edfi_ObjectiveAssessment = new FullName("edfi", "ObjectiveAssessment"); // Declare collection item validators - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); + private ObjectiveAssessmentAssessmentItemPutPostRequestValidator _objectiveAssessmentAssessmentItemsValidator = new (); + private ObjectiveAssessmentLearningStandardPutPostRequestValidator _objectiveAssessmentLearningStandardsValidator = new (); + private ObjectiveAssessmentPerformanceLevelPutPostRequestValidator _objectiveAssessmentPerformanceLevelsValidator = new (); + private ObjectiveAssessmentScorePutPostRequestValidator _objectiveAssessmentScoresValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -116132,74 +115231,52 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + if (mappingContract.IsObjectiveAssessmentAssessmentItemIncluded != null) { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + var hasInvalidObjectiveAssessmentAssessmentItemsItems = instance.ObjectiveAssessmentAssessmentItems.Any(x => !mappingContract.IsObjectiveAssessmentAssessmentItemIncluded(x)); - if (hasInvalidEducationOrganizationIdentificationCodesItems) + if (hasInvalidObjectiveAssessmentAssessmentItemsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ObjectiveAssessmentAssessmentItems", $"A supplied 'ObjectiveAssessmentAssessmentItem' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + if (mappingContract.IsObjectiveAssessmentLearningStandardIncluded != null) { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + var hasInvalidObjectiveAssessmentLearningStandardsItems = instance.ObjectiveAssessmentLearningStandards.Any(x => !mappingContract.IsObjectiveAssessmentLearningStandardIncluded(x)); - if (hasInvalidEducationOrganizationIndicatorsItems) + if (hasInvalidObjectiveAssessmentLearningStandardsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ObjectiveAssessmentLearningStandards", $"A supplied 'ObjectiveAssessmentLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + if (mappingContract.IsObjectiveAssessmentPerformanceLevelIncluded != null) { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + var hasInvalidObjectiveAssessmentPerformanceLevelsItems = instance.ObjectiveAssessmentPerformanceLevels.Any(x => !mappingContract.IsObjectiveAssessmentPerformanceLevelIncluded(x)); - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + if (hasInvalidObjectiveAssessmentPerformanceLevelsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ObjectiveAssessmentPerformanceLevels", $"A supplied 'ObjectiveAssessmentPerformanceLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + if (mappingContract.IsObjectiveAssessmentScoreIncluded != null) { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + var hasInvalidObjectiveAssessmentScoresItems = instance.ObjectiveAssessmentScores.Any(x => !mappingContract.IsObjectiveAssessmentScoreIncluded(x)); - if (hasInvalidEducationOrganizationInternationalAddressesItems) + if (hasInvalidObjectiveAssessmentScoresItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ObjectiveAssessmentScores", $"A supplied 'ObjectiveAssessmentScore' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -116220,22 +115297,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.OtherNameTypeDescriptor table of the OtherNameTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ObjectiveAssessmentAssessmentItem table of the ObjectiveAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class OtherNameTypeDescriptor : Entities.Common.EdFi.IOtherNameTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ObjectiveAssessmentAssessmentItem : Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "OtherNameTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentAssessmentItem"); // Fluent validator instance (threadsafe) - private static OtherNameTypeDescriptorPutPostRequestValidator _validator = new OtherNameTypeDescriptorPutPostRequestValidator(); + private static ObjectiveAssessmentAssessmentItemPutPostRequestValidator _validator = new ObjectiveAssessmentAssessmentItemPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -116252,35 +115324,99 @@ public class OtherNameTypeDescriptor : Entities.Common.EdFi.IOtherNameTypeDescri // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the OtherNameTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _assessmentItemReferenceExplicitlyAssigned; + private AssessmentItem.EdFi.AssessmentItemReference _assessmentItemReference; + private AssessmentItem.EdFi.AssessmentItemReference ImplicitAssessmentItemReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assessmentItemReference == null && !_assessmentItemReferenceExplicitlyAssigned) + _assessmentItemReference = new AssessmentItem.EdFi.AssessmentItemReference(); + + return _assessmentItemReference; + } + } + + [DataMember(Name="assessmentItemReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public AssessmentItem.EdFi.AssessmentItemReference AssessmentItemReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssessmentItemReference != null + && (_assessmentItemReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) + return ImplicitAssessmentItemReference; + + return null; + } + set + { + _assessmentItemReferenceExplicitlyAssigned = true; + _assessmentItemReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; + + [IgnoreDataMember] + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.ObjectiveAssessment + { + get { return _objectiveAssessment; } + set { SetObjectiveAssessment(value); } + } + + public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment + { + set { SetObjectiveAssessment(value); } + } + + private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) + { + _objectiveAssessment = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_assessmentItemReferenceExplicitlyAssigned) + { + ImplicitAssessmentItemReference.AssessmentIdentifier = _objectiveAssessment.AssessmentIdentifier; + ImplicitAssessmentItemReference.Namespace = _objectiveAssessment.Namespace; + } + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// A unique number or alphanumeric code assigned to a space, room, site, building, individual, organization, program, or institution by a school, school system, state, or other agency or entity. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int OtherNameTypeDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemIdentificationCode { - get { return OtherNameTypeDescriptorId; } - set { OtherNameTypeDescriptorId = value; } + get + { + if (ImplicitAssessmentItemReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) + return ImplicitAssessmentItemReference.IdentificationCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentItem + _assessmentItemReferenceExplicitlyAssigned = false; + ImplicitAssessmentItemReference.IdentificationCode = value; + } } // ------------------------------------------------------------- @@ -116296,7 +115432,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IOtherNameTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem; if (ReferenceEquals(this, compareTo)) return true; @@ -116304,9 +115440,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IOtherNameTypeDescriptor).OtherNameTypeDescriptorId.Equals(compareTo.OtherNameTypeDescriptorId)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).AssessmentItemIdentificationCode, compareTo.AssessmentItemIdentificationCode)) return false; @@ -116322,10 +115462,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_objectiveAssessment != null) + hash.Add(_objectiveAssessment); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IOtherNameTypeDescriptor).OtherNameTypeDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).AssessmentItemIdentificationCode); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -116333,66 +115475,17 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // Inherited One-to-one relationships @@ -116407,11 +115500,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentAssessmentItem")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116422,18 +115512,17 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -116441,19 +115530,154 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.OtherNameTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOtherNameTypeDescriptor)target); + return Entities.Common.EdFi.ObjectiveAssessmentAssessmentItemMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.OtherNameTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IOtherNameTypeDescriptor)target, null); + Entities.Common.EdFi.ObjectiveAssessmentAssessmentItemMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemResourceId + { + get { return null; } + set { ImplicitAssessmentItemReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem.AssessmentItemDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssessmentItemReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); + + if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).ObjectiveAssessment.AssessmentIdentifier); + + // Obtain value from other references + var valueFromAssessmentItemReference = this.AssessmentItemReference?.AssessmentIdentifier; + + if (valueFromAssessmentItemReference != null) + { + yield return ("assessmentItemReference.assessmentIdentifier", this.AssessmentItemReference.AssessmentIdentifier); + } + + } + var sourcesForNamespace = GetNamespaceSources().ToArray(); + + if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetNamespaceSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem).ObjectiveAssessment.Namespace); + + // Obtain value from other references + var valueFromAssessmentItemReference = this.AssessmentItemReference?.Namespace; + + if (valueFromAssessmentItemReference != null) + { + yield return ("assessmentItemReference.namespace", this.AssessmentItemReference.Namespace); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -116461,9 +115685,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class OtherNameTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ObjectiveAssessmentAssessmentItemPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -116491,22 +115715,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ParticipationDescriptor table of the ParticipationDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ObjectiveAssessmentLearningStandard table of the ObjectiveAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ParticipationDescriptor : Entities.Common.EdFi.IParticipationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ObjectiveAssessmentLearningStandard : Entities.Common.EdFi.IObjectiveAssessmentLearningStandard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ParticipationDescriptor"); + private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentLearningStandard"); // Fluent validator instance (threadsafe) - private static ParticipationDescriptorPutPostRequestValidator _validator = new ParticipationDescriptorPutPostRequestValidator(); + private static ObjectiveAssessmentLearningStandardPutPostRequestValidator _validator = new ObjectiveAssessmentLearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -116523,35 +115742,92 @@ public class ParticipationDescriptor : Entities.Common.EdFi.IParticipationDescri // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ParticipationDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _learningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) + _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); + + return _learningStandardReference; + } + } + + [DataMember(Name="learningStandardReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LearningStandard.EdFi.LearningStandardReference LearningStandardReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLearningStandardReference != null + && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference; + + return null; + } + set + { + _learningStandardReferenceExplicitlyAssigned = true; + _learningStandardReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; + + [IgnoreDataMember] + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.ObjectiveAssessment + { + get { return _objectiveAssessment; } + set { SetObjectiveAssessment(value); } + } + + public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment + { + set { SetObjectiveAssessment(value); } + } + + private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) + { + _objectiveAssessment = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ParticipationDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardId { - get { return ParticipationDescriptorId; } - set { ParticipationDescriptorId = value; } + get + { + if (ImplicitLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference.LearningStandardId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LearningStandard + _learningStandardReferenceExplicitlyAssigned = false; + ImplicitLearningStandardReference.LearningStandardId = value; + } } // ------------------------------------------------------------- @@ -116567,7 +115843,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IParticipationDescriptor; + var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentLearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -116575,9 +115851,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IParticipationDescriptor).ParticipationDescriptorId.Equals(compareTo.ParticipationDescriptorId)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentLearningStandard).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -116593,10 +115873,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_objectiveAssessment != null) + hash.Add(_objectiveAssessment); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IParticipationDescriptor).ParticipationDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -116604,55 +115886,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116678,11 +115911,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentLearningStandard")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116693,13 +115923,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -116712,19 +115935,93 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ParticipationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IParticipationDescriptor)target); + return Entities.Common.EdFi.ObjectiveAssessmentLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ParticipationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IParticipationDescriptor)target, null); + Entities.Common.EdFi.ObjectiveAssessmentLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentLearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardResourceId + { + get { return null; } + set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IObjectiveAssessmentLearningStandard.LearningStandardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLearningStandardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -116732,9 +116029,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ParticipationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ObjectiveAssessmentLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -116762,22 +116059,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ParticipationStatusDescriptor table of the ParticipationStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ObjectiveAssessmentPerformanceLevel table of the ObjectiveAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ParticipationStatusDescriptor : Entities.Common.EdFi.IParticipationStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ObjectiveAssessmentPerformanceLevel : Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ParticipationStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentPerformanceLevel"); // Fluent validator instance (threadsafe) - private static ParticipationStatusDescriptorPutPostRequestValidator _validator = new ParticipationStatusDescriptorPutPostRequestValidator(); + private static ObjectiveAssessmentPerformanceLevelPutPostRequestValidator _validator = new ObjectiveAssessmentPerformanceLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -116794,13 +116086,6 @@ public class ParticipationStatusDescriptor : Entities.Common.EdFi.IParticipation // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ParticipationStatusDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -116811,19 +116096,42 @@ public class ParticipationStatusDescriptor : Entities.Common.EdFi.IParticipation //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ParticipationStatusDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentPerformanceLevel.ObjectiveAssessment + { + get { return _objectiveAssessment; } + set { SetObjectiveAssessment(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment { - get { return ParticipationStatusDescriptorId; } - set { ParticipationStatusDescriptorId = value; } + set { SetObjectiveAssessment(value); } + } + + private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) + { + _objectiveAssessment = value; } + + /// + /// The method that the instructor of the class uses to report the performance and achievement of all students. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } + + /// + /// The performance level(s) defined for the assessment. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] + public string PerformanceLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116838,7 +116146,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IParticipationStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -116846,9 +116154,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IParticipationStatusDescriptor).ParticipationStatusDescriptorId.Equals(compareTo.ParticipationStatusDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor, compareTo.PerformanceLevelDescriptor)) return false; @@ -116864,9 +116181,16 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_objectiveAssessment != null) + hash.Add(_objectiveAssessment); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IParticipationStatusDescriptor).ParticipationStatusDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor); return hash.ToHashCode(); } @@ -116875,60 +116199,43 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The maximum score to make the indicated level of performance. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maximumScore")] + public string MaximumScore { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The minimum score required to make the indicated level of performance. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="minimumScore")] + public string MinimumScore { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The name of the indicator being measured for a collection of performance level values. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="performanceLevelIndicatorName")] + public string PerformanceLevelIndicatorName { get; set; } /// - /// A shortened description for the descriptor. + /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] + public string ResultDatatypeTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116949,11 +116256,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentPerformanceLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -116964,13 +116268,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -116983,12 +116280,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ParticipationStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IParticipationStatusDescriptor)target); + return Entities.Common.EdFi.ObjectiveAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ParticipationStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IParticipationStatusDescriptor)target, null); + Entities.Common.EdFi.ObjectiveAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel)target, null); } // ------------------------------------------------------------- @@ -116996,6 +116293,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -117003,9 +116360,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ParticipationStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ObjectiveAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -117033,22 +116390,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PerformanceBaseConversionDescriptor table of the PerformanceBaseConversionDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ObjectiveAssessmentScore table of the ObjectiveAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PerformanceBaseConversionDescriptor : Entities.Common.EdFi.IPerformanceBaseConversionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ObjectiveAssessmentScore : Entities.Common.EdFi.IObjectiveAssessmentScore, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PerformanceBaseConversionDescriptor"); + private static FullName _fullName = new FullName("edfi", "ObjectiveAssessmentScore"); // Fluent validator instance (threadsafe) - private static PerformanceBaseConversionDescriptorPutPostRequestValidator _validator = new PerformanceBaseConversionDescriptorPutPostRequestValidator(); + private static ObjectiveAssessmentScorePutPostRequestValidator _validator = new ObjectiveAssessmentScorePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -117065,13 +116417,6 @@ public class PerformanceBaseConversionDescriptor : Entities.Common.EdFi.IPerform // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the PerformanceBaseConversionDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -117082,19 +116427,33 @@ public class PerformanceBaseConversionDescriptor : Entities.Common.EdFi.IPerform //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IObjectiveAssessment _objectiveAssessment; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int PerformanceBaseConversionDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentScore.ObjectiveAssessment + { + get { return _objectiveAssessment; } + set { SetObjectiveAssessment(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IObjectiveAssessment ObjectiveAssessment { - get { return PerformanceBaseConversionDescriptorId; } - set { PerformanceBaseConversionDescriptorId = value; } + set { SetObjectiveAssessment(value); } + } + + private void SetObjectiveAssessment(Entities.Common.EdFi.IObjectiveAssessment value) + { + _objectiveAssessment = value; } + + /// + /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117109,7 +116468,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPerformanceBaseConversionDescriptor; + var compareTo = obj as Entities.Common.EdFi.IObjectiveAssessmentScore; if (ReferenceEquals(this, compareTo)) return true; @@ -117117,9 +116476,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_objectiveAssessment == null || !_objectiveAssessment.Equals(compareTo.ObjectiveAssessment)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IPerformanceBaseConversionDescriptor).PerformanceBaseConversionDescriptorId.Equals(compareTo.PerformanceBaseConversionDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IObjectiveAssessmentScore).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) return false; @@ -117135,9 +116498,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_objectiveAssessment != null) + hash.Add(_objectiveAssessment); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IPerformanceBaseConversionDescriptor).PerformanceBaseConversionDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IObjectiveAssessmentScore).AssessmentReportingMethodDescriptor); return hash.ToHashCode(); } @@ -117146,60 +116512,35 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The end date of the period when the descriptor is in effect. + /// The maximum score possible on the assessment. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maximumScore")] + public string MaximumScore { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The minimum score possible on the assessment. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="minimumScore")] + public string MinimumScore { get; set; } /// - /// A shortened description for the descriptor. + /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] + public string ResultDatatypeTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117220,11 +116561,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ObjectiveAssessment", "ObjectiveAssessmentScore")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117235,13 +116573,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -117254,12 +116585,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PerformanceBaseConversionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPerformanceBaseConversionDescriptor)target); + return Entities.Common.EdFi.ObjectiveAssessmentScoreMapper.SynchronizeTo(this, (Entities.Common.EdFi.IObjectiveAssessmentScore)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PerformanceBaseConversionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPerformanceBaseConversionDescriptor)target, null); + Entities.Common.EdFi.ObjectiveAssessmentScoreMapper.MapTo(this, (Entities.Common.EdFi.IObjectiveAssessmentScore)target, null); } // ------------------------------------------------------------- @@ -117267,6 +116598,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -117274,9 +116665,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PerformanceBaseConversionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ObjectiveAssessmentScorePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -117305,21 +116696,118 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PerformanceLevelDescriptor table of the PerformanceLevelDescriptor aggregate in the ODS Database. + /// Represents a reference to the OpenStaffPosition resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class OpenStaffPositionReference : IResourceReference + { + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="requisitionNumber")] + public string RequisitionNumber { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationId != default(long) && RequisitionNumber != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (RequisitionNumber == default) + { + yield return "RequisitionNumber"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "OpenStaffPosition", + Href = $"/ed-fi/openStaffPositions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.OpenStaffPosition table of the OpenStaffPosition aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PerformanceLevelDescriptor : Entities.Common.EdFi.IPerformanceLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class OpenStaffPosition : Entities.Common.EdFi.IOpenStaffPosition, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PerformanceLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "OpenStaffPosition"); // Fluent validator instance (threadsafe) - private static PerformanceLevelDescriptorPutPostRequestValidator _validator = new PerformanceLevelDescriptorPutPostRequestValidator(); + private static OpenStaffPositionPutPostRequestValidator _validator = new OpenStaffPositionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -117330,6 +116818,11 @@ public class PerformanceLevelDescriptor : Entities.Common.EdFi.IPerformanceLevel // Constructor // ------------------------------------------------------------- + public OpenStaffPosition() + { + OpenStaffPositionAcademicSubjects = new List(); + OpenStaffPositionInstructionalGradeLevels = new List(); + } // ------------------------------------------------------------ @@ -117338,7 +116831,7 @@ public class PerformanceLevelDescriptor : Entities.Common.EdFi.IPerformanceLevel // ------------------------------------------------------------ /// - /// The unique identifier for the PerformanceLevelDescriptor resource. + /// The unique identifier for the OpenStaffPosition resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -117348,24 +116841,79 @@ public class PerformanceLevelDescriptor : Entities.Common.EdFi.IPerformanceLevel // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int PerformanceLevelDescriptorId { get; set; } + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - int IDescriptor.DescriptorId + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { - get { return PerformanceLevelDescriptorId; } - set { PerformanceLevelDescriptorId = value; } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationId + { + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } } + + /// + /// The number or identifier assigned to an open staff position, typically a requisition number assigned by Human Resources. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="requisitionNumber")] + public string RequisitionNumber { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117380,7 +116928,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPerformanceLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.IOpenStaffPosition; if (ReferenceEquals(this, compareTo)) return true; @@ -117389,8 +116937,13 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IPerformanceLevelDescriptor).PerformanceLevelDescriptorId.Equals(compareTo.PerformanceLevelDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IOpenStaffPosition).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IOpenStaffPosition).RequisitionNumber, compareTo.RequisitionNumber)) return false; @@ -117407,8 +116960,11 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IPerformanceLevelDescriptor).PerformanceLevelDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IOpenStaffPosition).EducationOrganizationId); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IOpenStaffPosition).RequisitionNumber); return hash.ToHashCode(); } @@ -117417,60 +116973,68 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// Date the open staff position was posted. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [DataMember(Name="datePosted")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime DatePosted { get; set; } /// - /// The description of the descriptor. + /// The date the posting was removed or filled. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [DataMember(Name="datePostingRemoved")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DatePostingRemoved { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// Reflects the type of employment or contract desired for the position. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="employmentStatusDescriptor")][DescriptorExists("EmploymentStatusDescriptor")] + public string EmploymentStatusDescriptor { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The descriptive name of an individual's position. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="positionTitle")] + public string PositionTitle { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// Indication of whether the OpenStaffPosition was filled or retired without filling. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="postingResultDescriptor")][DescriptorExists("PostingResultDescriptor")] + public string PostingResultDescriptor { get; set; } /// - /// A shortened description for the descriptor. + /// The name of the program for which the open staff position will be assigned. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="programAssignmentDescriptor")][DescriptorExists("ProgramAssignmentDescriptor")] + public string ProgramAssignmentDescriptor { get; set; } - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// The titles of employment, official status, or rank of education staff. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="staffClassificationDescriptor")][DescriptorExists("StaffClassificationDescriptor")] + public string StaffClassificationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117491,16 +117055,73 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OpenStaffPosition", "OpenStaffPosition")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _openStaffPositionAcademicSubjects; + private ICollection _openStaffPositionAcademicSubjectsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="academicSubjects")] + public ICollection OpenStaffPositionAcademicSubjects + { + get { return _openStaffPositionAcademicSubjects; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)e.Item).OpenStaffPosition = this); + _openStaffPositionAcademicSubjects = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)e.Item).OpenStaffPosition = this; + _openStaffPositionAcademicSubjectsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionAcademicSubjects + { + get { return _openStaffPositionAcademicSubjectsCovariant; } + set { OpenStaffPositionAcademicSubjects = new List(value.Cast()); } + } + + private ICollection _openStaffPositionInstructionalGradeLevels; + private ICollection _openStaffPositionInstructionalGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="instructionalGradeLevels")] + public ICollection OpenStaffPositionInstructionalGradeLevels + { + get { return _openStaffPositionInstructionalGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)e.Item).OpenStaffPosition = this); + _openStaffPositionInstructionalGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)e.Item).OpenStaffPosition = this; + _openStaffPositionInstructionalGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IOpenStaffPosition.OpenStaffPositionInstructionalGradeLevels + { + get { return _openStaffPositionInstructionalGradeLevelsCovariant; } + set { OpenStaffPositionInstructionalGradeLevels = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -117518,6 +117139,22 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_openStaffPositionAcademicSubjects != null) foreach (var item in _openStaffPositionAcademicSubjects) + { + item.OpenStaffPosition = this; + } + + if (_openStaffPositionInstructionalGradeLevels != null) foreach (var item in _openStaffPositionInstructionalGradeLevels) + { + item.OpenStaffPosition = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -117525,169 +117162,203 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PerformanceLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPerformanceLevelDescriptor)target); + return Entities.Common.EdFi.OpenStaffPositionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOpenStaffPosition)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PerformanceLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPerformanceLevelDescriptor)target, null); + Entities.Common.EdFi.OpenStaffPositionMapper.MapTo(this, (Entities.Common.EdFi.IOpenStaffPosition)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } + Guid? Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } - // ================================================================= - // Validators - // ----------------------------------------------------------------- + string Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } - [ExcludeFromCodeCoverage] - public class PerformanceLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - if (context.InstanceToValidate == null) + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + // Prepare builders for validating members + int dotLength = pathBuilder.Length; - return false; - } + // ---------------------- + // Validate collections + // ---------------------- + if (OpenStaffPositionAcademicSubjects.Any() && mappingContract?.IsMemberSupported("OpenStaffPositionAcademicSubjects") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("OpenStaffPositionAcademicSubjects"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(OpenStaffPositionAcademicSubjects, validationContext, validationContext.Items.ForCollection("OpenStaffPositionAcademicSubjects")))) + { + yield return result; + } + } - var instance = context.InstanceToValidate; + if (OpenStaffPositionInstructionalGradeLevels.Any() && mappingContract?.IsMemberSupported("OpenStaffPositionInstructionalGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("OpenStaffPositionInstructionalGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(OpenStaffPositionInstructionalGradeLevels, validationContext, validationContext.Items.ForCollection("OpenStaffPositionInstructionalGradeLevels")))) + { + yield return result; + } + } - var failures = new List(); - if (failures.Any()) - { - foreach (var failure in failures) + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) { - result.Errors.Add(failure); + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); - return false; + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } } - - return true; + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- } } - // ----------------------------------------------------------------- -} -// Aggregate: Person + // ================================================================= + // Validators + // ----------------------------------------------------------------- -namespace EdFi.Ods.Api.Common.Models.Resources.Person.EdFi -{ - /// - /// Represents a reference to the Person resource. - /// - [DataContract] [ExcludeFromCodeCoverage] - public class PersonReference : IResourceReference + public class OpenStaffPositionPutPostRequestValidator : FluentValidation.AbstractValidator { - [DataMember(Name="personId")] - public string PersonId { get; set; } - - [DataMember(Name="sourceSystemDescriptor")][DescriptorExists("SourceSystemDescriptor")] - public string SourceSystemDescriptor { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - + private static readonly FullName _fullName_edfi_OpenStaffPosition = new FullName("edfi", "OpenStaffPosition"); - private Link _link; + // Declare collection item validators + private OpenStaffPositionAcademicSubjectPutPostRequestValidator _openStaffPositionAcademicSubjectsValidator = new (); + private OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator _openStaffPositionInstructionalGradeLevelsValidator = new (); - [DataMember(Name="link")] - public Link Link + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - get + if (context.InstanceToValidate == null) { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - return _link; + return false; } - } - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return PersonId != default(string) && SourceSystemDescriptor != default(string); - } + var instance = context.InstanceToValidate; - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (PersonId == default) - { - yield return "PersonId"; - } + var failures = new List(); - if (SourceSystemDescriptor == default) - { - yield return "SourceSystemDescriptor"; - } + // Profile-based collection item filter validation + string profileName = null; - } + // Get the current mapping contract + var mappingContract = (OpenStaffPositionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_OpenStaffPosition); - private Link CreateLink() - { - var link = new Link + if (mappingContract != null) { - Rel = "Person", - Href = $"/ed-fi/people/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; + if (mappingContract.IsOpenStaffPositionAcademicSubjectIncluded != null) + { + var hasInvalidOpenStaffPositionAcademicSubjectsItems = instance.OpenStaffPositionAcademicSubjects.Any(x => !mappingContract.IsOpenStaffPositionAcademicSubjectIncluded(x)); + + if (hasInvalidOpenStaffPositionAcademicSubjectsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("OpenStaffPositionAcademicSubjects", $"A supplied 'OpenStaffPositionAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } - string[] linkParts = Discriminator.Split('.'); + if (mappingContract.IsOpenStaffPositionInstructionalGradeLevelIncluded != null) + { + var hasInvalidOpenStaffPositionInstructionalGradeLevelsItems = instance.OpenStaffPositionInstructionalGradeLevels.Any(x => !mappingContract.IsOpenStaffPositionInstructionalGradeLevelIncluded(x)); + + if (hasInvalidOpenStaffPositionInstructionalGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("OpenStaffPositionInstructionalGradeLevels", $"A supplied 'OpenStaffPositionInstructionalGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } - if (linkParts.Length < 2) - return link; + } - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.Person table of the Person aggregate in the ODS Database. + /// A class which represents the edfi.OpenStaffPositionAcademicSubject table of the OpenStaffPosition aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Person : Entities.Common.EdFi.IPerson, IHasETag, IDateVersionedEntity, IValidatableObject + public class OpenStaffPositionAcademicSubject : Entities.Common.EdFi.IOpenStaffPositionAcademicSubject, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Person"); + private static FullName _fullName = new FullName("edfi", "OpenStaffPositionAcademicSubject"); // Fluent validator instance (threadsafe) - private static PersonPutPostRequestValidator _validator = new PersonPutPostRequestValidator(); + private static OpenStaffPositionAcademicSubjectPutPostRequestValidator _validator = new OpenStaffPositionAcademicSubjectPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -117704,13 +117375,6 @@ public class Person : Entities.Common.EdFi.IPerson, IHasETag, IDateVersionedEnti // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the Person resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -117721,24 +117385,33 @@ public class Person : Entities.Common.EdFi.IPerson, IHasETag, IDateVersionedEnti //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IOpenStaffPosition _openStaffPosition; - /// - /// A unique alphanumeric code assigned to a person. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="personId")] - public string PersonId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionAcademicSubject.OpenStaffPosition + { + get { return _openStaffPosition; } + set { SetOpenStaffPosition(value); } + } + + public Entities.Common.EdFi.IOpenStaffPosition OpenStaffPosition + { + set { SetOpenStaffPosition(value); } + } + + private void SetOpenStaffPosition(Entities.Common.EdFi.IOpenStaffPosition value) + { + _openStaffPosition = value; + } /// - /// This descriptor defines the originating record source system for the person. + /// The teaching field required for the open staff position. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="sourceSystemDescriptor")][DescriptorExists("SourceSystemDescriptor")] - public string SourceSystemDescriptor { get; set; } + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -117753,7 +117426,7 @@ public class Person : Entities.Common.EdFi.IPerson, IHasETag, IDateVersionedEnti /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPerson; + var compareTo = obj as Entities.Common.EdFi.IOpenStaffPositionAcademicSubject; if (ReferenceEquals(this, compareTo)) return true; @@ -117761,14 +117434,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IPerson).PersonId, compareTo.PersonId)) + // Parent Property + if (_openStaffPosition == null || !_openStaffPosition.Equals(compareTo.OpenStaffPosition)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IPerson).SourceSystemDescriptor, compareTo.SourceSystemDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IOpenStaffPositionAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) return false; @@ -117784,13 +117456,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_openStaffPosition != null) + hash.Add(_openStaffPosition); // Standard Property - hash.Add((this as Entities.Common.EdFi.IPerson).PersonId); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IPerson).SourceSystemDescriptor); + hash.Add((this as Entities.Common.EdFi.IOpenStaffPositionAcademicSubject).AcademicSubjectDescriptor); return hash.ToHashCode(); } @@ -117824,7 +117495,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Person", "Person")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OpenStaffPosition", "OpenStaffPositionAcademicSubject")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -117836,13 +117507,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -117855,12 +117519,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PersonMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPerson)target); + return Entities.Common.EdFi.OpenStaffPositionAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PersonMapper.MapTo(this, (Entities.Common.EdFi.IPerson)target, null); + Entities.Common.EdFi.OpenStaffPositionAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.IOpenStaffPositionAcademicSubject)target, null); } // ------------------------------------------------------------- @@ -117884,6 +117548,7 @@ void IMappable.Map(object target) try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -117934,9 +117599,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PersonPutPostRequestValidator : FluentValidation.AbstractValidator + public class OpenStaffPositionAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -117964,22 +117629,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext c } // ----------------------------------------------------------------- -} -// Aggregate: PersonalInformationVerificationDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.PersonalInformationVerificationDescriptor.EdFi -{ /// - /// A class which represents the edfi.PersonalInformationVerificationDescriptor table of the PersonalInformationVerificationDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.OpenStaffPositionInstructionalGradeLevel table of the OpenStaffPosition aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PersonalInformationVerificationDescriptor : Entities.Common.EdFi.IPersonalInformationVerificationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class OpenStaffPositionInstructionalGradeLevel : Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PersonalInformationVerificationDescriptor"); + private static FullName _fullName = new FullName("edfi", "OpenStaffPositionInstructionalGradeLevel"); // Fluent validator instance (threadsafe) - private static PersonalInformationVerificationDescriptorPutPostRequestValidator _validator = new PersonalInformationVerificationDescriptorPutPostRequestValidator(); + private static OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator _validator = new OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -117996,13 +117656,6 @@ public class PersonalInformationVerificationDescriptor : Entities.Common.EdFi.IP // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the PersonalInformationVerificationDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -118013,19 +117666,33 @@ public class PersonalInformationVerificationDescriptor : Entities.Common.EdFi.IP //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IOpenStaffPosition _openStaffPosition; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int PersonalInformationVerificationDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionInstructionalGradeLevel.OpenStaffPosition + { + get { return _openStaffPosition; } + set { SetOpenStaffPosition(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IOpenStaffPosition OpenStaffPosition { - get { return PersonalInformationVerificationDescriptorId; } - set { PersonalInformationVerificationDescriptorId = value; } + set { SetOpenStaffPosition(value); } + } + + private void SetOpenStaffPosition(Entities.Common.EdFi.IOpenStaffPosition value) + { + _openStaffPosition = value; } + + /// + /// The set of grade levels for which the position's assignment is responsible. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118040,7 +117707,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPersonalInformationVerificationDescriptor; + var compareTo = obj as Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -118048,9 +117715,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_openStaffPosition == null || !_openStaffPosition.Equals(compareTo.OpenStaffPosition)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IPersonalInformationVerificationDescriptor).PersonalInformationVerificationDescriptorId.Equals(compareTo.PersonalInformationVerificationDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -118066,9 +117737,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_openStaffPosition != null) + hash.Add(_openStaffPosition); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IPersonalInformationVerificationDescriptor).PersonalInformationVerificationDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -118077,55 +117751,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118151,11 +117776,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OpenStaffPosition", "OpenStaffPositionInstructionalGradeLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118166,13 +117788,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -118185,12 +117800,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PersonalInformationVerificationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPersonalInformationVerificationDescriptor)target); + return Entities.Common.EdFi.OpenStaffPositionInstructionalGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PersonalInformationVerificationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPersonalInformationVerificationDescriptor)target, null); + Entities.Common.EdFi.OpenStaffPositionInstructionalGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel)target, null); } // ------------------------------------------------------------- @@ -118198,6 +117813,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -118205,9 +117880,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PersonalInformationVerificationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class OpenStaffPositionInstructionalGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -118236,21 +117911,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PlatformTypeDescriptor table of the PlatformTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.OperationalStatusDescriptor table of the OperationalStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PlatformTypeDescriptor : Entities.Common.EdFi.IPlatformTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class OperationalStatusDescriptor : Entities.Common.EdFi.IOperationalStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "PlatformTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "OperationalStatusDescriptor"); // Fluent validator instance (threadsafe) - private static PlatformTypeDescriptorPutPostRequestValidator _validator = new PlatformTypeDescriptorPutPostRequestValidator(); + private static OperationalStatusDescriptorPutPostRequestValidator _validator = new OperationalStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -118269,7 +117944,7 @@ public class PlatformTypeDescriptor : Entities.Common.EdFi.IPlatformTypeDescript // ------------------------------------------------------------ /// - /// The unique identifier for the PlatformTypeDescriptor resource. + /// The unique identifier for the OperationalStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -118290,12 +117965,12 @@ public class PlatformTypeDescriptor : Entities.Common.EdFi.IPlatformTypeDescript /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int PlatformTypeDescriptorId { get; set; } + public int OperationalStatusDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return PlatformTypeDescriptorId; } - set { PlatformTypeDescriptorId = value; } + get { return OperationalStatusDescriptorId; } + set { OperationalStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -118311,7 +117986,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPlatformTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IOperationalStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -118321,7 +117996,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IPlatformTypeDescriptor).PlatformTypeDescriptorId.Equals(compareTo.PlatformTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.IOperationalStatusDescriptor).OperationalStatusDescriptorId.Equals(compareTo.OperationalStatusDescriptorId)) return false; @@ -118339,7 +118014,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IPlatformTypeDescriptor).PlatformTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.IOperationalStatusDescriptor).OperationalStatusDescriptorId); return hash.ToHashCode(); } @@ -118456,12 +118131,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PlatformTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPlatformTypeDescriptor)target); + return Entities.Common.EdFi.OperationalStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOperationalStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PlatformTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPlatformTypeDescriptor)target, null); + Entities.Common.EdFi.OperationalStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IOperationalStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -118476,9 +118151,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PlatformTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class OperationalStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -118507,21 +118182,119 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PopulationServedDescriptor table of the PopulationServedDescriptor aggregate in the ODS Database. + /// Represents a reference to the OperationalUnitDimension resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class OperationalUnitDimensionReference : IResourceReference + { + [DataMember(Name="code")] + public string Code { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return Code != default(string) && FiscalYear != default(int); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (Code == default) + { + yield return "Code"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "OperationalUnitDimension", + Href = $"/ed-fi/operationalUnitDimensions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.OperationalUnitDimension table of the OperationalUnitDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PopulationServedDescriptor : Entities.Common.EdFi.IPopulationServedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class OperationalUnitDimension : Entities.Common.EdFi.IOperationalUnitDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PopulationServedDescriptor"); + private static FullName _fullName = new FullName("edfi", "OperationalUnitDimension"); // Fluent validator instance (threadsafe) - private static PopulationServedDescriptorPutPostRequestValidator _validator = new PopulationServedDescriptorPutPostRequestValidator(); + private static OperationalUnitDimensionPutPostRequestValidator _validator = new OperationalUnitDimensionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -118532,6 +118305,10 @@ public class PopulationServedDescriptor : Entities.Common.EdFi.IPopulationServed // Constructor // ------------------------------------------------------------- + public OperationalUnitDimension() + { + OperationalUnitDimensionReportingTags = new List(); + } // ------------------------------------------------------------ @@ -118540,7 +118317,7 @@ public class PopulationServedDescriptor : Entities.Common.EdFi.IPopulationServed // ------------------------------------------------------------ /// - /// The unique identifier for the PopulationServedDescriptor resource. + /// The unique identifier for the OperationalUnitDimension resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -118557,17 +118334,33 @@ public class PopulationServedDescriptor : Entities.Common.EdFi.IPopulationServed // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The code representation of the account operational unit dimension. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int PopulationServedDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="code")] + public string Code { get; set; } + + private bool _fiscalYearExplicitlyAssigned = false; + private int _fiscalYear; - int IDescriptor.DescriptorId - { - get { return PopulationServedDescriptorId; } - set { PopulationServedDescriptorId = value; } + /// + /// The fiscal year for which the account operational unit dimension is valid. + /// + // NOT in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get => _fiscalYear; + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; + } } + // ------------------------------------------------------------- // ============================================================= @@ -118582,7 +118375,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPopulationServedDescriptor; + var compareTo = obj as Entities.Common.EdFi.IOperationalUnitDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -118591,8 +118384,13 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IPopulationServedDescriptor).PopulationServedDescriptorId.Equals(compareTo.PopulationServedDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IOperationalUnitDimension).Code, compareTo.Code)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IOperationalUnitDimension).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -118609,8 +118407,12 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IPopulationServedDescriptor).PopulationServedDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IOperationalUnitDimension).Code); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IOperationalUnitDimension).FiscalYear); return hash.ToHashCode(); } @@ -118619,66 +118421,33 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// A description of the account operational unit dimension. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeName")] + public string CodeName { get; set; } + // ------------------------------------------------------------- - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_fiscalYearExplicitlyAssigned) + { + yield return "FiscalYear"; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // Inherited One-to-one relationships @@ -118693,16 +118462,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OperationalUnitDimension", "OperationalUnitDimension")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _operationalUnitDimensionReportingTags; + private ICollection _operationalUnitDimensionReportingTagsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportingTags")] + public ICollection OperationalUnitDimensionReportingTags + { + get { return _operationalUnitDimensionReportingTags; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)e.Item).OperationalUnitDimension = this); + _operationalUnitDimensionReportingTags = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)e.Item).OperationalUnitDimension = this; + _operationalUnitDimensionReportingTagsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IOperationalUnitDimension.OperationalUnitDimensionReportingTags + { + get { return _operationalUnitDimensionReportingTagsCovariant; } + set { OperationalUnitDimensionReportingTags = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -118720,6 +118516,17 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_operationalUnitDimensionReportingTags != null) foreach (var item in _operationalUnitDimensionReportingTags) + { + item.OperationalUnitDimension = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -118727,12 +118534,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PopulationServedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPopulationServedDescriptor)target); + return Entities.Common.EdFi.OperationalUnitDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOperationalUnitDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PopulationServedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPopulationServedDescriptor)target, null); + Entities.Common.EdFi.OperationalUnitDimensionMapper.MapTo(this, (Entities.Common.EdFi.IOperationalUnitDimension)target, null); } // ------------------------------------------------------------- @@ -118740,6 +118547,77 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (OperationalUnitDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("OperationalUnitDimensionReportingTags") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("OperationalUnitDimensionReportingTags"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(OperationalUnitDimensionReportingTags, validationContext, validationContext.Items.ForCollection("OperationalUnitDimensionReportingTags")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -118747,9 +118625,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PopulationServedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class OperationalUnitDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_OperationalUnitDimension = new FullName("edfi", "OperationalUnitDimension"); + + // Declare collection item validators + private OperationalUnitDimensionReportingTagPutPostRequestValidator _operationalUnitDimensionReportingTagsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -118762,6 +118645,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (OperationalUnitDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_OperationalUnitDimension); + + if (mappingContract != null) + { + if (mappingContract.IsOperationalUnitDimensionReportingTagIncluded != null) + { + var hasInvalidOperationalUnitDimensionReportingTagsItems = instance.OperationalUnitDimensionReportingTags.Any(x => !mappingContract.IsOperationalUnitDimensionReportingTagIncluded(x)); + + if (hasInvalidOperationalUnitDimensionReportingTagsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("OperationalUnitDimensionReportingTags", $"A supplied 'OperationalUnitDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -118777,22 +118682,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PostingResultDescriptor table of the PostingResultDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.OperationalUnitDimensionReportingTag table of the OperationalUnitDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PostingResultDescriptor : Entities.Common.EdFi.IPostingResultDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class OperationalUnitDimensionReportingTag : Entities.Common.EdFi.IOperationalUnitDimensionReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PostingResultDescriptor"); + private static FullName _fullName = new FullName("edfi", "OperationalUnitDimensionReportingTag"); // Fluent validator instance (threadsafe) - private static PostingResultDescriptorPutPostRequestValidator _validator = new PostingResultDescriptorPutPostRequestValidator(); + private static OperationalUnitDimensionReportingTagPutPostRequestValidator _validator = new OperationalUnitDimensionReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -118809,13 +118709,6 @@ public class PostingResultDescriptor : Entities.Common.EdFi.IPostingResultDescri // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the PostingResultDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -118826,19 +118719,33 @@ public class PostingResultDescriptor : Entities.Common.EdFi.IPostingResultDescri //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IOperationalUnitDimension _operationalUnitDimension; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int PostingResultDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IOperationalUnitDimension IOperationalUnitDimensionReportingTag.OperationalUnitDimension + { + get { return _operationalUnitDimension; } + set { SetOperationalUnitDimension(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IOperationalUnitDimension OperationalUnitDimension { - get { return PostingResultDescriptorId; } - set { PostingResultDescriptorId = value; } + set { SetOperationalUnitDimension(value); } + } + + private void SetOperationalUnitDimension(Entities.Common.EdFi.IOperationalUnitDimension value) + { + _operationalUnitDimension = value; } + + /// + /// Optional tag for accountability reporting. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118853,7 +118760,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPostingResultDescriptor; + var compareTo = obj as Entities.Common.EdFi.IOperationalUnitDimensionReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -118861,9 +118768,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_operationalUnitDimension == null || !_operationalUnitDimension.Equals(compareTo.OperationalUnitDimension)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IPostingResultDescriptor).PostingResultDescriptorId.Equals(compareTo.PostingResultDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IOperationalUnitDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -118879,9 +118790,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_operationalUnitDimension != null) + hash.Add(_operationalUnitDimension); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IPostingResultDescriptor).PostingResultDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IOperationalUnitDimensionReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -118890,55 +118804,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118964,11 +118829,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OperationalUnitDimension", "OperationalUnitDimensionReportingTag")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -118979,13 +118841,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -118998,12 +118853,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PostingResultDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostingResultDescriptor)target); + return Entities.Common.EdFi.OperationalUnitDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PostingResultDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPostingResultDescriptor)target, null); + Entities.Common.EdFi.OperationalUnitDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IOperationalUnitDimensionReportingTag)target, null); } // ------------------------------------------------------------- @@ -119011,6 +118866,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -119018,9 +118933,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PostingResultDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class OperationalUnitDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -119049,46 +118964,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the PostSecondaryEvent resource. + /// Represents a reference to the OrganizationDepartment resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class PostSecondaryEventReference : IResourceReference + public class OrganizationDepartmentReference : IResourceReference { - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } - - [DataMember(Name="postSecondaryEventCategoryDescriptor")][DescriptorExists("PostSecondaryEventCategoryDescriptor")] - public string PostSecondaryEventCategoryDescriptor { get; set; } - - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; + [DataMember(Name="organizationDepartmentId")] + public long OrganizationDepartmentId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. /// public Guid ResourceId { get; set; } - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - private Link _link; @@ -119114,24 +119008,14 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EventDate != default(DateTime) && PostSecondaryEventCategoryDescriptor != default(string) && StudentUniqueId != default(string); + return OrganizationDepartmentId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (EventDate == default) - { - yield return "EventDate"; - } - - if (PostSecondaryEventCategoryDescriptor == default) - { - yield return "PostSecondaryEventCategoryDescriptor"; - } - - if (StudentUniqueId == default) + if (OrganizationDepartmentId == default) { - yield return "StudentUniqueId"; + yield return "OrganizationDepartmentId"; } } @@ -119140,44 +119024,25 @@ private Link CreateLink() { var link = new Link { - Rel = "PostSecondaryEvent", - Href = $"/ed-fi/postSecondaryEvents/{ResourceId:n}" + Rel = "OrganizationDepartment", + Href = $"/ed-fi/organizationDepartments/{ResourceId:n}" }; - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return link; } } // Aggregate reference /// - /// A class which represents the edfi.PostSecondaryEvent table of the PostSecondaryEvent aggregate in the ODS Database. + /// A class which represents the edfi.OrganizationDepartment table of the OrganizationDepartment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PostSecondaryEvent : Entities.Common.EdFi.IPostSecondaryEvent, IHasETag, IDateVersionedEntity, IValidatableObject + public class OrganizationDepartment : Entities.Common.EdFi.IOrganizationDepartment, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PostSecondaryEvent"); + private static FullName _fullName = new FullName("edfi", "OrganizationDepartment"); // Fluent validator instance (threadsafe) - private static PostSecondaryEventPutPostRequestValidator _validator = new PostSecondaryEventPutPostRequestValidator(); + private static OrganizationDepartmentPutPostRequestValidator _validator = new OrganizationDepartmentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -119188,6 +119053,17 @@ public class PostSecondaryEvent : Entities.Common.EdFi.IPostSecondaryEvent, IHas // Constructor // ------------------------------------------------------------- + public OrganizationDepartment() + { + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); + } // ------------------------------------------------------------ @@ -119196,7 +119072,7 @@ public class PostSecondaryEvent : Entities.Common.EdFi.IPostSecondaryEvent, IHas // ------------------------------------------------------------ /// - /// The unique identifier for the PostSecondaryEvent resource. + /// The unique identifier for the OrganizationDepartment resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -119207,70 +119083,37 @@ public class PostSecondaryEvent : Entities.Common.EdFi.IPostSecondaryEvent, IHas // References // ------------------------------------------------------------- - private bool _postSecondaryInstitutionReferenceExplicitlyAssigned; - private PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference _postSecondaryInstitutionReference; - private PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference ImplicitPostSecondaryInstitutionReference + private bool _parentEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _parentEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitParentEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_postSecondaryInstitutionReference == null && !_postSecondaryInstitutionReferenceExplicitlyAssigned) - _postSecondaryInstitutionReference = new PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference(); + if (_parentEducationOrganizationReference == null && !_parentEducationOrganizationReferenceExplicitlyAssigned) + _parentEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _postSecondaryInstitutionReference; + return _parentEducationOrganizationReference; } } - [DataMember(Name="postSecondaryInstitutionReference")] + [DataMember(Name="parentEducationOrganizationReference")] [FullyDefinedReference] - public PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference PostSecondaryInstitutionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitPostSecondaryInstitutionReference != null - && (_postSecondaryInstitutionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPostSecondaryInstitutionReference.IsReferenceFullyDefined())) - return ImplicitPostSecondaryInstitutionReference; - - return null; - } - set - { - _postSecondaryInstitutionReferenceExplicitlyAssigned = true; - _postSecondaryInstitutionReference = value; - } - } - private bool _studentReferenceExplicitlyAssigned; - private Student.EdFi.StudentReference _studentReference; - private Student.EdFi.StudentReference ImplicitStudentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentReference == null && !_studentReferenceExplicitlyAssigned) - _studentReference = new Student.EdFi.StudentReference(); - - return _studentReference; - } - } - - [DataMember(Name="studentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Student.EdFi.StudentReference StudentReference + public EducationOrganization.EdFi.EducationOrganizationReference ParentEducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentReference != null - && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference; + if (ImplicitParentEducationOrganizationReference != null + && (_parentEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitParentEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitParentEducationOrganizationReference; return null; } set { - _studentReferenceExplicitlyAssigned = true; - _studentReference = value; + _parentEducationOrganizationReferenceExplicitlyAssigned = true; + _parentEducationOrganizationReference = value; } } // ------------------------------------------------------------- @@ -119280,46 +119123,17 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// The date the event occurred or was recorded. + /// The unique identification code for the organization department. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } - - /// - /// The post secondary event that is logged. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="postSecondaryEventCategoryDescriptor")][DescriptorExists("PostSecondaryEventCategoryDescriptor")] - public string PostSecondaryEventCategoryDescriptor { get; set; } + [DataMember(Name="organizationDepartmentId")] + public long OrganizationDepartmentId { get; set; } - /// - /// A unique alphanumeric code assigned to a student. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IPostSecondaryEvent.StudentUniqueId + long IEducationOrganization.EducationOrganizationId { - get - { - if (ImplicitStudentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Student - _studentReferenceExplicitlyAssigned = false; - ImplicitStudentReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } + get { return OrganizationDepartmentId; } + set { OrganizationDepartmentId = value; } } // ------------------------------------------------------------- @@ -119335,7 +119149,7 @@ string Entities.Common.EdFi.IPostSecondaryEvent.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPostSecondaryEvent; + var compareTo = obj as Entities.Common.EdFi.IOrganizationDepartment; if (ReferenceEquals(this, compareTo)) return true; @@ -119344,18 +119158,8 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IPostSecondaryEvent).EventDate.Equals(compareTo.EventDate)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IPostSecondaryEvent).PostSecondaryEventCategoryDescriptor, compareTo.PostSecondaryEventCategoryDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IPostSecondaryEvent).StudentUniqueId, compareTo.StudentUniqueId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IOrganizationDepartment).OrganizationDepartmentId.Equals(compareTo.OrganizationDepartmentId)) return false; @@ -119372,16 +119176,9 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IPostSecondaryEvent).EventDate); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IPostSecondaryEvent).PostSecondaryEventCategoryDescriptor); - + //Derived Property + hash.Add((this as Entities.Common.EdFi.IOrganizationDepartment).OrganizationDepartmentId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IPostSecondaryEvent).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -119389,6 +119186,39 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// The full, legally accepted name of the institution. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } + + /// + /// The current operational status of the education organization (e.g., active, inactive). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } + + /// + /// A short name for the institution. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } + + /// + /// The public web site address (URL) for the education organization. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -119396,17 +119226,25 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The ID of the post secondary institution. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The intended major subject area of the department. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } + + /// + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.IPostSecondaryEvent.PostSecondaryInstitutionId + long? Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationId { get { - if (ImplicitPostSecondaryInstitutionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPostSecondaryInstitutionReference.IsReferenceFullyDefined())) + if (ImplicitParentEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitParentEducationOrganizationReference.IsReferenceFullyDefined())) { - return ImplicitPostSecondaryInstitutionReference.PostSecondaryInstitutionId; + return ImplicitParentEducationOrganizationReference.EducationOrganizationId; } return default(long?); @@ -119416,9 +119254,9 @@ public override int GetHashCode() // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // PostSecondaryInstitution - _postSecondaryInstitutionReferenceExplicitlyAssigned = false; - ImplicitPostSecondaryInstitutionReference.PostSecondaryInstitutionId = value.GetValueOrDefault(); + // ParentEducationOrganization + _parentEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitParentEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); } } // ------------------------------------------------------------- @@ -119436,12 +119274,138 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses + { + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories + { + get { return _educationOrganizationCategories; } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators + { + get { return _educationOrganizationIndicators; } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "PostSecondaryEvent", "PostSecondaryEvent")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "OrganizationDepartment", "OrganizationDepartment")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -119465,6 +119429,42 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -119472,36 +119472,29 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PostSecondaryEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryEvent)target); + return Entities.Common.EdFi.OrganizationDepartmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOrganizationDepartment)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PostSecondaryEventMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryEvent)target, null); + Entities.Common.EdFi.OrganizationDepartmentMapper.MapTo(this, (Entities.Common.EdFi.IOrganizationDepartment)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IPostSecondaryEvent.PostSecondaryInstitutionResourceId - { - get { return null; } - set { ImplicitPostSecondaryInstitutionReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IPostSecondaryEvent.StudentResourceId + Guid? Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationResourceId { get { return null; } - set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + set { ImplicitParentEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IPostSecondaryEvent.StudentDiscriminator + string Entities.Common.EdFi.IOrganizationDepartment.ParentEducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitStudentReference.Discriminator = value; } + set { ImplicitParentEducationOrganizationReference.Discriminator = value; } } @@ -119527,6 +119520,78 @@ string Entities.Common.EdFi.IPostSecondaryEvent.StudentDiscriminator // ---------------------- // Validate collections // ---------------------- + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -119572,9 +119637,19 @@ string Entities.Common.EdFi.IPostSecondaryEvent.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PostSecondaryEventPutPostRequestValidator : FluentValidation.AbstractValidator + public class OrganizationDepartmentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_OrganizationDepartment = new FullName("edfi", "OrganizationDepartment"); + + // Declare collection item validators + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -119587,6 +119662,83 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (OrganizationDepartmentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_OrganizationDepartment); + + if (mappingContract != null) + { + if (mappingContract.IsEducationOrganizationAddressIncluded != null) + { + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); + + if (hasInvalidEducationOrganizationAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -119603,21 +119755,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PostSecondaryEventCategoryDescriptor table of the PostSecondaryEventCategoryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.OtherNameTypeDescriptor table of the OtherNameTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PostSecondaryEventCategoryDescriptor : Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class OtherNameTypeDescriptor : Entities.Common.EdFi.IOtherNameTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "PostSecondaryEventCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "OtherNameTypeDescriptor"); // Fluent validator instance (threadsafe) - private static PostSecondaryEventCategoryDescriptorPutPostRequestValidator _validator = new PostSecondaryEventCategoryDescriptorPutPostRequestValidator(); + private static OtherNameTypeDescriptorPutPostRequestValidator _validator = new OtherNameTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -119636,7 +119788,7 @@ public class PostSecondaryEventCategoryDescriptor : Entities.Common.EdFi.IPostSe // ------------------------------------------------------------ /// - /// The unique identifier for the PostSecondaryEventCategoryDescriptor resource. + /// The unique identifier for the OtherNameTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -119657,12 +119809,12 @@ public class PostSecondaryEventCategoryDescriptor : Entities.Common.EdFi.IPostSe /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int PostSecondaryEventCategoryDescriptorId { get; set; } + public int OtherNameTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return PostSecondaryEventCategoryDescriptorId; } - set { PostSecondaryEventCategoryDescriptorId = value; } + get { return OtherNameTypeDescriptorId; } + set { OtherNameTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -119678,7 +119830,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IOtherNameTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -119688,7 +119840,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor).PostSecondaryEventCategoryDescriptorId.Equals(compareTo.PostSecondaryEventCategoryDescriptorId)) + if (!(this as Entities.Common.EdFi.IOtherNameTypeDescriptor).OtherNameTypeDescriptorId.Equals(compareTo.OtherNameTypeDescriptorId)) return false; @@ -119706,7 +119858,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor).PostSecondaryEventCategoryDescriptorId); + hash.Add((this as Entities.Common.EdFi.IOtherNameTypeDescriptor).OtherNameTypeDescriptorId); return hash.ToHashCode(); } @@ -119823,12 +119975,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PostSecondaryEventCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor)target); + return Entities.Common.EdFi.OtherNameTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IOtherNameTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PostSecondaryEventCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor)target, null); + Entities.Common.EdFi.OtherNameTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IOtherNameTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -119843,9 +119995,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PostSecondaryEventCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class OtherNameTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -119874,85 +120026,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the PostSecondaryInstitution resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionReference : IResourceReference - { - [DataMember(Name="postSecondaryInstitutionId")] - public long PostSecondaryInstitutionId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return PostSecondaryInstitutionId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (PostSecondaryInstitutionId == default) - { - yield return "PostSecondaryInstitutionId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "PostSecondaryInstitution", - Href = $"/ed-fi/postSecondaryInstitutions/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.PostSecondaryInstitution table of the PostSecondaryInstitution aggregate in the ODS Database. + /// A class which represents the edfi.ParticipationDescriptor table of the ParticipationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PostSecondaryInstitution : Entities.Common.EdFi.IPostSecondaryInstitution, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + public class ParticipationDescriptor : Entities.Common.EdFi.IParticipationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "PostSecondaryInstitution"); + private static FullName _fullName = new FullName("edfi", "ParticipationDescriptor"); // Fluent validator instance (threadsafe) - private static PostSecondaryInstitutionPutPostRequestValidator _validator = new PostSecondaryInstitutionPutPostRequestValidator(); + private static ParticipationDescriptorPutPostRequestValidator _validator = new ParticipationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -119963,18 +120051,6 @@ public class PostSecondaryInstitution : Entities.Common.EdFi.IPostSecondaryInsti // Constructor // ------------------------------------------------------------- - public PostSecondaryInstitution() - { - PostSecondaryInstitutionMediumOfInstructions = new List(); - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); - } // ------------------------------------------------------------ @@ -119983,7 +120059,7 @@ public PostSecondaryInstitution() // ------------------------------------------------------------ /// - /// The unique identifier for the PostSecondaryInstitution resource. + /// The unique identifier for the ParticipationDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -120000,17 +120076,16 @@ public PostSecondaryInstitution() // ------------------------------------------------------------- /// - /// The ID of the post secondary institution. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="postSecondaryInstitutionId")] - public long PostSecondaryInstitutionId { get; set; } + [JsonIgnore] + public int ParticipationDescriptorId { get; set; } - long IEducationOrganization.EducationOrganizationId + int IDescriptor.DescriptorId { - get { return PostSecondaryInstitutionId; } - set { PostSecondaryInstitutionId = value; } + get { return ParticipationDescriptorId; } + set { ParticipationDescriptorId = value; } } // ------------------------------------------------------------- @@ -120026,7 +120101,7 @@ long IEducationOrganization.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPostSecondaryInstitution; + var compareTo = obj as Entities.Common.EdFi.IParticipationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -120036,7 +120111,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IPostSecondaryInstitution).PostSecondaryInstitutionId.Equals(compareTo.PostSecondaryInstitutionId)) + if (!(this as Entities.Common.EdFi.IParticipationDescriptor).ParticipationDescriptorId.Equals(compareTo.ParticipationDescriptorId)) return false; @@ -120054,7 +120129,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IPostSecondaryInstitution).PostSecondaryInstitutionId); + hash.Add((this as Entities.Common.EdFi.IParticipationDescriptor).ParticipationDescriptorId); return hash.ToHashCode(); } @@ -120065,58 +120140,58 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The full, legally accepted name of the institution. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The current operational status of the education organization (e.g., active, inactive). + /// The description of the descriptor. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// A short name for the institution. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The public web site address (URL) for the education organization. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// A classification of whether a postsecondary institution is operated by publicly elected or appointed officials (public control) or by privately elected or appointed officials and derives its major source of funds from private sources (private control). + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="administrativeFundingControlDescriptor")][DescriptorExists("AdministrativeFundingControlDescriptor")] - public string AdministrativeFundingControlDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// A classification of whether a post secondary institution's highest level of offering is a program of 4-years or higher (4 year), 2-but-less-than 4-years (2 year), or less than 2-years. + /// A shortened description for the descriptor. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="postSecondaryInstitutionLevelDescriptor")][DescriptorExists("PostSecondaryInstitutionLevelDescriptor")] - public string PostSecondaryInstitutionLevelDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -120132,174 +120207,21 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses - { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses - { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } - set - { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodes; } - set - { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } - set - { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators - { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } - } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephones; } - set - { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } - } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddresses; } - set - { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } - } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "PostSecondaryInstitution", "PostSecondaryInstitution")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _postSecondaryInstitutionMediumOfInstructions; - private ICollection _postSecondaryInstitutionMediumOfInstructionsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="mediumOfInstructions")] - public ICollection PostSecondaryInstitutionMediumOfInstructions - { - get { return _postSecondaryInstitutionMediumOfInstructions; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)e.Item).PostSecondaryInstitution = this); - _postSecondaryInstitutionMediumOfInstructions = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)e.Item).PostSecondaryInstitution = this; - _postSecondaryInstitutionMediumOfInstructionsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IPostSecondaryInstitution.PostSecondaryInstitutionMediumOfInstructions - { - get { return _postSecondaryInstitutionMediumOfInstructionsCovariant; } - set { PostSecondaryInstitutionMediumOfInstructions = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -120314,510 +120236,6 @@ public ICollection PostSecondaryIns // ------------------------------------------------------------- - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) - { - item.EducationOrganization = this; - } - - if (_postSecondaryInstitutionMediumOfInstructions != null) foreach (var item in _postSecondaryInstitutionMediumOfInstructions) - { - item.PostSecondaryInstitution = this; - } - - } - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.PostSecondaryInstitutionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryInstitution)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.PostSecondaryInstitutionMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryInstitution)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) - { - yield return result; - } - } - - if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationCategories"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) - { - yield return result; - } - } - - if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIdentificationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) - { - yield return result; - } - } - - if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIndicators"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) - { - yield return result; - } - } - - if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInstitutionTelephones"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) - { - yield return result; - } - } - - if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInternationalAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) - { - yield return result; - } - } - - if (PostSecondaryInstitutionMediumOfInstructions.Any() && mappingContract?.IsMemberSupported("PostSecondaryInstitutionMediumOfInstructions") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("PostSecondaryInstitutionMediumOfInstructions"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(PostSecondaryInstitutionMediumOfInstructions, validationContext, validationContext.Items.ForCollection("PostSecondaryInstitutionMediumOfInstructions")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionPutPostRequestValidator : FluentValidation.AbstractValidator - { - private static readonly FullName _fullName_edfi_PostSecondaryInstitution = new FullName("edfi", "PostSecondaryInstitution"); - - // Declare collection item validators - private PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator _postSecondaryInstitutionMediumOfInstructionsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (PostSecondaryInstitutionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_PostSecondaryInstitution); - - if (mappingContract != null) - { - if (mappingContract.IsPostSecondaryInstitutionMediumOfInstructionIncluded != null) - { - var hasInvalidPostSecondaryInstitutionMediumOfInstructionsItems = instance.PostSecondaryInstitutionMediumOfInstructions.Any(x => !mappingContract.IsPostSecondaryInstitutionMediumOfInstructionIncluded(x)); - - if (hasInvalidPostSecondaryInstitutionMediumOfInstructionsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("PostSecondaryInstitutionMediumOfInstructions", $"A supplied 'PostSecondaryInstitutionMediumOfInstruction' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationAddressIncluded != null) - { - var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); - - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) - { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - - if (hasInvalidEducationOrganizationInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.PostSecondaryInstitutionMediumOfInstruction table of the PostSecondaryInstitution aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionMediumOfInstruction : Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "PostSecondaryInstitutionMediumOfInstruction"); - - // Fluent validator instance (threadsafe) - private static PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator _validator = new PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IPostSecondaryInstitution _postSecondaryInstitution; - - [IgnoreDataMember] - Entities.Common.EdFi.IPostSecondaryInstitution IPostSecondaryInstitutionMediumOfInstruction.PostSecondaryInstitution - { - get { return _postSecondaryInstitution; } - set { SetPostSecondaryInstitution(value); } - } - - public Entities.Common.EdFi.IPostSecondaryInstitution PostSecondaryInstitution - { - set { SetPostSecondaryInstitution(value); } - } - - private void SetPostSecondaryInstitution(Entities.Common.EdFi.IPostSecondaryInstitution value) - { - _postSecondaryInstitution = value; - } - - /// - /// The categories in which an institution serves the students. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="mediumOfInstructionDescriptor")][DescriptorExists("MediumOfInstructionDescriptor")] - public string MediumOfInstructionDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_postSecondaryInstitution == null || !_postSecondaryInstitution.Equals(compareTo.PostSecondaryInstitution)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction).MediumOfInstructionDescriptor, compareTo.MediumOfInstructionDescriptor)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_postSecondaryInstitution != null) - hash.Add(_postSecondaryInstitution); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction).MediumOfInstructionDescriptor); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "PostSecondaryInstitution", "PostSecondaryInstitutionMediumOfInstruction")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- @@ -120828,12 +120246,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PostSecondaryInstitutionMediumOfInstructionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)target); + return Entities.Common.EdFi.ParticipationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IParticipationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PostSecondaryInstitutionMediumOfInstructionMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)target, null); + Entities.Common.EdFi.ParticipationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IParticipationDescriptor)target, null); } // ------------------------------------------------------------- @@ -120841,66 +120259,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -120908,9 +120266,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator : FluentValidation.AbstractValidator + public class ParticipationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -120939,21 +120297,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PostSecondaryInstitutionLevelDescriptor table of the PostSecondaryInstitutionLevelDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ParticipationStatusDescriptor table of the ParticipationStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionLevelDescriptor : Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ParticipationStatusDescriptor : Entities.Common.EdFi.IParticipationStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "PostSecondaryInstitutionLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "ParticipationStatusDescriptor"); // Fluent validator instance (threadsafe) - private static PostSecondaryInstitutionLevelDescriptorPutPostRequestValidator _validator = new PostSecondaryInstitutionLevelDescriptorPutPostRequestValidator(); + private static ParticipationStatusDescriptorPutPostRequestValidator _validator = new ParticipationStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -120972,7 +120330,7 @@ public class PostSecondaryInstitutionLevelDescriptor : Entities.Common.EdFi.IPos // ------------------------------------------------------------ /// - /// The unique identifier for the PostSecondaryInstitutionLevelDescriptor resource. + /// The unique identifier for the ParticipationStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -120993,12 +120351,12 @@ public class PostSecondaryInstitutionLevelDescriptor : Entities.Common.EdFi.IPos /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int PostSecondaryInstitutionLevelDescriptorId { get; set; } + public int ParticipationStatusDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return PostSecondaryInstitutionLevelDescriptorId; } - set { PostSecondaryInstitutionLevelDescriptorId = value; } + get { return ParticipationStatusDescriptorId; } + set { ParticipationStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -121014,7 +120372,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.IParticipationStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -121024,7 +120382,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor).PostSecondaryInstitutionLevelDescriptorId.Equals(compareTo.PostSecondaryInstitutionLevelDescriptorId)) + if (!(this as Entities.Common.EdFi.IParticipationStatusDescriptor).ParticipationStatusDescriptorId.Equals(compareTo.ParticipationStatusDescriptorId)) return false; @@ -121042,7 +120400,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor).PostSecondaryInstitutionLevelDescriptorId); + hash.Add((this as Entities.Common.EdFi.IParticipationStatusDescriptor).ParticipationStatusDescriptorId); return hash.ToHashCode(); } @@ -121159,12 +120517,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PostSecondaryInstitutionLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor)target); + return Entities.Common.EdFi.ParticipationStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IParticipationStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PostSecondaryInstitutionLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor)target, null); + Entities.Common.EdFi.ParticipationStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IParticipationStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -121179,9 +120537,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PostSecondaryInstitutionLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ParticipationStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -121210,21 +120568,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PrimaryLearningDeviceAccessDescriptor table of the PrimaryLearningDeviceAccessDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.PerformanceBaseConversionDescriptor table of the PerformanceBaseConversionDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceAccessDescriptor : Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class PerformanceBaseConversionDescriptor : Entities.Common.EdFi.IPerformanceBaseConversionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "PrimaryLearningDeviceAccessDescriptor"); + private static FullName _fullName = new FullName("edfi", "PerformanceBaseConversionDescriptor"); // Fluent validator instance (threadsafe) - private static PrimaryLearningDeviceAccessDescriptorPutPostRequestValidator _validator = new PrimaryLearningDeviceAccessDescriptorPutPostRequestValidator(); + private static PerformanceBaseConversionDescriptorPutPostRequestValidator _validator = new PerformanceBaseConversionDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -121243,7 +120601,7 @@ public class PrimaryLearningDeviceAccessDescriptor : Entities.Common.EdFi.IPrima // ------------------------------------------------------------ /// - /// The unique identifier for the PrimaryLearningDeviceAccessDescriptor resource. + /// The unique identifier for the PerformanceBaseConversionDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -121264,12 +120622,12 @@ public class PrimaryLearningDeviceAccessDescriptor : Entities.Common.EdFi.IPrima /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int PrimaryLearningDeviceAccessDescriptorId { get; set; } + public int PerformanceBaseConversionDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return PrimaryLearningDeviceAccessDescriptorId; } - set { PrimaryLearningDeviceAccessDescriptorId = value; } + get { return PerformanceBaseConversionDescriptorId; } + set { PerformanceBaseConversionDescriptorId = value; } } // ------------------------------------------------------------- @@ -121285,7 +120643,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor; + var compareTo = obj as Entities.Common.EdFi.IPerformanceBaseConversionDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -121295,7 +120653,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor).PrimaryLearningDeviceAccessDescriptorId.Equals(compareTo.PrimaryLearningDeviceAccessDescriptorId)) + if (!(this as Entities.Common.EdFi.IPerformanceBaseConversionDescriptor).PerformanceBaseConversionDescriptorId.Equals(compareTo.PerformanceBaseConversionDescriptorId)) return false; @@ -121313,7 +120671,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor).PrimaryLearningDeviceAccessDescriptorId); + hash.Add((this as Entities.Common.EdFi.IPerformanceBaseConversionDescriptor).PerformanceBaseConversionDescriptorId); return hash.ToHashCode(); } @@ -121430,12 +120788,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PrimaryLearningDeviceAccessDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor)target); + return Entities.Common.EdFi.PerformanceBaseConversionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPerformanceBaseConversionDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PrimaryLearningDeviceAccessDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor)target, null); + Entities.Common.EdFi.PerformanceBaseConversionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPerformanceBaseConversionDescriptor)target, null); } // ------------------------------------------------------------- @@ -121450,9 +120808,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceAccessDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class PerformanceBaseConversionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -121481,21 +120839,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PrimaryLearningDeviceAwayFromSchoolDescriptor table of the PrimaryLearningDeviceAwayFromSchoolDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.PerformanceLevelDescriptor table of the PerformanceLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceAwayFromSchoolDescriptor : Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class PerformanceLevelDescriptor : Entities.Common.EdFi.IPerformanceLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "PrimaryLearningDeviceAwayFromSchoolDescriptor"); + private static FullName _fullName = new FullName("edfi", "PerformanceLevelDescriptor"); // Fluent validator instance (threadsafe) - private static PrimaryLearningDeviceAwayFromSchoolDescriptorPutPostRequestValidator _validator = new PrimaryLearningDeviceAwayFromSchoolDescriptorPutPostRequestValidator(); + private static PerformanceLevelDescriptorPutPostRequestValidator _validator = new PerformanceLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -121514,7 +120872,7 @@ public class PrimaryLearningDeviceAwayFromSchoolDescriptor : Entities.Common.EdF // ------------------------------------------------------------ /// - /// The unique identifier for the PrimaryLearningDeviceAwayFromSchoolDescriptor resource. + /// The unique identifier for the PerformanceLevelDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -121535,12 +120893,12 @@ public class PrimaryLearningDeviceAwayFromSchoolDescriptor : Entities.Common.EdF /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int PrimaryLearningDeviceAwayFromSchoolDescriptorId { get; set; } + public int PerformanceLevelDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return PrimaryLearningDeviceAwayFromSchoolDescriptorId; } - set { PrimaryLearningDeviceAwayFromSchoolDescriptorId = value; } + get { return PerformanceLevelDescriptorId; } + set { PerformanceLevelDescriptorId = value; } } // ------------------------------------------------------------- @@ -121556,7 +120914,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor; + var compareTo = obj as Entities.Common.EdFi.IPerformanceLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -121566,7 +120924,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor).PrimaryLearningDeviceAwayFromSchoolDescriptorId.Equals(compareTo.PrimaryLearningDeviceAwayFromSchoolDescriptorId)) + if (!(this as Entities.Common.EdFi.IPerformanceLevelDescriptor).PerformanceLevelDescriptorId.Equals(compareTo.PerformanceLevelDescriptorId)) return false; @@ -121584,7 +120942,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor).PrimaryLearningDeviceAwayFromSchoolDescriptorId); + hash.Add((this as Entities.Common.EdFi.IPerformanceLevelDescriptor).PerformanceLevelDescriptorId); return hash.ToHashCode(); } @@ -121701,12 +121059,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PrimaryLearningDeviceAwayFromSchoolDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor)target); + return Entities.Common.EdFi.PerformanceLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPerformanceLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PrimaryLearningDeviceAwayFromSchoolDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor)target, null); + Entities.Common.EdFi.PerformanceLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPerformanceLevelDescriptor)target, null); } // ------------------------------------------------------------- @@ -121721,9 +121079,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceAwayFromSchoolDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class PerformanceLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -121752,21 +121110,118 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PrimaryLearningDeviceProviderDescriptor table of the PrimaryLearningDeviceProviderDescriptor aggregate in the ODS Database. + /// Represents a reference to the Person resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class PersonReference : IResourceReference + { + [DataMember(Name="personId")] + public string PersonId { get; set; } + + [DataMember(Name="sourceSystemDescriptor")][DescriptorExists("SourceSystemDescriptor")] + public string SourceSystemDescriptor { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return PersonId != default(string) && SourceSystemDescriptor != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (PersonId == default) + { + yield return "PersonId"; + } + + if (SourceSystemDescriptor == default) + { + yield return "SourceSystemDescriptor"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "Person", + Href = $"/ed-fi/people/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.Person table of the Person aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceProviderDescriptor : Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class Person : Entities.Common.EdFi.IPerson, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PrimaryLearningDeviceProviderDescriptor"); + private static FullName _fullName = new FullName("edfi", "Person"); // Fluent validator instance (threadsafe) - private static PrimaryLearningDeviceProviderDescriptorPutPostRequestValidator _validator = new PrimaryLearningDeviceProviderDescriptorPutPostRequestValidator(); + private static PersonPutPostRequestValidator _validator = new PersonPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -121785,7 +121240,7 @@ public class PrimaryLearningDeviceProviderDescriptor : Entities.Common.EdFi.IPri // ------------------------------------------------------------ /// - /// The unique identifier for the PrimaryLearningDeviceProviderDescriptor resource. + /// The unique identifier for the Person resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -121802,17 +121257,22 @@ public class PrimaryLearningDeviceProviderDescriptor : Entities.Common.EdFi.IPri // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// A unique alphanumeric code assigned to a person. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int PrimaryLearningDeviceProviderDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="personId")] + public string PersonId { get; set; } - int IDescriptor.DescriptorId - { - get { return PrimaryLearningDeviceProviderDescriptorId; } - set { PrimaryLearningDeviceProviderDescriptorId = value; } - } + /// + /// This descriptor defines the originating record source system for the person. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="sourceSystemDescriptor")][DescriptorExists("SourceSystemDescriptor")] + public string SourceSystemDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -121827,7 +121287,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor; + var compareTo = obj as Entities.Common.EdFi.IPerson; if (ReferenceEquals(this, compareTo)) return true; @@ -121836,8 +121296,13 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor).PrimaryLearningDeviceProviderDescriptorId.Equals(compareTo.PrimaryLearningDeviceProviderDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IPerson).PersonId, compareTo.PersonId)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IPerson).SourceSystemDescriptor, compareTo.SourceSystemDescriptor)) return false; @@ -121854,8 +121319,12 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor).PrimaryLearningDeviceProviderDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IPerson).PersonId); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IPerson).SourceSystemDescriptor); return hash.ToHashCode(); } @@ -121864,55 +121333,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -121938,11 +121358,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Person", "Person")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -121972,12 +121389,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PrimaryLearningDeviceProviderDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor)target); + return Entities.Common.EdFi.PersonMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPerson)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PrimaryLearningDeviceProviderDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor)target, null); + Entities.Common.EdFi.PersonMapper.MapTo(this, (Entities.Common.EdFi.IPerson)target, null); } // ------------------------------------------------------------- @@ -121985,6 +121402,65 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -121992,9 +121468,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PrimaryLearningDeviceProviderDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class PersonPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -122023,21 +121499,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProficiencyDescriptor table of the ProficiencyDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.PersonalInformationVerificationDescriptor table of the PersonalInformationVerificationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProficiencyDescriptor : Entities.Common.EdFi.IProficiencyDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class PersonalInformationVerificationDescriptor : Entities.Common.EdFi.IPersonalInformationVerificationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProficiencyDescriptor"); + private static FullName _fullName = new FullName("edfi", "PersonalInformationVerificationDescriptor"); // Fluent validator instance (threadsafe) - private static ProficiencyDescriptorPutPostRequestValidator _validator = new ProficiencyDescriptorPutPostRequestValidator(); + private static PersonalInformationVerificationDescriptorPutPostRequestValidator _validator = new PersonalInformationVerificationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -122056,7 +121532,7 @@ public class ProficiencyDescriptor : Entities.Common.EdFi.IProficiencyDescriptor // ------------------------------------------------------------ /// - /// The unique identifier for the ProficiencyDescriptor resource. + /// The unique identifier for the PersonalInformationVerificationDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -122077,12 +121553,12 @@ public class ProficiencyDescriptor : Entities.Common.EdFi.IProficiencyDescriptor /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ProficiencyDescriptorId { get; set; } + public int PersonalInformationVerificationDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ProficiencyDescriptorId; } - set { ProficiencyDescriptorId = value; } + get { return PersonalInformationVerificationDescriptorId; } + set { PersonalInformationVerificationDescriptorId = value; } } // ------------------------------------------------------------- @@ -122098,7 +121574,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProficiencyDescriptor; + var compareTo = obj as Entities.Common.EdFi.IPersonalInformationVerificationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -122108,7 +121584,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IProficiencyDescriptor).ProficiencyDescriptorId.Equals(compareTo.ProficiencyDescriptorId)) + if (!(this as Entities.Common.EdFi.IPersonalInformationVerificationDescriptor).PersonalInformationVerificationDescriptorId.Equals(compareTo.PersonalInformationVerificationDescriptorId)) return false; @@ -122126,7 +121602,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IProficiencyDescriptor).ProficiencyDescriptorId); + hash.Add((this as Entities.Common.EdFi.IPersonalInformationVerificationDescriptor).PersonalInformationVerificationDescriptorId); return hash.ToHashCode(); } @@ -122243,12 +121719,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProficiencyDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProficiencyDescriptor)target); + return Entities.Common.EdFi.PersonalInformationVerificationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPersonalInformationVerificationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProficiencyDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProficiencyDescriptor)target, null); + Entities.Common.EdFi.PersonalInformationVerificationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPersonalInformationVerificationDescriptor)target, null); } // ------------------------------------------------------------- @@ -122263,9 +121739,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProficiencyDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class PersonalInformationVerificationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -122294,126 +121770,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Program resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ProgramReference : IResourceReference - { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="programName")] - public string ProgramName { get; set; } - - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return EducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (ProgramName == default) - { - yield return "ProgramName"; - } - - if (ProgramTypeDescriptor == default) - { - yield return "ProgramTypeDescriptor"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Program", - Href = $"/ed-fi/programs/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.Program table of the Program aggregate in the ODS Database. + /// A class which represents the edfi.PlatformTypeDescriptor table of the PlatformTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Program : Entities.Common.EdFi.IProgram, IHasETag, IDateVersionedEntity, IValidatableObject + public class PlatformTypeDescriptor : Entities.Common.EdFi.IPlatformTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "Program"); + private static FullName _fullName = new FullName("edfi", "PlatformTypeDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramPutPostRequestValidator _validator = new ProgramPutPostRequestValidator(); + private static PlatformTypeDescriptorPutPostRequestValidator _validator = new PlatformTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -122424,12 +121795,6 @@ public class Program : Entities.Common.EdFi.IProgram, IHasETag, IDateVersionedEn // Constructor // ------------------------------------------------------------- - public Program() - { - ProgramCharacteristics = new List(); - ProgramLearningStandards = new List(); - ProgramSponsors = new List(); - } // ------------------------------------------------------------ @@ -122438,7 +121803,7 @@ public Program() // ------------------------------------------------------------ /// - /// The unique identifier for the Program resource. + /// The unique identifier for the PlatformTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -122448,40 +121813,6 @@ public Program() // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -122489,47 +121820,17 @@ public EducationOrganization.EdFi.EducationOrganizationReference EducationOrgani // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IProgram.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } - - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programName")] - public string ProgramName { get; set; } + [JsonIgnore] + public int PlatformTypeDescriptorId { get; set; } - /// - /// The type of program. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } + int IDescriptor.DescriptorId + { + get { return PlatformTypeDescriptorId; } + set { PlatformTypeDescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -122544,7 +121845,7 @@ long Entities.Common.EdFi.IProgram.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgram; + var compareTo = obj as Entities.Common.EdFi.IPlatformTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -122553,18 +121854,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IProgram).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgram).ProgramName, compareTo.ProgramName)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IPlatformTypeDescriptor).PlatformTypeDescriptorId.Equals(compareTo.PlatformTypeDescriptorId)) return false; @@ -122581,15 +121872,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgram).EducationOrganizationId); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgram).ProgramName); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgram).ProgramTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPlatformTypeDescriptor).PlatformTypeDescriptorId); return hash.ToHashCode(); } @@ -122598,19 +121882,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// A unique number or alphanumeric code assigned to a program by a school, school system, a state, or other agency or entity. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="programId")] - public string ProgramId { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -122631,103 +121956,16 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "Program")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _programCharacteristics; - private ICollection _programCharacteristicsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="characteristics")] - public ICollection ProgramCharacteristics - { - get { return _programCharacteristics; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProgramCharacteristic)e.Item).Program = this); - _programCharacteristics = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramCharacteristic)e.Item).Program = this; - _programCharacteristicsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgram.ProgramCharacteristics - { - get { return _programCharacteristicsCovariant; } - set { ProgramCharacteristics = new List(value.Cast()); } - } - - private ICollection _programLearningStandards; - private ICollection _programLearningStandardsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="learningStandards")] - public ICollection ProgramLearningStandards - { - get { return _programLearningStandards; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProgramLearningStandard)e.Item).Program = this); - _programLearningStandards = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramLearningStandard)e.Item).Program = this; - _programLearningStandardsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgram.ProgramLearningStandards - { - get { return _programLearningStandardsCovariant; } - set { ProgramLearningStandards = new List(value.Cast()); } - } - - private ICollection _programSponsors; - private ICollection _programSponsorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="sponsors")] - public ICollection ProgramSponsors - { - get { return _programSponsors; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProgramSponsor)e.Item).Program = this); - _programSponsors = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramSponsor)e.Item).Program = this; - _programSponsorsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgram.ProgramSponsors - { - get { return _programSponsorsCovariant; } - set { ProgramSponsors = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -122745,27 +121983,6 @@ public ICollection ProgramSponsors // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_programCharacteristics != null) foreach (var item in _programCharacteristics) - { - item.Program = this; - } - - if (_programLearningStandards != null) foreach (var item in _programLearningStandards) - { - item.Program = this; - } - - if (_programSponsors != null) foreach (var item in _programSponsors) - { - item.Program = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -122773,128 +121990,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgram)target); + return Entities.Common.EdFi.PlatformTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPlatformTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramMapper.MapTo(this, (Entities.Common.EdFi.IProgram)target, null); + Entities.Common.EdFi.PlatformTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPlatformTypeDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IProgram.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IProgram.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (ProgramCharacteristics.Any() && mappingContract?.IsMemberSupported("ProgramCharacteristics") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ProgramCharacteristics"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramCharacteristics, validationContext, validationContext.Items.ForCollection("ProgramCharacteristics")))) - { - yield return result; - } - } - - if (ProgramLearningStandards.Any() && mappingContract?.IsMemberSupported("ProgramLearningStandards") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ProgramLearningStandards"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramLearningStandards, validationContext, validationContext.Items.ForCollection("ProgramLearningStandards")))) - { - yield return result; - } - } - - if (ProgramSponsors.Any() && mappingContract?.IsMemberSupported("ProgramSponsors") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ProgramSponsors"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramSponsors, validationContext, validationContext.Items.ForCollection("ProgramSponsors")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -122902,16 +122010,9 @@ string Entities.Common.EdFi.IProgram.EducationOrganizationDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramPutPostRequestValidator : FluentValidation.AbstractValidator + public class PlatformTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Program = new FullName("edfi", "Program"); - - // Declare collection item validators - private ProgramCharacteristicPutPostRequestValidator _programCharacteristicsValidator = new (); - private ProgramLearningStandardPutPostRequestValidator _programLearningStandardsValidator = new (); - private ProgramSponsorPutPostRequestValidator _programSponsorsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -122924,50 +122025,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ProgramMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Program); - - if (mappingContract != null) - { - if (mappingContract.IsProgramCharacteristicIncluded != null) - { - var hasInvalidProgramCharacteristicsItems = instance.ProgramCharacteristics.Any(x => !mappingContract.IsProgramCharacteristicIncluded(x)); - - if (hasInvalidProgramCharacteristicsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProgramCharacteristics", $"A supplied 'ProgramCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsProgramLearningStandardIncluded != null) - { - var hasInvalidProgramLearningStandardsItems = instance.ProgramLearningStandards.Any(x => !mappingContract.IsProgramLearningStandardIncluded(x)); - - if (hasInvalidProgramLearningStandardsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProgramLearningStandards", $"A supplied 'ProgramLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsProgramSponsorIncluded != null) - { - var hasInvalidProgramSponsorsItems = instance.ProgramSponsors.Any(x => !mappingContract.IsProgramSponsorIncluded(x)); - - if (hasInvalidProgramSponsorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProgramSponsors", $"A supplied 'ProgramSponsor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -122983,17 +122040,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext } // ----------------------------------------------------------------- +} +// Aggregate: PopulationServedDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.PopulationServedDescriptor.EdFi +{ /// - /// A class which represents the edfi.ProgramCharacteristic table of the Program aggregate in the ODS Database. + /// A class which represents the edfi.PopulationServedDescriptor table of the PopulationServedDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramCharacteristic : Entities.Common.EdFi.IProgramCharacteristic, IValidatableObject + public class PopulationServedDescriptor : Entities.Common.EdFi.IPopulationServedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramCharacteristic"); + private static FullName _fullName = new FullName("edfi", "PopulationServedDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramCharacteristicPutPostRequestValidator _validator = new ProgramCharacteristicPutPostRequestValidator(); + private static PopulationServedDescriptorPutPostRequestValidator _validator = new PopulationServedDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -123010,6 +122072,13 @@ public class ProgramCharacteristic : Entities.Common.EdFi.IProgramCharacteristic // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the PopulationServedDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -123020,33 +122089,19 @@ public class ProgramCharacteristic : Entities.Common.EdFi.IProgramCharacteristic //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IProgram _program; - - [IgnoreDataMember] - Entities.Common.EdFi.IProgram IProgramCharacteristic.Program - { - get { return _program; } - set { SetProgram(value); } - } - public Entities.Common.EdFi.IProgram Program - { - set { SetProgram(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int PopulationServedDescriptorId { get; set; } - private void SetProgram(Entities.Common.EdFi.IProgram value) + int IDescriptor.DescriptorId { - _program = value; + get { return PopulationServedDescriptorId; } + set { PopulationServedDescriptorId = value; } } - - /// - /// Reflects important characteristics of the program, such as categories or particular indications. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programCharacteristicDescriptor")][DescriptorExists("ProgramCharacteristicDescriptor")] - public string ProgramCharacteristicDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -123061,7 +122116,7 @@ private void SetProgram(Entities.Common.EdFi.IProgram value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramCharacteristic; + var compareTo = obj as Entities.Common.EdFi.IPopulationServedDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -123069,13 +122124,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_program == null || !_program.Equals(compareTo.Program)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramCharacteristic).ProgramCharacteristicDescriptor, compareTo.ProgramCharacteristicDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IPopulationServedDescriptor).PopulationServedDescriptorId.Equals(compareTo.PopulationServedDescriptorId)) return false; @@ -123091,12 +122142,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_program != null) - hash.Add(_program); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramCharacteristic).ProgramCharacteristicDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPopulationServedDescriptor).PopulationServedDescriptorId); return hash.ToHashCode(); } @@ -123105,6 +122153,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -123130,8 +122227,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "ProgramCharacteristic")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -123142,6 +122242,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -123154,12 +122261,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramCharacteristic)target); + return Entities.Common.EdFi.PopulationServedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPopulationServedDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.IProgramCharacteristic)target, null); + Entities.Common.EdFi.PopulationServedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPopulationServedDescriptor)target, null); } // ------------------------------------------------------------- @@ -123167,76 +122274,16 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } + } // ================================================================= // Validators // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator + public class PopulationServedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -123264,17 +122311,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramLearningStandard table of the Program aggregate in the ODS Database. + /// A class which represents the edfi.PostingResultDescriptor table of the PostingResultDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramLearningStandard : Entities.Common.EdFi.IProgramLearningStandard, IValidatableObject + public class PostingResultDescriptor : Entities.Common.EdFi.IPostingResultDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramLearningStandard"); + private static FullName _fullName = new FullName("edfi", "PostingResultDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramLearningStandardPutPostRequestValidator _validator = new ProgramLearningStandardPutPostRequestValidator(); + private static PostingResultDescriptorPutPostRequestValidator _validator = new PostingResultDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -123291,92 +122343,35 @@ public class ProgramLearningStandard : Entities.Common.EdFi.IProgramLearningStan // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the PostingResultDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _learningStandardReferenceExplicitlyAssigned; - private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; - private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) - _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); - - return _learningStandardReference; - } - } - - [DataMember(Name="learningStandardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public LearningStandard.EdFi.LearningStandardReference LearningStandardReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLearningStandardReference != null - && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference; - - return null; - } - set - { - _learningStandardReferenceExplicitlyAssigned = true; - _learningStandardReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IProgram _program; - - [IgnoreDataMember] - Entities.Common.EdFi.IProgram IProgramLearningStandard.Program - { - get { return _program; } - set { SetProgram(value); } - } - - public Entities.Common.EdFi.IProgram Program - { - set { SetProgram(value); } - } - - private void SetProgram(Entities.Common.EdFi.IProgram value) - { - _program = value; - } /// - /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardId - { - get - { - if (ImplicitLearningStandardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) - return ImplicitLearningStandardReference.LearningStandardId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int PostingResultDescriptorId { get; set; } - // LearningStandard - _learningStandardReferenceExplicitlyAssigned = false; - ImplicitLearningStandardReference.LearningStandardId = value; - } + int IDescriptor.DescriptorId + { + get { return PostingResultDescriptorId; } + set { PostingResultDescriptorId = value; } } // ------------------------------------------------------------- @@ -123392,7 +122387,7 @@ string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramLearningStandard; + var compareTo = obj as Entities.Common.EdFi.IPostingResultDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -123400,13 +122395,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_program == null || !_program.Equals(compareTo.Program)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramLearningStandard).LearningStandardId, compareTo.LearningStandardId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IPostingResultDescriptor).PostingResultDescriptorId.Equals(compareTo.PostingResultDescriptorId)) return false; @@ -123422,12 +122413,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_program != null) - hash.Add(_program); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramLearningStandard).LearningStandardId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPostingResultDescriptor).PostingResultDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -123435,6 +122424,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -123460,8 +122498,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "ProgramLearningStandard")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -123472,6 +122513,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -123484,93 +122532,19 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramLearningStandard)target); + return Entities.Common.EdFi.PostingResultDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostingResultDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IProgramLearningStandard)target, null); + Entities.Common.EdFi.PostingResultDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPostingResultDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IProgramLearningStandard.LearningStandardResourceId - { - get { return null; } - set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLearningStandardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -123578,9 +122552,9 @@ string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardDiscriminat // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator + public class PostingResultDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -123608,17 +122582,136 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramSponsor table of the Program aggregate in the ODS Database. + /// Represents a reference to the PostSecondaryEvent resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class PostSecondaryEventReference : IResourceReference + { + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } + + [DataMember(Name="postSecondaryEventCategoryDescriptor")][DescriptorExists("PostSecondaryEventCategoryDescriptor")] + public string PostSecondaryEventCategoryDescriptor { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EventDate != default(DateTime) && PostSecondaryEventCategoryDescriptor != default(string) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EventDate == default) + { + yield return "EventDate"; + } + + if (PostSecondaryEventCategoryDescriptor == default) + { + yield return "PostSecondaryEventCategoryDescriptor"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "PostSecondaryEvent", + Href = $"/ed-fi/postSecondaryEvents/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.PostSecondaryEvent table of the PostSecondaryEvent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramSponsor : Entities.Common.EdFi.IProgramSponsor, IValidatableObject + public class PostSecondaryEvent : Entities.Common.EdFi.IPostSecondaryEvent, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgramSponsor"); + private static FullName _fullName = new FullName("edfi", "PostSecondaryEvent"); // Fluent validator instance (threadsafe) - private static ProgramSponsorPutPostRequestValidator _validator = new ProgramSponsorPutPostRequestValidator(); + private static PostSecondaryEventPutPostRequestValidator _validator = new PostSecondaryEventPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -123635,43 +122728,133 @@ public class ProgramSponsor : Entities.Common.EdFi.IProgramSponsor, IValidatable // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the PostSecondaryEvent resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IProgram _program; - [IgnoreDataMember] - Entities.Common.EdFi.IProgram IProgramSponsor.Program + private bool _postSecondaryInstitutionReferenceExplicitlyAssigned; + private PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference _postSecondaryInstitutionReference; + private PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference ImplicitPostSecondaryInstitutionReference { - get { return _program; } - set { SetProgram(value); } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_postSecondaryInstitutionReference == null && !_postSecondaryInstitutionReferenceExplicitlyAssigned) + _postSecondaryInstitutionReference = new PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference(); + + return _postSecondaryInstitutionReference; + } } - public Entities.Common.EdFi.IProgram Program + [DataMember(Name="postSecondaryInstitutionReference")] + [FullyDefinedReference] + public PostSecondaryInstitution.EdFi.PostSecondaryInstitutionReference PostSecondaryInstitutionReference { - set { SetProgram(value); } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitPostSecondaryInstitutionReference != null + && (_postSecondaryInstitutionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPostSecondaryInstitutionReference.IsReferenceFullyDefined())) + return ImplicitPostSecondaryInstitutionReference; + + return null; + } + set + { + _postSecondaryInstitutionReferenceExplicitlyAssigned = true; + _postSecondaryInstitutionReference = value; + } + } + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); + + return _studentReference; + } } - private void SetProgram(Entities.Common.EdFi.IProgram value) + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference { - _program = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; + + return null; + } + set + { + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// Ultimate and intermediate providers of funds for a particular educational or service program or activity, or for an individual's participation in the program or activity (e.g., Federal, State, ESC, District, School, Private Organization). + /// The date the event occurred or was recorded. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } + + /// + /// The post secondary event that is logged. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programSponsorDescriptor")][DescriptorExists("ProgramSponsorDescriptor")] - public string ProgramSponsorDescriptor { get; set; } + [DataMember(Name="postSecondaryEventCategoryDescriptor")][DescriptorExists("PostSecondaryEventCategoryDescriptor")] + public string PostSecondaryEventCategoryDescriptor { get; set; } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IPostSecondaryEvent.StudentUniqueId + { + get + { + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } // ------------------------------------------------------------- // ============================================================= @@ -123686,7 +122869,7 @@ private void SetProgram(Entities.Common.EdFi.IProgram value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramSponsor; + var compareTo = obj as Entities.Common.EdFi.IPostSecondaryEvent; if (ReferenceEquals(this, compareTo)) return true; @@ -123694,13 +122877,19 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_program == null || !_program.Equals(compareTo.Program)) + + // Standard Property + if (!(this as Entities.Common.EdFi.IPostSecondaryEvent).EventDate.Equals(compareTo.EventDate)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramSponsor).ProgramSponsorDescriptor, compareTo.ProgramSponsorDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IPostSecondaryEvent).PostSecondaryEventCategoryDescriptor, compareTo.PostSecondaryEventCategoryDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IPostSecondaryEvent).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -123716,13 +122905,17 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_program != null) - hash.Add(_program); // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramSponsor).ProgramSponsorDescriptor); + hash.Add((this as Entities.Common.EdFi.IPostSecondaryEvent).EventDate); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IPostSecondaryEvent).PostSecondaryEventCategoryDescriptor); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IPostSecondaryEvent).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -123735,6 +122928,33 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The ID of the post secondary institution. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IPostSecondaryEvent.PostSecondaryInstitutionId + { + get + { + if (ImplicitPostSecondaryInstitutionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPostSecondaryInstitutionReference.IsReferenceFullyDefined())) + { + return ImplicitPostSecondaryInstitutionReference.PostSecondaryInstitutionId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // PostSecondaryInstitution + _postSecondaryInstitutionReferenceExplicitlyAssigned = false; + ImplicitPostSecondaryInstitutionReference.PostSecondaryInstitutionId = value.GetValueOrDefault(); + } + } // ------------------------------------------------------------- // ============================================================= @@ -123755,7 +122975,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "ProgramSponsor")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "PostSecondaryEvent", "PostSecondaryEvent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -123767,6 +122987,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -123779,18 +123006,39 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramSponsorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramSponsor)target); + return Entities.Common.EdFi.PostSecondaryEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryEvent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramSponsorMapper.MapTo(this, (Entities.Common.EdFi.IProgramSponsor)target, null); + Entities.Common.EdFi.PostSecondaryEventMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryEvent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IPostSecondaryEvent.PostSecondaryInstitutionResourceId + { + get { return null; } + set { ImplicitPostSecondaryInstitutionReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IPostSecondaryEvent.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IPostSecondaryEvent.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -123808,7 +123056,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -123859,9 +123106,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramSponsorPutPostRequestValidator : FluentValidation.AbstractValidator + public class PostSecondaryEventPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -123890,21 +123137,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramAssignmentDescriptor table of the ProgramAssignmentDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.PostSecondaryEventCategoryDescriptor table of the PostSecondaryEventCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramAssignmentDescriptor : Entities.Common.EdFi.IProgramAssignmentDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class PostSecondaryEventCategoryDescriptor : Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramAssignmentDescriptor"); + private static FullName _fullName = new FullName("edfi", "PostSecondaryEventCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramAssignmentDescriptorPutPostRequestValidator _validator = new ProgramAssignmentDescriptorPutPostRequestValidator(); + private static PostSecondaryEventCategoryDescriptorPutPostRequestValidator _validator = new PostSecondaryEventCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -123923,7 +123170,7 @@ public class ProgramAssignmentDescriptor : Entities.Common.EdFi.IProgramAssignme // ------------------------------------------------------------ /// - /// The unique identifier for the ProgramAssignmentDescriptor resource. + /// The unique identifier for the PostSecondaryEventCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -123944,12 +123191,12 @@ public class ProgramAssignmentDescriptor : Entities.Common.EdFi.IProgramAssignme /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ProgramAssignmentDescriptorId { get; set; } + public int PostSecondaryEventCategoryDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ProgramAssignmentDescriptorId; } - set { ProgramAssignmentDescriptorId = value; } + get { return PostSecondaryEventCategoryDescriptorId; } + set { PostSecondaryEventCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -123965,7 +123212,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramAssignmentDescriptor; + var compareTo = obj as Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -123975,7 +123222,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IProgramAssignmentDescriptor).ProgramAssignmentDescriptorId.Equals(compareTo.ProgramAssignmentDescriptorId)) + if (!(this as Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor).PostSecondaryEventCategoryDescriptorId.Equals(compareTo.PostSecondaryEventCategoryDescriptorId)) return false; @@ -123993,7 +123240,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgramAssignmentDescriptor).ProgramAssignmentDescriptorId); + hash.Add((this as Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor).PostSecondaryEventCategoryDescriptorId); return hash.ToHashCode(); } @@ -124110,12 +123357,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramAssignmentDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramAssignmentDescriptor)target); + return Entities.Common.EdFi.PostSecondaryEventCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramAssignmentDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramAssignmentDescriptor)target, null); + Entities.Common.EdFi.PostSecondaryEventCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor)target, null); } // ------------------------------------------------------------- @@ -124130,9 +123377,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramAssignmentDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class PostSecondaryEventCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -124161,21 +123408,85 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramCharacteristicDescriptor table of the ProgramCharacteristicDescriptor aggregate in the ODS Database. + /// Represents a reference to the PostSecondaryInstitution resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class PostSecondaryInstitutionReference : IResourceReference + { + [DataMember(Name="postSecondaryInstitutionId")] + public long PostSecondaryInstitutionId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return PostSecondaryInstitutionId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (PostSecondaryInstitutionId == default) + { + yield return "PostSecondaryInstitutionId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "PostSecondaryInstitution", + Href = $"/ed-fi/postSecondaryInstitutions/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.PostSecondaryInstitution table of the PostSecondaryInstitution aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramCharacteristicDescriptor : Entities.Common.EdFi.IProgramCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class PostSecondaryInstitution : Entities.Common.EdFi.IPostSecondaryInstitution, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgramCharacteristicDescriptor"); + private static FullName _fullName = new FullName("edfi", "PostSecondaryInstitution"); // Fluent validator instance (threadsafe) - private static ProgramCharacteristicDescriptorPutPostRequestValidator _validator = new ProgramCharacteristicDescriptorPutPostRequestValidator(); + private static PostSecondaryInstitutionPutPostRequestValidator _validator = new PostSecondaryInstitutionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -124186,6 +123497,18 @@ public class ProgramCharacteristicDescriptor : Entities.Common.EdFi.IProgramChar // Constructor // ------------------------------------------------------------- + public PostSecondaryInstitution() + { + PostSecondaryInstitutionMediumOfInstructions = new List(); + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); + } // ------------------------------------------------------------ @@ -124194,7 +123517,7 @@ public class ProgramCharacteristicDescriptor : Entities.Common.EdFi.IProgramChar // ------------------------------------------------------------ /// - /// The unique identifier for the ProgramCharacteristicDescriptor resource. + /// The unique identifier for the PostSecondaryInstitution resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -124211,16 +123534,17 @@ public class ProgramCharacteristicDescriptor : Entities.Common.EdFi.IProgramChar // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The ID of the post secondary institution. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProgramCharacteristicDescriptorId { get; set; } + [RequiredWithNonDefault] + [DataMember(Name="postSecondaryInstitutionId")] + public long PostSecondaryInstitutionId { get; set; } - int IDescriptor.DescriptorId + long IEducationOrganization.EducationOrganizationId { - get { return ProgramCharacteristicDescriptorId; } - set { ProgramCharacteristicDescriptorId = value; } + get { return PostSecondaryInstitutionId; } + set { PostSecondaryInstitutionId = value; } } // ------------------------------------------------------------- @@ -124236,7 +123560,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramCharacteristicDescriptor; + var compareTo = obj as Entities.Common.EdFi.IPostSecondaryInstitution; if (ReferenceEquals(this, compareTo)) return true; @@ -124246,7 +123570,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IProgramCharacteristicDescriptor).ProgramCharacteristicDescriptorId.Equals(compareTo.ProgramCharacteristicDescriptorId)) + if (!(this as Entities.Common.EdFi.IPostSecondaryInstitution).PostSecondaryInstitutionId.Equals(compareTo.PostSecondaryInstitutionId)) return false; @@ -124264,7 +123588,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgramCharacteristicDescriptor).ProgramCharacteristicDescriptorId); + hash.Add((this as Entities.Common.EdFi.IPostSecondaryInstitution).PostSecondaryInstitutionId); return hash.ToHashCode(); } @@ -124275,58 +123599,58 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A code or abbreviation that is used to refer to the descriptor. + /// The full, legally accepted name of the institution. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } /// - /// The description of the descriptor. + /// The current operational status of the education organization (e.g., active, inactive). /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// A short name for the institution. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The public web site address (URL) for the education organization. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// A classification of whether a postsecondary institution is operated by publicly elected or appointed officials (public control) or by privately elected or appointed officials and derives its major source of funds from private sources (private control). /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="administrativeFundingControlDescriptor")][DescriptorExists("AdministrativeFundingControlDescriptor")] + public string AdministrativeFundingControlDescriptor { get; set; } /// - /// A shortened description for the descriptor. + /// A classification of whether a post secondary institution's highest level of offering is a program of 4-years or higher (4 year), 2-but-less-than 4-years (2 year), or less than 2-years. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="postSecondaryInstitutionLevelDescriptor")][DescriptorExists("PostSecondaryInstitutionLevelDescriptor")] + public string PostSecondaryInstitutionLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -124342,411 +123666,172 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses + { + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories { - return Entities.Common.EdFi.ProgramCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramCharacteristicDescriptor)target); + get { return _educationOrganizationCategories; } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } } - void IMappable.Map(object target) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories { - Entities.Common.EdFi.ProgramCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramCharacteristicDescriptor)target, null); + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } } - // ------------------------------------------------------------- + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } - // ================================================================= - // Validators - // ----------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; - [ExcludeFromCodeCoverage] - public class ProgramCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators { - if (context.InstanceToValidate == null) + get { return _educationOrganizationIndicators; } + set { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); } + } - var instance = context.InstanceToValidate; - - var failures = new List(); + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; - if (failures.Any()) + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); } - - return true; } - } - // ----------------------------------------------------------------- -} -// Aggregate: ProgramDimension + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; -namespace EdFi.Ods.Api.Common.Models.Resources.ProgramDimension.EdFi -{ - /// - /// Represents a reference to the ProgramDimension resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ProgramDimensionReference : IResourceReference - { - [DataMember(Name="code")] - public string Code { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return Code != default(string) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (Code == default) - { - yield return "Code"; - } - - if (FiscalYear == default) - { - yield return "FiscalYear"; - } - - } - - private Link CreateLink() + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses { - var link = new Link - { - Rel = "ProgramDimension", - Href = $"/ed-fi/programDimensions/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link + get { return _educationOrganizationInternationalAddresses; } + set { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.ProgramDimension table of the ProgramDimension aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class ProgramDimension : Entities.Common.EdFi.IProgramDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "ProgramDimension"); - - // Fluent validator instance (threadsafe) - private static ProgramDimensionPutPostRequestValidator _validator = new ProgramDimensionPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - public ProgramDimension() - { - ProgramDimensionReportingTags = new List(); - } - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the ProgramDimension resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// The code representation of the account program dimension. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="code")] - public string Code { get; set; } - - private bool _fiscalYearExplicitlyAssigned = false; - private int _fiscalYear; - - /// - /// The fiscal year for which the account program dimension is valid. - /// - // NOT in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get => _fiscalYear; - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); } } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IProgramDimension; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramDimension).Code, compareTo.Code)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IProgramDimension).FiscalYear.Equals(compareTo.FiscalYear)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramDimension).Code); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramDimension).FiscalYear); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// A description of the account program dimension. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeName")] - public string CodeName { get; set; } - // ------------------------------------------------------------- - - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } } - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramDimension", "ProgramDimension")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "PostSecondaryInstitution", "PostSecondaryInstitution")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _programDimensionReportingTags; - private ICollection _programDimensionReportingTagsCovariant; + private ICollection _postSecondaryInstitutionMediumOfInstructions; + private ICollection _postSecondaryInstitutionMediumOfInstructionsCovariant; [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection ProgramDimensionReportingTags + [DataMember(Name="mediumOfInstructions")] + public ICollection PostSecondaryInstitutionMediumOfInstructions { - get { return _programDimensionReportingTags; } + get { return _postSecondaryInstitutionMediumOfInstructions; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProgramDimensionReportingTag)e.Item).ProgramDimension = this); - _programDimensionReportingTags = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)e.Item).PostSecondaryInstitution = this); + _postSecondaryInstitutionMediumOfInstructions = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramDimensionReportingTag)e.Item).ProgramDimension = this; - _programDimensionReportingTagsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)e.Item).PostSecondaryInstitution = this; + _postSecondaryInstitutionMediumOfInstructionsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramDimension.ProgramDimensionReportingTags + ICollection Entities.Common.EdFi.IPostSecondaryInstitution.PostSecondaryInstitutionMediumOfInstructions { - get { return _programDimensionReportingTagsCovariant; } - set { ProgramDimensionReportingTags = new List(value.Cast()); } + get { return _postSecondaryInstitutionMediumOfInstructionsCovariant; } + set { PostSecondaryInstitutionMediumOfInstructions = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -124771,9 +123856,39 @@ public ICollection ProgramDimensionReportingTags internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_programDimensionReportingTags != null) foreach (var item in _programDimensionReportingTags) + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) { - item.ProgramDimension = this; + item.EducationOrganization = this; + } + + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; + } + + if (_postSecondaryInstitutionMediumOfInstructions != null) foreach (var item in _postSecondaryInstitutionMediumOfInstructions) + { + item.PostSecondaryInstitution = this; } } @@ -124784,12 +123899,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramDimension)target); + return Entities.Common.EdFi.PostSecondaryInstitutionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryInstitution)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramDimensionMapper.MapTo(this, (Entities.Common.EdFi.IProgramDimension)target, null); + Entities.Common.EdFi.PostSecondaryInstitutionMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryInstitution)target, null); } // ------------------------------------------------------------- @@ -124818,13 +123933,85 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (ProgramDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("ProgramDimensionReportingTags") != false) + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("ProgramDimensionReportingTags"); + pathBuilder.Append("EducationOrganizationAddresses"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramDimensionReportingTags, validationContext, validationContext.Items.ForCollection("ProgramDimensionReportingTags")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + { + yield return result; + } + } + + if (PostSecondaryInstitutionMediumOfInstructions.Any() && mappingContract?.IsMemberSupported("PostSecondaryInstitutionMediumOfInstructions") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("PostSecondaryInstitutionMediumOfInstructions"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(PostSecondaryInstitutionMediumOfInstructions, validationContext, validationContext.Items.ForCollection("PostSecondaryInstitutionMediumOfInstructions")))) { yield return result; } @@ -124875,14 +124062,20 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class PostSecondaryInstitutionPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ProgramDimension = new FullName("edfi", "ProgramDimension"); + private static readonly FullName _fullName_edfi_PostSecondaryInstitution = new FullName("edfi", "PostSecondaryInstitution"); // Declare collection item validators - private ProgramDimensionReportingTagPutPostRequestValidator _programDimensionReportingTagsValidator = new (); + private PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator _postSecondaryInstitutionMediumOfInstructionsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -124899,19 +124092,85 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsProgramDimensionReportingTagIncluded(x)); + var hasInvalidPostSecondaryInstitutionMediumOfInstructionsItems = instance.PostSecondaryInstitutionMediumOfInstructions.Any(x => !mappingContract.IsPostSecondaryInstitutionMediumOfInstructionIncluded(x)); - if (hasInvalidProgramDimensionReportingTagsItems) + if (hasInvalidPostSecondaryInstitutionMediumOfInstructionsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProgramDimensionReportingTags", $"A supplied 'ProgramDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("PostSecondaryInstitutionMediumOfInstructions", $"A supplied 'PostSecondaryInstitutionMediumOfInstruction' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationAddressIncluded != null) + { + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); + + if (hasInvalidEducationOrganizationAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -124933,16 +124192,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramDimensionReportingTag table of the ProgramDimension aggregate in the ODS Database. + /// A class which represents the edfi.PostSecondaryInstitutionMediumOfInstruction table of the PostSecondaryInstitution aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramDimensionReportingTag : Entities.Common.EdFi.IProgramDimensionReportingTag, IValidatableObject + public class PostSecondaryInstitutionMediumOfInstruction : Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgramDimensionReportingTag"); + private static FullName _fullName = new FullName("edfi", "PostSecondaryInstitutionMediumOfInstruction"); // Fluent validator instance (threadsafe) - private static ProgramDimensionReportingTagPutPostRequestValidator _validator = new ProgramDimensionReportingTagPutPostRequestValidator(); + private static PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator _validator = new PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -124969,33 +124228,33 @@ public class ProgramDimensionReportingTag : Entities.Common.EdFi.IProgramDimensi //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IProgramDimension _programDimension; + private Entities.Common.EdFi.IPostSecondaryInstitution _postSecondaryInstitution; [IgnoreDataMember] - Entities.Common.EdFi.IProgramDimension IProgramDimensionReportingTag.ProgramDimension + Entities.Common.EdFi.IPostSecondaryInstitution IPostSecondaryInstitutionMediumOfInstruction.PostSecondaryInstitution { - get { return _programDimension; } - set { SetProgramDimension(value); } + get { return _postSecondaryInstitution; } + set { SetPostSecondaryInstitution(value); } } - public Entities.Common.EdFi.IProgramDimension ProgramDimension + public Entities.Common.EdFi.IPostSecondaryInstitution PostSecondaryInstitution { - set { SetProgramDimension(value); } + set { SetPostSecondaryInstitution(value); } } - private void SetProgramDimension(Entities.Common.EdFi.IProgramDimension value) + private void SetPostSecondaryInstitution(Entities.Common.EdFi.IPostSecondaryInstitution value) { - _programDimension = value; + _postSecondaryInstitution = value; } /// - /// Optional tag for accountability reporting. + /// The categories in which an institution serves the students. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } + [DataMember(Name="mediumOfInstructionDescriptor")][DescriptorExists("MediumOfInstructionDescriptor")] + public string MediumOfInstructionDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -125010,7 +124269,7 @@ private void SetProgramDimension(Entities.Common.EdFi.IProgramDimension value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramDimensionReportingTag; + var compareTo = obj as Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction; if (ReferenceEquals(this, compareTo)) return true; @@ -125019,12 +124278,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_programDimension == null || !_programDimension.Equals(compareTo.ProgramDimension)) + if (_postSecondaryInstitution == null || !_postSecondaryInstitution.Equals(compareTo.PostSecondaryInstitution)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction).MediumOfInstructionDescriptor, compareTo.MediumOfInstructionDescriptor)) return false; @@ -125041,11 +124300,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_programDimension != null) - hash.Add(_programDimension); + if (_postSecondaryInstitution != null) + hash.Add(_postSecondaryInstitution); // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramDimensionReportingTag).ReportingTagDescriptor); + hash.Add((this as Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction).MediumOfInstructionDescriptor); return hash.ToHashCode(); } @@ -125079,7 +124338,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramDimension", "ProgramDimensionReportingTag")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "PostSecondaryInstitution", "PostSecondaryInstitutionMediumOfInstruction")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -125103,12 +124362,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramDimensionReportingTag)target); + return Entities.Common.EdFi.PostSecondaryInstitutionMediumOfInstructionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IProgramDimensionReportingTag)target, null); + Entities.Common.EdFi.PostSecondaryInstitutionMediumOfInstructionMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction)target, null); } // ------------------------------------------------------------- @@ -125183,9 +124442,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class PostSecondaryInstitutionMediumOfInstructionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -125214,150 +124473,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ProgramEvaluation resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ProgramEvaluationReference : IResourceReference - { - [DataMember(Name="programEducationOrganizationId")] - public long ProgramEducationOrganizationId { get; set; } - - [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] - public string ProgramEvaluationPeriodDescriptor { get; set; } - - [DataMember(Name="programEvaluationTitle")] - public string ProgramEvaluationTitle { get; set; } - - [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] - public string ProgramEvaluationTypeDescriptor { get; set; } - - [DataMember(Name="programName")] - public string ProgramName { get; set; } - - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return ProgramEducationOrganizationId != default(long) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (ProgramEducationOrganizationId == default) - { - yield return "ProgramEducationOrganizationId"; - } - - if (ProgramEvaluationPeriodDescriptor == default) - { - yield return "ProgramEvaluationPeriodDescriptor"; - } - - if (ProgramEvaluationTitle == default) - { - yield return "ProgramEvaluationTitle"; - } - - if (ProgramEvaluationTypeDescriptor == default) - { - yield return "ProgramEvaluationTypeDescriptor"; - } - - if (ProgramName == default) - { - yield return "ProgramName"; - } - - if (ProgramTypeDescriptor == default) - { - yield return "ProgramTypeDescriptor"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "ProgramEvaluation", - Href = $"/ed-fi/programEvaluations/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.ProgramEvaluation table of the ProgramEvaluation aggregate in the ODS Database. + /// A class which represents the edfi.PostSecondaryInstitutionLevelDescriptor table of the PostSecondaryInstitutionLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluation : Entities.Common.EdFi.IProgramEvaluation, IHasETag, IDateVersionedEntity, IValidatableObject + public class PostSecondaryInstitutionLevelDescriptor : Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluation"); + private static FullName _fullName = new FullName("edfi", "PostSecondaryInstitutionLevelDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationPutPostRequestValidator _validator = new ProgramEvaluationPutPostRequestValidator(); + private static PostSecondaryInstitutionLevelDescriptorPutPostRequestValidator _validator = new PostSecondaryInstitutionLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -125368,10 +124498,6 @@ public class ProgramEvaluation : Entities.Common.EdFi.IProgramEvaluation, IHasET // Constructor // ------------------------------------------------------------- - public ProgramEvaluation() - { - ProgramEvaluationLevels = new List(); - } // ------------------------------------------------------------ @@ -125380,7 +124506,7 @@ public ProgramEvaluation() // ------------------------------------------------------------ /// - /// The unique identifier for the ProgramEvaluation resource. + /// The unique identifier for the PostSecondaryInstitutionLevelDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -125390,40 +124516,6 @@ public ProgramEvaluation() // ============================================================= // References // ------------------------------------------------------------- - - private bool _programReferenceExplicitlyAssigned; - private Program.EdFi.ProgramReference _programReference; - private Program.EdFi.ProgramReference ImplicitProgramReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programReference == null && !_programReferenceExplicitlyAssigned) - _programReference = new Program.EdFi.ProgramReference(); - - return _programReference; - } - } - - [DataMember(Name="programReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Program.EdFi.ProgramReference ProgramReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramReference != null - && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference; - - return null; - } - set - { - _programReferenceExplicitlyAssigned = true; - _programReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -125431,101 +124523,16 @@ public Program.EdFi.ProgramReference ProgramReference // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IProgramEvaluation.ProgramEducationOrganizationId - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.EducationOrganizationId = value; - } - } - - /// - /// The name of the period for the program evaluation. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] - public string ProgramEvaluationPeriodDescriptor { get; set; } - - /// - /// An assigned unique identifier for the student program evaluation. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programEvaluationTitle")] - public string ProgramEvaluationTitle { get; set; } - - /// - /// The type of program evaluation conducted. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] - public string ProgramEvaluationTypeDescriptor { get; set; } - - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IProgramEvaluation.ProgramName - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.ProgramName = value; - } - } - - /// - /// The type of program. - /// + [JsonIgnore] + public int PostSecondaryInstitutionLevelDescriptorId { get; set; } - // IS in a reference (ProgramEvaluation.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IProgramEvaluation.ProgramTypeDescriptor + int IDescriptor.DescriptorId { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramReference.ProgramTypeDescriptor = value; - } + get { return PostSecondaryInstitutionLevelDescriptorId; } + set { PostSecondaryInstitutionLevelDescriptorId = value; } } // ------------------------------------------------------------- @@ -125541,7 +124548,7 @@ string Entities.Common.EdFi.IProgramEvaluation.ProgramTypeDescriptor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluation; + var compareTo = obj as Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -125550,33 +124557,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IProgramEvaluation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramName, compareTo.ProgramName)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor).PostSecondaryInstitutionLevelDescriptorId.Equals(compareTo.PostSecondaryInstitutionLevelDescriptorId)) return false; @@ -125593,26 +124575,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEducationOrganizationId); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationPeriodDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTitle); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTypeDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramName); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor).PostSecondaryInstitutionLevelDescriptorId); return hash.ToHashCode(); } @@ -125621,35 +124585,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The maximum summary numerical rating or score for the program evaluation. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="evaluationMaxNumericRating")] - public decimal? EvaluationMaxNumericRating { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The minimum summary numerical rating or score for the program evaluation. If omitted, assumed to be 0.0 + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="evaluationMinNumericRating")] - public decimal? EvaluationMinNumericRating { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The long description of the program evaluation. + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="programEvaluationDescription")] - public string ProgramEvaluationDescription { get; set; } + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -125670,43 +124659,16 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluation", "ProgramEvaluation")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _programEvaluationLevels; - private ICollection _programEvaluationLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="levels")] - public ICollection ProgramEvaluationLevels - { - get { return _programEvaluationLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProgramEvaluationLevel)e.Item).ProgramEvaluation = this); - _programEvaluationLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramEvaluationLevel)e.Item).ProgramEvaluation = this; - _programEvaluationLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramEvaluation.ProgramEvaluationLevels - { - get { return _programEvaluationLevelsCovariant; } - set { ProgramEvaluationLevels = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -125724,17 +124686,6 @@ public ICollection ProgramEvaluationLevels // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_programEvaluationLevels != null) foreach (var item in _programEvaluationLevels) - { - item.ProgramEvaluation = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -125742,119 +124693,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluation)target); + return Entities.Common.EdFi.PostSecondaryInstitutionLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluation)target, null); + Entities.Common.EdFi.PostSecondaryInstitutionLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IProgramEvaluation.ProgramResourceId - { - get { return null; } - set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IProgramEvaluation.ProgramDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitProgramReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (ProgramEvaluationLevels.Any() && mappingContract?.IsMemberSupported("ProgramEvaluationLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ProgramEvaluationLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramEvaluationLevels, validationContext, validationContext.Items.ForCollection("ProgramEvaluationLevels")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } + } // ================================================================= // Validators // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationPutPostRequestValidator : FluentValidation.AbstractValidator + public class PostSecondaryInstitutionLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ProgramEvaluation = new FullName("edfi", "ProgramEvaluation"); - - // Declare collection item validators - private ProgramEvaluationLevelPutPostRequestValidator _programEvaluationLevelsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -125867,28 +124728,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ProgramEvaluationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_ProgramEvaluation); - - if (mappingContract != null) - { - if (mappingContract.IsProgramEvaluationLevelIncluded != null) - { - var hasInvalidProgramEvaluationLevelsItems = instance.ProgramEvaluationLevels.Any(x => !mappingContract.IsProgramEvaluationLevelIncluded(x)); - - if (hasInvalidProgramEvaluationLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProgramEvaluationLevels", $"A supplied 'ProgramEvaluationLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -125904,17 +124743,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramEvaluationLevel table of the ProgramEvaluation aggregate in the ODS Database. + /// A class which represents the edfi.PrimaryLearningDeviceAccessDescriptor table of the PrimaryLearningDeviceAccessDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationLevel, IValidatableObject + public class PrimaryLearningDeviceAccessDescriptor : Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluationLevel"); + private static FullName _fullName = new FullName("edfi", "PrimaryLearningDeviceAccessDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationLevelPutPostRequestValidator _validator = new ProgramEvaluationLevelPutPostRequestValidator(); + private static PrimaryLearningDeviceAccessDescriptorPutPostRequestValidator _validator = new PrimaryLearningDeviceAccessDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -125931,6 +124775,13 @@ public class ProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationLev // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the PrimaryLearningDeviceAccessDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -125941,33 +124792,19 @@ public class ProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationLev //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IProgramEvaluation _programEvaluation; - [IgnoreDataMember] - Entities.Common.EdFi.IProgramEvaluation IProgramEvaluationLevel.ProgramEvaluation - { - get { return _programEvaluation; } - set { SetProgramEvaluation(value); } - } - - public Entities.Common.EdFi.IProgramEvaluation ProgramEvaluation - { - set { SetProgramEvaluation(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int PrimaryLearningDeviceAccessDescriptorId { get; set; } - private void SetProgramEvaluation(Entities.Common.EdFi.IProgramEvaluation value) + int IDescriptor.DescriptorId { - _programEvaluation = value; + get { return PrimaryLearningDeviceAccessDescriptorId; } + set { PrimaryLearningDeviceAccessDescriptorId = value; } } - - /// - /// The title for a level of rating or evaluation band (e.g., Excellent, Acceptable, Needs Improvement, Unacceptable). - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="ratingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] - public string RatingLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -125982,7 +124819,7 @@ private void SetProgramEvaluation(Entities.Common.EdFi.IProgramEvaluation value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationLevel; + var compareTo = obj as Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -125990,13 +124827,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_programEvaluation == null || !_programEvaluation.Equals(compareTo.ProgramEvaluation)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationLevel).RatingLevelDescriptor, compareTo.RatingLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor).PrimaryLearningDeviceAccessDescriptorId.Equals(compareTo.PrimaryLearningDeviceAccessDescriptorId)) return false; @@ -126012,12 +124845,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_programEvaluation != null) - hash.Add(_programEvaluation); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationLevel).RatingLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor).PrimaryLearningDeviceAccessDescriptorId); return hash.ToHashCode(); } @@ -126026,27 +124856,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The maximum numerical rating or score to achieve the evaluation rating level. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxNumericRating")] - public decimal? MaxNumericRating { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The minimum numerical rating or score to achieve the evaluation rating level. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="minNumericRating")] - public decimal? MinNumericRating { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -126067,8 +124930,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluation", "ProgramEvaluationLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -126079,6 +124945,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -126091,12 +124964,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationLevel)target); + return Entities.Common.EdFi.PrimaryLearningDeviceAccessDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationLevelMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationLevel)target, null); + Entities.Common.EdFi.PrimaryLearningDeviceAccessDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor)target, null); } // ------------------------------------------------------------- @@ -126104,66 +124977,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -126171,9 +124984,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class PrimaryLearningDeviceAccessDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -126202,158 +125015,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ProgramEvaluationElement resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ProgramEvaluationElementReference : IResourceReference - { - [DataMember(Name="programEducationOrganizationId")] - public long ProgramEducationOrganizationId { get; set; } - - [DataMember(Name="programEvaluationElementTitle")] - public string ProgramEvaluationElementTitle { get; set; } - - [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] - public string ProgramEvaluationPeriodDescriptor { get; set; } - - [DataMember(Name="programEvaluationTitle")] - public string ProgramEvaluationTitle { get; set; } - - [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] - public string ProgramEvaluationTypeDescriptor { get; set; } - - [DataMember(Name="programName")] - public string ProgramName { get; set; } - - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return ProgramEducationOrganizationId != default(long) && ProgramEvaluationElementTitle != default(string) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (ProgramEducationOrganizationId == default) - { - yield return "ProgramEducationOrganizationId"; - } - - if (ProgramEvaluationElementTitle == default) - { - yield return "ProgramEvaluationElementTitle"; - } - - if (ProgramEvaluationPeriodDescriptor == default) - { - yield return "ProgramEvaluationPeriodDescriptor"; - } - - if (ProgramEvaluationTitle == default) - { - yield return "ProgramEvaluationTitle"; - } - - if (ProgramEvaluationTypeDescriptor == default) - { - yield return "ProgramEvaluationTypeDescriptor"; - } - - if (ProgramName == default) - { - yield return "ProgramName"; - } - - if (ProgramTypeDescriptor == default) - { - yield return "ProgramTypeDescriptor"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "ProgramEvaluationElement", - Href = $"/ed-fi/programEvaluationElements/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.ProgramEvaluationElement table of the ProgramEvaluationElement aggregate in the ODS Database. + /// A class which represents the edfi.PrimaryLearningDeviceAwayFromSchoolDescriptor table of the PrimaryLearningDeviceAwayFromSchoolDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationElement : Entities.Common.EdFi.IProgramEvaluationElement, IHasETag, IDateVersionedEntity, IValidatableObject + public class PrimaryLearningDeviceAwayFromSchoolDescriptor : Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluationElement"); + private static FullName _fullName = new FullName("edfi", "PrimaryLearningDeviceAwayFromSchoolDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationElementPutPostRequestValidator _validator = new ProgramEvaluationElementPutPostRequestValidator(); + private static PrimaryLearningDeviceAwayFromSchoolDescriptorPutPostRequestValidator _validator = new PrimaryLearningDeviceAwayFromSchoolDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -126364,10 +125040,6 @@ public class ProgramEvaluationElement : Entities.Common.EdFi.IProgramEvaluationE // Constructor // ------------------------------------------------------------- - public ProgramEvaluationElement() - { - ProgramEvaluationElementProgramEvaluationLevels = new List(); - } // ------------------------------------------------------------ @@ -126376,7 +125048,7 @@ public ProgramEvaluationElement() // ------------------------------------------------------------ /// - /// The unique identifier for the ProgramEvaluationElement resource. + /// The unique identifier for the PrimaryLearningDeviceAwayFromSchoolDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -126386,73 +125058,6 @@ public ProgramEvaluationElement() // ============================================================= // References // ------------------------------------------------------------- - - private bool _programEvaluationObjectiveReferenceExplicitlyAssigned; - private ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference _programEvaluationObjectiveReference; - private ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference ImplicitProgramEvaluationObjectiveReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programEvaluationObjectiveReference == null && !_programEvaluationObjectiveReferenceExplicitlyAssigned) - _programEvaluationObjectiveReference = new ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference(); - - return _programEvaluationObjectiveReference; - } - } - - [DataMember(Name="programEvaluationObjectiveReference")] - [FullyDefinedReference] - public ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference ProgramEvaluationObjectiveReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramEvaluationObjectiveReference != null - && (_programEvaluationObjectiveReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationObjectiveReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationObjectiveReference; - - return null; - } - set - { - _programEvaluationObjectiveReferenceExplicitlyAssigned = true; - _programEvaluationObjectiveReference = value; - } - } - private bool _programEvaluationReferenceExplicitlyAssigned; - private ProgramEvaluation.EdFi.ProgramEvaluationReference _programEvaluationReference; - private ProgramEvaluation.EdFi.ProgramEvaluationReference ImplicitProgramEvaluationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programEvaluationReference == null && !_programEvaluationReferenceExplicitlyAssigned) - _programEvaluationReference = new ProgramEvaluation.EdFi.ProgramEvaluationReference(); - - return _programEvaluationReference; - } - } - - [DataMember(Name="programEvaluationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public ProgramEvaluation.EdFi.ProgramEvaluationReference ProgramEvaluationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramEvaluationReference != null - && (_programEvaluationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference; - - return null; - } - set - { - _programEvaluationReferenceExplicitlyAssigned = true; - _programEvaluationReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -126460,165 +125065,16 @@ public ProgramEvaluation.EdFi.ProgramEvaluationReference ProgramEvaluationRefere // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IProgramEvaluationElement.ProgramEducationOrganizationId - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProgramEvaluation - _programEvaluationReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationReference.ProgramEducationOrganizationId = value; - - // ProgramEvaluationObjective - _programEvaluationObjectiveReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationObjectiveReference.ProgramEducationOrganizationId = value; - } - } - - /// - /// The name or title of the program evaluation element. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programEvaluationElementTitle")] - public string ProgramEvaluationElementTitle { get; set; } - - /// - /// The name of the period for the program evaluation. - /// - - // IS in a reference (ProgramEvaluationElement.ProgramEvaluationPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationPeriodDescriptor - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor; - - return null; - } - set - { - ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor = value; - ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationPeriodDescriptor = value; - } - } - - /// - /// An assigned unique identifier for the student program evaluation. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationTitle - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEvaluationTitle; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProgramEvaluation - _programEvaluationReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationReference.ProgramEvaluationTitle = value; - - // ProgramEvaluationObjective - _programEvaluationObjectiveReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationTitle = value; - } - } - - /// - /// The type of program evaluation conducted. - /// - - // IS in a reference (ProgramEvaluationElement.ProgramEvaluationTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationTypeDescriptor - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor; - - return null; - } - set - { - ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor = value; - ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationTypeDescriptor = value; - } - } - - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramName - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProgramEvaluation - _programEvaluationReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationReference.ProgramName = value; - - // ProgramEvaluationObjective - _programEvaluationObjectiveReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationObjectiveReference.ProgramName = value; - } - } - - /// - /// The type of program. - /// + [JsonIgnore] + public int PrimaryLearningDeviceAwayFromSchoolDescriptorId { get; set; } - // IS in a reference (ProgramEvaluationElement.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramTypeDescriptor + int IDescriptor.DescriptorId { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramEvaluationReference.ProgramTypeDescriptor = value; - ImplicitProgramEvaluationObjectiveReference.ProgramTypeDescriptor = value; - } + get { return PrimaryLearningDeviceAwayFromSchoolDescriptorId; } + set { PrimaryLearningDeviceAwayFromSchoolDescriptorId = value; } } // ------------------------------------------------------------- @@ -126634,7 +125090,7 @@ string Entities.Common.EdFi.IProgramEvaluationElement.ProgramTypeDescriptor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationElement; + var compareTo = obj as Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -126643,38 +125099,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationElementTitle, compareTo.ProgramEvaluationElementTitle)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramName, compareTo.ProgramName)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor).PrimaryLearningDeviceAwayFromSchoolDescriptorId.Equals(compareTo.PrimaryLearningDeviceAwayFromSchoolDescriptorId)) return false; @@ -126691,29 +125117,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEducationOrganizationId); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationElementTitle); - - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationPeriodDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTitle); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTypeDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramName); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor).PrimaryLearningDeviceAwayFromSchoolDescriptorId); return hash.ToHashCode(); } @@ -126722,69 +125127,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The maximum summary numerical rating or score for the program evaluation element. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="elementMaxNumericRating")] - public decimal? ElementMaxNumericRating { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The minimum summary numerical rating or score for the program evaluation element. If omitted, assumed to be 0.0. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="elementMinNumericRating")] - public decimal? ElementMinNumericRating { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The sort order of this program evaluation element. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="elementSortOrder")] - public int? ElementSortOrder { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The long description of the program evaluation element. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="programEvaluationElementDescription")] - public string ProgramEvaluationElementDescription { get; set; } + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The name or title of the program evaluation objective. + /// A shortened description for the descriptor. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveTitle - { - get - { - if (ImplicitProgramEvaluationObjectiveReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationObjectiveReference.IsReferenceFullyDefined())) - { - return ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationObjectiveTitle; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - // ProgramEvaluationObjective - _programEvaluationObjectiveReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationObjectiveTitle = value; - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -126805,43 +125201,16 @@ string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjective // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationElement", "ProgramEvaluationElement")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _programEvaluationElementProgramEvaluationLevels; - private ICollection _programEvaluationElementProgramEvaluationLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="programEvaluationLevels")] - public ICollection ProgramEvaluationElementProgramEvaluationLevels - { - get { return _programEvaluationElementProgramEvaluationLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)e.Item).ProgramEvaluationElement = this); - _programEvaluationElementProgramEvaluationLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)e.Item).ProgramEvaluationElement = this; - _programEvaluationElementProgramEvaluationLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationElementProgramEvaluationLevels - { - get { return _programEvaluationElementProgramEvaluationLevelsCovariant; } - set { ProgramEvaluationElementProgramEvaluationLevels = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -126859,17 +125228,6 @@ public ICollection ProgramEvalua // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_programEvaluationElementProgramEvaluationLevels != null) foreach (var item in _programEvaluationElementProgramEvaluationLevels) - { - item.ProgramEvaluationElement = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -126877,317 +125235,290 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationElementMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationElement)target); + return Entities.Common.EdFi.PrimaryLearningDeviceAwayFromSchoolDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationElementMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationElement)target, null); + Entities.Common.EdFi.PrimaryLearningDeviceAwayFromSchoolDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationResourceId - { - get { return null; } - set { ImplicitProgramEvaluationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitProgramEvaluationReference.Discriminator = value; } - } - + // ----------------------------------------------------------------- + } - Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveResourceId - { - get { return null; } - set { ImplicitProgramEvaluationObjectiveReference.ResourceId = value ?? default(Guid); } - } + // ================================================================= + // Validators + // ----------------------------------------------------------------- - string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveDiscriminator + [ExcludeFromCodeCoverage] + public class PrimaryLearningDeviceAwayFromSchoolDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - // Not supported for Resources - get { return null; } - set { ImplicitProgramEvaluationObjectiveReference.Discriminator = value; } - } + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + return false; + } - // ----------------------------------------------------------------- + var instance = context.InstanceToValidate; - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; + var failures = new List(); - try + if (failures.Any()) { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (ProgramEvaluationElementProgramEvaluationLevels.Any() && mappingContract?.IsMemberSupported("ProgramEvaluationElementProgramEvaluationLevels") != false) + foreach (var failure in failures) { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ProgramEvaluationElementProgramEvaluationLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramEvaluationElementProgramEvaluationLevels, validationContext, validationContext.Items.ForCollection("ProgramEvaluationElementProgramEvaluationLevels")))) - { - yield return result; - } + result.Errors.Add(failure); } + return false; + } - // --------------------------- - // Validate embedded objects - // --------------------------- + return true; + } + } + // ----------------------------------------------------------------- - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } +} +// Aggregate: PrimaryLearningDeviceProviderDescriptor - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; +namespace EdFi.Ods.Api.Common.Models.Resources.PrimaryLearningDeviceProviderDescriptor.EdFi +{ + /// + /// A class which represents the edfi.PrimaryLearningDeviceProviderDescriptor table of the PrimaryLearningDeviceProviderDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class PrimaryLearningDeviceProviderDescriptor : Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "PrimaryLearningDeviceProviderDescriptor"); - var sourcesForProgramEducationOrganizationId = GetProgramEducationOrganizationIdSources().ToArray(); + // Fluent validator instance (threadsafe) + private static PrimaryLearningDeviceProviderDescriptorPutPostRequestValidator _validator = new PrimaryLearningDeviceProviderDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - if (!sourcesForProgramEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); + // ============================================================= + // Constructor + // ------------------------------------------------------------- - string values = string.Join("', '", sourcesForProgramEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForProgramEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + // ------------------------------------------------------------ - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEducationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForProgramEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetProgramEducationOrganizationIdSources() - { - // Obtain value from other references - var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEducationOrganizationId; - - if (valueFromProgramEvaluationReference != null) - { - yield return ("programEvaluationReference.programEducationOrganizationId", this.ProgramEvaluationReference.ProgramEducationOrganizationId); - } - - // Obtain value from other references - var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEducationOrganizationId; - - if (valueFromProgramEvaluationObjectiveReference != null) - { - yield return ("programEvaluationObjectiveReference.programEducationOrganizationId", this.ProgramEvaluationObjectiveReference.ProgramEducationOrganizationId); - } - - } - var sourcesForProgramEvaluationPeriodDescriptor = GetProgramEvaluationPeriodDescriptorSources().ToArray(); + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ - if (!sourcesForProgramEvaluationPeriodDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); + /// + /// The unique identifier for the PrimaryLearningDeviceProviderDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ - string values = string.Join("', '", sourcesForProgramEvaluationPeriodDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForProgramEvaluationPeriodDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEvaluationPeriodDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForProgramEvaluationPeriodDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetProgramEvaluationPeriodDescriptorSources() - { - // Obtain value from other references - var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEvaluationPeriodDescriptor; - - if (valueFromProgramEvaluationReference != null) - { - yield return ("programEvaluationReference.programEvaluationPeriodDescriptor", this.ProgramEvaluationReference.ProgramEvaluationPeriodDescriptor); - } - - // Obtain value from other references - var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEvaluationPeriodDescriptor; - - if (valueFromProgramEvaluationObjectiveReference != null) - { - yield return ("programEvaluationObjectiveReference.programEvaluationPeriodDescriptor", this.ProgramEvaluationObjectiveReference.ProgramEvaluationPeriodDescriptor); - } - - } - var sourcesForProgramEvaluationTitle = GetProgramEvaluationTitleSources().ToArray(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- - if (!sourcesForProgramEvaluationTitle.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int PrimaryLearningDeviceProviderDescriptorId { get; set; } - string values = string.Join("', '", sourcesForProgramEvaluationTitle.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForProgramEvaluationTitle.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + int IDescriptor.DescriptorId + { + get { return PrimaryLearningDeviceProviderDescriptorId; } + set { PrimaryLearningDeviceProviderDescriptorId = value; } + } + // ------------------------------------------------------------- - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEvaluationTitle' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForProgramEvaluationTitle.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetProgramEvaluationTitleSources() - { - // Obtain value from other references - var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEvaluationTitle; - - if (valueFromProgramEvaluationReference != null) - { - yield return ("programEvaluationReference.programEvaluationTitle", this.ProgramEvaluationReference.ProgramEvaluationTitle); - } - - // Obtain value from other references - var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEvaluationTitle; - - if (valueFromProgramEvaluationObjectiveReference != null) - { - yield return ("programEvaluationObjectiveReference.programEvaluationTitle", this.ProgramEvaluationObjectiveReference.ProgramEvaluationTitle); - } - - } - var sourcesForProgramEvaluationTypeDescriptor = GetProgramEvaluationTypeDescriptorSources().ToArray(); + // ============================================================= + // Equality + // ------------------------------------------------------------- - if (!sourcesForProgramEvaluationTypeDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor; - string values = string.Join("', '", sourcesForProgramEvaluationTypeDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForProgramEvaluationTypeDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + if (ReferenceEquals(this, compareTo)) + return true; - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEvaluationTypeDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForProgramEvaluationTypeDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetProgramEvaluationTypeDescriptorSources() - { - // Obtain value from other references - var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEvaluationTypeDescriptor; - - if (valueFromProgramEvaluationReference != null) - { - yield return ("programEvaluationReference.programEvaluationTypeDescriptor", this.ProgramEvaluationReference.ProgramEvaluationTypeDescriptor); - } - - // Obtain value from other references - var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEvaluationTypeDescriptor; - - if (valueFromProgramEvaluationObjectiveReference != null) - { - yield return ("programEvaluationObjectiveReference.programEvaluationTypeDescriptor", this.ProgramEvaluationObjectiveReference.ProgramEvaluationTypeDescriptor); - } - - } - var sourcesForProgramName = GetProgramNameSources().ToArray(); + if (compareTo == null) + return false; - if (!sourcesForProgramName.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - string values = string.Join("', '", sourcesForProgramName.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForProgramName.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + // Derived Property + if (!(this as Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor).PrimaryLearningDeviceProviderDescriptorId.Equals(compareTo.PrimaryLearningDeviceProviderDescriptorId)) + return false; - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programName' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForProgramName.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetProgramNameSources() - { - // Obtain value from other references - var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramName; - - if (valueFromProgramEvaluationReference != null) - { - yield return ("programEvaluationReference.programName", this.ProgramEvaluationReference.ProgramName); - } - - // Obtain value from other references - var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramName; - - if (valueFromProgramEvaluationObjectiveReference != null) - { - yield return ("programEvaluationObjectiveReference.programName", this.ProgramEvaluationObjectiveReference.ProgramName); - } - - } - var sourcesForProgramTypeDescriptor = GetProgramTypeDescriptorSources().ToArray(); - if (!sourcesForProgramTypeDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); + return true; + } - string values = string.Join("', '", sourcesForProgramTypeDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForProgramTypeDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programTypeDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForProgramTypeDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetProgramTypeDescriptorSources() - { - // Obtain value from other references - var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramTypeDescriptor; - - if (valueFromProgramEvaluationReference != null) - { - yield return ("programEvaluationReference.programTypeDescriptor", this.ProgramEvaluationReference.ProgramTypeDescriptor); - } - - // Obtain value from other references - var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramTypeDescriptor; - - if (valueFromProgramEvaluationObjectiveReference != null) - { - yield return ("programEvaluationObjectiveReference.programTypeDescriptor", this.ProgramEvaluationObjectiveReference.ProgramTypeDescriptor); - } - - } + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor).PrimaryLearningDeviceProviderDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.PrimaryLearningDeviceProviderDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.PrimaryLearningDeviceProviderDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor)target, null); } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- } // ================================================================= @@ -127195,14 +125526,9 @@ string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjective // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationElementPutPostRequestValidator : FluentValidation.AbstractValidator + public class PrimaryLearningDeviceProviderDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ProgramEvaluationElement = new FullName("edfi", "ProgramEvaluationElement"); - - // Declare collection item validators - private ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator _programEvaluationElementProgramEvaluationLevelsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -127215,28 +125541,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ProgramEvaluationElementMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_ProgramEvaluationElement); - - if (mappingContract != null) - { - if (mappingContract.IsProgramEvaluationElementProgramEvaluationLevelIncluded != null) - { - var hasInvalidProgramEvaluationElementProgramEvaluationLevelsItems = instance.ProgramEvaluationElementProgramEvaluationLevels.Any(x => !mappingContract.IsProgramEvaluationElementProgramEvaluationLevelIncluded(x)); - - if (hasInvalidProgramEvaluationElementProgramEvaluationLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProgramEvaluationElementProgramEvaluationLevels", $"A supplied 'ProgramEvaluationElementProgramEvaluationLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -127252,17 +125556,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramEvaluationElementProgramEvaluationLevel table of the ProgramEvaluationElement aggregate in the ODS Database. + /// A class which represents the edfi.ProficiencyDescriptor table of the ProficiencyDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationElementProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel, IValidatableObject + public class ProficiencyDescriptor : Entities.Common.EdFi.IProficiencyDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluationElementProgramEvaluationLevel"); + private static FullName _fullName = new FullName("edfi", "ProficiencyDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator _validator = new ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator(); + private static ProficiencyDescriptorPutPostRequestValidator _validator = new ProficiencyDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -127279,6 +125588,13 @@ public class ProgramEvaluationElementProgramEvaluationLevel : Entities.Common.Ed // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ProficiencyDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -127289,33 +125605,19 @@ public class ProgramEvaluationElementProgramEvaluationLevel : Entities.Common.Ed //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IProgramEvaluationElement _programEvaluationElement; - - [IgnoreDataMember] - Entities.Common.EdFi.IProgramEvaluationElement IProgramEvaluationElementProgramEvaluationLevel.ProgramEvaluationElement - { - get { return _programEvaluationElement; } - set { SetProgramEvaluationElement(value); } - } - public Entities.Common.EdFi.IProgramEvaluationElement ProgramEvaluationElement - { - set { SetProgramEvaluationElement(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ProficiencyDescriptorId { get; set; } - private void SetProgramEvaluationElement(Entities.Common.EdFi.IProgramEvaluationElement value) + int IDescriptor.DescriptorId { - _programEvaluationElement = value; + get { return ProficiencyDescriptorId; } + set { ProficiencyDescriptorId = value; } } - - /// - /// The title for a level of rating or evaluation band (e.g., Excellent, Acceptable, Needs Improvement, Unacceptable). - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="ratingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] - public string RatingLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -127330,7 +125632,7 @@ private void SetProgramEvaluationElement(Entities.Common.EdFi.IProgramEvaluation /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel; + var compareTo = obj as Entities.Common.EdFi.IProficiencyDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -127338,13 +125640,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_programEvaluationElement == null || !_programEvaluationElement.Equals(compareTo.ProgramEvaluationElement)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel).RatingLevelDescriptor, compareTo.RatingLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IProficiencyDescriptor).ProficiencyDescriptorId.Equals(compareTo.ProficiencyDescriptorId)) return false; @@ -127360,12 +125658,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_programEvaluationElement != null) - hash.Add(_programEvaluationElement); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel).RatingLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IProficiencyDescriptor).ProficiencyDescriptorId); return hash.ToHashCode(); } @@ -127374,27 +125669,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The maximum numerical rating or score to achieve the evaluation rating level. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxNumericRating")] - public decimal? MaxNumericRating { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The minimum numerical rating or score to achieve the evaluation rating level. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="minNumericRating")] - public decimal? MinNumericRating { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -127415,8 +125743,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationElement", "ProgramEvaluationElementProgramEvaluationLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -127427,6 +125758,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -127439,12 +125777,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationElementProgramEvaluationLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)target); + return Entities.Common.EdFi.ProficiencyDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProficiencyDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationElementProgramEvaluationLevelMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)target, null); + Entities.Common.EdFi.ProficiencyDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProficiencyDescriptor)target, null); } // ------------------------------------------------------------- @@ -127452,66 +125790,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -127519,9 +125797,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProficiencyDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -127550,31 +125828,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ProgramEvaluationObjective resource. + /// Represents a reference to the Program resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationObjectiveReference : IResourceReference + public class ProgramReference : IResourceReference { - [DataMember(Name="programEducationOrganizationId")] - public long ProgramEducationOrganizationId { get; set; } - - [DataMember(Name="programEvaluationObjectiveTitle")] - public string ProgramEvaluationObjectiveTitle { get; set; } - - [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] - public string ProgramEvaluationPeriodDescriptor { get; set; } - - [DataMember(Name="programEvaluationTitle")] - public string ProgramEvaluationTitle { get; set; } - - [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] - public string ProgramEvaluationTypeDescriptor { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } [DataMember(Name="programName")] public string ProgramName { get; set; } @@ -127618,34 +125884,14 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return ProgramEducationOrganizationId != default(long) && ProgramEvaluationObjectiveTitle != default(string) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); + return EducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (ProgramEducationOrganizationId == default) - { - yield return "ProgramEducationOrganizationId"; - } - - if (ProgramEvaluationObjectiveTitle == default) - { - yield return "ProgramEvaluationObjectiveTitle"; - } - - if (ProgramEvaluationPeriodDescriptor == default) - { - yield return "ProgramEvaluationPeriodDescriptor"; - } - - if (ProgramEvaluationTitle == default) - { - yield return "ProgramEvaluationTitle"; - } - - if (ProgramEvaluationTypeDescriptor == default) + if (EducationOrganizationId == default) { - yield return "ProgramEvaluationTypeDescriptor"; + yield return "EducationOrganizationId"; } if (ProgramName == default) @@ -127664,8 +125910,8 @@ private Link CreateLink() { var link = new Link { - Rel = "ProgramEvaluationObjective", - Href = $"/ed-fi/programEvaluationObjectives/{ResourceId:n}" + Rel = "Program", + Href = $"/ed-fi/programs/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -127692,16 +125938,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.ProgramEvaluationObjective table of the ProgramEvaluationObjective aggregate in the ODS Database. + /// A class which represents the edfi.Program table of the Program aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationObjective : Entities.Common.EdFi.IProgramEvaluationObjective, IHasETag, IDateVersionedEntity, IValidatableObject + public class Program : Entities.Common.EdFi.IProgram, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluationObjective"); + private static FullName _fullName = new FullName("edfi", "Program"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationObjectivePutPostRequestValidator _validator = new ProgramEvaluationObjectivePutPostRequestValidator(); + private static ProgramPutPostRequestValidator _validator = new ProgramPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -127712,9 +125958,11 @@ public class ProgramEvaluationObjective : Entities.Common.EdFi.IProgramEvaluatio // Constructor // ------------------------------------------------------------- - public ProgramEvaluationObjective() + public Program() { - ProgramEvaluationObjectiveProgramEvaluationLevels = new List(); + ProgramCharacteristics = new List(); + ProgramLearningStandards = new List(); + ProgramSponsors = new List(); } // ------------------------------------------------------------ @@ -127724,7 +125972,7 @@ public ProgramEvaluationObjective() // ------------------------------------------------------------ /// - /// The unique identifier for the ProgramEvaluationObjective resource. + /// The unique identifier for the Program resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -127735,37 +125983,37 @@ public ProgramEvaluationObjective() // References // ------------------------------------------------------------- - private bool _programEvaluationReferenceExplicitlyAssigned; - private ProgramEvaluation.EdFi.ProgramEvaluationReference _programEvaluationReference; - private ProgramEvaluation.EdFi.ProgramEvaluationReference ImplicitProgramEvaluationReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programEvaluationReference == null && !_programEvaluationReferenceExplicitlyAssigned) - _programEvaluationReference = new ProgramEvaluation.EdFi.ProgramEvaluationReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _programEvaluationReference; + return _educationOrganizationReference; } } - [DataMember(Name="programEvaluationReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public ProgramEvaluation.EdFi.ProgramEvaluationReference ProgramEvaluationReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramEvaluationReference != null - && (_programEvaluationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _programEvaluationReferenceExplicitlyAssigned = true; - _programEvaluationReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } // ------------------------------------------------------------- @@ -127778,13 +126026,13 @@ public ProgramEvaluation.EdFi.ProgramEvaluationReference ProgramEvaluationRefere /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEducationOrganizationId + long Entities.Common.EdFi.IProgram.EducationOrganizationId { get { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEducationOrganizationId; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -127793,133 +126041,29 @@ long Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEducationOrganizati // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ProgramEvaluation - _programEvaluationReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationReference.ProgramEducationOrganizationId = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } /// - /// The name or title of the program evaluation objective. + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programEvaluationObjectiveTitle")] - public string ProgramEvaluationObjectiveTitle { get; set; } - - /// - /// The name of the period for the program evaluation. - /// - - // IS in a reference (ProgramEvaluationObjective.ProgramEvaluationPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationPeriodDescriptor - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor; - - return null; - } - set - { - ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor = value; - } - } - - /// - /// An assigned unique identifier for the student program evaluation. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationTitle - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEvaluationTitle; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProgramEvaluation - _programEvaluationReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationReference.ProgramEvaluationTitle = value; - } - } - - /// - /// The type of program evaluation conducted. - /// - - // IS in a reference (ProgramEvaluationObjective.ProgramEvaluationTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationTypeDescriptor - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor; - - return null; - } - set - { - ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor = value; - } - } - - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramName - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ProgramEvaluation - _programEvaluationReferenceExplicitlyAssigned = false; - ImplicitProgramEvaluationReference.ProgramName = value; - } - } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programName")] + public string ProgramName { get; set; } /// /// The type of program. /// - - // IS in a reference (ProgramEvaluationObjective.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramTypeDescriptor - { - get - { - if (ImplicitProgramEvaluationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) - return ImplicitProgramEvaluationReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramEvaluationReference.ProgramTypeDescriptor = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -127934,7 +126078,7 @@ string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramTypeDescriptor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationObjective; + var compareTo = obj as Entities.Common.EdFi.IProgram; if (ReferenceEquals(this, compareTo)) return true; @@ -127944,37 +126088,17 @@ public override bool Equals(object obj) // Referenced Property - if (!(this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + if (!(this as Entities.Common.EdFi.IProgram).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationObjectiveTitle, compareTo.ProgramEvaluationObjectiveTitle)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramName, compareTo.ProgramName)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgram).ProgramName, compareTo.ProgramName)) return false; - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -127992,28 +126116,14 @@ public override int GetHashCode() var hash = new HashCode(); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IProgram).EducationOrganizationId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationObjectiveTitle); - - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationPeriodDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTitle); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTypeDescriptor); - + hash.Add((this as Entities.Common.EdFi.IProgram).ProgramName); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramName); - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramTypeDescriptor); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgram).ProgramTypeDescriptor); return hash.ToHashCode(); } @@ -128029,35 +126139,12 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The maximum summary numerical rating or score for the program evaluation objective. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="objectiveMaxNumericRating")] - public decimal? ObjectiveMaxNumericRating { get; set; } - - /// - /// The minimum summary numerical rating or score for the program evaluation objective. If omitted, assumed to be 0.0 - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="objectiveMinNumericRating")] - public decimal? ObjectiveMinNumericRating { get; set; } - - /// - /// The sort order of this program evaluation objective. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="objectiveSortOrder")] - public int? ObjectiveSortOrder { get; set; } - - /// - /// The long description of the program evaluation objective. + /// A unique number or alphanumeric code assigned to a program by a school, school system, a state, or other agency or entity. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="programEvaluationObjectiveDescription")] - public string ProgramEvaluationObjectiveDescription { get; set; } + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="programId")] + public string ProgramId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -128078,41 +126165,101 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationObjective", "ProgramEvaluationObjective")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "Program")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _programEvaluationObjectiveProgramEvaluationLevels; - private ICollection _programEvaluationObjectiveProgramEvaluationLevelsCovariant; + private ICollection _programCharacteristics; + private ICollection _programCharacteristicsCovariant; [NoDuplicateMembers] - [DataMember(Name="programEvaluationLevels")] - public ICollection ProgramEvaluationObjectiveProgramEvaluationLevels + [DataMember(Name="characteristics")] + public ICollection ProgramCharacteristics { - get { return _programEvaluationObjectiveProgramEvaluationLevels; } + get { return _programCharacteristics; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)e.Item).ProgramEvaluationObjective = this); - _programEvaluationObjectiveProgramEvaluationLevels = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProgramCharacteristic)e.Item).Program = this); + _programCharacteristics = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)e.Item).ProgramEvaluationObjective = this; - _programEvaluationObjectiveProgramEvaluationLevelsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramCharacteristic)e.Item).Program = this; + _programCharacteristicsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationObjectiveProgramEvaluationLevels + ICollection Entities.Common.EdFi.IProgram.ProgramCharacteristics { - get { return _programEvaluationObjectiveProgramEvaluationLevelsCovariant; } - set { ProgramEvaluationObjectiveProgramEvaluationLevels = new List(value.Cast()); } + get { return _programCharacteristicsCovariant; } + set { ProgramCharacteristics = new List(value.Cast()); } + } + + private ICollection _programLearningStandards; + private ICollection _programLearningStandardsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="learningStandards")] + public ICollection ProgramLearningStandards + { + get { return _programLearningStandards; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProgramLearningStandard)e.Item).Program = this); + _programLearningStandards = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramLearningStandard)e.Item).Program = this; + _programLearningStandardsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgram.ProgramLearningStandards + { + get { return _programLearningStandardsCovariant; } + set { ProgramLearningStandards = new List(value.Cast()); } + } + + private ICollection _programSponsors; + private ICollection _programSponsorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="sponsors")] + public ICollection ProgramSponsors + { + get { return _programSponsors; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProgramSponsor)e.Item).Program = this); + _programSponsors = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramSponsor)e.Item).Program = this; + _programSponsorsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgram.ProgramSponsors + { + get { return _programSponsorsCovariant; } + set { ProgramSponsors = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -128137,9 +126284,19 @@ public ICollection ProgramEval internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_programEvaluationObjectiveProgramEvaluationLevels != null) foreach (var item in _programEvaluationObjectiveProgramEvaluationLevels) + if (_programCharacteristics != null) foreach (var item in _programCharacteristics) { - item.ProgramEvaluationObjective = this; + item.Program = this; + } + + if (_programLearningStandards != null) foreach (var item in _programLearningStandards) + { + item.Program = this; + } + + if (_programSponsors != null) foreach (var item in _programSponsors) + { + item.Program = this; } } @@ -128150,29 +126307,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationObjective)target); + return Entities.Common.EdFi.ProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgram)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationObjectiveMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationObjective)target, null); + Entities.Common.EdFi.ProgramMapper.MapTo(this, (Entities.Common.EdFi.IProgram)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationResourceId + Guid? Entities.Common.EdFi.IProgram.EducationOrganizationResourceId { get { return null; } - set { ImplicitProgramEvaluationReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscriminator + string Entities.Common.EdFi.IProgram.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitProgramEvaluationReference.Discriminator = value; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } } @@ -128198,13 +126355,37 @@ string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscrim // ---------------------- // Validate collections // ---------------------- - if (ProgramEvaluationObjectiveProgramEvaluationLevels.Any() && mappingContract?.IsMemberSupported("ProgramEvaluationObjectiveProgramEvaluationLevels") != false) + if (ProgramCharacteristics.Any() && mappingContract?.IsMemberSupported("ProgramCharacteristics") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("ProgramEvaluationObjectiveProgramEvaluationLevels"); + pathBuilder.Append("ProgramCharacteristics"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramEvaluationObjectiveProgramEvaluationLevels, validationContext, validationContext.Items.ForCollection("ProgramEvaluationObjectiveProgramEvaluationLevels")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramCharacteristics, validationContext, validationContext.Items.ForCollection("ProgramCharacteristics")))) + { + yield return result; + } + } + + if (ProgramLearningStandards.Any() && mappingContract?.IsMemberSupported("ProgramLearningStandards") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ProgramLearningStandards"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramLearningStandards, validationContext, validationContext.Items.ForCollection("ProgramLearningStandards")))) + { + yield return result; + } + } + + if (ProgramSponsors.Any() && mappingContract?.IsMemberSupported("ProgramSponsors") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ProgramSponsors"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramSponsors, validationContext, validationContext.Items.ForCollection("ProgramSponsors")))) { yield return result; } @@ -128255,14 +126436,16 @@ string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscrim // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationObjectivePutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ProgramEvaluationObjective = new FullName("edfi", "ProgramEvaluationObjective"); + private static readonly FullName _fullName_edfi_Program = new FullName("edfi", "Program"); // Declare collection item validators - private ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator _programEvaluationObjectiveProgramEvaluationLevelsValidator = new (); + private ProgramCharacteristicPutPostRequestValidator _programCharacteristicsValidator = new (); + private ProgramLearningStandardPutPostRequestValidator _programLearningStandardsValidator = new (); + private ProgramSponsorPutPostRequestValidator _programSponsorsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -128279,19 +126462,41 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsProgramEvaluationObjectiveProgramEvaluationLevelIncluded(x)); + var hasInvalidProgramCharacteristicsItems = instance.ProgramCharacteristics.Any(x => !mappingContract.IsProgramCharacteristicIncluded(x)); - if (hasInvalidProgramEvaluationObjectiveProgramEvaluationLevelsItems) + if (hasInvalidProgramCharacteristicsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProgramEvaluationObjectiveProgramEvaluationLevels", $"A supplied 'ProgramEvaluationObjectiveProgramEvaluationLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ProgramCharacteristics", $"A supplied 'ProgramCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsProgramLearningStandardIncluded != null) + { + var hasInvalidProgramLearningStandardsItems = instance.ProgramLearningStandards.Any(x => !mappingContract.IsProgramLearningStandardIncluded(x)); + + if (hasInvalidProgramLearningStandardsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ProgramLearningStandards", $"A supplied 'ProgramLearningStandard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsProgramSponsorIncluded != null) + { + var hasInvalidProgramSponsorsItems = instance.ProgramSponsors.Any(x => !mappingContract.IsProgramSponsorIncluded(x)); + + if (hasInvalidProgramSponsorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ProgramSponsors", $"A supplied 'ProgramSponsor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -128313,16 +126518,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramEvaluationObjectiveProgramEvaluationLevel table of the ProgramEvaluationObjective aggregate in the ODS Database. + /// A class which represents the edfi.ProgramCharacteristic table of the Program aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationObjectiveProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel, IValidatableObject + public class ProgramCharacteristic : Entities.Common.EdFi.IProgramCharacteristic, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluationObjectiveProgramEvaluationLevel"); + private static FullName _fullName = new FullName("edfi", "ProgramCharacteristic"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator _validator = new ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator(); + private static ProgramCharacteristicPutPostRequestValidator _validator = new ProgramCharacteristicPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -128349,33 +126554,33 @@ public class ProgramEvaluationObjectiveProgramEvaluationLevel : Entities.Common. //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IProgramEvaluationObjective _programEvaluationObjective; + private Entities.Common.EdFi.IProgram _program; [IgnoreDataMember] - Entities.Common.EdFi.IProgramEvaluationObjective IProgramEvaluationObjectiveProgramEvaluationLevel.ProgramEvaluationObjective + Entities.Common.EdFi.IProgram IProgramCharacteristic.Program { - get { return _programEvaluationObjective; } - set { SetProgramEvaluationObjective(value); } + get { return _program; } + set { SetProgram(value); } } - public Entities.Common.EdFi.IProgramEvaluationObjective ProgramEvaluationObjective + public Entities.Common.EdFi.IProgram Program { - set { SetProgramEvaluationObjective(value); } + set { SetProgram(value); } } - private void SetProgramEvaluationObjective(Entities.Common.EdFi.IProgramEvaluationObjective value) + private void SetProgram(Entities.Common.EdFi.IProgram value) { - _programEvaluationObjective = value; + _program = value; } /// - /// The title for a level of rating or evaluation band (e.g., Excellent, Acceptable, Needs Improvement, Unacceptable). + /// Reflects important characteristics of the program, such as categories or particular indications. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="ratingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] - public string RatingLevelDescriptor { get; set; } + [DataMember(Name="programCharacteristicDescriptor")][DescriptorExists("ProgramCharacteristicDescriptor")] + public string ProgramCharacteristicDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -128390,7 +126595,7 @@ private void SetProgramEvaluationObjective(Entities.Common.EdFi.IProgramEvaluati /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel; + var compareTo = obj as Entities.Common.EdFi.IProgramCharacteristic; if (ReferenceEquals(this, compareTo)) return true; @@ -128399,12 +126604,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_programEvaluationObjective == null || !_programEvaluationObjective.Equals(compareTo.ProgramEvaluationObjective)) + if (_program == null || !_program.Equals(compareTo.Program)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel).RatingLevelDescriptor, compareTo.RatingLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramCharacteristic).ProgramCharacteristicDescriptor, compareTo.ProgramCharacteristicDescriptor)) return false; @@ -128421,11 +126626,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_programEvaluationObjective != null) - hash.Add(_programEvaluationObjective); + if (_program != null) + hash.Add(_program); // Standard Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel).RatingLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IProgramCharacteristic).ProgramCharacteristicDescriptor); return hash.ToHashCode(); } @@ -128439,22 +126644,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The maximum numerical rating or score to achieve the evaluation rating level. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxNumericRating")] - public decimal? MaxNumericRating { get; set; } - - /// - /// The minimum numerical rating or score to achieve the evaluation rating level. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="minNumericRating")] - public decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -128475,7 +126664,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationObjective", "ProgramEvaluationObjectiveProgramEvaluationLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "ProgramCharacteristic")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -128499,12 +126688,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationObjectiveProgramEvaluationLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)target); + return Entities.Common.EdFi.ProgramCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramCharacteristic)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationObjectiveProgramEvaluationLevelMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)target, null); + Entities.Common.EdFi.ProgramCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.IProgramCharacteristic)target, null); } // ------------------------------------------------------------- @@ -128579,9 +126768,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -128609,22 +126798,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramEvaluationPeriodDescriptor table of the ProgramEvaluationPeriodDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramLearningStandard table of the Program aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationPeriodDescriptor : Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramLearningStandard : Entities.Common.EdFi.IProgramLearningStandard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluationPeriodDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramLearningStandard"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationPeriodDescriptorPutPostRequestValidator _validator = new ProgramEvaluationPeriodDescriptorPutPostRequestValidator(); + private static ProgramLearningStandardPutPostRequestValidator _validator = new ProgramLearningStandardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -128641,35 +126825,92 @@ public class ProgramEvaluationPeriodDescriptor : Entities.Common.EdFi.IProgramEv // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ProgramEvaluationPeriodDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _learningStandardReferenceExplicitlyAssigned; + private LearningStandard.EdFi.LearningStandardReference _learningStandardReference; + private LearningStandard.EdFi.LearningStandardReference ImplicitLearningStandardReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_learningStandardReference == null && !_learningStandardReferenceExplicitlyAssigned) + _learningStandardReference = new LearningStandard.EdFi.LearningStandardReference(); + + return _learningStandardReference; + } + } + + [DataMember(Name="learningStandardReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public LearningStandard.EdFi.LearningStandardReference LearningStandardReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLearningStandardReference != null + && (_learningStandardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference; + + return null; + } + set + { + _learningStandardReferenceExplicitlyAssigned = true; + _learningStandardReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IProgram _program; + + [IgnoreDataMember] + Entities.Common.EdFi.IProgram IProgramLearningStandard.Program + { + get { return _program; } + set { SetProgram(value); } + } + + public Entities.Common.EdFi.IProgram Program + { + set { SetProgram(value); } + } + + private void SetProgram(Entities.Common.EdFi.IProgram value) + { + _program = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier for the specific learning standard (e.g., 111.15.3.1.A). /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProgramEvaluationPeriodDescriptorId { get; set; } - - int IDescriptor.DescriptorId + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardId { - get { return ProgramEvaluationPeriodDescriptorId; } - set { ProgramEvaluationPeriodDescriptorId = value; } + get + { + if (ImplicitLearningStandardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLearningStandardReference.IsReferenceFullyDefined())) + return ImplicitLearningStandardReference.LearningStandardId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LearningStandard + _learningStandardReferenceExplicitlyAssigned = false; + ImplicitLearningStandardReference.LearningStandardId = value; + } } // ------------------------------------------------------------- @@ -128685,7 +126926,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramLearningStandard; if (ReferenceEquals(this, compareTo)) return true; @@ -128693,9 +126934,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_program == null || !_program.Equals(compareTo.Program)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor).ProgramEvaluationPeriodDescriptorId.Equals(compareTo.ProgramEvaluationPeriodDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramLearningStandard).LearningStandardId, compareTo.LearningStandardId)) return false; @@ -128711,10 +126956,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_program != null) + hash.Add(_program); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor).ProgramEvaluationPeriodDescriptorId); - + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramLearningStandard).LearningStandardId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -128722,55 +126969,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -128796,11 +126994,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "ProgramLearningStandard")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -128811,13 +127006,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -128830,19 +127018,93 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationPeriodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor)target); + return Entities.Common.EdFi.ProgramLearningStandardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramLearningStandard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationPeriodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor)target, null); + Entities.Common.EdFi.ProgramLearningStandardMapper.MapTo(this, (Entities.Common.EdFi.IProgramLearningStandard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IProgramLearningStandard.LearningStandardResourceId + { + get { return null; } + set { ImplicitLearningStandardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IProgramLearningStandard.LearningStandardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLearningStandardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -128850,9 +127112,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationPeriodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramLearningStandardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -128880,22 +127142,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramEvaluationTypeDescriptor table of the ProgramEvaluationTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramSponsor table of the Program aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramEvaluationTypeDescriptor : Entities.Common.EdFi.IProgramEvaluationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramSponsor : Entities.Common.EdFi.IProgramSponsor, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgramEvaluationTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramSponsor"); // Fluent validator instance (threadsafe) - private static ProgramEvaluationTypeDescriptorPutPostRequestValidator _validator = new ProgramEvaluationTypeDescriptorPutPostRequestValidator(); + private static ProgramSponsorPutPostRequestValidator _validator = new ProgramSponsorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -128912,13 +127169,6 @@ public class ProgramEvaluationTypeDescriptor : Entities.Common.EdFi.IProgramEval // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ProgramEvaluationTypeDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -128929,19 +127179,33 @@ public class ProgramEvaluationTypeDescriptor : Entities.Common.EdFi.IProgramEval //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IProgram _program; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProgramEvaluationTypeDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IProgram IProgramSponsor.Program + { + get { return _program; } + set { SetProgram(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IProgram Program { - get { return ProgramEvaluationTypeDescriptorId; } - set { ProgramEvaluationTypeDescriptorId = value; } + set { SetProgram(value); } } + + private void SetProgram(Entities.Common.EdFi.IProgram value) + { + _program = value; + } + + /// + /// Ultimate and intermediate providers of funds for a particular educational or service program or activity, or for an individual's participation in the program or activity (e.g., Federal, State, ESC, District, School, Private Organization). + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programSponsorDescriptor")][DescriptorExists("ProgramSponsorDescriptor")] + public string ProgramSponsorDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -128956,7 +127220,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramSponsor; if (ReferenceEquals(this, compareTo)) return true; @@ -128964,9 +127228,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_program == null || !_program.Equals(compareTo.Program)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IProgramEvaluationTypeDescriptor).ProgramEvaluationTypeDescriptorId.Equals(compareTo.ProgramEvaluationTypeDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramSponsor).ProgramSponsorDescriptor, compareTo.ProgramSponsorDescriptor)) return false; @@ -128982,9 +127250,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_program != null) + hash.Add(_program); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgramEvaluationTypeDescriptor).ProgramEvaluationTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramSponsor).ProgramSponsorDescriptor); return hash.ToHashCode(); } @@ -128993,55 +127264,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -129067,11 +127289,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Program", "ProgramSponsor")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -129082,13 +127301,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -129101,12 +127313,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramEvaluationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationTypeDescriptor)target); + return Entities.Common.EdFi.ProgramSponsorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramSponsor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramEvaluationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationTypeDescriptor)target, null); + Entities.Common.EdFi.ProgramSponsorMapper.MapTo(this, (Entities.Common.EdFi.IProgramSponsor)target, null); } // ------------------------------------------------------------- @@ -129114,6 +127326,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -129121,9 +127393,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramEvaluationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramSponsorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -129152,21 +127424,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramSponsorDescriptor table of the ProgramSponsorDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramAssignmentDescriptor table of the ProgramAssignmentDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramSponsorDescriptor : Entities.Common.EdFi.IProgramSponsorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramAssignmentDescriptor : Entities.Common.EdFi.IProgramAssignmentDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramSponsorDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramAssignmentDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramSponsorDescriptorPutPostRequestValidator _validator = new ProgramSponsorDescriptorPutPostRequestValidator(); + private static ProgramAssignmentDescriptorPutPostRequestValidator _validator = new ProgramAssignmentDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -129185,7 +127457,7 @@ public class ProgramSponsorDescriptor : Entities.Common.EdFi.IProgramSponsorDesc // ------------------------------------------------------------ /// - /// The unique identifier for the ProgramSponsorDescriptor resource. + /// The unique identifier for the ProgramAssignmentDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -129206,12 +127478,12 @@ public class ProgramSponsorDescriptor : Entities.Common.EdFi.IProgramSponsorDesc /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ProgramSponsorDescriptorId { get; set; } + public int ProgramAssignmentDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ProgramSponsorDescriptorId; } - set { ProgramSponsorDescriptorId = value; } + get { return ProgramAssignmentDescriptorId; } + set { ProgramAssignmentDescriptorId = value; } } // ------------------------------------------------------------- @@ -129227,7 +127499,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramSponsorDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramAssignmentDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -129237,7 +127509,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IProgramSponsorDescriptor).ProgramSponsorDescriptorId.Equals(compareTo.ProgramSponsorDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgramAssignmentDescriptor).ProgramAssignmentDescriptorId.Equals(compareTo.ProgramAssignmentDescriptorId)) return false; @@ -129255,7 +127527,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgramSponsorDescriptor).ProgramSponsorDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgramAssignmentDescriptor).ProgramAssignmentDescriptorId); return hash.ToHashCode(); } @@ -129372,12 +127644,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramSponsorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramSponsorDescriptor)target); + return Entities.Common.EdFi.ProgramAssignmentDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramAssignmentDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramSponsorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramSponsorDescriptor)target, null); + Entities.Common.EdFi.ProgramAssignmentDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramAssignmentDescriptor)target, null); } // ------------------------------------------------------------- @@ -129392,9 +127664,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramSponsorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramAssignmentDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -129423,21 +127695,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgramTypeDescriptor table of the ProgramTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramCharacteristicDescriptor table of the ProgramCharacteristicDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgramTypeDescriptor : Entities.Common.EdFi.IProgramTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramCharacteristicDescriptor : Entities.Common.EdFi.IProgramCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ProgramTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramCharacteristicDescriptor"); // Fluent validator instance (threadsafe) - private static ProgramTypeDescriptorPutPostRequestValidator _validator = new ProgramTypeDescriptorPutPostRequestValidator(); + private static ProgramCharacteristicDescriptorPutPostRequestValidator _validator = new ProgramCharacteristicDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -129456,7 +127728,7 @@ public class ProgramTypeDescriptor : Entities.Common.EdFi.IProgramTypeDescriptor // ------------------------------------------------------------ /// - /// The unique identifier for the ProgramTypeDescriptor resource. + /// The unique identifier for the ProgramCharacteristicDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -129477,12 +127749,12 @@ public class ProgramTypeDescriptor : Entities.Common.EdFi.IProgramTypeDescriptor /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ProgramTypeDescriptorId { get; set; } + public int ProgramCharacteristicDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ProgramTypeDescriptorId; } - set { ProgramTypeDescriptorId = value; } + get { return ProgramCharacteristicDescriptorId; } + set { ProgramCharacteristicDescriptorId = value; } } // ------------------------------------------------------------- @@ -129498,7 +127770,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgramTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramCharacteristicDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -129508,7 +127780,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IProgramTypeDescriptor).ProgramTypeDescriptorId.Equals(compareTo.ProgramTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgramCharacteristicDescriptor).ProgramCharacteristicDescriptorId.Equals(compareTo.ProgramCharacteristicDescriptorId)) return false; @@ -129526,7 +127798,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgramTypeDescriptor).ProgramTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgramCharacteristicDescriptor).ProgramCharacteristicDescriptorId); return hash.ToHashCode(); } @@ -129643,12 +127915,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgramTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramTypeDescriptor)target); + return Entities.Common.EdFi.ProgramCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramCharacteristicDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgramTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramTypeDescriptor)target, null); + Entities.Common.EdFi.ProgramCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramCharacteristicDescriptor)target, null); } // ------------------------------------------------------------- @@ -129663,9 +127935,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgramTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -129694,21 +127966,119 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgressDescriptor table of the ProgressDescriptor aggregate in the ODS Database. + /// Represents a reference to the ProgramDimension resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class ProgramDimensionReference : IResourceReference + { + [DataMember(Name="code")] + public string Code { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return Code != default(string) && FiscalYear != default(int); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (Code == default) + { + yield return "Code"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "ProgramDimension", + Href = $"/ed-fi/programDimensions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.ProgramDimension table of the ProgramDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgressDescriptor : Entities.Common.EdFi.IProgressDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class ProgramDimension : Entities.Common.EdFi.IProgramDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgressDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramDimension"); // Fluent validator instance (threadsafe) - private static ProgressDescriptorPutPostRequestValidator _validator = new ProgressDescriptorPutPostRequestValidator(); + private static ProgramDimensionPutPostRequestValidator _validator = new ProgramDimensionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -129719,6 +128089,10 @@ public class ProgressDescriptor : Entities.Common.EdFi.IProgressDescriptor, Enti // Constructor // ------------------------------------------------------------- + public ProgramDimension() + { + ProgramDimensionReportingTags = new List(); + } // ------------------------------------------------------------ @@ -129727,7 +128101,7 @@ public class ProgressDescriptor : Entities.Common.EdFi.IProgressDescriptor, Enti // ------------------------------------------------------------ /// - /// The unique identifier for the ProgressDescriptor resource. + /// The unique identifier for the ProgramDimension resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -129744,17 +128118,33 @@ public class ProgressDescriptor : Entities.Common.EdFi.IProgressDescriptor, Enti // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The code representation of the account program dimension. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProgressDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="code")] + public string Code { get; set; } + + private bool _fiscalYearExplicitlyAssigned = false; + private int _fiscalYear; - int IDescriptor.DescriptorId - { - get { return ProgressDescriptorId; } - set { ProgressDescriptorId = value; } + /// + /// The fiscal year for which the account program dimension is valid. + /// + // NOT in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get => _fiscalYear; + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; + } } + // ------------------------------------------------------------- // ============================================================= @@ -129769,7 +128159,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgressDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -129778,8 +128168,13 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IProgressDescriptor).ProgressDescriptorId.Equals(compareTo.ProgressDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramDimension).Code, compareTo.Code)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IProgramDimension).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -129796,8 +128191,12 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgressDescriptor).ProgressDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramDimension).Code); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramDimension).FiscalYear); return hash.ToHashCode(); } @@ -129806,61 +128205,28 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A shortened description for the descriptor. + /// A description of the account program dimension. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeName")] + public string CodeName { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_fiscalYearExplicitlyAssigned) + { + yield return "FiscalYear"; + } + } // ============================================================= // One-to-one relationships @@ -129880,16 +128246,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramDimension", "ProgramDimension")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _programDimensionReportingTags; + private ICollection _programDimensionReportingTagsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportingTags")] + public ICollection ProgramDimensionReportingTags + { + get { return _programDimensionReportingTags; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProgramDimensionReportingTag)e.Item).ProgramDimension = this); + _programDimensionReportingTags = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramDimensionReportingTag)e.Item).ProgramDimension = this; + _programDimensionReportingTagsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgramDimension.ProgramDimensionReportingTags + { + get { return _programDimensionReportingTagsCovariant; } + set { ProgramDimensionReportingTags = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -129907,6 +128300,17 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_programDimensionReportingTags != null) foreach (var item in _programDimensionReportingTags) + { + item.ProgramDimension = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -129914,12 +128318,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgressDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgressDescriptor)target); + return Entities.Common.EdFi.ProgramDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgressDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgressDescriptor)target, null); + Entities.Common.EdFi.ProgramDimensionMapper.MapTo(this, (Entities.Common.EdFi.IProgramDimension)target, null); } // ------------------------------------------------------------- @@ -129927,6 +128331,77 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ProgramDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("ProgramDimensionReportingTags") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ProgramDimensionReportingTags"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramDimensionReportingTags, validationContext, validationContext.Items.ForCollection("ProgramDimensionReportingTags")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -129934,9 +128409,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgressDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ProgramDimension = new FullName("edfi", "ProgramDimension"); + + // Declare collection item validators + private ProgramDimensionReportingTagPutPostRequestValidator _programDimensionReportingTagsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -129949,6 +128429,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ProgramDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ProgramDimension); + + if (mappingContract != null) + { + if (mappingContract.IsProgramDimensionReportingTagIncluded != null) + { + var hasInvalidProgramDimensionReportingTagsItems = instance.ProgramDimensionReportingTags.Any(x => !mappingContract.IsProgramDimensionReportingTagIncluded(x)); + + if (hasInvalidProgramDimensionReportingTagsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ProgramDimensionReportingTags", $"A supplied 'ProgramDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -129964,22 +128466,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProgressLevelDescriptor table of the ProgressLevelDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramDimensionReportingTag table of the ProgramDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProgressLevelDescriptor : Entities.Common.EdFi.IProgressLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramDimensionReportingTag : Entities.Common.EdFi.IProgramDimensionReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProgressLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramDimensionReportingTag"); // Fluent validator instance (threadsafe) - private static ProgressLevelDescriptorPutPostRequestValidator _validator = new ProgressLevelDescriptorPutPostRequestValidator(); + private static ProgramDimensionReportingTagPutPostRequestValidator _validator = new ProgramDimensionReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -129996,13 +128493,6 @@ public class ProgressLevelDescriptor : Entities.Common.EdFi.IProgressLevelDescri // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ProgressLevelDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -130013,19 +128503,33 @@ public class ProgressLevelDescriptor : Entities.Common.EdFi.IProgressLevelDescri //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IProgramDimension _programDimension; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProgressLevelDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IProgramDimension IProgramDimensionReportingTag.ProgramDimension + { + get { return _programDimension; } + set { SetProgramDimension(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IProgramDimension ProgramDimension { - get { return ProgressLevelDescriptorId; } - set { ProgressLevelDescriptorId = value; } + set { SetProgramDimension(value); } + } + + private void SetProgramDimension(Entities.Common.EdFi.IProgramDimension value) + { + _programDimension = value; } + + /// + /// Optional tag for accountability reporting. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -130040,7 +128544,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProgressLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramDimensionReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -130048,9 +128552,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_programDimension == null || !_programDimension.Equals(compareTo.ProgramDimension)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IProgressLevelDescriptor).ProgressLevelDescriptorId.Equals(compareTo.ProgressLevelDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -130066,9 +128574,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_programDimension != null) + hash.Add(_programDimension); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IProgressLevelDescriptor).ProgressLevelDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramDimensionReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -130077,55 +128588,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -130151,11 +128613,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramDimension", "ProgramDimensionReportingTag")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -130166,13 +128625,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -130185,12 +128637,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProgressLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgressLevelDescriptor)target); + return Entities.Common.EdFi.ProgramDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramDimensionReportingTag)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProgressLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgressLevelDescriptor)target, null); + Entities.Common.EdFi.ProgramDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IProgramDimensionReportingTag)target, null); } // ------------------------------------------------------------- @@ -130198,6 +128650,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -130205,9 +128717,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProgressLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -130236,22 +128748,34 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ProjectDimension resource. + /// Represents a reference to the ProgramEvaluation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class ProjectDimensionReference : IResourceReference + public class ProgramEvaluationReference : IResourceReference { - [DataMember(Name="code")] - public string Code { get; set; } + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] + public string ProgramEvaluationPeriodDescriptor { get; set; } + + [DataMember(Name="programEvaluationTitle")] + public string ProgramEvaluationTitle { get; set; } + + [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] + public string ProgramEvaluationTypeDescriptor { get; set; } + + [DataMember(Name="programName")] + public string ProgramName { get; set; } + + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. @@ -130289,19 +128813,39 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return Code != default(string) && FiscalYear != default(int); + return ProgramEducationOrganizationId != default(long) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (Code == default) + if (ProgramEducationOrganizationId == default) { - yield return "Code"; + yield return "ProgramEducationOrganizationId"; } - if (FiscalYear == default) + if (ProgramEvaluationPeriodDescriptor == default) { - yield return "FiscalYear"; + yield return "ProgramEvaluationPeriodDescriptor"; + } + + if (ProgramEvaluationTitle == default) + { + yield return "ProgramEvaluationTitle"; + } + + if (ProgramEvaluationTypeDescriptor == default) + { + yield return "ProgramEvaluationTypeDescriptor"; + } + + if (ProgramName == default) + { + yield return "ProgramName"; + } + + if (ProgramTypeDescriptor == default) + { + yield return "ProgramTypeDescriptor"; } } @@ -130310,8 +128854,8 @@ private Link CreateLink() { var link = new Link { - Rel = "ProjectDimension", - Href = $"/ed-fi/projectDimensions/{ResourceId:n}" + Rel = "ProgramEvaluation", + Href = $"/ed-fi/programEvaluations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -130338,17 +128882,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.ProjectDimension table of the ProjectDimension aggregate in the ODS Database. + /// A class which represents the edfi.ProgramEvaluation table of the ProgramEvaluation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class ProjectDimension : Entities.Common.EdFi.IProjectDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class ProgramEvaluation : Entities.Common.EdFi.IProgramEvaluation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProjectDimension"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluation"); // Fluent validator instance (threadsafe) - private static ProjectDimensionPutPostRequestValidator _validator = new ProjectDimensionPutPostRequestValidator(); + private static ProgramEvaluationPutPostRequestValidator _validator = new ProgramEvaluationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -130359,9 +128902,9 @@ public class ProjectDimension : Entities.Common.EdFi.IProjectDimension, IHasETag // Constructor // ------------------------------------------------------------- - public ProjectDimension() + public ProgramEvaluation() { - ProjectDimensionReportingTags = new List(); + ProgramEvaluationLevels = new List(); } // ------------------------------------------------------------ @@ -130371,7 +128914,7 @@ public ProjectDimension() // ------------------------------------------------------------ /// - /// The unique identifier for the ProjectDimension resource. + /// The unique identifier for the ProgramEvaluation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -130381,6 +128924,40 @@ public ProjectDimension() // ============================================================= // References // ------------------------------------------------------------- + + private bool _programReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _programReference; + private Program.EdFi.ProgramReference ImplicitProgramReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programReference == null && !_programReferenceExplicitlyAssigned) + _programReference = new Program.EdFi.ProgramReference(); + + return _programReference; + } + } + + [DataMember(Name="programReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Program.EdFi.ProgramReference ProgramReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramReference != null + && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference; + + return null; + } + set + { + _programReferenceExplicitlyAssigned = true; + _programReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -130388,33 +128965,102 @@ public ProjectDimension() // ------------------------------------------------------------- /// - /// The code representation of the account project dimension. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IProgramEvaluation.ProgramEducationOrganizationId + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.EducationOrganizationId = value; + } + } + + /// + /// The name of the period for the program evaluation. + /// + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="code")] - public string Code { get; set; } - - private bool _fiscalYearExplicitlyAssigned = false; - private int _fiscalYear; + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] + public string ProgramEvaluationPeriodDescriptor { get; set; } /// - /// The fiscal year for which the account project dimension is valid. + /// An assigned unique identifier for the student program evaluation. /// // NOT in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get => _fiscalYear; - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programEvaluationTitle")] + public string ProgramEvaluationTitle { get; set; } + + /// + /// The type of program evaluation conducted. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] + public string ProgramEvaluationTypeDescriptor { get; set; } + + /// + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IProgramEvaluation.ProgramName + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.ProgramName = value; } } + /// + /// The type of program. + /// + + // IS in a reference (ProgramEvaluation.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IProgramEvaluation.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramReference.ProgramTypeDescriptor = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -130429,7 +129075,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProjectDimension; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluation; if (ReferenceEquals(this, compareTo)) return true; @@ -130438,13 +129084,33 @@ public override bool Equals(object obj) return false; + // Referenced Property + if (!(this as Entities.Common.EdFi.IProgramEvaluation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + return false; + + // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProjectDimension).Code, compareTo.Code)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.IProjectDimension).FiscalYear.Equals(compareTo.FiscalYear)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -130461,12 +129127,26 @@ public override int GetHashCode() { var hash = new HashCode(); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEducationOrganizationId); + // Standard Property - hash.Add((this as Entities.Common.EdFi.IProjectDimension).Code); + hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationPeriodDescriptor); // Standard Property - hash.Add((this as Entities.Common.EdFi.IProjectDimension).FiscalYear); + hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTitle); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramEvaluationTypeDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluation).ProgramTypeDescriptor); return hash.ToHashCode(); } @@ -130482,21 +129162,29 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// A description of the account project dimension. + /// The maximum summary numerical rating or score for the program evaluation. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeName")] - public string CodeName { get; set; } - // ------------------------------------------------------------- + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="evaluationMaxNumericRating")] + public decimal? EvaluationMaxNumericRating { get; set; } - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } - } + /// + /// The minimum summary numerical rating or score for the program evaluation. If omitted, assumed to be 0.0 + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="evaluationMinNumericRating")] + public decimal? EvaluationMinNumericRating { get; set; } + + /// + /// The long description of the program evaluation. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="programEvaluationDescription")] + public string ProgramEvaluationDescription { get; set; } + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -130516,41 +129204,41 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProjectDimension", "ProjectDimension")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluation", "ProgramEvaluation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _projectDimensionReportingTags; - private ICollection _projectDimensionReportingTagsCovariant; + private ICollection _programEvaluationLevels; + private ICollection _programEvaluationLevelsCovariant; [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection ProjectDimensionReportingTags + [DataMember(Name="levels")] + public ICollection ProgramEvaluationLevels { - get { return _projectDimensionReportingTags; } + get { return _programEvaluationLevels; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IProjectDimensionReportingTag)e.Item).ProjectDimension = this); - _projectDimensionReportingTags = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProgramEvaluationLevel)e.Item).ProgramEvaluation = this); + _programEvaluationLevels = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProjectDimensionReportingTag)e.Item).ProjectDimension = this; - _projectDimensionReportingTagsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramEvaluationLevel)e.Item).ProgramEvaluation = this; + _programEvaluationLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IProjectDimension.ProjectDimensionReportingTags + ICollection Entities.Common.EdFi.IProgramEvaluation.ProgramEvaluationLevels { - get { return _projectDimensionReportingTagsCovariant; } - set { ProjectDimensionReportingTags = new List(value.Cast()); } + get { return _programEvaluationLevelsCovariant; } + set { ProgramEvaluationLevels = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -130575,9 +129263,9 @@ public ICollection ProjectDimensionReportingTags internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_projectDimensionReportingTags != null) foreach (var item in _projectDimensionReportingTags) + if (_programEvaluationLevels != null) foreach (var item in _programEvaluationLevels) { - item.ProjectDimension = this; + item.ProgramEvaluation = this; } } @@ -130588,18 +129276,32 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProjectDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProjectDimension)target); + return Entities.Common.EdFi.ProgramEvaluationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProjectDimensionMapper.MapTo(this, (Entities.Common.EdFi.IProjectDimension)target, null); + Entities.Common.EdFi.ProgramEvaluationMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IProgramEvaluation.ProgramResourceId + { + get { return null; } + set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IProgramEvaluation.ProgramDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -130622,13 +129324,13 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (ProjectDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("ProjectDimensionReportingTags") != false) + if (ProgramEvaluationLevels.Any() && mappingContract?.IsMemberSupported("ProgramEvaluationLevels") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("ProjectDimensionReportingTags"); + pathBuilder.Append("ProgramEvaluationLevels"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProjectDimensionReportingTags, validationContext, validationContext.Items.ForCollection("ProjectDimensionReportingTags")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramEvaluationLevels, validationContext, validationContext.Items.ForCollection("ProgramEvaluationLevels")))) { yield return result; } @@ -130679,14 +129381,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProjectDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ProjectDimension = new FullName("edfi", "ProjectDimension"); + private static readonly FullName _fullName_edfi_ProgramEvaluation = new FullName("edfi", "ProgramEvaluation"); // Declare collection item validators - private ProjectDimensionReportingTagPutPostRequestValidator _projectDimensionReportingTagsValidator = new (); + private ProgramEvaluationLevelPutPostRequestValidator _programEvaluationLevelsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -130703,19 +129405,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsProjectDimensionReportingTagIncluded(x)); + var hasInvalidProgramEvaluationLevelsItems = instance.ProgramEvaluationLevels.Any(x => !mappingContract.IsProgramEvaluationLevelIncluded(x)); - if (hasInvalidProjectDimensionReportingTagsItems) + if (hasInvalidProgramEvaluationLevelsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ProjectDimensionReportingTags", $"A supplied 'ProjectDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("ProgramEvaluationLevels", $"A supplied 'ProgramEvaluationLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -130737,16 +129439,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProjectDimensionReportingTag table of the ProjectDimension aggregate in the ODS Database. + /// A class which represents the edfi.ProgramEvaluationLevel table of the ProgramEvaluation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProjectDimensionReportingTag : Entities.Common.EdFi.IProjectDimensionReportingTag, IValidatableObject + public class ProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProjectDimensionReportingTag"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluationLevel"); // Fluent validator instance (threadsafe) - private static ProjectDimensionReportingTagPutPostRequestValidator _validator = new ProjectDimensionReportingTagPutPostRequestValidator(); + private static ProgramEvaluationLevelPutPostRequestValidator _validator = new ProgramEvaluationLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -130773,33 +129475,33 @@ public class ProjectDimensionReportingTag : Entities.Common.EdFi.IProjectDimensi //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IProjectDimension _projectDimension; + private Entities.Common.EdFi.IProgramEvaluation _programEvaluation; [IgnoreDataMember] - Entities.Common.EdFi.IProjectDimension IProjectDimensionReportingTag.ProjectDimension + Entities.Common.EdFi.IProgramEvaluation IProgramEvaluationLevel.ProgramEvaluation { - get { return _projectDimension; } - set { SetProjectDimension(value); } + get { return _programEvaluation; } + set { SetProgramEvaluation(value); } } - public Entities.Common.EdFi.IProjectDimension ProjectDimension + public Entities.Common.EdFi.IProgramEvaluation ProgramEvaluation { - set { SetProjectDimension(value); } + set { SetProgramEvaluation(value); } } - private void SetProjectDimension(Entities.Common.EdFi.IProjectDimension value) + private void SetProgramEvaluation(Entities.Common.EdFi.IProgramEvaluation value) { - _projectDimension = value; + _programEvaluation = value; } /// - /// Optional tag for accountability reporting. + /// The title for a level of rating or evaluation band (e.g., Excellent, Acceptable, Needs Improvement, Unacceptable). /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } + [DataMember(Name="ratingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] + public string RatingLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -130814,7 +129516,7 @@ private void SetProjectDimension(Entities.Common.EdFi.IProjectDimension value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProjectDimensionReportingTag; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -130823,12 +129525,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_projectDimension == null || !_projectDimension.Equals(compareTo.ProjectDimension)) + if (_programEvaluation == null || !_programEvaluation.Equals(compareTo.ProgramEvaluation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProjectDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationLevel).RatingLevelDescriptor, compareTo.RatingLevelDescriptor)) return false; @@ -130845,11 +129547,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_projectDimension != null) - hash.Add(_projectDimension); + if (_programEvaluation != null) + hash.Add(_programEvaluation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IProjectDimensionReportingTag).ReportingTagDescriptor); + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationLevel).RatingLevelDescriptor); return hash.ToHashCode(); } @@ -130863,6 +129565,22 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The maximum numerical rating or score to achieve the evaluation rating level. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxNumericRating")] + public decimal? MaxNumericRating { get; set; } + + /// + /// The minimum numerical rating or score to achieve the evaluation rating level. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="minNumericRating")] + public decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -130883,7 +129601,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProjectDimension", "ProjectDimensionReportingTag")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluation", "ProgramEvaluationLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -130907,12 +129625,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProjectDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProjectDimensionReportingTag)target); + return Entities.Common.EdFi.ProgramEvaluationLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProjectDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IProjectDimensionReportingTag)target, null); + Entities.Common.EdFi.ProgramEvaluationLevelMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationLevel)target, null); } // ------------------------------------------------------------- @@ -130987,9 +129705,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProjectDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -131018,21 +129736,158 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProviderCategoryDescriptor table of the ProviderCategoryDescriptor aggregate in the ODS Database. + /// Represents a reference to the ProgramEvaluationElement resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class ProgramEvaluationElementReference : IResourceReference + { + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } + + [DataMember(Name="programEvaluationElementTitle")] + public string ProgramEvaluationElementTitle { get; set; } + + [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] + public string ProgramEvaluationPeriodDescriptor { get; set; } + + [DataMember(Name="programEvaluationTitle")] + public string ProgramEvaluationTitle { get; set; } + + [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] + public string ProgramEvaluationTypeDescriptor { get; set; } + + [DataMember(Name="programName")] + public string ProgramName { get; set; } + + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return ProgramEducationOrganizationId != default(long) && ProgramEvaluationElementTitle != default(string) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (ProgramEducationOrganizationId == default) + { + yield return "ProgramEducationOrganizationId"; + } + + if (ProgramEvaluationElementTitle == default) + { + yield return "ProgramEvaluationElementTitle"; + } + + if (ProgramEvaluationPeriodDescriptor == default) + { + yield return "ProgramEvaluationPeriodDescriptor"; + } + + if (ProgramEvaluationTitle == default) + { + yield return "ProgramEvaluationTitle"; + } + + if (ProgramEvaluationTypeDescriptor == default) + { + yield return "ProgramEvaluationTypeDescriptor"; + } + + if (ProgramName == default) + { + yield return "ProgramName"; + } + + if (ProgramTypeDescriptor == default) + { + yield return "ProgramTypeDescriptor"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "ProgramEvaluationElement", + Href = $"/ed-fi/programEvaluationElements/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.ProgramEvaluationElement table of the ProgramEvaluationElement aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProviderCategoryDescriptor : Entities.Common.EdFi.IProviderCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramEvaluationElement : Entities.Common.EdFi.IProgramEvaluationElement, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProviderCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluationElement"); // Fluent validator instance (threadsafe) - private static ProviderCategoryDescriptorPutPostRequestValidator _validator = new ProviderCategoryDescriptorPutPostRequestValidator(); + private static ProgramEvaluationElementPutPostRequestValidator _validator = new ProgramEvaluationElementPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -131043,6 +129898,10 @@ public class ProviderCategoryDescriptor : Entities.Common.EdFi.IProviderCategory // Constructor // ------------------------------------------------------------- + public ProgramEvaluationElement() + { + ProgramEvaluationElementProgramEvaluationLevels = new List(); + } // ------------------------------------------------------------ @@ -131051,7 +129910,7 @@ public class ProviderCategoryDescriptor : Entities.Common.EdFi.IProviderCategory // ------------------------------------------------------------ /// - /// The unique identifier for the ProviderCategoryDescriptor resource. + /// The unique identifier for the ProgramEvaluationElement resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -131061,6 +129920,73 @@ public class ProviderCategoryDescriptor : Entities.Common.EdFi.IProviderCategory // ============================================================= // References // ------------------------------------------------------------- + + private bool _programEvaluationObjectiveReferenceExplicitlyAssigned; + private ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference _programEvaluationObjectiveReference; + private ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference ImplicitProgramEvaluationObjectiveReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programEvaluationObjectiveReference == null && !_programEvaluationObjectiveReferenceExplicitlyAssigned) + _programEvaluationObjectiveReference = new ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference(); + + return _programEvaluationObjectiveReference; + } + } + + [DataMember(Name="programEvaluationObjectiveReference")] + [FullyDefinedReference] + public ProgramEvaluationObjective.EdFi.ProgramEvaluationObjectiveReference ProgramEvaluationObjectiveReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramEvaluationObjectiveReference != null + && (_programEvaluationObjectiveReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationObjectiveReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationObjectiveReference; + + return null; + } + set + { + _programEvaluationObjectiveReferenceExplicitlyAssigned = true; + _programEvaluationObjectiveReference = value; + } + } + private bool _programEvaluationReferenceExplicitlyAssigned; + private ProgramEvaluation.EdFi.ProgramEvaluationReference _programEvaluationReference; + private ProgramEvaluation.EdFi.ProgramEvaluationReference ImplicitProgramEvaluationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programEvaluationReference == null && !_programEvaluationReferenceExplicitlyAssigned) + _programEvaluationReference = new ProgramEvaluation.EdFi.ProgramEvaluationReference(); + + return _programEvaluationReference; + } + } + + [DataMember(Name="programEvaluationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public ProgramEvaluation.EdFi.ProgramEvaluationReference ProgramEvaluationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramEvaluationReference != null + && (_programEvaluationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference; + + return null; + } + set + { + _programEvaluationReferenceExplicitlyAssigned = true; + _programEvaluationReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -131068,16 +129994,165 @@ public class ProviderCategoryDescriptor : Entities.Common.EdFi.IProviderCategory // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IProgramEvaluationElement.ProgramEducationOrganizationId + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramEvaluation + _programEvaluationReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationReference.ProgramEducationOrganizationId = value; + + // ProgramEvaluationObjective + _programEvaluationObjectiveReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationObjectiveReference.ProgramEducationOrganizationId = value; + } + } + + /// + /// The name or title of the program evaluation element. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProviderCategoryDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programEvaluationElementTitle")] + public string ProgramEvaluationElementTitle { get; set; } - int IDescriptor.DescriptorId + /// + /// The name of the period for the program evaluation. + /// + + // IS in a reference (ProgramEvaluationElement.ProgramEvaluationPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationPeriodDescriptor { - get { return ProviderCategoryDescriptorId; } - set { ProviderCategoryDescriptorId = value; } + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor; + + return null; + } + set + { + ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor = value; + ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationPeriodDescriptor = value; + } + } + + /// + /// An assigned unique identifier for the student program evaluation. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationTitle + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEvaluationTitle; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramEvaluation + _programEvaluationReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationReference.ProgramEvaluationTitle = value; + + // ProgramEvaluationObjective + _programEvaluationObjectiveReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationTitle = value; + } + } + + /// + /// The type of program evaluation conducted. + /// + + // IS in a reference (ProgramEvaluationElement.ProgramEvaluationTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationTypeDescriptor + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor; + + return null; + } + set + { + ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor = value; + ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationTypeDescriptor = value; + } + } + + /// + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramName + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramEvaluation + _programEvaluationReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationReference.ProgramName = value; + + // ProgramEvaluationObjective + _programEvaluationObjectiveReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationObjectiveReference.ProgramName = value; + } + } + + /// + /// The type of program. + /// + + // IS in a reference (ProgramEvaluationElement.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramEvaluationReference.ProgramTypeDescriptor = value; + ImplicitProgramEvaluationObjectiveReference.ProgramTypeDescriptor = value; + } } // ------------------------------------------------------------- @@ -131093,7 +130168,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProviderCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationElement; if (ReferenceEquals(this, compareTo)) return true; @@ -131102,8 +130177,38 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IProviderCategoryDescriptor).ProviderCategoryDescriptorId.Equals(compareTo.ProviderCategoryDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationElementTitle, compareTo.ProgramEvaluationElementTitle)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -131120,8 +130225,29 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IProviderCategoryDescriptor).ProviderCategoryDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEducationOrganizationId); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationElementTitle); + + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationPeriodDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTitle); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramEvaluationTypeDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElement).ProgramTypeDescriptor); return hash.ToHashCode(); } @@ -131130,60 +130256,69 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The description of the descriptor. + /// The maximum summary numerical rating or score for the program evaluation element. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="elementMaxNumericRating")] + public decimal? ElementMaxNumericRating { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The minimum summary numerical rating or score for the program evaluation element. If omitted, assumed to be 0.0. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="elementMinNumericRating")] + public decimal? ElementMinNumericRating { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The sort order of this program evaluation element. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [DataMember(Name="elementSortOrder")] + public int? ElementSortOrder { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The long description of the program evaluation element. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="programEvaluationElementDescription")] + public string ProgramEvaluationElementDescription { get; set; } /// - /// A shortened description for the descriptor. + /// The name or title of the program evaluation objective. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveTitle + { + get + { + if (ImplicitProgramEvaluationObjectiveReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationObjectiveReference.IsReferenceFullyDefined())) + { + return ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationObjectiveTitle; + } - // ============================================================= - // Properties - // ------------------------------------------------------------- + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramEvaluationObjective + _programEvaluationObjectiveReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationObjectiveReference.ProgramEvaluationObjectiveTitle = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -131204,16 +130339,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationElement", "ProgramEvaluationElement")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _programEvaluationElementProgramEvaluationLevels; + private ICollection _programEvaluationElementProgramEvaluationLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="programEvaluationLevels")] + public ICollection ProgramEvaluationElementProgramEvaluationLevels + { + get { return _programEvaluationElementProgramEvaluationLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)e.Item).ProgramEvaluationElement = this); + _programEvaluationElementProgramEvaluationLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)e.Item).ProgramEvaluationElement = this; + _programEvaluationElementProgramEvaluationLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationElementProgramEvaluationLevels + { + get { return _programEvaluationElementProgramEvaluationLevelsCovariant; } + set { ProgramEvaluationElementProgramEvaluationLevels = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -131231,6 +130393,17 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_programEvaluationElementProgramEvaluationLevels != null) foreach (var item in _programEvaluationElementProgramEvaluationLevels) + { + item.ProgramEvaluationElement = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -131238,19 +130411,317 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProviderCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProviderCategoryDescriptor)target); + return Entities.Common.EdFi.ProgramEvaluationElementMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationElement)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProviderCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProviderCategoryDescriptor)target, null); + Entities.Common.EdFi.ProgramEvaluationElementMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationElement)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationResourceId + { + get { return null; } + set { ImplicitProgramEvaluationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramEvaluationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveResourceId + { + get { return null; } + set { ImplicitProgramEvaluationObjectiveReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjectiveDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramEvaluationObjectiveReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ProgramEvaluationElementProgramEvaluationLevels.Any() && mappingContract?.IsMemberSupported("ProgramEvaluationElementProgramEvaluationLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ProgramEvaluationElementProgramEvaluationLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramEvaluationElementProgramEvaluationLevels, validationContext, validationContext.Items.ForCollection("ProgramEvaluationElementProgramEvaluationLevels")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForProgramEducationOrganizationId = GetProgramEducationOrganizationIdSources().ToArray(); + + if (!sourcesForProgramEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForProgramEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForProgramEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEducationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForProgramEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetProgramEducationOrganizationIdSources() + { + // Obtain value from other references + var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEducationOrganizationId; + + if (valueFromProgramEvaluationReference != null) + { + yield return ("programEvaluationReference.programEducationOrganizationId", this.ProgramEvaluationReference.ProgramEducationOrganizationId); + } + + // Obtain value from other references + var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEducationOrganizationId; + + if (valueFromProgramEvaluationObjectiveReference != null) + { + yield return ("programEvaluationObjectiveReference.programEducationOrganizationId", this.ProgramEvaluationObjectiveReference.ProgramEducationOrganizationId); + } + + } + var sourcesForProgramEvaluationPeriodDescriptor = GetProgramEvaluationPeriodDescriptorSources().ToArray(); + + if (!sourcesForProgramEvaluationPeriodDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForProgramEvaluationPeriodDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForProgramEvaluationPeriodDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEvaluationPeriodDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForProgramEvaluationPeriodDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetProgramEvaluationPeriodDescriptorSources() + { + // Obtain value from other references + var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEvaluationPeriodDescriptor; + + if (valueFromProgramEvaluationReference != null) + { + yield return ("programEvaluationReference.programEvaluationPeriodDescriptor", this.ProgramEvaluationReference.ProgramEvaluationPeriodDescriptor); + } + + // Obtain value from other references + var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEvaluationPeriodDescriptor; + + if (valueFromProgramEvaluationObjectiveReference != null) + { + yield return ("programEvaluationObjectiveReference.programEvaluationPeriodDescriptor", this.ProgramEvaluationObjectiveReference.ProgramEvaluationPeriodDescriptor); + } + + } + var sourcesForProgramEvaluationTitle = GetProgramEvaluationTitleSources().ToArray(); + + if (!sourcesForProgramEvaluationTitle.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForProgramEvaluationTitle.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForProgramEvaluationTitle.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEvaluationTitle' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForProgramEvaluationTitle.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetProgramEvaluationTitleSources() + { + // Obtain value from other references + var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEvaluationTitle; + + if (valueFromProgramEvaluationReference != null) + { + yield return ("programEvaluationReference.programEvaluationTitle", this.ProgramEvaluationReference.ProgramEvaluationTitle); + } + + // Obtain value from other references + var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEvaluationTitle; + + if (valueFromProgramEvaluationObjectiveReference != null) + { + yield return ("programEvaluationObjectiveReference.programEvaluationTitle", this.ProgramEvaluationObjectiveReference.ProgramEvaluationTitle); + } + + } + var sourcesForProgramEvaluationTypeDescriptor = GetProgramEvaluationTypeDescriptorSources().ToArray(); + + if (!sourcesForProgramEvaluationTypeDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForProgramEvaluationTypeDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForProgramEvaluationTypeDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programEvaluationTypeDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForProgramEvaluationTypeDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetProgramEvaluationTypeDescriptorSources() + { + // Obtain value from other references + var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramEvaluationTypeDescriptor; + + if (valueFromProgramEvaluationReference != null) + { + yield return ("programEvaluationReference.programEvaluationTypeDescriptor", this.ProgramEvaluationReference.ProgramEvaluationTypeDescriptor); + } + + // Obtain value from other references + var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramEvaluationTypeDescriptor; + + if (valueFromProgramEvaluationObjectiveReference != null) + { + yield return ("programEvaluationObjectiveReference.programEvaluationTypeDescriptor", this.ProgramEvaluationObjectiveReference.ProgramEvaluationTypeDescriptor); + } + + } + var sourcesForProgramName = GetProgramNameSources().ToArray(); + + if (!sourcesForProgramName.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForProgramName.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForProgramName.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programName' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForProgramName.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetProgramNameSources() + { + // Obtain value from other references + var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramName; + + if (valueFromProgramEvaluationReference != null) + { + yield return ("programEvaluationReference.programName", this.ProgramEvaluationReference.ProgramName); + } + + // Obtain value from other references + var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramName; + + if (valueFromProgramEvaluationObjectiveReference != null) + { + yield return ("programEvaluationObjectiveReference.programName", this.ProgramEvaluationObjectiveReference.ProgramName); + } + + } + var sourcesForProgramTypeDescriptor = GetProgramTypeDescriptorSources().ToArray(); + + if (!sourcesForProgramTypeDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForProgramTypeDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForProgramTypeDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'programTypeDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForProgramTypeDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetProgramTypeDescriptorSources() + { + // Obtain value from other references + var valueFromProgramEvaluationReference = this.ProgramEvaluationReference?.ProgramTypeDescriptor; + + if (valueFromProgramEvaluationReference != null) + { + yield return ("programEvaluationReference.programTypeDescriptor", this.ProgramEvaluationReference.ProgramTypeDescriptor); + } + + // Obtain value from other references + var valueFromProgramEvaluationObjectiveReference = this.ProgramEvaluationObjectiveReference?.ProgramTypeDescriptor; + + if (valueFromProgramEvaluationObjectiveReference != null) + { + yield return ("programEvaluationObjectiveReference.programTypeDescriptor", this.ProgramEvaluationObjectiveReference.ProgramTypeDescriptor); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -131258,9 +130729,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProviderCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationElementPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ProgramEvaluationElement = new FullName("edfi", "ProgramEvaluationElement"); + + // Declare collection item validators + private ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator _programEvaluationElementProgramEvaluationLevelsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -131273,6 +130749,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ProgramEvaluationElementMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ProgramEvaluationElement); + + if (mappingContract != null) + { + if (mappingContract.IsProgramEvaluationElementProgramEvaluationLevelIncluded != null) + { + var hasInvalidProgramEvaluationElementProgramEvaluationLevelsItems = instance.ProgramEvaluationElementProgramEvaluationLevels.Any(x => !mappingContract.IsProgramEvaluationElementProgramEvaluationLevelIncluded(x)); + + if (hasInvalidProgramEvaluationElementProgramEvaluationLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ProgramEvaluationElementProgramEvaluationLevels", $"A supplied 'ProgramEvaluationElementProgramEvaluationLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -131288,22 +130786,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProviderProfitabilityDescriptor table of the ProviderProfitabilityDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramEvaluationElementProgramEvaluationLevel table of the ProgramEvaluationElement aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProviderProfitabilityDescriptor : Entities.Common.EdFi.IProviderProfitabilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramEvaluationElementProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProviderProfitabilityDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluationElementProgramEvaluationLevel"); // Fluent validator instance (threadsafe) - private static ProviderProfitabilityDescriptorPutPostRequestValidator _validator = new ProviderProfitabilityDescriptorPutPostRequestValidator(); + private static ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator _validator = new ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -131320,13 +130813,6 @@ public class ProviderProfitabilityDescriptor : Entities.Common.EdFi.IProviderPro // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the ProviderProfitabilityDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -131337,19 +130823,33 @@ public class ProviderProfitabilityDescriptor : Entities.Common.EdFi.IProviderPro //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IProgramEvaluationElement _programEvaluationElement; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProviderProfitabilityDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IProgramEvaluationElement IProgramEvaluationElementProgramEvaluationLevel.ProgramEvaluationElement + { + get { return _programEvaluationElement; } + set { SetProgramEvaluationElement(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IProgramEvaluationElement ProgramEvaluationElement { - get { return ProviderProfitabilityDescriptorId; } - set { ProviderProfitabilityDescriptorId = value; } + set { SetProgramEvaluationElement(value); } + } + + private void SetProgramEvaluationElement(Entities.Common.EdFi.IProgramEvaluationElement value) + { + _programEvaluationElement = value; } + + /// + /// The title for a level of rating or evaluation band (e.g., Excellent, Acceptable, Needs Improvement, Unacceptable). + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="ratingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] + public string RatingLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -131364,7 +130864,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProviderProfitabilityDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -131372,9 +130872,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_programEvaluationElement == null || !_programEvaluationElement.Equals(compareTo.ProgramEvaluationElement)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IProviderProfitabilityDescriptor).ProviderProfitabilityDescriptorId.Equals(compareTo.ProviderProfitabilityDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel).RatingLevelDescriptor, compareTo.RatingLevelDescriptor)) return false; @@ -131390,9 +130894,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_programEvaluationElement != null) + hash.Add(_programEvaluationElement); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IProviderProfitabilityDescriptor).ProviderProfitabilityDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel).RatingLevelDescriptor); return hash.ToHashCode(); } @@ -131401,60 +130908,27 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The maximum numerical rating or score to achieve the evaluation rating level. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxNumericRating")] + public decimal? MaxNumericRating { get; set; } /// - /// A shortened description for the descriptor. + /// The minimum numerical rating or score to achieve the evaluation rating level. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="minNumericRating")] + public decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -131475,11 +130949,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationElement", "ProgramEvaluationElementProgramEvaluationLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -131490,13 +130961,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -131509,12 +130973,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProviderProfitabilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProviderProfitabilityDescriptor)target); + return Entities.Common.EdFi.ProgramEvaluationElementProgramEvaluationLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProviderProfitabilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProviderProfitabilityDescriptor)target, null); + Entities.Common.EdFi.ProgramEvaluationElementProgramEvaluationLevelMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel)target, null); } // ------------------------------------------------------------- @@ -131522,6 +130986,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -131529,9 +131053,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProviderProfitabilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationElementProgramEvaluationLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -131560,21 +131084,158 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ProviderStatusDescriptor table of the ProviderStatusDescriptor aggregate in the ODS Database. + /// Represents a reference to the ProgramEvaluationObjective resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class ProgramEvaluationObjectiveReference : IResourceReference + { + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } + + [DataMember(Name="programEvaluationObjectiveTitle")] + public string ProgramEvaluationObjectiveTitle { get; set; } + + [DataMember(Name="programEvaluationPeriodDescriptor")][DescriptorExists("ProgramEvaluationPeriodDescriptor")] + public string ProgramEvaluationPeriodDescriptor { get; set; } + + [DataMember(Name="programEvaluationTitle")] + public string ProgramEvaluationTitle { get; set; } + + [DataMember(Name="programEvaluationTypeDescriptor")][DescriptorExists("ProgramEvaluationTypeDescriptor")] + public string ProgramEvaluationTypeDescriptor { get; set; } + + [DataMember(Name="programName")] + public string ProgramName { get; set; } + + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return ProgramEducationOrganizationId != default(long) && ProgramEvaluationObjectiveTitle != default(string) && ProgramEvaluationPeriodDescriptor != default(string) && ProgramEvaluationTitle != default(string) && ProgramEvaluationTypeDescriptor != default(string) && ProgramName != default(string) && ProgramTypeDescriptor != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (ProgramEducationOrganizationId == default) + { + yield return "ProgramEducationOrganizationId"; + } + + if (ProgramEvaluationObjectiveTitle == default) + { + yield return "ProgramEvaluationObjectiveTitle"; + } + + if (ProgramEvaluationPeriodDescriptor == default) + { + yield return "ProgramEvaluationPeriodDescriptor"; + } + + if (ProgramEvaluationTitle == default) + { + yield return "ProgramEvaluationTitle"; + } + + if (ProgramEvaluationTypeDescriptor == default) + { + yield return "ProgramEvaluationTypeDescriptor"; + } + + if (ProgramName == default) + { + yield return "ProgramName"; + } + + if (ProgramTypeDescriptor == default) + { + yield return "ProgramTypeDescriptor"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "ProgramEvaluationObjective", + Href = $"/ed-fi/programEvaluationObjectives/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.ProgramEvaluationObjective table of the ProgramEvaluationObjective aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ProviderStatusDescriptor : Entities.Common.EdFi.IProviderStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramEvaluationObjective : Entities.Common.EdFi.IProgramEvaluationObjective, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ProviderStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluationObjective"); // Fluent validator instance (threadsafe) - private static ProviderStatusDescriptorPutPostRequestValidator _validator = new ProviderStatusDescriptorPutPostRequestValidator(); + private static ProgramEvaluationObjectivePutPostRequestValidator _validator = new ProgramEvaluationObjectivePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -131585,6 +131246,10 @@ public class ProviderStatusDescriptor : Entities.Common.EdFi.IProviderStatusDesc // Constructor // ------------------------------------------------------------- + public ProgramEvaluationObjective() + { + ProgramEvaluationObjectiveProgramEvaluationLevels = new List(); + } // ------------------------------------------------------------ @@ -131593,7 +131258,7 @@ public class ProviderStatusDescriptor : Entities.Common.EdFi.IProviderStatusDesc // ------------------------------------------------------------ /// - /// The unique identifier for the ProviderStatusDescriptor resource. + /// The unique identifier for the ProgramEvaluationObjective resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -131603,6 +131268,40 @@ public class ProviderStatusDescriptor : Entities.Common.EdFi.IProviderStatusDesc // ============================================================= // References // ------------------------------------------------------------- + + private bool _programEvaluationReferenceExplicitlyAssigned; + private ProgramEvaluation.EdFi.ProgramEvaluationReference _programEvaluationReference; + private ProgramEvaluation.EdFi.ProgramEvaluationReference ImplicitProgramEvaluationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programEvaluationReference == null && !_programEvaluationReferenceExplicitlyAssigned) + _programEvaluationReference = new ProgramEvaluation.EdFi.ProgramEvaluationReference(); + + return _programEvaluationReference; + } + } + + [DataMember(Name="programEvaluationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public ProgramEvaluation.EdFi.ProgramEvaluationReference ProgramEvaluationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramEvaluationReference != null + && (_programEvaluationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference; + + return null; + } + set + { + _programEvaluationReferenceExplicitlyAssigned = true; + _programEvaluationReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -131610,16 +131309,150 @@ public class ProviderStatusDescriptor : Entities.Common.EdFi.IProviderStatusDesc // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEducationOrganizationId + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramEvaluation + _programEvaluationReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationReference.ProgramEducationOrganizationId = value; + } + } + + /// + /// The name or title of the program evaluation objective. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ProviderStatusDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programEvaluationObjectiveTitle")] + public string ProgramEvaluationObjectiveTitle { get; set; } - int IDescriptor.DescriptorId + /// + /// The name of the period for the program evaluation. + /// + + // IS in a reference (ProgramEvaluationObjective.ProgramEvaluationPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationPeriodDescriptor { - get { return ProviderStatusDescriptorId; } - set { ProviderStatusDescriptorId = value; } + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor; + + return null; + } + set + { + ImplicitProgramEvaluationReference.ProgramEvaluationPeriodDescriptor = value; + } + } + + /// + /// An assigned unique identifier for the student program evaluation. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationTitle + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEvaluationTitle; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramEvaluation + _programEvaluationReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationReference.ProgramEvaluationTitle = value; + } + } + + /// + /// The type of program evaluation conducted. + /// + + // IS in a reference (ProgramEvaluationObjective.ProgramEvaluationTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationTypeDescriptor + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor; + + return null; + } + set + { + ImplicitProgramEvaluationReference.ProgramEvaluationTypeDescriptor = value; + } + } + + /// + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramName + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ProgramEvaluation + _programEvaluationReferenceExplicitlyAssigned = false; + ImplicitProgramEvaluationReference.ProgramName = value; + } + } + + /// + /// The type of program. + /// + + // IS in a reference (ProgramEvaluationObjective.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramEvaluationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramEvaluationReference.IsReferenceFullyDefined())) + return ImplicitProgramEvaluationReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramEvaluationReference.ProgramTypeDescriptor = value; + } } // ------------------------------------------------------------- @@ -131635,7 +131468,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IProviderStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationObjective; if (ReferenceEquals(this, compareTo)) return true; @@ -131644,8 +131477,38 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IProviderStatusDescriptor).ProviderStatusDescriptorId.Equals(compareTo.ProviderStatusDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationObjectiveTitle, compareTo.ProgramEvaluationObjectiveTitle)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationPeriodDescriptor, compareTo.ProgramEvaluationPeriodDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTitle, compareTo.ProgramEvaluationTitle)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTypeDescriptor, compareTo.ProgramEvaluationTypeDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -131662,8 +131525,29 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IProviderStatusDescriptor).ProviderStatusDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEducationOrganizationId); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationObjectiveTitle); + + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationPeriodDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTitle); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramEvaluationTypeDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjective).ProgramTypeDescriptor); return hash.ToHashCode(); } @@ -131672,60 +131556,42 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The description of the descriptor. + /// The maximum summary numerical rating or score for the program evaluation objective. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="objectiveMaxNumericRating")] + public decimal? ObjectiveMaxNumericRating { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// The minimum summary numerical rating or score for the program evaluation objective. If omitted, assumed to be 0.0 /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="objectiveMinNumericRating")] + public decimal? ObjectiveMinNumericRating { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The sort order of this program evaluation objective. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [DataMember(Name="objectiveSortOrder")] + public int? ObjectiveSortOrder { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The long description of the program evaluation objective. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [DataMember(Name="programEvaluationObjectiveDescription")] + public string ProgramEvaluationObjectiveDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -131746,16 +131612,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationObjective", "ProgramEvaluationObjective")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _programEvaluationObjectiveProgramEvaluationLevels; + private ICollection _programEvaluationObjectiveProgramEvaluationLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="programEvaluationLevels")] + public ICollection ProgramEvaluationObjectiveProgramEvaluationLevels + { + get { return _programEvaluationObjectiveProgramEvaluationLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)e.Item).ProgramEvaluationObjective = this); + _programEvaluationObjectiveProgramEvaluationLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)e.Item).ProgramEvaluationObjective = this; + _programEvaluationObjectiveProgramEvaluationLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationObjectiveProgramEvaluationLevels + { + get { return _programEvaluationObjectiveProgramEvaluationLevelsCovariant; } + set { ProgramEvaluationObjectiveProgramEvaluationLevels = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -131773,6 +131666,17 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_programEvaluationObjectiveProgramEvaluationLevels != null) foreach (var item in _programEvaluationObjectiveProgramEvaluationLevels) + { + item.ProgramEvaluationObjective = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -131780,19 +131684,104 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ProviderStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProviderStatusDescriptor)target); + return Entities.Common.EdFi.ProgramEvaluationObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationObjective)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ProviderStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProviderStatusDescriptor)target, null); + Entities.Common.EdFi.ProgramEvaluationObjectiveMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationObjective)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationResourceId + { + get { return null; } + set { ImplicitProgramEvaluationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramEvaluationReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ProgramEvaluationObjectiveProgramEvaluationLevels.Any() && mappingContract?.IsMemberSupported("ProgramEvaluationObjectiveProgramEvaluationLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ProgramEvaluationObjectiveProgramEvaluationLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProgramEvaluationObjectiveProgramEvaluationLevels, validationContext, validationContext.Items.ForCollection("ProgramEvaluationObjectiveProgramEvaluationLevels")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -131800,9 +131789,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ProviderStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationObjectivePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ProgramEvaluationObjective = new FullName("edfi", "ProgramEvaluationObjective"); + + // Declare collection item validators + private ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator _programEvaluationObjectiveProgramEvaluationLevelsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -131815,6 +131809,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ProgramEvaluationObjectiveMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ProgramEvaluationObjective); + + if (mappingContract != null) + { + if (mappingContract.IsProgramEvaluationObjectiveProgramEvaluationLevelIncluded != null) + { + var hasInvalidProgramEvaluationObjectiveProgramEvaluationLevelsItems = instance.ProgramEvaluationObjectiveProgramEvaluationLevels.Any(x => !mappingContract.IsProgramEvaluationObjectiveProgramEvaluationLevelIncluded(x)); + + if (hasInvalidProgramEvaluationObjectiveProgramEvaluationLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ProgramEvaluationObjectiveProgramEvaluationLevels", $"A supplied 'ProgramEvaluationObjectiveProgramEvaluationLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -131830,22 +131846,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.PublicationStatusDescriptor table of the PublicationStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramEvaluationObjectiveProgramEvaluationLevel table of the ProgramEvaluationObjective aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class PublicationStatusDescriptor : Entities.Common.EdFi.IPublicationStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramEvaluationObjectiveProgramEvaluationLevel : Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "PublicationStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluationObjectiveProgramEvaluationLevel"); // Fluent validator instance (threadsafe) - private static PublicationStatusDescriptorPutPostRequestValidator _validator = new PublicationStatusDescriptorPutPostRequestValidator(); + private static ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator _validator = new ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -131862,13 +131873,6 @@ public class PublicationStatusDescriptor : Entities.Common.EdFi.IPublicationStat // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the PublicationStatusDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -131879,19 +131883,33 @@ public class PublicationStatusDescriptor : Entities.Common.EdFi.IPublicationStat //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IProgramEvaluationObjective _programEvaluationObjective; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int PublicationStatusDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IProgramEvaluationObjective IProgramEvaluationObjectiveProgramEvaluationLevel.ProgramEvaluationObjective + { + get { return _programEvaluationObjective; } + set { SetProgramEvaluationObjective(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IProgramEvaluationObjective ProgramEvaluationObjective { - get { return PublicationStatusDescriptorId; } - set { PublicationStatusDescriptorId = value; } + set { SetProgramEvaluationObjective(value); } + } + + private void SetProgramEvaluationObjective(Entities.Common.EdFi.IProgramEvaluationObjective value) + { + _programEvaluationObjective = value; } + + /// + /// The title for a level of rating or evaluation band (e.g., Excellent, Acceptable, Needs Improvement, Unacceptable). + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="ratingLevelDescriptor")][DescriptorExists("RatingLevelDescriptor")] + public string RatingLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -131906,7 +131924,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IPublicationStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -131914,9 +131932,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_programEvaluationObjective == null || !_programEvaluationObjective.Equals(compareTo.ProgramEvaluationObjective)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IPublicationStatusDescriptor).PublicationStatusDescriptorId.Equals(compareTo.PublicationStatusDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel).RatingLevelDescriptor, compareTo.RatingLevelDescriptor)) return false; @@ -131932,9 +131954,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_programEvaluationObjective != null) + hash.Add(_programEvaluationObjective); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IPublicationStatusDescriptor).PublicationStatusDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel).RatingLevelDescriptor); return hash.ToHashCode(); } @@ -131943,60 +131968,27 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The maximum numerical rating or score to achieve the evaluation rating level. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxNumericRating")] + public decimal? MaxNumericRating { get; set; } /// - /// A shortened description for the descriptor. + /// The minimum numerical rating or score to achieve the evaluation rating level. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [Range(typeof(decimal), "-999.999", "999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="minNumericRating")] + public decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -132017,11 +132009,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProgramEvaluationObjective", "ProgramEvaluationObjectiveProgramEvaluationLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -132032,13 +132021,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -132051,12 +132033,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.PublicationStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPublicationStatusDescriptor)target); + return Entities.Common.EdFi.ProgramEvaluationObjectiveProgramEvaluationLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.PublicationStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPublicationStatusDescriptor)target, null); + Entities.Common.EdFi.ProgramEvaluationObjectiveProgramEvaluationLevelMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel)target, null); } // ------------------------------------------------------------- @@ -132064,6 +132046,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -132071,9 +132113,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class PublicationStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationObjectiveProgramEvaluationLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -132102,21 +132144,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.QuestionFormDescriptor table of the QuestionFormDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramEvaluationPeriodDescriptor table of the ProgramEvaluationPeriodDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class QuestionFormDescriptor : Entities.Common.EdFi.IQuestionFormDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramEvaluationPeriodDescriptor : Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "QuestionFormDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluationPeriodDescriptor"); // Fluent validator instance (threadsafe) - private static QuestionFormDescriptorPutPostRequestValidator _validator = new QuestionFormDescriptorPutPostRequestValidator(); + private static ProgramEvaluationPeriodDescriptorPutPostRequestValidator _validator = new ProgramEvaluationPeriodDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -132135,7 +132177,7 @@ public class QuestionFormDescriptor : Entities.Common.EdFi.IQuestionFormDescript // ------------------------------------------------------------ /// - /// The unique identifier for the QuestionFormDescriptor resource. + /// The unique identifier for the ProgramEvaluationPeriodDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -132156,12 +132198,12 @@ public class QuestionFormDescriptor : Entities.Common.EdFi.IQuestionFormDescript /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int QuestionFormDescriptorId { get; set; } + public int ProgramEvaluationPeriodDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return QuestionFormDescriptorId; } - set { QuestionFormDescriptorId = value; } + get { return ProgramEvaluationPeriodDescriptorId; } + set { ProgramEvaluationPeriodDescriptorId = value; } } // ------------------------------------------------------------- @@ -132177,7 +132219,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IQuestionFormDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -132187,7 +132229,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IQuestionFormDescriptor).QuestionFormDescriptorId.Equals(compareTo.QuestionFormDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor).ProgramEvaluationPeriodDescriptorId.Equals(compareTo.ProgramEvaluationPeriodDescriptorId)) return false; @@ -132205,7 +132247,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IQuestionFormDescriptor).QuestionFormDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor).ProgramEvaluationPeriodDescriptorId); return hash.ToHashCode(); } @@ -132322,12 +132364,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.QuestionFormDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IQuestionFormDescriptor)target); + return Entities.Common.EdFi.ProgramEvaluationPeriodDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.QuestionFormDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IQuestionFormDescriptor)target, null); + Entities.Common.EdFi.ProgramEvaluationPeriodDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor)target, null); } // ------------------------------------------------------------- @@ -132342,9 +132384,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class QuestionFormDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationPeriodDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -132373,21 +132415,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RaceDescriptor table of the RaceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramEvaluationTypeDescriptor table of the ProgramEvaluationTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RaceDescriptor : Entities.Common.EdFi.IRaceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramEvaluationTypeDescriptor : Entities.Common.EdFi.IProgramEvaluationTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "RaceDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramEvaluationTypeDescriptor"); // Fluent validator instance (threadsafe) - private static RaceDescriptorPutPostRequestValidator _validator = new RaceDescriptorPutPostRequestValidator(); + private static ProgramEvaluationTypeDescriptorPutPostRequestValidator _validator = new ProgramEvaluationTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -132406,7 +132448,7 @@ public class RaceDescriptor : Entities.Common.EdFi.IRaceDescriptor, Entities.Com // ------------------------------------------------------------ /// - /// The unique identifier for the RaceDescriptor resource. + /// The unique identifier for the ProgramEvaluationTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -132427,12 +132469,12 @@ public class RaceDescriptor : Entities.Common.EdFi.IRaceDescriptor, Entities.Com /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int RaceDescriptorId { get; set; } + public int ProgramEvaluationTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return RaceDescriptorId; } - set { RaceDescriptorId = value; } + get { return ProgramEvaluationTypeDescriptorId; } + set { ProgramEvaluationTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -132448,7 +132490,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRaceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramEvaluationTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -132458,7 +132500,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IRaceDescriptor).RaceDescriptorId.Equals(compareTo.RaceDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgramEvaluationTypeDescriptor).ProgramEvaluationTypeDescriptorId.Equals(compareTo.ProgramEvaluationTypeDescriptorId)) return false; @@ -132476,7 +132518,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IRaceDescriptor).RaceDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgramEvaluationTypeDescriptor).ProgramEvaluationTypeDescriptorId); return hash.ToHashCode(); } @@ -132593,12 +132635,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RaceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRaceDescriptor)target); + return Entities.Common.EdFi.ProgramEvaluationTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramEvaluationTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RaceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRaceDescriptor)target, null); + Entities.Common.EdFi.ProgramEvaluationTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramEvaluationTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -132613,9 +132655,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RaceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramEvaluationTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -132644,21 +132686,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RatingLevelDescriptor table of the RatingLevelDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramSponsorDescriptor table of the ProgramSponsorDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RatingLevelDescriptor : Entities.Common.EdFi.IRatingLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramSponsorDescriptor : Entities.Common.EdFi.IProgramSponsorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "RatingLevelDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramSponsorDescriptor"); // Fluent validator instance (threadsafe) - private static RatingLevelDescriptorPutPostRequestValidator _validator = new RatingLevelDescriptorPutPostRequestValidator(); + private static ProgramSponsorDescriptorPutPostRequestValidator _validator = new ProgramSponsorDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -132677,7 +132719,7 @@ public class RatingLevelDescriptor : Entities.Common.EdFi.IRatingLevelDescriptor // ------------------------------------------------------------ /// - /// The unique identifier for the RatingLevelDescriptor resource. + /// The unique identifier for the ProgramSponsorDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -132698,12 +132740,12 @@ public class RatingLevelDescriptor : Entities.Common.EdFi.IRatingLevelDescriptor /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int RatingLevelDescriptorId { get; set; } + public int ProgramSponsorDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return RatingLevelDescriptorId; } - set { RatingLevelDescriptorId = value; } + get { return ProgramSponsorDescriptorId; } + set { ProgramSponsorDescriptorId = value; } } // ------------------------------------------------------------- @@ -132719,7 +132761,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRatingLevelDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramSponsorDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -132729,7 +132771,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IRatingLevelDescriptor).RatingLevelDescriptorId.Equals(compareTo.RatingLevelDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgramSponsorDescriptor).ProgramSponsorDescriptorId.Equals(compareTo.ProgramSponsorDescriptorId)) return false; @@ -132747,7 +132789,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IRatingLevelDescriptor).RatingLevelDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgramSponsorDescriptor).ProgramSponsorDescriptorId); return hash.ToHashCode(); } @@ -132864,12 +132906,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RatingLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRatingLevelDescriptor)target); + return Entities.Common.EdFi.ProgramSponsorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramSponsorDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RatingLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRatingLevelDescriptor)target, null); + Entities.Common.EdFi.ProgramSponsorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramSponsorDescriptor)target, null); } // ------------------------------------------------------------- @@ -132884,9 +132926,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RatingLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramSponsorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -132915,21 +132957,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ReasonExitedDescriptor table of the ReasonExitedDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgramTypeDescriptor table of the ProgramTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ReasonExitedDescriptor : Entities.Common.EdFi.IReasonExitedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgramTypeDescriptor : Entities.Common.EdFi.IProgramTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReasonExitedDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgramTypeDescriptor"); // Fluent validator instance (threadsafe) - private static ReasonExitedDescriptorPutPostRequestValidator _validator = new ReasonExitedDescriptorPutPostRequestValidator(); + private static ProgramTypeDescriptorPutPostRequestValidator _validator = new ProgramTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -132948,7 +132990,7 @@ public class ReasonExitedDescriptor : Entities.Common.EdFi.IReasonExitedDescript // ------------------------------------------------------------ /// - /// The unique identifier for the ReasonExitedDescriptor resource. + /// The unique identifier for the ProgramTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -132969,12 +133011,12 @@ public class ReasonExitedDescriptor : Entities.Common.EdFi.IReasonExitedDescript /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ReasonExitedDescriptorId { get; set; } + public int ProgramTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ReasonExitedDescriptorId; } - set { ReasonExitedDescriptorId = value; } + get { return ProgramTypeDescriptorId; } + set { ProgramTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -132990,7 +133032,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IReasonExitedDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgramTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -133000,7 +133042,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IReasonExitedDescriptor).ReasonExitedDescriptorId.Equals(compareTo.ReasonExitedDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgramTypeDescriptor).ProgramTypeDescriptorId.Equals(compareTo.ProgramTypeDescriptorId)) return false; @@ -133018,7 +133060,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IReasonExitedDescriptor).ReasonExitedDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgramTypeDescriptor).ProgramTypeDescriptorId); return hash.ToHashCode(); } @@ -133135,12 +133177,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReasonExitedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReasonExitedDescriptor)target); + return Entities.Common.EdFi.ProgramTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgramTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReasonExitedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReasonExitedDescriptor)target, null); + Entities.Common.EdFi.ProgramTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgramTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -133155,9 +133197,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ReasonExitedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgramTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -133186,21 +133228,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ReasonNotTestedDescriptor table of the ReasonNotTestedDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgressDescriptor table of the ProgressDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ReasonNotTestedDescriptor : Entities.Common.EdFi.IReasonNotTestedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgressDescriptor : Entities.Common.EdFi.IProgressDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReasonNotTestedDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgressDescriptor"); // Fluent validator instance (threadsafe) - private static ReasonNotTestedDescriptorPutPostRequestValidator _validator = new ReasonNotTestedDescriptorPutPostRequestValidator(); + private static ProgressDescriptorPutPostRequestValidator _validator = new ProgressDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -133219,7 +133261,7 @@ public class ReasonNotTestedDescriptor : Entities.Common.EdFi.IReasonNotTestedDe // ------------------------------------------------------------ /// - /// The unique identifier for the ReasonNotTestedDescriptor resource. + /// The unique identifier for the ProgressDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -133240,12 +133282,12 @@ public class ReasonNotTestedDescriptor : Entities.Common.EdFi.IReasonNotTestedDe /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ReasonNotTestedDescriptorId { get; set; } + public int ProgressDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ReasonNotTestedDescriptorId; } - set { ReasonNotTestedDescriptorId = value; } + get { return ProgressDescriptorId; } + set { ProgressDescriptorId = value; } } // ------------------------------------------------------------- @@ -133261,7 +133303,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IReasonNotTestedDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgressDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -133271,7 +133313,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IReasonNotTestedDescriptor).ReasonNotTestedDescriptorId.Equals(compareTo.ReasonNotTestedDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgressDescriptor).ProgressDescriptorId.Equals(compareTo.ProgressDescriptorId)) return false; @@ -133289,7 +133331,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IReasonNotTestedDescriptor).ReasonNotTestedDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgressDescriptor).ProgressDescriptorId); return hash.ToHashCode(); } @@ -133406,12 +133448,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReasonNotTestedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReasonNotTestedDescriptor)target); + return Entities.Common.EdFi.ProgressDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgressDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReasonNotTestedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReasonNotTestedDescriptor)target, null); + Entities.Common.EdFi.ProgressDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgressDescriptor)target, null); } // ------------------------------------------------------------- @@ -133426,9 +133468,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ReasonNotTestedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgressDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -133457,21 +133499,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RecognitionTypeDescriptor table of the RecognitionTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProgressLevelDescriptor table of the ProgressLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RecognitionTypeDescriptor : Entities.Common.EdFi.IRecognitionTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProgressLevelDescriptor : Entities.Common.EdFi.IProgressLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "RecognitionTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProgressLevelDescriptor"); // Fluent validator instance (threadsafe) - private static RecognitionTypeDescriptorPutPostRequestValidator _validator = new RecognitionTypeDescriptorPutPostRequestValidator(); + private static ProgressLevelDescriptorPutPostRequestValidator _validator = new ProgressLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -133490,7 +133532,7 @@ public class RecognitionTypeDescriptor : Entities.Common.EdFi.IRecognitionTypeDe // ------------------------------------------------------------ /// - /// The unique identifier for the RecognitionTypeDescriptor resource. + /// The unique identifier for the ProgressLevelDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -133511,12 +133553,12 @@ public class RecognitionTypeDescriptor : Entities.Common.EdFi.IRecognitionTypeDe /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int RecognitionTypeDescriptorId { get; set; } + public int ProgressLevelDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return RecognitionTypeDescriptorId; } - set { RecognitionTypeDescriptorId = value; } + get { return ProgressLevelDescriptorId; } + set { ProgressLevelDescriptorId = value; } } // ------------------------------------------------------------- @@ -133532,7 +133574,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRecognitionTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProgressLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -133542,7 +133584,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IRecognitionTypeDescriptor).RecognitionTypeDescriptorId.Equals(compareTo.RecognitionTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.IProgressLevelDescriptor).ProgressLevelDescriptorId.Equals(compareTo.ProgressLevelDescriptorId)) return false; @@ -133560,7 +133602,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IRecognitionTypeDescriptor).RecognitionTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.IProgressLevelDescriptor).ProgressLevelDescriptorId); return hash.ToHashCode(); } @@ -133677,12 +133719,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RecognitionTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRecognitionTypeDescriptor)target); + return Entities.Common.EdFi.ProgressLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProgressLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RecognitionTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRecognitionTypeDescriptor)target, null); + Entities.Common.EdFi.ProgressLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProgressLevelDescriptor)target, null); } // ------------------------------------------------------------- @@ -133697,9 +133739,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RecognitionTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProgressLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -133728,21 +133770,119 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RelationDescriptor table of the RelationDescriptor aggregate in the ODS Database. + /// Represents a reference to the ProjectDimension resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class ProjectDimensionReference : IResourceReference + { + [DataMember(Name="code")] + public string Code { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return Code != default(string) && FiscalYear != default(int); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (Code == default) + { + yield return "Code"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "ProjectDimension", + Href = $"/ed-fi/projectDimensions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.ProjectDimension table of the ProjectDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RelationDescriptor : Entities.Common.EdFi.IRelationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class ProjectDimension : Entities.Common.EdFi.IProjectDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "RelationDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProjectDimension"); // Fluent validator instance (threadsafe) - private static RelationDescriptorPutPostRequestValidator _validator = new RelationDescriptorPutPostRequestValidator(); + private static ProjectDimensionPutPostRequestValidator _validator = new ProjectDimensionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -133753,6 +133893,10 @@ public class RelationDescriptor : Entities.Common.EdFi.IRelationDescriptor, Enti // Constructor // ------------------------------------------------------------- + public ProjectDimension() + { + ProjectDimensionReportingTags = new List(); + } // ------------------------------------------------------------ @@ -133761,7 +133905,7 @@ public class RelationDescriptor : Entities.Common.EdFi.IRelationDescriptor, Enti // ------------------------------------------------------------ /// - /// The unique identifier for the RelationDescriptor resource. + /// The unique identifier for the ProjectDimension resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -133778,17 +133922,33 @@ public class RelationDescriptor : Entities.Common.EdFi.IRelationDescriptor, Enti // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The code representation of the account project dimension. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int RelationDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="code")] + public string Code { get; set; } + + private bool _fiscalYearExplicitlyAssigned = false; + private int _fiscalYear; - int IDescriptor.DescriptorId - { - get { return RelationDescriptorId; } - set { RelationDescriptorId = value; } + /// + /// The fiscal year for which the account project dimension is valid. + /// + // NOT in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get => _fiscalYear; + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; + } } + // ------------------------------------------------------------- // ============================================================= @@ -133803,7 +133963,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRelationDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProjectDimension; if (ReferenceEquals(this, compareTo)) return true; @@ -133812,8 +133972,13 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IRelationDescriptor).RelationDescriptorId.Equals(compareTo.RelationDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IProjectDimension).Code, compareTo.Code)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IProjectDimension).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -133830,8 +133995,12 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IRelationDescriptor).RelationDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProjectDimension).Code); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProjectDimension).FiscalYear); return hash.ToHashCode(); } @@ -133840,61 +134009,28 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// A shortened description for the descriptor. + /// A description of the account project dimension. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeName")] + public string CodeName { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_fiscalYearExplicitlyAssigned) + { + yield return "FiscalYear"; + } + } // ============================================================= // One-to-one relationships @@ -133914,16 +134050,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProjectDimension", "ProjectDimension")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _projectDimensionReportingTags; + private ICollection _projectDimensionReportingTagsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportingTags")] + public ICollection ProjectDimensionReportingTags + { + get { return _projectDimensionReportingTags; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IProjectDimensionReportingTag)e.Item).ProjectDimension = this); + _projectDimensionReportingTags = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IProjectDimensionReportingTag)e.Item).ProjectDimension = this; + _projectDimensionReportingTagsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IProjectDimension.ProjectDimensionReportingTags + { + get { return _projectDimensionReportingTagsCovariant; } + set { ProjectDimensionReportingTags = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -133941,6 +134104,17 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_projectDimensionReportingTags != null) foreach (var item in _projectDimensionReportingTags) + { + item.ProjectDimension = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -133948,12 +134122,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RelationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRelationDescriptor)target); + return Entities.Common.EdFi.ProjectDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProjectDimension)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RelationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRelationDescriptor)target, null); + Entities.Common.EdFi.ProjectDimensionMapper.MapTo(this, (Entities.Common.EdFi.IProjectDimension)target, null); } // ------------------------------------------------------------- @@ -133961,6 +134135,77 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ProjectDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("ProjectDimensionReportingTags") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ProjectDimensionReportingTags"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ProjectDimensionReportingTags, validationContext, validationContext.Items.ForCollection("ProjectDimensionReportingTags")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -133968,9 +134213,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RelationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProjectDimensionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ProjectDimension = new FullName("edfi", "ProjectDimension"); + + // Declare collection item validators + private ProjectDimensionReportingTagPutPostRequestValidator _projectDimensionReportingTagsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -133983,6 +134233,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ProjectDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ProjectDimension); + + if (mappingContract != null) + { + if (mappingContract.IsProjectDimensionReportingTagIncluded != null) + { + var hasInvalidProjectDimensionReportingTagsItems = instance.ProjectDimensionReportingTags.Any(x => !mappingContract.IsProjectDimensionReportingTagIncluded(x)); + + if (hasInvalidProjectDimensionReportingTagsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ProjectDimensionReportingTags", $"A supplied 'ProjectDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -133998,22 +134270,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RepeatIdentifierDescriptor table of the RepeatIdentifierDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ProjectDimensionReportingTag table of the ProjectDimension aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RepeatIdentifierDescriptor : Entities.Common.EdFi.IRepeatIdentifierDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ProjectDimensionReportingTag : Entities.Common.EdFi.IProjectDimensionReportingTag, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "RepeatIdentifierDescriptor"); + private static FullName _fullName = new FullName("edfi", "ProjectDimensionReportingTag"); // Fluent validator instance (threadsafe) - private static RepeatIdentifierDescriptorPutPostRequestValidator _validator = new RepeatIdentifierDescriptorPutPostRequestValidator(); + private static ProjectDimensionReportingTagPutPostRequestValidator _validator = new ProjectDimensionReportingTagPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -134030,13 +134297,6 @@ public class RepeatIdentifierDescriptor : Entities.Common.EdFi.IRepeatIdentifier // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the RepeatIdentifierDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -134047,19 +134307,33 @@ public class RepeatIdentifierDescriptor : Entities.Common.EdFi.IRepeatIdentifier //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IProjectDimension _projectDimension; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int RepeatIdentifierDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IProjectDimension IProjectDimensionReportingTag.ProjectDimension + { + get { return _projectDimension; } + set { SetProjectDimension(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IProjectDimension ProjectDimension { - get { return RepeatIdentifierDescriptorId; } - set { RepeatIdentifierDescriptorId = value; } + set { SetProjectDimension(value); } } + + private void SetProjectDimension(Entities.Common.EdFi.IProjectDimension value) + { + _projectDimension = value; + } + + /// + /// Optional tag for accountability reporting. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -134074,7 +134348,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRepeatIdentifierDescriptor; + var compareTo = obj as Entities.Common.EdFi.IProjectDimensionReportingTag; if (ReferenceEquals(this, compareTo)) return true; @@ -134082,9 +134356,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_projectDimension == null || !_projectDimension.Equals(compareTo.ProjectDimension)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IRepeatIdentifierDescriptor).RepeatIdentifierDescriptorId.Equals(compareTo.RepeatIdentifierDescriptorId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IProjectDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) return false; @@ -134100,9 +134378,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_projectDimension != null) + hash.Add(_projectDimension); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IRepeatIdentifierDescriptor).RepeatIdentifierDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IProjectDimensionReportingTag).ReportingTagDescriptor); return hash.ToHashCode(); } @@ -134111,55 +134392,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -134185,11 +134417,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ProjectDimension", "ProjectDimensionReportingTag")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -134200,13 +134429,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -134219,12 +134441,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RepeatIdentifierDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRepeatIdentifierDescriptor)target); + return Entities.Common.EdFi.ProjectDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProjectDimensionReportingTag)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RepeatIdentifierDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRepeatIdentifierDescriptor)target, null); + Entities.Common.EdFi.ProjectDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.IProjectDimensionReportingTag)target, null); } // ------------------------------------------------------------- @@ -134232,6 +134454,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -134239,9 +134521,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RepeatIdentifierDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProjectDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -134270,159 +134552,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the ReportCard resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class ReportCardReference : IResourceReference - { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] - public string GradingPeriodDescriptor { get; set; } - - [DataMember(Name="gradingPeriodName")] - public string GradingPeriodName { get; set; } - - [DataMember(Name="gradingPeriodSchoolId")] - public long GradingPeriodSchoolId { get; set; } - - [DataMember(Name="gradingPeriodSchoolYear")] - public short GradingPeriodSchoolYear { get; set; } - - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return EducationOrganizationId != default(long) && GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && GradingPeriodSchoolId != default(long) && GradingPeriodSchoolYear != default(short) && StudentUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (GradingPeriodDescriptor == default) - { - yield return "GradingPeriodDescriptor"; - } - - if (GradingPeriodName == default) - { - yield return "GradingPeriodName"; - } - - if (GradingPeriodSchoolId == default) - { - yield return "GradingPeriodSchoolId"; - } - - if (GradingPeriodSchoolYear == default) - { - yield return "GradingPeriodSchoolYear"; - } - - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "ReportCard", - Href = $"/ed-fi/reportCards/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.ReportCard table of the ReportCard aggregate in the ODS Database. + /// A class which represents the edfi.ProviderCategoryDescriptor table of the ProviderCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ReportCard : Entities.Common.EdFi.IReportCard, IHasETag, IDateVersionedEntity, IValidatableObject + public class ProviderCategoryDescriptor : Entities.Common.EdFi.IProviderCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReportCard"); + private static FullName _fullName = new FullName("edfi", "ProviderCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static ReportCardPutPostRequestValidator _validator = new ReportCardPutPostRequestValidator(); + private static ProviderCategoryDescriptorPutPostRequestValidator _validator = new ProviderCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -134433,12 +134577,6 @@ public class ReportCard : Entities.Common.EdFi.IReportCard, IHasETag, IDateVersi // Constructor // ------------------------------------------------------------- - public ReportCard() - { - ReportCardGrades = new List(); - ReportCardGradePointAverages = new List(); - ReportCardStudentCompetencyObjectives = new List(); - } // ------------------------------------------------------------ @@ -134447,7 +134585,7 @@ public ReportCard() // ------------------------------------------------------------ /// - /// The unique identifier for the ReportCard resource. + /// The unique identifier for the ProviderCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -134457,106 +134595,6 @@ public ReportCard() // ============================================================= // References // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } - private bool _gradingPeriodReferenceExplicitlyAssigned; - private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; - private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) - _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); - - return _gradingPeriodReference; - } - } - - [DataMember(Name="gradingPeriodReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGradingPeriodReference != null - && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference; - - return null; - } - set - { - _gradingPeriodReferenceExplicitlyAssigned = true; - _gradingPeriodReference = value; - } - } - private bool _studentReferenceExplicitlyAssigned; - private Student.EdFi.StudentReference _studentReference; - private Student.EdFi.StudentReference ImplicitStudentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentReference == null && !_studentReferenceExplicitlyAssigned) - _studentReference = new Student.EdFi.StudentReference(); - - return _studentReference; - } - } - - [DataMember(Name="studentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Student.EdFi.StudentReference StudentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentReference != null - && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference; - - return null; - } - set - { - _studentReferenceExplicitlyAssigned = true; - _studentReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -134564,150 +134602,16 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IReportCard.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } - - /// - /// The state's name of the period for which grades are reported. - /// - - // IS in a reference (ReportCard.GradingPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.IReportCard.GradingPeriodDescriptor - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodDescriptor; - - return null; - } - set - { - ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; - } - } - - /// - /// The school's descriptive name of the grading period. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IReportCard.GradingPeriodName - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.GradingPeriodName = value; - } - } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IReportCard.GradingPeriodSchoolId - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolId = value; - } - } - - /// - /// The identifier for the grading period school year. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IReportCard.GradingPeriodSchoolYear - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolYear = value; - } - } + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ProviderCategoryDescriptorId { get; set; } - /// - /// A unique alphanumeric code assigned to a student. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IReportCard.StudentUniqueId + int IDescriptor.DescriptorId { - get - { - if (ImplicitStudentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Student - _studentReferenceExplicitlyAssigned = false; - ImplicitStudentReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } + get { return ProviderCategoryDescriptorId; } + set { ProviderCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -134723,7 +134627,7 @@ string Entities.Common.EdFi.IReportCard.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IReportCard; + var compareTo = obj as Entities.Common.EdFi.IProviderCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -134732,33 +134636,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IReportCard).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCard).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCard).GradingPeriodName, compareTo.GradingPeriodName)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolId.Equals(compareTo.GradingPeriodSchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCard).StudentUniqueId, compareTo.StudentUniqueId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IProviderCategoryDescriptor).ProviderCategoryDescriptorId.Equals(compareTo.ProviderCategoryDescriptorId)) return false; @@ -134775,24 +134654,9 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCard).EducationOrganizationId); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodName); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolYear); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IProviderCategoryDescriptor).ProviderCategoryDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCard).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -134800,35 +134664,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The number of days an individual is absent when school is in session during a given reporting period. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="numberOfDaysAbsent")] - public decimal? NumberOfDaysAbsent { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The number of days an individual is present when school is in session during a given reporting period. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="numberOfDaysInAttendance")] - public decimal? NumberOfDaysInAttendance { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The number of days an individual is tardy during a given reporting period. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [Range(0, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="numberOfDaysTardy")] - public int? NumberOfDaysTardy { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -134849,103 +134738,16 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCard")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _reportCardGradePointAverages; - private ICollection _reportCardGradePointAveragesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="gradePointAverages")] - public ICollection ReportCardGradePointAverages - { - get { return _reportCardGradePointAverages; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IReportCardGradePointAverage)e.Item).ReportCard = this); - _reportCardGradePointAverages = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IReportCardGradePointAverage)e.Item).ReportCard = this; - _reportCardGradePointAveragesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IReportCard.ReportCardGradePointAverages - { - get { return _reportCardGradePointAveragesCovariant; } - set { ReportCardGradePointAverages = new List(value.Cast()); } - } - - private ICollection _reportCardGrades; - private ICollection _reportCardGradesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="grades")] - public ICollection ReportCardGrades - { - get { return _reportCardGrades; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IReportCardGrade)e.Item).ReportCard = this); - _reportCardGrades = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IReportCardGrade)e.Item).ReportCard = this; - _reportCardGradesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IReportCard.ReportCardGrades - { - get { return _reportCardGradesCovariant; } - set { ReportCardGrades = new List(value.Cast()); } - } - - private ICollection _reportCardStudentCompetencyObjectives; - private ICollection _reportCardStudentCompetencyObjectivesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="studentCompetencyObjectives")] - public ICollection ReportCardStudentCompetencyObjectives - { - get { return _reportCardStudentCompetencyObjectives; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IReportCardStudentCompetencyObjective)e.Item).ReportCard = this); - _reportCardStudentCompetencyObjectives = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IReportCardStudentCompetencyObjective)e.Item).ReportCard = this; - _reportCardStudentCompetencyObjectivesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IReportCard.ReportCardStudentCompetencyObjectives - { - get { return _reportCardStudentCompetencyObjectivesCovariant; } - set { ReportCardStudentCompetencyObjectives = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -134963,27 +134765,6 @@ public ICollection ReportCardStudentCompet // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_reportCardGradePointAverages != null) foreach (var item in _reportCardGradePointAverages) - { - item.ReportCard = this; - } - - if (_reportCardGrades != null) foreach (var item in _reportCardGrades) - { - item.ReportCard = this; - } - - if (_reportCardStudentCompetencyObjectives != null) foreach (var item in _reportCardStudentCompetencyObjectives) - { - item.ReportCard = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -134991,156 +134772,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReportCardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCard)target); + return Entities.Common.EdFi.ProviderCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProviderCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReportCardMapper.MapTo(this, (Entities.Common.EdFi.IReportCard)target, null); + Entities.Common.EdFi.ProviderCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProviderCategoryDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IReportCard.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IReportCard.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IReportCard.GradingPeriodResourceId - { - get { return null; } - set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IReportCard.GradingPeriodDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitGradingPeriodReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IReportCard.StudentResourceId - { - get { return null; } - set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IReportCard.StudentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (ReportCardGradePointAverages.Any() && mappingContract?.IsMemberSupported("ReportCardGradePointAverages") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ReportCardGradePointAverages"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ReportCardGradePointAverages, validationContext, validationContext.Items.ForCollection("ReportCardGradePointAverages")))) - { - yield return result; - } - } - - if (ReportCardGrades.Any() && mappingContract?.IsMemberSupported("ReportCardGrades") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ReportCardGrades"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ReportCardGrades, validationContext, validationContext.Items.ForCollection("ReportCardGrades")))) - { - yield return result; - } - } - - if (ReportCardStudentCompetencyObjectives.Any() && mappingContract?.IsMemberSupported("ReportCardStudentCompetencyObjectives") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("ReportCardStudentCompetencyObjectives"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ReportCardStudentCompetencyObjectives, validationContext, validationContext.Items.ForCollection("ReportCardStudentCompetencyObjectives")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -135148,16 +134792,9 @@ string Entities.Common.EdFi.IReportCard.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ReportCardPutPostRequestValidator : FluentValidation.AbstractValidator + public class ProviderCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_ReportCard = new FullName("edfi", "ReportCard"); - - // Declare collection item validators - private ReportCardGradePutPostRequestValidator _reportCardGradesValidator = new (); - private ReportCardGradePointAveragePutPostRequestValidator _reportCardGradePointAveragesValidator = new (); - private ReportCardStudentCompetencyObjectivePutPostRequestValidator _reportCardStudentCompetencyObjectivesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -135170,50 +134807,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (ReportCardMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_ReportCard); - - if (mappingContract != null) - { - if (mappingContract.IsReportCardGradeIncluded != null) - { - var hasInvalidReportCardGradesItems = instance.ReportCardGrades.Any(x => !mappingContract.IsReportCardGradeIncluded(x)); - - if (hasInvalidReportCardGradesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ReportCardGrades", $"A supplied 'ReportCardGrade' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsReportCardGradePointAverageIncluded != null) - { - var hasInvalidReportCardGradePointAveragesItems = instance.ReportCardGradePointAverages.Any(x => !mappingContract.IsReportCardGradePointAverageIncluded(x)); - - if (hasInvalidReportCardGradePointAveragesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ReportCardGradePointAverages", $"A supplied 'ReportCardGradePointAverage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsReportCardStudentCompetencyObjectiveIncluded != null) - { - var hasInvalidReportCardStudentCompetencyObjectivesItems = instance.ReportCardStudentCompetencyObjectives.Any(x => !mappingContract.IsReportCardStudentCompetencyObjectiveIncluded(x)); - - if (hasInvalidReportCardStudentCompetencyObjectivesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("ReportCardStudentCompetencyObjectives", $"A supplied 'ReportCardStudentCompetencyObjective' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -135229,17 +134822,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ReportCardGrade table of the ReportCard aggregate in the ODS Database. + /// A class which represents the edfi.ProviderProfitabilityDescriptor table of the ProviderProfitabilityDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ReportCardGrade : Entities.Common.EdFi.IReportCardGrade, IValidatableObject + public class ProviderProfitabilityDescriptor : Entities.Common.EdFi.IProviderProfitabilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReportCardGrade"); + private static FullName _fullName = new FullName("edfi", "ProviderProfitabilityDescriptor"); // Fluent validator instance (threadsafe) - private static ReportCardGradePutPostRequestValidator _validator = new ReportCardGradePutPostRequestValidator(); + private static ProviderProfitabilityDescriptorPutPostRequestValidator _validator = new ProviderProfitabilityDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -135256,354 +134854,136 @@ public class ReportCardGrade : Entities.Common.EdFi.IReportCardGrade, IValidatab // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ProviderProfitabilityDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _gradeReferenceExplicitlyAssigned; - private Grade.EdFi.GradeReference _gradeReference; - private Grade.EdFi.GradeReference ImplicitGradeReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_gradeReference == null && !_gradeReferenceExplicitlyAssigned) - _gradeReference = new Grade.EdFi.GradeReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- - return _gradeReference; - } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ProviderProfitabilityDescriptorId { get; set; } - [DataMember(Name="gradeReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Grade.EdFi.GradeReference GradeReference + int IDescriptor.DescriptorId { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGradeReference != null - && (_gradeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference; - - return null; - } - set - { - _gradeReferenceExplicitlyAssigned = true; - _gradeReference = value; - } + get { return ProviderProfitabilityDescriptorId; } + set { ProviderProfitabilityDescriptorId = value; } } // ------------------------------------------------------------- - //============================================================== - // Primary Key + // ============================================================= + // Equality // ------------------------------------------------------------- - private Entities.Common.EdFi.IReportCard _reportCard; - [IgnoreDataMember] - Entities.Common.EdFi.IReportCard IReportCardGrade.ReportCard + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get { return _reportCard; } - set { SetReportCard(value); } - } + var compareTo = obj as Entities.Common.EdFi.IProviderProfitabilityDescriptor; - public Entities.Common.EdFi.IReportCard ReportCard - { - set { SetReportCard(value); } - } + if (ReferenceEquals(this, compareTo)) + return true; - private void SetReportCard(Entities.Common.EdFi.IReportCard value) - { - _reportCard = value; + if (compareTo == null) + return false; - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_gradeReferenceExplicitlyAssigned) - { - ImplicitGradeReference.GradingPeriodDescriptor = _reportCard.GradingPeriodDescriptor; - ImplicitGradeReference.GradingPeriodName = _reportCard.GradingPeriodName; - ImplicitGradeReference.GradingPeriodSchoolYear = _reportCard.GradingPeriodSchoolYear; - ImplicitGradeReference.StudentUniqueId = _reportCard.StudentUniqueId; - } + + // Derived Property + if (!(this as Entities.Common.EdFi.IProviderProfitabilityDescriptor).ProviderProfitabilityDescriptorId.Equals(compareTo.ProviderProfitabilityDescriptorId)) + return false; + + + return true; } /// - /// Month, day, and year of the student's entry or assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Builds the hash code based on the unique identifying values. /// - // IS in a reference, NOT a lookup column - DateTime Entities.Common.EdFi.IReportCardGrade.BeginDate + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - get - { - if (ImplicitGradeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference.BeginDate; - - return default(DateTime); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Grade - _gradeReferenceExplicitlyAssigned = false; - ImplicitGradeReference.BeginDate = value; - } - } - - /// - /// The type of grade reported (e.g., exam, final, grading period). - /// + var hash = new HashCode(); - // IS in a reference (ReportCardGrade.GradeTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IReportCardGrade.GradeTypeDescriptor - { - get - { - if (ImplicitGradeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference.GradeTypeDescriptor; + //Derived Property + hash.Add((this as Entities.Common.EdFi.IProviderProfitabilityDescriptor).ProviderProfitabilityDescriptorId); - return null; - } - set - { - ImplicitGradeReference.GradeTypeDescriptor = value; - } + return hash.ToHashCode(); } + // ------------------------------------------------------------- - /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IReportCardGrade.LocalCourseCode - { - get - { - if (ImplicitGradeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference.LocalCourseCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Grade - _gradeReferenceExplicitlyAssigned = false; - ImplicitGradeReference.LocalCourseCode = value; - } - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// A code or abbreviation that is used to refer to the descriptor. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IReportCardGrade.SchoolId - { - get - { - if (ImplicitGradeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Grade - _gradeReferenceExplicitlyAssigned = false; - ImplicitGradeReference.SchoolId = value; - } - } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The identifier for the school year. + /// The description of the descriptor. /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IReportCardGrade.SchoolYear - { - get - { - if (ImplicitGradeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Grade - _gradeReferenceExplicitlyAssigned = false; - ImplicitGradeReference.SchoolYear = value; - } - } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The local identifier assigned to a section. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IReportCardGrade.SectionIdentifier - { - get - { - if (ImplicitGradeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference.SectionIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Grade - _gradeReferenceExplicitlyAssigned = false; - ImplicitGradeReference.SectionIdentifier = value; - } - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The identifier for the calendar for the academic session. + /// The end date of the period when the descriptor is in effect. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IReportCardGrade.SessionName - { - get - { - if (ImplicitGradeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) - return ImplicitGradeReference.SessionName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Grade - _gradeReferenceExplicitlyAssigned = false; - ImplicitGradeReference.SessionName = value; - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// Determines equality based on the natural key properties of the resource. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IReportCardGrade; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_reportCard == null || !_reportCard.Equals(compareTo.ReportCard)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IReportCardGrade).BeginDate.Equals(compareTo.BeginDate)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCardGrade).GradeTypeDescriptor, compareTo.GradeTypeDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardGrade).LocalCourseCode, compareTo.LocalCourseCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IReportCardGrade).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IReportCardGrade).SchoolYear.Equals(compareTo.SchoolYear)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardGrade).SectionIdentifier, compareTo.SectionIdentifier)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardGrade).SessionName, compareTo.SessionName)) - return false; - - - return true; - } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// Builds the hash code based on the unique identifying values. + /// A shortened description for the descriptor. /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_reportCard != null) - hash.Add(_reportCard); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardGrade).BeginDate); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IReportCardGrade).GradeTypeDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardGrade).LocalCourseCode); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SchoolId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SchoolYear); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SectionIdentifier); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SessionName); - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -135629,8 +135009,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCardGrade")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -135641,17 +135024,18 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -135659,208 +135043,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReportCardGradeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCardGrade)target); + return Entities.Common.EdFi.ProviderProfitabilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProviderProfitabilityDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReportCardGradeMapper.MapTo(this, (Entities.Common.EdFi.IReportCardGrade)target, null); + Entities.Common.EdFi.ProviderProfitabilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProviderProfitabilityDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IReportCardGrade.GradeResourceId - { - get { return null; } - set { ImplicitGradeReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IReportCardGrade.GradeDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitGradeReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForGradingPeriodDescriptor = GetGradingPeriodDescriptorSources().ToArray(); - - if (!sourcesForGradingPeriodDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForGradingPeriodDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForGradingPeriodDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForGradingPeriodDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetGradingPeriodDescriptorSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.GradingPeriodDescriptor); - - // Obtain value from other references - var valueFromGradeReference = this.GradeReference?.GradingPeriodDescriptor; - - if (valueFromGradeReference != null) - { - yield return ("gradeReference.gradingPeriodDescriptor", this.GradeReference.GradingPeriodDescriptor); - } - - } - var sourcesForGradingPeriodName = GetGradingPeriodNameSources().ToArray(); - - if (!sourcesForGradingPeriodName.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForGradingPeriodName.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForGradingPeriodName.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodName' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForGradingPeriodName.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetGradingPeriodNameSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.GradingPeriodName); - - // Obtain value from other references - var valueFromGradeReference = this.GradeReference?.GradingPeriodName; - - if (valueFromGradeReference != null) - { - yield return ("gradeReference.gradingPeriodName", this.GradeReference.GradingPeriodName); - } - - } - var sourcesForGradingPeriodSchoolYear = GetGradingPeriodSchoolYearSources().ToArray(); - - if (!sourcesForGradingPeriodSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForGradingPeriodSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForGradingPeriodSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodSchoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForGradingPeriodSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, short value)> GetGradingPeriodSchoolYearSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.GradingPeriodSchoolYear); - - // Obtain value from other references - var valueFromGradeReference = this.GradeReference?.GradingPeriodSchoolYear; - - if (valueFromGradeReference != null) - { - yield return ("gradeReference.gradingPeriodSchoolYear", this.GradeReference.GradingPeriodSchoolYear); - } - - } - var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); - - if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetStudentUniqueIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.StudentUniqueId); - - // Obtain value from other references - var valueFromGradeReference = this.GradeReference?.StudentUniqueId; - - if (valueFromGradeReference != null) - { - yield return ("gradeReference.studentUniqueId", this.GradeReference.StudentUniqueId); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -135868,9 +135063,9 @@ string Entities.Common.EdFi.IReportCardGrade.GradeDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ReportCardGradePutPostRequestValidator : FluentValidation.AbstractValidator + public class ProviderProfitabilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -135898,18 +135093,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ReportCardGradePointAverage table of the ReportCard aggregate in the ODS Database. + /// A class which represents the edfi.ProviderStatusDescriptor table of the ProviderStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class ReportCardGradePointAverage : Entities.Common.EdFi.IReportCardGradePointAverage, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class ProviderStatusDescriptor : Entities.Common.EdFi.IProviderStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReportCardGradePointAverage"); + private static FullName _fullName = new FullName("edfi", "ProviderStatusDescriptor"); // Fluent validator instance (threadsafe) - private static ReportCardGradePointAveragePutPostRequestValidator _validator = new ReportCardGradePointAveragePutPostRequestValidator(); + private static ProviderStatusDescriptorPutPostRequestValidator _validator = new ProviderStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -135926,6 +135125,13 @@ public class ReportCardGradePointAverage : Entities.Common.EdFi.IReportCardGrade // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ProviderStatusDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -135936,33 +135142,19 @@ public class ReportCardGradePointAverage : Entities.Common.EdFi.IReportCardGrade //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IReportCard _reportCard; - - [IgnoreDataMember] - Entities.Common.EdFi.IReportCard IReportCardGradePointAverage.ReportCard - { - get { return _reportCard; } - set { SetReportCard(value); } - } - public Entities.Common.EdFi.IReportCard ReportCard - { - set { SetReportCard(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ProviderStatusDescriptorId { get; set; } - private void SetReportCard(Entities.Common.EdFi.IReportCard value) + int IDescriptor.DescriptorId { - _reportCard = value; + get { return ProviderStatusDescriptorId; } + set { ProviderStatusDescriptorId = value; } } - - /// - /// The system used for calculating the grade point average for an individual. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradePointAverageTypeDescriptor")][DescriptorExists("GradePointAverageTypeDescriptor")] - public string GradePointAverageTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -135977,7 +135169,7 @@ private void SetReportCard(Entities.Common.EdFi.IReportCard value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IReportCardGradePointAverage; + var compareTo = obj as Entities.Common.EdFi.IProviderStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -135985,13 +135177,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_reportCard == null || !_reportCard.Equals(compareTo.ReportCard)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCardGradePointAverage).GradePointAverageTypeDescriptor, compareTo.GradePointAverageTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IProviderStatusDescriptor).ProviderStatusDescriptorId.Equals(compareTo.ProviderStatusDescriptorId)) return false; @@ -136007,12 +135195,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_reportCard != null) - hash.Add(_reportCard); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IReportCardGradePointAverage).GradePointAverageTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IProviderStatusDescriptor).ProviderStatusDescriptorId); return hash.ToHashCode(); } @@ -136021,55 +135206,61 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - - private bool _gradePointAverageValueExplicitlyAssigned = false; - private decimal _gradePointAverageValue; + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The value of the grade points earned divided by the number of credits attempted. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="gradePointAverageValue")] - public decimal GradePointAverageValue - { - get => _gradePointAverageValue; - set - { - _gradePointAverageValue = value; - _gradePointAverageValueExplicitlyAssigned = true; - } - } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// Indicator of whether or not the Grade Point Average value is cumulative. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="isCumulative")] - public bool? IsCumulative { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The maximum value for the grade point average. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxGradePointAverageValue")] - public decimal? MaxGradePointAverageValue { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_gradePointAverageValueExplicitlyAssigned) - { - yield return "GradePointAverageValue"; - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -136089,8 +135280,11 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCardGradePointAverage")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -136101,6 +135295,13 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -136113,12 +135314,12 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReportCardGradePointAverageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCardGradePointAverage)target); + return Entities.Common.EdFi.ProviderStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IProviderStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReportCardGradePointAverageMapper.MapTo(this, (Entities.Common.EdFi.IReportCardGradePointAverage)target, null); + Entities.Common.EdFi.ProviderStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IProviderStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -136126,66 +135327,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -136193,9 +135334,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ReportCardGradePointAveragePutPostRequestValidator : FluentValidation.AbstractValidator + public class ProviderStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -136223,17 +135364,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ReportCardStudentCompetencyObjective table of the ReportCard aggregate in the ODS Database. + /// A class which represents the edfi.PublicationStatusDescriptor table of the PublicationStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ReportCardStudentCompetencyObjective : Entities.Common.EdFi.IReportCardStudentCompetencyObjective, IValidatableObject + public class PublicationStatusDescriptor : Entities.Common.EdFi.IPublicationStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReportCardStudentCompetencyObjective"); + private static FullName _fullName = new FullName("edfi", "PublicationStatusDescriptor"); // Fluent validator instance (threadsafe) - private static ReportCardStudentCompetencyObjectivePutPostRequestValidator _validator = new ReportCardStudentCompetencyObjectivePutPostRequestValidator(); + private static PublicationStatusDescriptorPutPostRequestValidator _validator = new PublicationStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -136250,148 +135396,35 @@ public class ReportCardStudentCompetencyObjective : Entities.Common.EdFi.IReport // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the PublicationStatusDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _studentCompetencyObjectiveReferenceExplicitlyAssigned; - private StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference _studentCompetencyObjectiveReference; - private StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference ImplicitStudentCompetencyObjectiveReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentCompetencyObjectiveReference == null && !_studentCompetencyObjectiveReferenceExplicitlyAssigned) - _studentCompetencyObjectiveReference = new StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference(); - - return _studentCompetencyObjectiveReference; - } - } - - [DataMember(Name="studentCompetencyObjectiveReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference StudentCompetencyObjectiveReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentCompetencyObjectiveReference != null - && (_studentCompetencyObjectiveReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitStudentCompetencyObjectiveReference; - - return null; - } - set - { - _studentCompetencyObjectiveReferenceExplicitlyAssigned = true; - _studentCompetencyObjectiveReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IReportCard _reportCard; - - [IgnoreDataMember] - Entities.Common.EdFi.IReportCard IReportCardStudentCompetencyObjective.ReportCard - { - get { return _reportCard; } - set { SetReportCard(value); } - } - - public Entities.Common.EdFi.IReportCard ReportCard - { - set { SetReportCard(value); } - } - - private void SetReportCard(Entities.Common.EdFi.IReportCard value) - { - _reportCard = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_studentCompetencyObjectiveReferenceExplicitlyAssigned) - { - ImplicitStudentCompetencyObjectiveReference.GradingPeriodDescriptor = _reportCard.GradingPeriodDescriptor; - ImplicitStudentCompetencyObjectiveReference.GradingPeriodName = _reportCard.GradingPeriodName; - ImplicitStudentCompetencyObjectiveReference.GradingPeriodSchoolId = _reportCard.GradingPeriodSchoolId; - ImplicitStudentCompetencyObjectiveReference.GradingPeriodSchoolYear = _reportCard.GradingPeriodSchoolYear; - ImplicitStudentCompetencyObjectiveReference.StudentUniqueId = _reportCard.StudentUniqueId; - } - } - - /// - /// The designated title of the competency objective. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.Objective - { - get - { - if (ImplicitStudentCompetencyObjectiveReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitStudentCompetencyObjectiveReference.Objective; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentCompetencyObjective - _studentCompetencyObjectiveReferenceExplicitlyAssigned = false; - ImplicitStudentCompetencyObjectiveReference.Objective = value; - } - } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IReportCardStudentCompetencyObjective.ObjectiveEducationOrganizationId - { - get - { - if (ImplicitStudentCompetencyObjectiveReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitStudentCompetencyObjectiveReference.ObjectiveEducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentCompetencyObjective - _studentCompetencyObjectiveReferenceExplicitlyAssigned = false; - ImplicitStudentCompetencyObjectiveReference.ObjectiveEducationOrganizationId = value; - } - } /// - /// The grade level for which the competency objective is targeted. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int PublicationStatusDescriptorId { get; set; } - // IS in a reference (ReportCardStudentCompetencyObjective.ObjectiveGradeLevelDescriptorId), IS a lookup column - string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.ObjectiveGradeLevelDescriptor + int IDescriptor.DescriptorId { - get - { - if (ImplicitStudentCompetencyObjectiveReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitStudentCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor; - - return null; - } - set - { - ImplicitStudentCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor = value; - } + get { return PublicationStatusDescriptorId; } + set { PublicationStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -136407,7 +135440,7 @@ string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.ObjectiveGrade /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IReportCardStudentCompetencyObjective; + var compareTo = obj as Entities.Common.EdFi.IPublicationStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -136415,23 +135448,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_reportCard == null || !_reportCard.Equals(compareTo.ReportCard)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).Objective, compareTo.Objective)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveEducationOrganizationId.Equals(compareTo.ObjectiveEducationOrganizationId)) - return false; - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveGradeLevelDescriptor, compareTo.ObjectiveGradeLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IPublicationStatusDescriptor).PublicationStatusDescriptorId.Equals(compareTo.PublicationStatusDescriptorId)) return false; @@ -136447,18 +135466,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_reportCard != null) - hash.Add(_reportCard); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).Objective); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveEducationOrganizationId); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveGradeLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IPublicationStatusDescriptor).PublicationStatusDescriptorId); return hash.ToHashCode(); } @@ -136467,6 +135477,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -136492,8 +135551,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCardStudentCompetencyObjective")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -136504,17 +135566,18 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -136522,254 +135585,38 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReportCardStudentCompetencyObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCardStudentCompetencyObjective)target); + return Entities.Common.EdFi.PublicationStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IPublicationStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReportCardStudentCompetencyObjectiveMapper.MapTo(this, (Entities.Common.EdFi.IReportCardStudentCompetencyObjective)target, null); + Entities.Common.EdFi.PublicationStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IPublicationStatusDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveResourceId - { - get { return null; } - set { ImplicitStudentCompetencyObjectiveReference.ResourceId = value ?? default(Guid); } - } + // ----------------------------------------------------------------- + } - string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveDiscriminator + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class PublicationStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - // Not supported for Resources - get { return null; } - set { ImplicitStudentCompetencyObjectiveReference.Discriminator = value; } - } + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + return false; + } - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForGradingPeriodDescriptor = GetGradingPeriodDescriptorSources().ToArray(); - - if (!sourcesForGradingPeriodDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForGradingPeriodDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForGradingPeriodDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForGradingPeriodDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetGradingPeriodDescriptorSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodDescriptor); - - // Obtain value from other references - var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodDescriptor; - - if (valueFromStudentCompetencyObjectiveReference != null) - { - yield return ("studentCompetencyObjectiveReference.gradingPeriodDescriptor", this.StudentCompetencyObjectiveReference.GradingPeriodDescriptor); - } - - } - var sourcesForGradingPeriodName = GetGradingPeriodNameSources().ToArray(); - - if (!sourcesForGradingPeriodName.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForGradingPeriodName.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForGradingPeriodName.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodName' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForGradingPeriodName.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetGradingPeriodNameSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodName); - - // Obtain value from other references - var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodName; - - if (valueFromStudentCompetencyObjectiveReference != null) - { - yield return ("studentCompetencyObjectiveReference.gradingPeriodName", this.StudentCompetencyObjectiveReference.GradingPeriodName); - } - - } - var sourcesForGradingPeriodSchoolId = GetGradingPeriodSchoolIdSources().ToArray(); - - if (!sourcesForGradingPeriodSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForGradingPeriodSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForGradingPeriodSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodSchoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForGradingPeriodSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetGradingPeriodSchoolIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodSchoolId); - - // Obtain value from other references - var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodSchoolId; - - if (valueFromStudentCompetencyObjectiveReference != null) - { - yield return ("studentCompetencyObjectiveReference.gradingPeriodSchoolId", this.StudentCompetencyObjectiveReference.GradingPeriodSchoolId); - } - - } - var sourcesForGradingPeriodSchoolYear = GetGradingPeriodSchoolYearSources().ToArray(); - - if (!sourcesForGradingPeriodSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForGradingPeriodSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForGradingPeriodSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodSchoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForGradingPeriodSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, short value)> GetGradingPeriodSchoolYearSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodSchoolYear); - - // Obtain value from other references - var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodSchoolYear; - - if (valueFromStudentCompetencyObjectiveReference != null) - { - yield return ("studentCompetencyObjectiveReference.gradingPeriodSchoolYear", this.StudentCompetencyObjectiveReference.GradingPeriodSchoolYear); - } - - } - var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); - - if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetStudentUniqueIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.StudentUniqueId); - - // Obtain value from other references - var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.StudentUniqueId; - - if (valueFromStudentCompetencyObjectiveReference != null) - { - yield return ("studentCompetencyObjectiveReference.studentUniqueId", this.StudentCompetencyObjectiveReference.StudentUniqueId); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class ReportCardStudentCompetencyObjectivePutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; + var instance = context.InstanceToValidate; var failures = new List(); @@ -136789,21 +135636,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ReporterDescriptionDescriptor table of the ReporterDescriptionDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.QuestionFormDescriptor table of the QuestionFormDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ReporterDescriptionDescriptor : Entities.Common.EdFi.IReporterDescriptionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class QuestionFormDescriptor : Entities.Common.EdFi.IQuestionFormDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReporterDescriptionDescriptor"); + private static FullName _fullName = new FullName("edfi", "QuestionFormDescriptor"); // Fluent validator instance (threadsafe) - private static ReporterDescriptionDescriptorPutPostRequestValidator _validator = new ReporterDescriptionDescriptorPutPostRequestValidator(); + private static QuestionFormDescriptorPutPostRequestValidator _validator = new QuestionFormDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -136822,7 +135669,7 @@ public class ReporterDescriptionDescriptor : Entities.Common.EdFi.IReporterDescr // ------------------------------------------------------------ /// - /// The unique identifier for the ReporterDescriptionDescriptor resource. + /// The unique identifier for the QuestionFormDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -136843,12 +135690,12 @@ public class ReporterDescriptionDescriptor : Entities.Common.EdFi.IReporterDescr /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ReporterDescriptionDescriptorId { get; set; } + public int QuestionFormDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ReporterDescriptionDescriptorId; } - set { ReporterDescriptionDescriptorId = value; } + get { return QuestionFormDescriptorId; } + set { QuestionFormDescriptorId = value; } } // ------------------------------------------------------------- @@ -136864,7 +135711,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IReporterDescriptionDescriptor; + var compareTo = obj as Entities.Common.EdFi.IQuestionFormDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -136874,7 +135721,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IReporterDescriptionDescriptor).ReporterDescriptionDescriptorId.Equals(compareTo.ReporterDescriptionDescriptorId)) + if (!(this as Entities.Common.EdFi.IQuestionFormDescriptor).QuestionFormDescriptorId.Equals(compareTo.QuestionFormDescriptorId)) return false; @@ -136892,7 +135739,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IReporterDescriptionDescriptor).ReporterDescriptionDescriptorId); + hash.Add((this as Entities.Common.EdFi.IQuestionFormDescriptor).QuestionFormDescriptorId); return hash.ToHashCode(); } @@ -137009,12 +135856,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReporterDescriptionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReporterDescriptionDescriptor)target); + return Entities.Common.EdFi.QuestionFormDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IQuestionFormDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReporterDescriptionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReporterDescriptionDescriptor)target, null); + Entities.Common.EdFi.QuestionFormDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IQuestionFormDescriptor)target, null); } // ------------------------------------------------------------- @@ -137029,9 +135876,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ReporterDescriptionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class QuestionFormDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -137060,21 +135907,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ReportingTagDescriptor table of the ReportingTagDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.RaceDescriptor table of the RaceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ReportingTagDescriptor : Entities.Common.EdFi.IReportingTagDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class RaceDescriptor : Entities.Common.EdFi.IRaceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ReportingTagDescriptor"); + private static FullName _fullName = new FullName("edfi", "RaceDescriptor"); // Fluent validator instance (threadsafe) - private static ReportingTagDescriptorPutPostRequestValidator _validator = new ReportingTagDescriptorPutPostRequestValidator(); + private static RaceDescriptorPutPostRequestValidator _validator = new RaceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -137093,7 +135940,7 @@ public class ReportingTagDescriptor : Entities.Common.EdFi.IReportingTagDescript // ------------------------------------------------------------ /// - /// The unique identifier for the ReportingTagDescriptor resource. + /// The unique identifier for the RaceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -137114,12 +135961,12 @@ public class ReportingTagDescriptor : Entities.Common.EdFi.IReportingTagDescript /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ReportingTagDescriptorId { get; set; } + public int RaceDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ReportingTagDescriptorId; } - set { ReportingTagDescriptorId = value; } + get { return RaceDescriptorId; } + set { RaceDescriptorId = value; } } // ------------------------------------------------------------- @@ -137135,7 +135982,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IReportingTagDescriptor; + var compareTo = obj as Entities.Common.EdFi.IRaceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -137145,7 +135992,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IReportingTagDescriptor).ReportingTagDescriptorId.Equals(compareTo.ReportingTagDescriptorId)) + if (!(this as Entities.Common.EdFi.IRaceDescriptor).RaceDescriptorId.Equals(compareTo.RaceDescriptorId)) return false; @@ -137163,7 +136010,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IReportingTagDescriptor).ReportingTagDescriptorId); + hash.Add((this as Entities.Common.EdFi.IRaceDescriptor).RaceDescriptorId); return hash.ToHashCode(); } @@ -137280,12 +136127,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ReportingTagDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportingTagDescriptor)target); + return Entities.Common.EdFi.RaceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRaceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ReportingTagDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReportingTagDescriptor)target, null); + Entities.Common.EdFi.RaceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRaceDescriptor)target, null); } // ------------------------------------------------------------- @@ -137300,9 +136147,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ReportingTagDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class RaceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -137331,21 +136178,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ResidencyStatusDescriptor table of the ResidencyStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.RatingLevelDescriptor table of the RatingLevelDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ResidencyStatusDescriptor : Entities.Common.EdFi.IResidencyStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class RatingLevelDescriptor : Entities.Common.EdFi.IRatingLevelDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ResidencyStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "RatingLevelDescriptor"); // Fluent validator instance (threadsafe) - private static ResidencyStatusDescriptorPutPostRequestValidator _validator = new ResidencyStatusDescriptorPutPostRequestValidator(); + private static RatingLevelDescriptorPutPostRequestValidator _validator = new RatingLevelDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -137364,7 +136211,7 @@ public class ResidencyStatusDescriptor : Entities.Common.EdFi.IResidencyStatusDe // ------------------------------------------------------------ /// - /// The unique identifier for the ResidencyStatusDescriptor resource. + /// The unique identifier for the RatingLevelDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -137385,12 +136232,12 @@ public class ResidencyStatusDescriptor : Entities.Common.EdFi.IResidencyStatusDe /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ResidencyStatusDescriptorId { get; set; } + public int RatingLevelDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ResidencyStatusDescriptorId; } - set { ResidencyStatusDescriptorId = value; } + get { return RatingLevelDescriptorId; } + set { RatingLevelDescriptorId = value; } } // ------------------------------------------------------------- @@ -137406,7 +136253,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IResidencyStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IRatingLevelDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -137416,7 +136263,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IResidencyStatusDescriptor).ResidencyStatusDescriptorId.Equals(compareTo.ResidencyStatusDescriptorId)) + if (!(this as Entities.Common.EdFi.IRatingLevelDescriptor).RatingLevelDescriptorId.Equals(compareTo.RatingLevelDescriptorId)) return false; @@ -137434,7 +136281,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IResidencyStatusDescriptor).ResidencyStatusDescriptorId); + hash.Add((this as Entities.Common.EdFi.IRatingLevelDescriptor).RatingLevelDescriptorId); return hash.ToHashCode(); } @@ -137551,12 +136398,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ResidencyStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResidencyStatusDescriptor)target); + return Entities.Common.EdFi.RatingLevelDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRatingLevelDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ResidencyStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResidencyStatusDescriptor)target, null); + Entities.Common.EdFi.RatingLevelDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRatingLevelDescriptor)target, null); } // ------------------------------------------------------------- @@ -137571,9 +136418,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ResidencyStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class RatingLevelDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -137602,21 +136449,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ResponseIndicatorDescriptor table of the ResponseIndicatorDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ReasonExitedDescriptor table of the ReasonExitedDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ResponseIndicatorDescriptor : Entities.Common.EdFi.IResponseIndicatorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ReasonExitedDescriptor : Entities.Common.EdFi.IReasonExitedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ResponseIndicatorDescriptor"); + private static FullName _fullName = new FullName("edfi", "ReasonExitedDescriptor"); // Fluent validator instance (threadsafe) - private static ResponseIndicatorDescriptorPutPostRequestValidator _validator = new ResponseIndicatorDescriptorPutPostRequestValidator(); + private static ReasonExitedDescriptorPutPostRequestValidator _validator = new ReasonExitedDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -137635,7 +136482,7 @@ public class ResponseIndicatorDescriptor : Entities.Common.EdFi.IResponseIndicat // ------------------------------------------------------------ /// - /// The unique identifier for the ResponseIndicatorDescriptor resource. + /// The unique identifier for the ReasonExitedDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -137656,12 +136503,12 @@ public class ResponseIndicatorDescriptor : Entities.Common.EdFi.IResponseIndicat /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ResponseIndicatorDescriptorId { get; set; } + public int ReasonExitedDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ResponseIndicatorDescriptorId; } - set { ResponseIndicatorDescriptorId = value; } + get { return ReasonExitedDescriptorId; } + set { ReasonExitedDescriptorId = value; } } // ------------------------------------------------------------- @@ -137677,7 +136524,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IResponseIndicatorDescriptor; + var compareTo = obj as Entities.Common.EdFi.IReasonExitedDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -137687,7 +136534,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IResponseIndicatorDescriptor).ResponseIndicatorDescriptorId.Equals(compareTo.ResponseIndicatorDescriptorId)) + if (!(this as Entities.Common.EdFi.IReasonExitedDescriptor).ReasonExitedDescriptorId.Equals(compareTo.ReasonExitedDescriptorId)) return false; @@ -137705,7 +136552,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IResponseIndicatorDescriptor).ResponseIndicatorDescriptorId); + hash.Add((this as Entities.Common.EdFi.IReasonExitedDescriptor).ReasonExitedDescriptorId); return hash.ToHashCode(); } @@ -137822,12 +136669,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ResponseIndicatorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResponseIndicatorDescriptor)target); + return Entities.Common.EdFi.ReasonExitedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReasonExitedDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ResponseIndicatorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResponseIndicatorDescriptor)target, null); + Entities.Common.EdFi.ReasonExitedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReasonExitedDescriptor)target, null); } // ------------------------------------------------------------- @@ -137842,9 +136689,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ResponseIndicatorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReasonExitedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -137873,21 +136720,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ResponsibilityDescriptor table of the ResponsibilityDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ReasonNotTestedDescriptor table of the ReasonNotTestedDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ResponsibilityDescriptor : Entities.Common.EdFi.IResponsibilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ReasonNotTestedDescriptor : Entities.Common.EdFi.IReasonNotTestedDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "ResponsibilityDescriptor"); + private static FullName _fullName = new FullName("edfi", "ReasonNotTestedDescriptor"); // Fluent validator instance (threadsafe) - private static ResponsibilityDescriptorPutPostRequestValidator _validator = new ResponsibilityDescriptorPutPostRequestValidator(); + private static ReasonNotTestedDescriptorPutPostRequestValidator _validator = new ReasonNotTestedDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -137906,7 +136753,7 @@ public class ResponsibilityDescriptor : Entities.Common.EdFi.IResponsibilityDesc // ------------------------------------------------------------ /// - /// The unique identifier for the ResponsibilityDescriptor resource. + /// The unique identifier for the ReasonNotTestedDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -137927,12 +136774,12 @@ public class ResponsibilityDescriptor : Entities.Common.EdFi.IResponsibilityDesc /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int ResponsibilityDescriptorId { get; set; } + public int ReasonNotTestedDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return ResponsibilityDescriptorId; } - set { ResponsibilityDescriptorId = value; } + get { return ReasonNotTestedDescriptorId; } + set { ReasonNotTestedDescriptorId = value; } } // ------------------------------------------------------------- @@ -137948,7 +136795,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IResponsibilityDescriptor; + var compareTo = obj as Entities.Common.EdFi.IReasonNotTestedDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -137958,7 +136805,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IResponsibilityDescriptor).ResponsibilityDescriptorId.Equals(compareTo.ResponsibilityDescriptorId)) + if (!(this as Entities.Common.EdFi.IReasonNotTestedDescriptor).ReasonNotTestedDescriptorId.Equals(compareTo.ReasonNotTestedDescriptorId)) return false; @@ -137976,7 +136823,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IResponsibilityDescriptor).ResponsibilityDescriptorId); + hash.Add((this as Entities.Common.EdFi.IReasonNotTestedDescriptor).ReasonNotTestedDescriptorId); return hash.ToHashCode(); } @@ -138093,12 +136940,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ResponsibilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResponsibilityDescriptor)target); + return Entities.Common.EdFi.ReasonNotTestedDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReasonNotTestedDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ResponsibilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResponsibilityDescriptor)target, null); + Entities.Common.EdFi.ReasonNotTestedDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReasonNotTestedDescriptor)target, null); } // ------------------------------------------------------------- @@ -138113,9 +136960,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ResponsibilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReasonNotTestedDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -138144,135 +136991,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the RestraintEvent resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class RestraintEventReference : IResourceReference - { - [DataMember(Name="restraintEventIdentifier")] - public string RestraintEventIdentifier { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return RestraintEventIdentifier != default(string) && SchoolId != default(long) && StudentUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (RestraintEventIdentifier == default) - { - yield return "RestraintEventIdentifier"; - } - - if (SchoolId == default) - { - yield return "SchoolId"; - } - - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "RestraintEvent", - Href = $"/ed-fi/restraintEvents/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.RestraintEvent table of the RestraintEvent aggregate in the ODS Database. + /// A class which represents the edfi.RecognitionTypeDescriptor table of the RecognitionTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RestraintEvent : Entities.Common.EdFi.IRestraintEvent, IHasETag, IDateVersionedEntity, IValidatableObject + public class RecognitionTypeDescriptor : Entities.Common.EdFi.IRecognitionTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "RestraintEvent"); + private static FullName _fullName = new FullName("edfi", "RecognitionTypeDescriptor"); // Fluent validator instance (threadsafe) - private static RestraintEventPutPostRequestValidator _validator = new RestraintEventPutPostRequestValidator(); + private static RecognitionTypeDescriptorPutPostRequestValidator _validator = new RecognitionTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -138283,11 +137016,6 @@ public class RestraintEvent : Entities.Common.EdFi.IRestraintEvent, IHasETag, ID // Constructor // ------------------------------------------------------------- - public RestraintEvent() - { - RestraintEventPrograms = new List(); - RestraintEventReasons = new List(); - } // ------------------------------------------------------------ @@ -138296,7 +137024,7 @@ public RestraintEvent() // ------------------------------------------------------------ /// - /// The unique identifier for the RestraintEvent resource. + /// The unique identifier for the RecognitionTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -138306,106 +137034,6 @@ public RestraintEvent() // ============================================================= // References // ------------------------------------------------------------- - - private bool _disciplineIncidentReferenceExplicitlyAssigned; - private DisciplineIncident.EdFi.DisciplineIncidentReference _disciplineIncidentReference; - private DisciplineIncident.EdFi.DisciplineIncidentReference ImplicitDisciplineIncidentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_disciplineIncidentReference == null && !_disciplineIncidentReferenceExplicitlyAssigned) - _disciplineIncidentReference = new DisciplineIncident.EdFi.DisciplineIncidentReference(); - - return _disciplineIncidentReference; - } - } - - [DataMember(Name="disciplineIncidentReference")] - [FullyDefinedReference] - public DisciplineIncident.EdFi.DisciplineIncidentReference DisciplineIncidentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitDisciplineIncidentReference != null - && (_disciplineIncidentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - return ImplicitDisciplineIncidentReference; - - return null; - } - set - { - _disciplineIncidentReferenceExplicitlyAssigned = true; - _disciplineIncidentReference = value; - } - } - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); - - return _schoolReference; - } - } - - [DataMember(Name="schoolReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; - - return null; - } - set - { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; - } - } - private bool _studentReferenceExplicitlyAssigned; - private Student.EdFi.StudentReference _studentReference; - private Student.EdFi.StudentReference ImplicitStudentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentReference == null && !_studentReferenceExplicitlyAssigned) - _studentReference = new Student.EdFi.StudentReference(); - - return _studentReference; - } - } - - [DataMember(Name="studentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Student.EdFi.StudentReference StudentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentReference != null - && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference; - - return null; - } - set - { - _studentReferenceExplicitlyAssigned = true; - _studentReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -138413,67 +137041,16 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// A unique number or alphanumeric code assigned to a restraint event by a school, school system, state, or other agency or entity. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="restraintEventIdentifier")] - public string RestraintEventIdentifier { get; set; } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IRestraintEvent.SchoolId - { - get - { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // DisciplineIncident - _disciplineIncidentReferenceExplicitlyAssigned = false; - ImplicitDisciplineIncidentReference.SchoolId = value; - - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; - } - } + [JsonIgnore] + public int RecognitionTypeDescriptorId { get; set; } - /// - /// A unique alphanumeric code assigned to a student. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IRestraintEvent.StudentUniqueId + int IDescriptor.DescriptorId { - get - { - if (ImplicitStudentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Student - _studentReferenceExplicitlyAssigned = false; - ImplicitStudentReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } + get { return RecognitionTypeDescriptorId; } + set { RecognitionTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -138489,7 +137066,7 @@ string Entities.Common.EdFi.IRestraintEvent.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRestraintEvent; + var compareTo = obj as Entities.Common.EdFi.IRecognitionTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -138498,18 +137075,8 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IRestraintEvent).RestraintEventIdentifier, compareTo.RestraintEventIdentifier)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IRestraintEvent).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IRestraintEvent).StudentUniqueId, compareTo.StudentUniqueId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IRecognitionTypeDescriptor).RecognitionTypeDescriptorId.Equals(compareTo.RecognitionTypeDescriptorId)) return false; @@ -138526,15 +137093,9 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IRestraintEvent).RestraintEventIdentifier); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IRestraintEvent).SchoolId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IRecognitionTypeDescriptor).RecognitionTypeDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IRestraintEvent).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -138542,54 +137103,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The setting where the RestraintEvent was exercised. + /// The description of the descriptor. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="educationalEnvironmentDescriptor")][DescriptorExists("EducationalEnvironmentDescriptor")] - public string EducationalEnvironmentDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// Month, day, and year of the restraint event. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. + /// The end date of the period when the descriptor is in effect. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IRestraintEvent.IncidentIdentifier - { - get - { - if (ImplicitDisciplineIncidentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - { - return ImplicitDisciplineIncidentReference.IncidentIdentifier; - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } - // DisciplineIncident - _disciplineIncidentReferenceExplicitlyAssigned = false; - ImplicitDisciplineIncidentReference.IncidentIdentifier = value; - } - } + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -138610,73 +137177,16 @@ string Entities.Common.EdFi.IRestraintEvent.IncidentIdentifier // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "RestraintEvent", "RestraintEvent")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _restraintEventPrograms; - private ICollection _restraintEventProgramsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="programs")] - public ICollection RestraintEventPrograms - { - get { return _restraintEventPrograms; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IRestraintEventProgram)e.Item).RestraintEvent = this); - _restraintEventPrograms = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IRestraintEventProgram)e.Item).RestraintEvent = this; - _restraintEventProgramsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventPrograms - { - get { return _restraintEventProgramsCovariant; } - set { RestraintEventPrograms = new List(value.Cast()); } - } - - private ICollection _restraintEventReasons; - private ICollection _restraintEventReasonsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="reasons")] - public ICollection RestraintEventReasons - { - get { return _restraintEventReasons; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IRestraintEventReason)e.Item).RestraintEvent = this); - _restraintEventReasons = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IRestraintEventReason)e.Item).RestraintEvent = this; - _restraintEventReasonsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventReasons - { - get { return _restraintEventReasonsCovariant; } - set { RestraintEventReasons = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -138694,22 +137204,6 @@ public ICollection RestraintEventReasons // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_restraintEventPrograms != null) foreach (var item in _restraintEventPrograms) - { - item.RestraintEvent = this; - } - - if (_restraintEventReasons != null) foreach (var item in _restraintEventReasons) - { - item.RestraintEvent = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -138717,176 +137211,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RestraintEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEvent)target); + return Entities.Common.EdFi.RecognitionTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRecognitionTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RestraintEventMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEvent)target, null); + Entities.Common.EdFi.RecognitionTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRecognitionTypeDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentResourceId - { - get { return null; } - set { ImplicitDisciplineIncidentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitDisciplineIncidentReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IRestraintEvent.SchoolResourceId - { - get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IRestraintEvent.StudentResourceId - { - get { return null; } - set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IRestraintEvent.StudentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (RestraintEventPrograms.Any() && mappingContract?.IsMemberSupported("RestraintEventPrograms") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("RestraintEventPrograms"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(RestraintEventPrograms, validationContext, validationContext.Items.ForCollection("RestraintEventPrograms")))) - { - yield return result; - } - } - - if (RestraintEventReasons.Any() && mappingContract?.IsMemberSupported("RestraintEventReasons") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("RestraintEventReasons"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(RestraintEventReasons, validationContext, validationContext.Items.ForCollection("RestraintEventReasons")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetSchoolIdSources() - { - // Obtain value from other references - var valueFromSchoolReference = this.SchoolReference?.SchoolId; - - if (valueFromSchoolReference != null) - { - yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); - } - - // Obtain value from other references - var valueFromDisciplineIncidentReference = this.DisciplineIncidentReference?.SchoolId; - - if (valueFromDisciplineIncidentReference != null) - { - yield return ("disciplineIncidentReference.schoolId", this.DisciplineIncidentReference.SchoolId); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -138894,15 +137231,9 @@ string Entities.Common.EdFi.IRestraintEvent.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RestraintEventPutPostRequestValidator : FluentValidation.AbstractValidator + public class RecognitionTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_RestraintEvent = new FullName("edfi", "RestraintEvent"); - - // Declare collection item validators - private RestraintEventProgramPutPostRequestValidator _restraintEventProgramsValidator = new (); - private RestraintEventReasonPutPostRequestValidator _restraintEventReasonsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -138915,39 +137246,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (RestraintEventMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_RestraintEvent); - - if (mappingContract != null) - { - if (mappingContract.IsRestraintEventProgramIncluded != null) - { - var hasInvalidRestraintEventProgramsItems = instance.RestraintEventPrograms.Any(x => !mappingContract.IsRestraintEventProgramIncluded(x)); - - if (hasInvalidRestraintEventProgramsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("RestraintEventPrograms", $"A supplied 'RestraintEventProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsRestraintEventReasonIncluded != null) - { - var hasInvalidRestraintEventReasonsItems = instance.RestraintEventReasons.Any(x => !mappingContract.IsRestraintEventReasonIncluded(x)); - - if (hasInvalidRestraintEventReasonsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("RestraintEventReasons", $"A supplied 'RestraintEventReason' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -138963,17 +137261,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RestraintEventProgram table of the RestraintEvent aggregate in the ODS Database. + /// A class which represents the edfi.RelationDescriptor table of the RelationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RestraintEventProgram : Entities.Common.EdFi.IRestraintEventProgram, IValidatableObject + public class RelationDescriptor : Entities.Common.EdFi.IRelationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "RestraintEventProgram"); + private static FullName _fullName = new FullName("edfi", "RelationDescriptor"); // Fluent validator instance (threadsafe) - private static RestraintEventProgramPutPostRequestValidator _validator = new RestraintEventProgramPutPostRequestValidator(); + private static RelationDescriptorPutPostRequestValidator _validator = new RelationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -138990,138 +137293,35 @@ public class RestraintEventProgram : Entities.Common.EdFi.IRestraintEventProgram // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the RelationDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _programReferenceExplicitlyAssigned; - private Program.EdFi.ProgramReference _programReference; - private Program.EdFi.ProgramReference ImplicitProgramReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programReference == null && !_programReferenceExplicitlyAssigned) - _programReference = new Program.EdFi.ProgramReference(); - - return _programReference; - } - } - - [DataMember(Name="programReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Program.EdFi.ProgramReference ProgramReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramReference != null - && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference; - - return null; - } - set - { - _programReferenceExplicitlyAssigned = true; - _programReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IRestraintEvent _restraintEvent; - - [IgnoreDataMember] - Entities.Common.EdFi.IRestraintEvent IRestraintEventProgram.RestraintEvent - { - get { return _restraintEvent; } - set { SetRestraintEvent(value); } - } - - public Entities.Common.EdFi.IRestraintEvent RestraintEvent - { - set { SetRestraintEvent(value); } - } - - private void SetRestraintEvent(Entities.Common.EdFi.IRestraintEvent value) - { - _restraintEvent = value; - } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IRestraintEventProgram.EducationOrganizationId - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.EducationOrganizationId = value; - } - } - - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IRestraintEventProgram.ProgramName - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.ProgramName = value; - } - } /// - /// The type of program. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int RelationDescriptorId { get; set; } - // IS in a reference (RestraintEventProgram.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IRestraintEventProgram.ProgramTypeDescriptor + int IDescriptor.DescriptorId { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramReference.ProgramTypeDescriptor = value; - } + get { return RelationDescriptorId; } + set { RelationDescriptorId = value; } } // ------------------------------------------------------------- @@ -139137,7 +137337,7 @@ string Entities.Common.EdFi.IRestraintEventProgram.ProgramTypeDescriptor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRestraintEventProgram; + var compareTo = obj as Entities.Common.EdFi.IRelationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -139145,23 +137345,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_restraintEvent == null || !_restraintEvent.Equals(compareTo.RestraintEvent)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IRestraintEventProgram).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramName, compareTo.ProgramName)) - return false; - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IRelationDescriptor).RelationDescriptorId.Equals(compareTo.RelationDescriptorId)) return false; @@ -139177,18 +137363,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_restraintEvent != null) - hash.Add(_restraintEvent); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IRestraintEventProgram).EducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramName); - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IRelationDescriptor).RelationDescriptorId); return hash.ToHashCode(); } @@ -139197,6 +137374,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -139222,8 +137448,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "RestraintEvent", "RestraintEventProgram")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -139234,301 +137463,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.RestraintEventProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEventProgram)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.RestraintEventProgramMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEventProgram)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IRestraintEventProgram.ProgramResourceId - { - get { return null; } - set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IRestraintEventProgram.ProgramDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitProgramReference.Discriminator = value; } - } - - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class RestraintEventProgramPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - - /// - /// A class which represents the edfi.RestraintEventReason table of the RestraintEvent aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class RestraintEventReason : Entities.Common.EdFi.IRestraintEventReason, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "RestraintEventReason"); - - // Fluent validator instance (threadsafe) - private static RestraintEventReasonPutPostRequestValidator _validator = new RestraintEventReasonPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IRestraintEvent _restraintEvent; - - [IgnoreDataMember] - Entities.Common.EdFi.IRestraintEvent IRestraintEventReason.RestraintEvent - { - get { return _restraintEvent; } - set { SetRestraintEvent(value); } - } - - public Entities.Common.EdFi.IRestraintEvent RestraintEvent - { - set { SetRestraintEvent(value); } - } - - private void SetRestraintEvent(Entities.Common.EdFi.IRestraintEvent value) - { - _restraintEvent = value; - } - - /// - /// A categorization of the circumstances or reason for the RestraintEvent. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="restraintEventReasonDescriptor")][DescriptorExists("RestraintEventReasonDescriptor")] - public string RestraintEventReasonDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IRestraintEventReason; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_restraintEvent == null || !_restraintEvent.Equals(compareTo.RestraintEvent)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IRestraintEventReason).RestraintEventReasonDescriptor, compareTo.RestraintEventReasonDescriptor)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_restraintEvent != null) - hash.Add(_restraintEvent); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IRestraintEventReason).RestraintEventReasonDescriptor); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "RestraintEvent", "RestraintEventReason")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } - // ============================================================= - // Versioning - // ------------------------------------------------------------- // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -139541,12 +137482,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RestraintEventReasonMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEventReason)target); + return Entities.Common.EdFi.RelationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRelationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RestraintEventReasonMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEventReason)target, null); + Entities.Common.EdFi.RelationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRelationDescriptor)target, null); } // ------------------------------------------------------------- @@ -139554,66 +137495,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -139621,9 +137502,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RestraintEventReasonPutPostRequestValidator : FluentValidation.AbstractValidator + public class RelationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -139652,21 +137533,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RestraintEventReasonDescriptor table of the RestraintEventReasonDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.RepeatIdentifierDescriptor table of the RepeatIdentifierDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RestraintEventReasonDescriptor : Entities.Common.EdFi.IRestraintEventReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class RepeatIdentifierDescriptor : Entities.Common.EdFi.IRepeatIdentifierDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "RestraintEventReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "RepeatIdentifierDescriptor"); // Fluent validator instance (threadsafe) - private static RestraintEventReasonDescriptorPutPostRequestValidator _validator = new RestraintEventReasonDescriptorPutPostRequestValidator(); + private static RepeatIdentifierDescriptorPutPostRequestValidator _validator = new RepeatIdentifierDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -139685,7 +137566,7 @@ public class RestraintEventReasonDescriptor : Entities.Common.EdFi.IRestraintEve // ------------------------------------------------------------ /// - /// The unique identifier for the RestraintEventReasonDescriptor resource. + /// The unique identifier for the RepeatIdentifierDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -139706,12 +137587,12 @@ public class RestraintEventReasonDescriptor : Entities.Common.EdFi.IRestraintEve /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int RestraintEventReasonDescriptorId { get; set; } + public int RepeatIdentifierDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return RestraintEventReasonDescriptorId; } - set { RestraintEventReasonDescriptorId = value; } + get { return RepeatIdentifierDescriptorId; } + set { RepeatIdentifierDescriptorId = value; } } // ------------------------------------------------------------- @@ -139727,7 +137608,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRestraintEventReasonDescriptor; + var compareTo = obj as Entities.Common.EdFi.IRepeatIdentifierDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -139737,7 +137618,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.IRestraintEventReasonDescriptor).RestraintEventReasonDescriptorId.Equals(compareTo.RestraintEventReasonDescriptorId)) + if (!(this as Entities.Common.EdFi.IRepeatIdentifierDescriptor).RepeatIdentifierDescriptorId.Equals(compareTo.RepeatIdentifierDescriptorId)) return false; @@ -139755,7 +137636,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.IRestraintEventReasonDescriptor).RestraintEventReasonDescriptorId); + hash.Add((this as Entities.Common.EdFi.IRepeatIdentifierDescriptor).RepeatIdentifierDescriptorId); return hash.ToHashCode(); } @@ -139872,12 +137753,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RestraintEventReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEventReasonDescriptor)target); + return Entities.Common.EdFi.RepeatIdentifierDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRepeatIdentifierDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RestraintEventReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEventReasonDescriptor)target, null); + Entities.Common.EdFi.RepeatIdentifierDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRepeatIdentifierDescriptor)target, null); } // ------------------------------------------------------------- @@ -139892,9 +137773,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RestraintEventReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class RepeatIdentifierDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -139923,21 +137804,159 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ResultDatatypeTypeDescriptor table of the ResultDatatypeTypeDescriptor aggregate in the ODS Database. + /// Represents a reference to the ReportCard resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class ReportCardReference : IResourceReference + { + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] + public string GradingPeriodDescriptor { get; set; } + + [DataMember(Name="gradingPeriodName")] + public string GradingPeriodName { get; set; } + + [DataMember(Name="gradingPeriodSchoolId")] + public long GradingPeriodSchoolId { get; set; } + + [DataMember(Name="gradingPeriodSchoolYear")] + public short GradingPeriodSchoolYear { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationId != default(long) && GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && GradingPeriodSchoolId != default(long) && GradingPeriodSchoolYear != default(short) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (GradingPeriodDescriptor == default) + { + yield return "GradingPeriodDescriptor"; + } + + if (GradingPeriodName == default) + { + yield return "GradingPeriodName"; + } + + if (GradingPeriodSchoolId == default) + { + yield return "GradingPeriodSchoolId"; + } + + if (GradingPeriodSchoolYear == default) + { + yield return "GradingPeriodSchoolYear"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "ReportCard", + Href = $"/ed-fi/reportCards/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.ReportCard table of the ReportCard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ResultDatatypeTypeDescriptor : Entities.Common.EdFi.IResultDatatypeTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ReportCard : Entities.Common.EdFi.IReportCard, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ResultDatatypeTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "ReportCard"); // Fluent validator instance (threadsafe) - private static ResultDatatypeTypeDescriptorPutPostRequestValidator _validator = new ResultDatatypeTypeDescriptorPutPostRequestValidator(); + private static ReportCardPutPostRequestValidator _validator = new ReportCardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -139948,6 +137967,12 @@ public class ResultDatatypeTypeDescriptor : Entities.Common.EdFi.IResultDatatype // Constructor // ------------------------------------------------------------- + public ReportCard() + { + ReportCardGrades = new List(); + ReportCardGradePointAverages = new List(); + ReportCardStudentCompetencyObjectives = new List(); + } // ------------------------------------------------------------ @@ -139956,7 +137981,7 @@ public class ResultDatatypeTypeDescriptor : Entities.Common.EdFi.IResultDatatype // ------------------------------------------------------------ /// - /// The unique identifier for the ResultDatatypeTypeDescriptor resource. + /// The unique identifier for the ReportCard resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -139966,6 +137991,106 @@ public class ResultDatatypeTypeDescriptor : Entities.Common.EdFi.IResultDatatype // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } + private bool _gradingPeriodReferenceExplicitlyAssigned; + private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; + private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) + _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); + + return _gradingPeriodReference; + } + } + + [DataMember(Name="gradingPeriodReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitGradingPeriodReference != null + && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference; + + return null; + } + set + { + _gradingPeriodReferenceExplicitlyAssigned = true; + _gradingPeriodReference = value; + } + } + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); + + return _studentReference; + } + } + + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; + + return null; + } + set + { + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -139973,16 +138098,150 @@ public class ResultDatatypeTypeDescriptor : Entities.Common.EdFi.IResultDatatype // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ResultDatatypeTypeDescriptorId { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IReportCard.EducationOrganizationId + { + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; - int IDescriptor.DescriptorId + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } + + /// + /// The state's name of the period for which grades are reported. + /// + + // IS in a reference (ReportCard.GradingPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.IReportCard.GradingPeriodDescriptor { - get { return ResultDatatypeTypeDescriptorId; } - set { ResultDatatypeTypeDescriptorId = value; } + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodDescriptor; + + return null; + } + set + { + ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + } + } + + /// + /// The school's descriptive name of the grading period. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IReportCard.GradingPeriodName + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.GradingPeriodName = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IReportCard.GradingPeriodSchoolId + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolId = value; + } + } + + /// + /// The identifier for the grading period school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IReportCard.GradingPeriodSchoolYear + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolYear = value; + } + } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IReportCard.StudentUniqueId + { + get + { + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } } // ------------------------------------------------------------- @@ -139998,7 +138257,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IResultDatatypeTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IReportCard; if (ReferenceEquals(this, compareTo)) return true; @@ -140007,8 +138266,33 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IResultDatatypeTypeDescriptor).ResultDatatypeTypeDescriptorId.Equals(compareTo.ResultDatatypeTypeDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IReportCard).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCard).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCard).GradingPeriodName, compareTo.GradingPeriodName)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolId.Equals(compareTo.GradingPeriodSchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCard).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -140025,9 +138309,24 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IResultDatatypeTypeDescriptor).ResultDatatypeTypeDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCard).EducationOrganizationId); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCard).GradingPeriodSchoolYear); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCard).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -140035,60 +138334,35 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The end date of the period when the descriptor is in effect. + /// The number of days an individual is absent when school is in session during a given reporting period. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="numberOfDaysAbsent")] + public decimal? NumberOfDaysAbsent { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// The number of days an individual is present when school is in session during a given reporting period. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="numberOfDaysInAttendance")] + public decimal? NumberOfDaysInAttendance { get; set; } /// - /// A shortened description for the descriptor. + /// The number of days an individual is tardy during a given reporting period. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [Range(0, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="numberOfDaysTardy")] + public int? NumberOfDaysTardy { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -140109,16 +138383,103 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCard")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _reportCardGradePointAverages; + private ICollection _reportCardGradePointAveragesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="gradePointAverages")] + public ICollection ReportCardGradePointAverages + { + get { return _reportCardGradePointAverages; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IReportCardGradePointAverage)e.Item).ReportCard = this); + _reportCardGradePointAverages = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IReportCardGradePointAverage)e.Item).ReportCard = this; + _reportCardGradePointAveragesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IReportCard.ReportCardGradePointAverages + { + get { return _reportCardGradePointAveragesCovariant; } + set { ReportCardGradePointAverages = new List(value.Cast()); } + } + + private ICollection _reportCardGrades; + private ICollection _reportCardGradesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="grades")] + public ICollection ReportCardGrades + { + get { return _reportCardGrades; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IReportCardGrade)e.Item).ReportCard = this); + _reportCardGrades = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IReportCardGrade)e.Item).ReportCard = this; + _reportCardGradesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IReportCard.ReportCardGrades + { + get { return _reportCardGradesCovariant; } + set { ReportCardGrades = new List(value.Cast()); } + } + + private ICollection _reportCardStudentCompetencyObjectives; + private ICollection _reportCardStudentCompetencyObjectivesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="studentCompetencyObjectives")] + public ICollection ReportCardStudentCompetencyObjectives + { + get { return _reportCardStudentCompetencyObjectives; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IReportCardStudentCompetencyObjective)e.Item).ReportCard = this); + _reportCardStudentCompetencyObjectives = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IReportCardStudentCompetencyObjective)e.Item).ReportCard = this; + _reportCardStudentCompetencyObjectivesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IReportCard.ReportCardStudentCompetencyObjectives + { + get { return _reportCardStudentCompetencyObjectivesCovariant; } + set { ReportCardStudentCompetencyObjectives = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -140136,26 +138497,184 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.ResultDatatypeTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResultDatatypeTypeDescriptor)target); - } - void IMappable.Map(object target) + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) { - Entities.Common.EdFi.ResultDatatypeTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResultDatatypeTypeDescriptor)target, null); - } - // ------------------------------------------------------------- + // Reconnect collection item parent references on deserialization + if (_reportCardGradePointAverages != null) foreach (var item in _reportCardGradePointAverages) + { + item.ReportCard = this; + } + + if (_reportCardGrades != null) foreach (var item in _reportCardGrades) + { + item.ReportCard = this; + } + + if (_reportCardStudentCompetencyObjectives != null) foreach (var item in _reportCardStudentCompetencyObjectives) + { + item.ReportCard = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.ReportCardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCard)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.ReportCardMapper.MapTo(this, (Entities.Common.EdFi.IReportCard)target, null); + } + // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IReportCard.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IReportCard.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IReportCard.GradingPeriodResourceId + { + get { return null; } + set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IReportCard.GradingPeriodDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitGradingPeriodReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IReportCard.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IReportCard.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (ReportCardGradePointAverages.Any() && mappingContract?.IsMemberSupported("ReportCardGradePointAverages") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ReportCardGradePointAverages"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ReportCardGradePointAverages, validationContext, validationContext.Items.ForCollection("ReportCardGradePointAverages")))) + { + yield return result; + } + } + + if (ReportCardGrades.Any() && mappingContract?.IsMemberSupported("ReportCardGrades") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ReportCardGrades"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ReportCardGrades, validationContext, validationContext.Items.ForCollection("ReportCardGrades")))) + { + yield return result; + } + } + + if (ReportCardStudentCompetencyObjectives.Any() && mappingContract?.IsMemberSupported("ReportCardStudentCompetencyObjectives") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("ReportCardStudentCompetencyObjectives"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(ReportCardStudentCompetencyObjectives, validationContext, validationContext.Items.ForCollection("ReportCardStudentCompetencyObjectives")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -140163,9 +138682,16 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ResultDatatypeTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReportCardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_ReportCard = new FullName("edfi", "ReportCard"); + + // Declare collection item validators + private ReportCardGradePutPostRequestValidator _reportCardGradesValidator = new (); + private ReportCardGradePointAveragePutPostRequestValidator _reportCardGradePointAveragesValidator = new (); + private ReportCardStudentCompetencyObjectivePutPostRequestValidator _reportCardStudentCompetencyObjectivesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -140178,6 +138704,50 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (ReportCardMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_ReportCard); + + if (mappingContract != null) + { + if (mappingContract.IsReportCardGradeIncluded != null) + { + var hasInvalidReportCardGradesItems = instance.ReportCardGrades.Any(x => !mappingContract.IsReportCardGradeIncluded(x)); + + if (hasInvalidReportCardGradesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ReportCardGrades", $"A supplied 'ReportCardGrade' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsReportCardGradePointAverageIncluded != null) + { + var hasInvalidReportCardGradePointAveragesItems = instance.ReportCardGradePointAverages.Any(x => !mappingContract.IsReportCardGradePointAverageIncluded(x)); + + if (hasInvalidReportCardGradePointAveragesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ReportCardGradePointAverages", $"A supplied 'ReportCardGradePointAverage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsReportCardStudentCompetencyObjectiveIncluded != null) + { + var hasInvalidReportCardStudentCompetencyObjectivesItems = instance.ReportCardStudentCompetencyObjectives.Any(x => !mappingContract.IsReportCardStudentCompetencyObjectiveIncluded(x)); + + if (hasInvalidReportCardStudentCompetencyObjectivesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("ReportCardStudentCompetencyObjectives", $"A supplied 'ReportCardStudentCompetencyObjective' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -140193,22 +138763,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.RetestIndicatorDescriptor table of the RetestIndicatorDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ReportCardGrade table of the ReportCard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class RetestIndicatorDescriptor : Entities.Common.EdFi.IRetestIndicatorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ReportCardGrade : Entities.Common.EdFi.IReportCardGrade, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "RetestIndicatorDescriptor"); + private static FullName _fullName = new FullName("edfi", "ReportCardGrade"); // Fluent validator instance (threadsafe) - private static RetestIndicatorDescriptorPutPostRequestValidator _validator = new RetestIndicatorDescriptorPutPostRequestValidator(); + private static ReportCardGradePutPostRequestValidator _validator = new ReportCardGradePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -140225,35 +138790,247 @@ public class RetestIndicatorDescriptor : Entities.Common.EdFi.IRetestIndicatorDe // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the RetestIndicatorDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _gradeReferenceExplicitlyAssigned; + private Grade.EdFi.GradeReference _gradeReference; + private Grade.EdFi.GradeReference ImplicitGradeReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_gradeReference == null && !_gradeReferenceExplicitlyAssigned) + _gradeReference = new Grade.EdFi.GradeReference(); + + return _gradeReference; + } + } + + [DataMember(Name="gradeReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Grade.EdFi.GradeReference GradeReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitGradeReference != null + && (_gradeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference; + + return null; + } + set + { + _gradeReferenceExplicitlyAssigned = true; + _gradeReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IReportCard _reportCard; + + [IgnoreDataMember] + Entities.Common.EdFi.IReportCard IReportCardGrade.ReportCard + { + get { return _reportCard; } + set { SetReportCard(value); } + } + + public Entities.Common.EdFi.IReportCard ReportCard + { + set { SetReportCard(value); } + } + + private void SetReportCard(Entities.Common.EdFi.IReportCard value) + { + _reportCard = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_gradeReferenceExplicitlyAssigned) + { + ImplicitGradeReference.GradingPeriodDescriptor = _reportCard.GradingPeriodDescriptor; + ImplicitGradeReference.GradingPeriodName = _reportCard.GradingPeriodName; + ImplicitGradeReference.GradingPeriodSchoolYear = _reportCard.GradingPeriodSchoolYear; + ImplicitGradeReference.StudentUniqueId = _reportCard.StudentUniqueId; + } + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Month, day, and year of the student's entry or assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int RetestIndicatorDescriptorId { get; set; } + // IS in a reference, NOT a lookup column + DateTime Entities.Common.EdFi.IReportCardGrade.BeginDate + { + get + { + if (ImplicitGradeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference.BeginDate; - int IDescriptor.DescriptorId + return default(DateTime); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Grade + _gradeReferenceExplicitlyAssigned = false; + ImplicitGradeReference.BeginDate = value; + } + } + + /// + /// The type of grade reported (e.g., exam, final, grading period). + /// + + // IS in a reference (ReportCardGrade.GradeTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IReportCardGrade.GradeTypeDescriptor { - get { return RetestIndicatorDescriptorId; } - set { RetestIndicatorDescriptorId = value; } + get + { + if (ImplicitGradeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference.GradeTypeDescriptor; + + return null; + } + set + { + ImplicitGradeReference.GradeTypeDescriptor = value; + } + } + + /// + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IReportCardGrade.LocalCourseCode + { + get + { + if (ImplicitGradeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference.LocalCourseCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Grade + _gradeReferenceExplicitlyAssigned = false; + ImplicitGradeReference.LocalCourseCode = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IReportCardGrade.SchoolId + { + get + { + if (ImplicitGradeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Grade + _gradeReferenceExplicitlyAssigned = false; + ImplicitGradeReference.SchoolId = value; + } + } + + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IReportCardGrade.SchoolYear + { + get + { + if (ImplicitGradeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Grade + _gradeReferenceExplicitlyAssigned = false; + ImplicitGradeReference.SchoolYear = value; + } + } + + /// + /// The local identifier assigned to a section. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IReportCardGrade.SectionIdentifier + { + get + { + if (ImplicitGradeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference.SectionIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Grade + _gradeReferenceExplicitlyAssigned = false; + ImplicitGradeReference.SectionIdentifier = value; + } + } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IReportCardGrade.SessionName + { + get + { + if (ImplicitGradeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradeReference.IsReferenceFullyDefined())) + return ImplicitGradeReference.SessionName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Grade + _gradeReferenceExplicitlyAssigned = false; + ImplicitGradeReference.SessionName = value; + } } // ------------------------------------------------------------- @@ -140269,7 +139046,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IRetestIndicatorDescriptor; + var compareTo = obj as Entities.Common.EdFi.IReportCardGrade; if (ReferenceEquals(this, compareTo)) return true; @@ -140277,9 +139054,43 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_reportCard == null || !_reportCard.Equals(compareTo.ReportCard)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IRetestIndicatorDescriptor).RetestIndicatorDescriptorId.Equals(compareTo.RetestIndicatorDescriptorId)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IReportCardGrade).BeginDate.Equals(compareTo.BeginDate)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCardGrade).GradeTypeDescriptor, compareTo.GradeTypeDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardGrade).LocalCourseCode, compareTo.LocalCourseCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IReportCardGrade).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IReportCardGrade).SchoolYear.Equals(compareTo.SchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardGrade).SectionIdentifier, compareTo.SectionIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardGrade).SessionName, compareTo.SessionName)) return false; @@ -140295,66 +139106,38 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_reportCard != null) + hash.Add(_reportCard); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IRetestIndicatorDescriptor).RetestIndicatorDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardGrade).BeginDate); - return hash.ToHashCode(); - } - // ------------------------------------------------------------- + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IReportCardGrade).GradeTypeDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardGrade).LocalCourseCode); - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SchoolId); - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SchoolYear); - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SectionIdentifier); - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardGrade).SessionName); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -140380,11 +139163,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCardGrade")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -140395,18 +139175,17 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -140414,19 +139193,208 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.RetestIndicatorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRetestIndicatorDescriptor)target); + return Entities.Common.EdFi.ReportCardGradeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCardGrade)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.RetestIndicatorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRetestIndicatorDescriptor)target, null); + Entities.Common.EdFi.ReportCardGradeMapper.MapTo(this, (Entities.Common.EdFi.IReportCardGrade)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IReportCardGrade.GradeResourceId + { + get { return null; } + set { ImplicitGradeReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IReportCardGrade.GradeDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitGradeReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForGradingPeriodDescriptor = GetGradingPeriodDescriptorSources().ToArray(); + + if (!sourcesForGradingPeriodDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForGradingPeriodDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForGradingPeriodDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForGradingPeriodDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetGradingPeriodDescriptorSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.GradingPeriodDescriptor); + + // Obtain value from other references + var valueFromGradeReference = this.GradeReference?.GradingPeriodDescriptor; + + if (valueFromGradeReference != null) + { + yield return ("gradeReference.gradingPeriodDescriptor", this.GradeReference.GradingPeriodDescriptor); + } + + } + var sourcesForGradingPeriodName = GetGradingPeriodNameSources().ToArray(); + + if (!sourcesForGradingPeriodName.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForGradingPeriodName.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForGradingPeriodName.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodName' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForGradingPeriodName.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetGradingPeriodNameSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.GradingPeriodName); + + // Obtain value from other references + var valueFromGradeReference = this.GradeReference?.GradingPeriodName; + + if (valueFromGradeReference != null) + { + yield return ("gradeReference.gradingPeriodName", this.GradeReference.GradingPeriodName); + } + + } + var sourcesForGradingPeriodSchoolYear = GetGradingPeriodSchoolYearSources().ToArray(); + + if (!sourcesForGradingPeriodSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForGradingPeriodSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForGradingPeriodSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodSchoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForGradingPeriodSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, short value)> GetGradingPeriodSchoolYearSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.GradingPeriodSchoolYear); + + // Obtain value from other references + var valueFromGradeReference = this.GradeReference?.GradingPeriodSchoolYear; + + if (valueFromGradeReference != null) + { + yield return ("gradeReference.gradingPeriodSchoolYear", this.GradeReference.GradingPeriodSchoolYear); + } + + } + var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); + + if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetStudentUniqueIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardGrade).ReportCard.StudentUniqueId); + + // Obtain value from other references + var valueFromGradeReference = this.GradeReference?.StudentUniqueId; + + if (valueFromGradeReference != null) + { + yield return ("gradeReference.studentUniqueId", this.GradeReference.StudentUniqueId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -140434,9 +139402,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class RetestIndicatorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReportCardGradePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -140464,86 +139432,18 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the School resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class SchoolReference : IResourceReference - { - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return SchoolId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (SchoolId == default) - { - yield return "SchoolId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "School", - Href = $"/ed-fi/schools/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - /// - /// A class which represents the edfi.School table of the School aggregate in the ODS Database. + /// A class which represents the edfi.ReportCardGradePointAverage table of the ReportCard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class School : Entities.Common.EdFi.ISchool, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class ReportCardGradePointAverage : Entities.Common.EdFi.IReportCardGradePointAverage, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "School"); + private static FullName _fullName = new FullName("edfi", "ReportCardGradePointAverage"); // Fluent validator instance (threadsafe) - private static SchoolPutPostRequestValidator _validator = new SchoolPutPostRequestValidator(); + private static ReportCardGradePointAveragePutPostRequestValidator _validator = new ReportCardGradePointAveragePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -140554,123 +139454,49 @@ public class School : Entities.Common.EdFi.ISchool, Entities.Common.EdFi.IEducat // Constructor // ------------------------------------------------------------- - public School() - { - SchoolCategories = new List(); - SchoolGradeLevels = new List(); - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the School resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _charterApprovalSchoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _charterApprovalSchoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitCharterApprovalSchoolYearTypeReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_charterApprovalSchoolYearTypeReference == null && !_charterApprovalSchoolYearTypeReferenceExplicitlyAssigned) - _charterApprovalSchoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - - return _charterApprovalSchoolYearTypeReference; - } - } + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IReportCard _reportCard; - [DataMember(Name="charterApprovalSchoolYearTypeReference")] - [FullyDefinedReference] - public SchoolYearType.EdFi.SchoolYearTypeReference CharterApprovalSchoolYearTypeReference + [IgnoreDataMember] + Entities.Common.EdFi.IReportCard IReportCardGradePointAverage.ReportCard { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCharterApprovalSchoolYearTypeReference != null - && (_charterApprovalSchoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCharterApprovalSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitCharterApprovalSchoolYearTypeReference; - - return null; - } - set - { - _charterApprovalSchoolYearTypeReferenceExplicitlyAssigned = true; - _charterApprovalSchoolYearTypeReference = value; - } + get { return _reportCard; } + set { SetReportCard(value); } } - private bool _localEducationAgencyReferenceExplicitlyAssigned; - private LocalEducationAgency.EdFi.LocalEducationAgencyReference _localEducationAgencyReference; - private LocalEducationAgency.EdFi.LocalEducationAgencyReference ImplicitLocalEducationAgencyReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_localEducationAgencyReference == null && !_localEducationAgencyReferenceExplicitlyAssigned) - _localEducationAgencyReference = new LocalEducationAgency.EdFi.LocalEducationAgencyReference(); - return _localEducationAgencyReference; - } + public Entities.Common.EdFi.IReportCard ReportCard + { + set { SetReportCard(value); } } - [DataMember(Name="localEducationAgencyReference")] - [FullyDefinedReference] - public LocalEducationAgency.EdFi.LocalEducationAgencyReference LocalEducationAgencyReference + private void SetReportCard(Entities.Common.EdFi.IReportCard value) { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocalEducationAgencyReference != null - && (_localEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalEducationAgencyReference.IsReferenceFullyDefined())) - return ImplicitLocalEducationAgencyReference; - - return null; - } - set - { - _localEducationAgencyReferenceExplicitlyAssigned = true; - _localEducationAgencyReference = value; - } + _reportCard = value; } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The system used for calculating the grade point average for an individual. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - long IEducationOrganization.EducationOrganizationId - { - get { return SchoolId; } - set { SchoolId = value; } - } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradePointAverageTypeDescriptor")][DescriptorExists("GradePointAverageTypeDescriptor")] + public string GradePointAverageTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -140685,7 +139511,7 @@ long IEducationOrganization.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchool; + var compareTo = obj as Entities.Common.EdFi.IReportCardGradePointAverage; if (ReferenceEquals(this, compareTo)) return true; @@ -140693,9 +139519,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_reportCard == null || !_reportCard.Equals(compareTo.ReportCard)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ISchool).SchoolId.Equals(compareTo.SchoolId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCardGradePointAverage).GradePointAverageTypeDescriptor, compareTo.GradePointAverageTypeDescriptor)) return false; @@ -140711,9 +139541,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_reportCard != null) + hash.Add(_reportCard); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ISchool).SchoolId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IReportCardGradePointAverage).GradePointAverageTypeDescriptor); return hash.ToHashCode(); } @@ -140722,156 +139555,56 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _gradePointAverageValueExplicitlyAssigned = false; + private decimal _gradePointAverageValue; /// - /// The full, legally accepted name of the institution. + /// The value of the grade points earned divided by the number of credits attempted. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } + [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="gradePointAverageValue")] + public decimal GradePointAverageValue + { + get => _gradePointAverageValue; + set + { + _gradePointAverageValue = value; + _gradePointAverageValueExplicitlyAssigned = true; + } + } - /// - /// The current operational status of the education organization (e.g., active, inactive). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } /// - /// A short name for the institution. + /// Indicator of whether or not the Grade Point Average value is cumulative. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } + [DataMember(Name="isCumulative")] + public bool? IsCumulative { get; set; } /// - /// The public web site address (URL) for the education organization. + /// The maximum value for the grade point average. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties + [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxGradePointAverageValue")] + public decimal? MaxGradePointAverageValue { get; set; } // ------------------------------------------------------------- - /// - /// The type of education institution as classified by its funding source, for example public or private. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="administrativeFundingControlDescriptor")][DescriptorExists("AdministrativeFundingControlDescriptor")] - public string AdministrativeFundingControlDescriptor { get; set; } - - /// - /// The type of agency that approved the establishment or continuation of a charter school. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="charterApprovalAgencyTypeDescriptor")][DescriptorExists("CharterApprovalAgencyTypeDescriptor")] - public string CharterApprovalAgencyTypeDescriptor { get; set; } - - /// - /// The school year in which a charter school was initially approved. - /// - // IS in a reference, NOT a lookup column - short? Entities.Common.EdFi.ISchool.CharterApprovalSchoolYear - { - get - { - if (ImplicitCharterApprovalSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCharterApprovalSchoolYearTypeReference.IsReferenceFullyDefined())) - { - return ImplicitCharterApprovalSchoolYearTypeReference.SchoolYear; - } - - return default(short?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CharterApprovalSchoolYearType - _charterApprovalSchoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitCharterApprovalSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); - } - } - - /// - /// A school or agency providing free public elementary or secondary education to eligible students under a specific charter granted by the state legislature or other appropriate authority and designated by such authority to be a charter school. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="charterStatusDescriptor")][DescriptorExists("CharterStatusDescriptor")] - public string CharterStatusDescriptor { get; set; } - - /// - /// The type of Internet access available. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="internetAccessDescriptor")][DescriptorExists("InternetAccessDescriptor")] - public string InternetAccessDescriptor { get; set; } - - /// - /// The identifier assigned to a local education agency. It must be distinct from any other identifier assigned to educational organizations, such as a SchoolId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ISchool.LocalEducationAgencyId + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() { - get - { - if (ImplicitLocalEducationAgencyReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocalEducationAgencyReference.IsReferenceFullyDefined())) - { - return ImplicitLocalEducationAgencyReference.LocalEducationAgencyId; - } - - return default(long?); - } - set + if (!_gradePointAverageValueExplicitlyAssigned) { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // LocalEducationAgency - _localEducationAgencyReferenceExplicitlyAssigned = false; - ImplicitLocalEducationAgencyReference.LocalEducationAgencyId = value.GetValueOrDefault(); + yield return "GradePointAverageValue"; } } - /// - /// A school that has been designed: 1) to attract students of different racial/ethnic backgrounds for the purpose of reducing, preventing, or eliminating racial isolation; and/or 2) to provide an academic or social focus on a particular theme (e.g., science/math, performing arts, gifted/talented, or foreign language). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="magnetSpecialProgramEmphasisSchoolDescriptor")][DescriptorExists("MagnetSpecialProgramEmphasisSchoolDescriptor")] - public string MagnetSpecialProgramEmphasisSchoolDescriptor { get; set; } - - /// - /// The type of education institution as classified by its primary focus. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="schoolTypeDescriptor")][DescriptorExists("SchoolTypeDescriptor")] - public string SchoolTypeDescriptor { get; set; } - - /// - /// Denotes the Title I Part A designation for the school. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="titleIPartASchoolDesignationDescriptor")][DescriptorExists("TitleIPartASchoolDesignationDescriptor")] - public string TitleIPartASchoolDesignationDescriptor { get; set; } - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -140885,267 +139618,28 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses - { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses - { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } - } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="educationOrganizationCategories")] - public ICollection EducationOrganizationCategories - { - get { return _educationOrganizationCategories; } - set - { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodes; } - set - { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } - set - { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators - { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } - } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephones; } - set - { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } - } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddresses; } - set - { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses - { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } - } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "School", "School")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCardGradePointAverage")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _schoolCategories; - private ICollection _schoolCategoriesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="schoolCategories")] - public ICollection SchoolCategories - { - get { return _schoolCategories; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISchoolCategory)e.Item).School = this); - _schoolCategories = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISchoolCategory)e.Item).School = this; - _schoolCategoriesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISchool.SchoolCategories - { - get { return _schoolCategoriesCovariant; } - set { SchoolCategories = new List(value.Cast()); } - } - - private ICollection _schoolGradeLevels; - private ICollection _schoolGradeLevelsCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="gradeLevels")] - public ICollection SchoolGradeLevels - { - get { return _schoolGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISchoolGradeLevel)e.Item).School = this); - _schoolGradeLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISchoolGradeLevel)e.Item).School = this; - _schoolGradeLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISchool.SchoolGradeLevels - { - get { return _schoolGradeLevelsCovariant; } - set { SchoolGradeLevels = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) - { - item.EducationOrganization = this; - } - - if (_schoolCategories != null) foreach (var item in _schoolCategories) - { - item.School = this; - } - - if (_schoolGradeLevels != null) foreach (var item in _schoolGradeLevels) - { - item.School = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -141153,32 +139647,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchool)target); + return Entities.Common.EdFi.ReportCardGradePointAverageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCardGradePointAverage)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolMapper.MapTo(this, (Entities.Common.EdFi.ISchool)target, null); + Entities.Common.EdFi.ReportCardGradePointAverageMapper.MapTo(this, (Entities.Common.EdFi.IReportCardGradePointAverage)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISchool.CharterApprovalSchoolYearTypeResourceId - { - get { return null; } - set { ImplicitCharterApprovalSchoolYearTypeReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.ISchool.LocalEducationAgencyResourceId - { - get { return null; } - set { ImplicitLocalEducationAgencyReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- // ================================== @@ -141196,107 +139676,12 @@ void IMappable.Map(object target) try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) - { - yield return result; - } - } - - if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationCategories"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) - { - yield return result; - } - } - - if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIdentificationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) - { - yield return result; - } - } - - if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIndicators"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) - { - yield return result; - } - } - - if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInstitutionTelephones"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) - { - yield return result; - } - } - - if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInternationalAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) - { - yield return result; - } - } - - if (SchoolCategories.Any() && mappingContract?.IsMemberSupported("SchoolCategories") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SchoolCategories"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SchoolCategories, validationContext, validationContext.Items.ForCollection("SchoolCategories")))) - { - yield return result; - } - } - - if (SchoolGradeLevels.Any() && mappingContract?.IsMemberSupported("SchoolGradeLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SchoolGradeLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SchoolGradeLevels, validationContext, validationContext.Items.ForCollection("SchoolGradeLevels")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -141342,21 +139727,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReportCardGradePointAveragePutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_School = new FullName("edfi", "School"); - - // Declare collection item validators - private SchoolCategoryPutPostRequestValidator _schoolCategoriesValidator = new (); - private SchoolGradeLevelPutPostRequestValidator _schoolGradeLevelsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -141369,105 +139742,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext c var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (SchoolMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_School); - - if (mappingContract != null) - { - if (mappingContract.IsSchoolCategoryIncluded != null) - { - var hasInvalidSchoolCategoriesItems = instance.SchoolCategories.Any(x => !mappingContract.IsSchoolCategoryIncluded(x)); - - if (hasInvalidSchoolCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SchoolCategories", $"A supplied 'SchoolCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsSchoolGradeLevelIncluded != null) - { - var hasInvalidSchoolGradeLevelsItems = instance.SchoolGradeLevels.Any(x => !mappingContract.IsSchoolGradeLevelIncluded(x)); - - if (hasInvalidSchoolGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SchoolGradeLevels", $"A supplied 'SchoolGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationAddressIncluded != null) - { - var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); - - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) - { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - - if (hasInvalidEducationOrganizationInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -141484,16 +139758,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext c // ----------------------------------------------------------------- /// - /// A class which represents the edfi.SchoolCategory table of the School aggregate in the ODS Database. + /// A class which represents the edfi.ReportCardStudentCompetencyObjective table of the ReportCard aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SchoolCategory : Entities.Common.EdFi.ISchoolCategory, IValidatableObject + public class ReportCardStudentCompetencyObjective : Entities.Common.EdFi.IReportCardStudentCompetencyObjective, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SchoolCategory"); + private static FullName _fullName = new FullName("edfi", "ReportCardStudentCompetencyObjective"); // Fluent validator instance (threadsafe) - private static SchoolCategoryPutPostRequestValidator _validator = new SchoolCategoryPutPostRequestValidator(); + private static ReportCardStudentCompetencyObjectivePutPostRequestValidator _validator = new ReportCardStudentCompetencyObjectivePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -141515,38 +139789,144 @@ public class SchoolCategory : Entities.Common.EdFi.ISchoolCategory, IValidatable // ============================================================= // References // ------------------------------------------------------------- + + private bool _studentCompetencyObjectiveReferenceExplicitlyAssigned; + private StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference _studentCompetencyObjectiveReference; + private StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference ImplicitStudentCompetencyObjectiveReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentCompetencyObjectiveReference == null && !_studentCompetencyObjectiveReferenceExplicitlyAssigned) + _studentCompetencyObjectiveReference = new StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference(); + + return _studentCompetencyObjectiveReference; + } + } + + [DataMember(Name="studentCompetencyObjectiveReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentCompetencyObjective.EdFi.StudentCompetencyObjectiveReference StudentCompetencyObjectiveReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentCompetencyObjectiveReference != null + && (_studentCompetencyObjectiveReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitStudentCompetencyObjectiveReference; + + return null; + } + set + { + _studentCompetencyObjectiveReferenceExplicitlyAssigned = true; + _studentCompetencyObjectiveReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISchool _school; + private Entities.Common.EdFi.IReportCard _reportCard; [IgnoreDataMember] - Entities.Common.EdFi.ISchool ISchoolCategory.School + Entities.Common.EdFi.IReportCard IReportCardStudentCompetencyObjective.ReportCard { - get { return _school; } - set { SetSchool(value); } + get { return _reportCard; } + set { SetReportCard(value); } } - public Entities.Common.EdFi.ISchool School + public Entities.Common.EdFi.IReportCard ReportCard { - set { SetSchool(value); } + set { SetReportCard(value); } } - private void SetSchool(Entities.Common.EdFi.ISchool value) + private void SetReportCard(Entities.Common.EdFi.IReportCard value) { - _school = value; + _reportCard = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_studentCompetencyObjectiveReferenceExplicitlyAssigned) + { + ImplicitStudentCompetencyObjectiveReference.GradingPeriodDescriptor = _reportCard.GradingPeriodDescriptor; + ImplicitStudentCompetencyObjectiveReference.GradingPeriodName = _reportCard.GradingPeriodName; + ImplicitStudentCompetencyObjectiveReference.GradingPeriodSchoolId = _reportCard.GradingPeriodSchoolId; + ImplicitStudentCompetencyObjectiveReference.GradingPeriodSchoolYear = _reportCard.GradingPeriodSchoolYear; + ImplicitStudentCompetencyObjectiveReference.StudentUniqueId = _reportCard.StudentUniqueId; + } } /// - /// The one or more categories of school. + /// The designated title of the competency objective. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="schoolCategoryDescriptor")][DescriptorExists("SchoolCategoryDescriptor")] - public string SchoolCategoryDescriptor { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.Objective + { + get + { + if (ImplicitStudentCompetencyObjectiveReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitStudentCompetencyObjectiveReference.Objective; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentCompetencyObjective + _studentCompetencyObjectiveReferenceExplicitlyAssigned = false; + ImplicitStudentCompetencyObjectiveReference.Objective = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IReportCardStudentCompetencyObjective.ObjectiveEducationOrganizationId + { + get + { + if (ImplicitStudentCompetencyObjectiveReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitStudentCompetencyObjectiveReference.ObjectiveEducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentCompetencyObjective + _studentCompetencyObjectiveReferenceExplicitlyAssigned = false; + ImplicitStudentCompetencyObjectiveReference.ObjectiveEducationOrganizationId = value; + } + } + + /// + /// The grade level for which the competency objective is targeted. + /// + + // IS in a reference (ReportCardStudentCompetencyObjective.ObjectiveGradeLevelDescriptorId), IS a lookup column + string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.ObjectiveGradeLevelDescriptor + { + get + { + if (ImplicitStudentCompetencyObjectiveReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitStudentCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor; + + return null; + } + set + { + ImplicitStudentCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -141561,7 +139941,7 @@ private void SetSchool(Entities.Common.EdFi.ISchool value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolCategory; + var compareTo = obj as Entities.Common.EdFi.IReportCardStudentCompetencyObjective; if (ReferenceEquals(this, compareTo)) return true; @@ -141570,12 +139950,22 @@ public override bool Equals(object obj) return false; // Parent Property - if (_school == null || !_school.Equals(compareTo.School)) + if (_reportCard == null || !_reportCard.Equals(compareTo.ReportCard)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISchoolCategory).SchoolCategoryDescriptor, compareTo.SchoolCategoryDescriptor)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).Objective, compareTo.Objective)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveEducationOrganizationId.Equals(compareTo.ObjectiveEducationOrganizationId)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveGradeLevelDescriptor, compareTo.ObjectiveGradeLevelDescriptor)) return false; @@ -141592,11 +139982,17 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_school != null) - hash.Add(_school); + if (_reportCard != null) + hash.Add(_reportCard); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISchoolCategory).SchoolCategoryDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).Objective); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveEducationOrganizationId); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ObjectiveGradeLevelDescriptor); return hash.ToHashCode(); } @@ -141630,7 +140026,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "School", "SchoolCategory")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "ReportCard", "ReportCardStudentCompetencyObjective")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -141647,6 +140043,12 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -141654,18 +140056,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolCategoryMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolCategory)target); + return Entities.Common.EdFi.ReportCardStudentCompetencyObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportCardStudentCompetencyObjective)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolCategoryMapper.MapTo(this, (Entities.Common.EdFi.ISchoolCategory)target, null); + Entities.Common.EdFi.ReportCardStudentCompetencyObjectiveMapper.MapTo(this, (Entities.Common.EdFi.IReportCardStudentCompetencyObjective)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveResourceId + { + get { return null; } + set { ImplicitStudentCompetencyObjectiveReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IReportCardStudentCompetencyObjective.StudentCompetencyObjectiveDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentCompetencyObjectiveReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -141708,6 +140124,148 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForGradingPeriodDescriptor = GetGradingPeriodDescriptorSources().ToArray(); + + if (!sourcesForGradingPeriodDescriptor.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForGradingPeriodDescriptor.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForGradingPeriodDescriptor.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodDescriptor' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForGradingPeriodDescriptor.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetGradingPeriodDescriptorSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodDescriptor); + + // Obtain value from other references + var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodDescriptor; + + if (valueFromStudentCompetencyObjectiveReference != null) + { + yield return ("studentCompetencyObjectiveReference.gradingPeriodDescriptor", this.StudentCompetencyObjectiveReference.GradingPeriodDescriptor); + } + + } + var sourcesForGradingPeriodName = GetGradingPeriodNameSources().ToArray(); + + if (!sourcesForGradingPeriodName.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForGradingPeriodName.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForGradingPeriodName.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodName' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForGradingPeriodName.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetGradingPeriodNameSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodName); + + // Obtain value from other references + var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodName; + + if (valueFromStudentCompetencyObjectiveReference != null) + { + yield return ("studentCompetencyObjectiveReference.gradingPeriodName", this.StudentCompetencyObjectiveReference.GradingPeriodName); + } + + } + var sourcesForGradingPeriodSchoolId = GetGradingPeriodSchoolIdSources().ToArray(); + + if (!sourcesForGradingPeriodSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForGradingPeriodSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForGradingPeriodSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodSchoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForGradingPeriodSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetGradingPeriodSchoolIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodSchoolId); + + // Obtain value from other references + var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodSchoolId; + + if (valueFromStudentCompetencyObjectiveReference != null) + { + yield return ("studentCompetencyObjectiveReference.gradingPeriodSchoolId", this.StudentCompetencyObjectiveReference.GradingPeriodSchoolId); + } + + } + var sourcesForGradingPeriodSchoolYear = GetGradingPeriodSchoolYearSources().ToArray(); + + if (!sourcesForGradingPeriodSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForGradingPeriodSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForGradingPeriodSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'gradingPeriodSchoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForGradingPeriodSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, short value)> GetGradingPeriodSchoolYearSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.GradingPeriodSchoolYear); + + // Obtain value from other references + var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.GradingPeriodSchoolYear; + + if (valueFromStudentCompetencyObjectiveReference != null) + { + yield return ("studentCompetencyObjectiveReference.gradingPeriodSchoolYear", this.StudentCompetencyObjectiveReference.GradingPeriodSchoolYear); + } + + } + var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); + + if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetStudentUniqueIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IReportCardStudentCompetencyObjective).ReportCard.StudentUniqueId); + + // Obtain value from other references + var valueFromStudentCompetencyObjectiveReference = this.StudentCompetencyObjectiveReference?.StudentUniqueId; + + if (valueFromStudentCompetencyObjectiveReference != null) + { + yield return ("studentCompetencyObjectiveReference.studentUniqueId", this.StudentCompetencyObjectiveReference.StudentUniqueId); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -141734,9 +140292,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolCategoryPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReportCardStudentCompetencyObjectivePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -141764,17 +140322,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SchoolGradeLevel table of the School aggregate in the ODS Database. + /// A class which represents the edfi.ReporterDescriptionDescriptor table of the ReporterDescriptionDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SchoolGradeLevel : Entities.Common.EdFi.ISchoolGradeLevel, IValidatableObject + public class ReporterDescriptionDescriptor : Entities.Common.EdFi.IReporterDescriptionDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SchoolGradeLevel"); + private static FullName _fullName = new FullName("edfi", "ReporterDescriptionDescriptor"); // Fluent validator instance (threadsafe) - private static SchoolGradeLevelPutPostRequestValidator _validator = new SchoolGradeLevelPutPostRequestValidator(); + private static ReporterDescriptionDescriptorPutPostRequestValidator _validator = new ReporterDescriptionDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -141791,6 +140354,13 @@ public class SchoolGradeLevel : Entities.Common.EdFi.ISchoolGradeLevel, IValidat // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ReporterDescriptionDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -141801,33 +140371,19 @@ public class SchoolGradeLevel : Entities.Common.EdFi.ISchoolGradeLevel, IValidat //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISchool _school; - [IgnoreDataMember] - Entities.Common.EdFi.ISchool ISchoolGradeLevel.School - { - get { return _school; } - set { SetSchool(value); } - } - - public Entities.Common.EdFi.ISchool School - { - set { SetSchool(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ReporterDescriptionDescriptorId { get; set; } - private void SetSchool(Entities.Common.EdFi.ISchool value) + int IDescriptor.DescriptorId { - _school = value; + get { return ReporterDescriptionDescriptorId; } + set { ReporterDescriptionDescriptorId = value; } } - - /// - /// The grade levels served at the school. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -141842,7 +140398,7 @@ private void SetSchool(Entities.Common.EdFi.ISchool value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IReporterDescriptionDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -141850,13 +140406,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_school == null || !_school.Equals(compareTo.School)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISchoolGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + + // Derived Property + if (!(this as Entities.Common.EdFi.IReporterDescriptionDescriptor).ReporterDescriptionDescriptorId.Equals(compareTo.ReporterDescriptionDescriptorId)) return false; @@ -141872,12 +140424,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_school != null) - hash.Add(_school); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISchoolGradeLevel).GradeLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IReporterDescriptionDescriptor).ReporterDescriptionDescriptorId); return hash.ToHashCode(); } @@ -141886,6 +140435,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -141911,8 +140509,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "School", "SchoolGradeLevel")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -141923,6 +140524,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -141935,12 +140543,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolGradeLevel)target); + return Entities.Common.EdFi.ReporterDescriptionDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReporterDescriptionDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ISchoolGradeLevel)target, null); + Entities.Common.EdFi.ReporterDescriptionDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReporterDescriptionDescriptor)target, null); } // ------------------------------------------------------------- @@ -141948,66 +140556,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -142015,9 +140563,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReporterDescriptionDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -142046,21 +140594,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SchoolCategoryDescriptor table of the SchoolCategoryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ReportingTagDescriptor table of the ReportingTagDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SchoolCategoryDescriptor : Entities.Common.EdFi.ISchoolCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ReportingTagDescriptor : Entities.Common.EdFi.IReportingTagDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SchoolCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "ReportingTagDescriptor"); // Fluent validator instance (threadsafe) - private static SchoolCategoryDescriptorPutPostRequestValidator _validator = new SchoolCategoryDescriptorPutPostRequestValidator(); + private static ReportingTagDescriptorPutPostRequestValidator _validator = new ReportingTagDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -142079,7 +140627,7 @@ public class SchoolCategoryDescriptor : Entities.Common.EdFi.ISchoolCategoryDesc // ------------------------------------------------------------ /// - /// The unique identifier for the SchoolCategoryDescriptor resource. + /// The unique identifier for the ReportingTagDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -142100,12 +140648,12 @@ public class SchoolCategoryDescriptor : Entities.Common.EdFi.ISchoolCategoryDesc /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SchoolCategoryDescriptorId { get; set; } + public int ReportingTagDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SchoolCategoryDescriptorId; } - set { SchoolCategoryDescriptorId = value; } + get { return ReportingTagDescriptorId; } + set { ReportingTagDescriptorId = value; } } // ------------------------------------------------------------- @@ -142121,7 +140669,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IReportingTagDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -142131,7 +140679,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISchoolCategoryDescriptor).SchoolCategoryDescriptorId.Equals(compareTo.SchoolCategoryDescriptorId)) + if (!(this as Entities.Common.EdFi.IReportingTagDescriptor).ReportingTagDescriptorId.Equals(compareTo.ReportingTagDescriptorId)) return false; @@ -142149,7 +140697,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISchoolCategoryDescriptor).SchoolCategoryDescriptorId); + hash.Add((this as Entities.Common.EdFi.IReportingTagDescriptor).ReportingTagDescriptorId); return hash.ToHashCode(); } @@ -142266,12 +140814,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolCategoryDescriptor)target); + return Entities.Common.EdFi.ReportingTagDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IReportingTagDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolCategoryDescriptor)target, null); + Entities.Common.EdFi.ReportingTagDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IReportingTagDescriptor)target, null); } // ------------------------------------------------------------- @@ -142286,9 +140834,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ReportingTagDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -142317,21 +140865,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SchoolChoiceBasisDescriptor table of the SchoolChoiceBasisDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ResidencyStatusDescriptor table of the ResidencyStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SchoolChoiceBasisDescriptor : Entities.Common.EdFi.ISchoolChoiceBasisDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ResidencyStatusDescriptor : Entities.Common.EdFi.IResidencyStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SchoolChoiceBasisDescriptor"); + private static FullName _fullName = new FullName("edfi", "ResidencyStatusDescriptor"); // Fluent validator instance (threadsafe) - private static SchoolChoiceBasisDescriptorPutPostRequestValidator _validator = new SchoolChoiceBasisDescriptorPutPostRequestValidator(); + private static ResidencyStatusDescriptorPutPostRequestValidator _validator = new ResidencyStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -142350,7 +140898,7 @@ public class SchoolChoiceBasisDescriptor : Entities.Common.EdFi.ISchoolChoiceBas // ------------------------------------------------------------ /// - /// The unique identifier for the SchoolChoiceBasisDescriptor resource. + /// The unique identifier for the ResidencyStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -142371,12 +140919,12 @@ public class SchoolChoiceBasisDescriptor : Entities.Common.EdFi.ISchoolChoiceBas /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SchoolChoiceBasisDescriptorId { get; set; } + public int ResidencyStatusDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SchoolChoiceBasisDescriptorId; } - set { SchoolChoiceBasisDescriptorId = value; } + get { return ResidencyStatusDescriptorId; } + set { ResidencyStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -142392,7 +140940,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolChoiceBasisDescriptor; + var compareTo = obj as Entities.Common.EdFi.IResidencyStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -142402,7 +140950,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISchoolChoiceBasisDescriptor).SchoolChoiceBasisDescriptorId.Equals(compareTo.SchoolChoiceBasisDescriptorId)) + if (!(this as Entities.Common.EdFi.IResidencyStatusDescriptor).ResidencyStatusDescriptorId.Equals(compareTo.ResidencyStatusDescriptorId)) return false; @@ -142420,7 +140968,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISchoolChoiceBasisDescriptor).SchoolChoiceBasisDescriptorId); + hash.Add((this as Entities.Common.EdFi.IResidencyStatusDescriptor).ResidencyStatusDescriptorId); return hash.ToHashCode(); } @@ -142537,12 +141085,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolChoiceBasisDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolChoiceBasisDescriptor)target); + return Entities.Common.EdFi.ResidencyStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResidencyStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolChoiceBasisDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolChoiceBasisDescriptor)target, null); + Entities.Common.EdFi.ResidencyStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResidencyStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -142557,9 +141105,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolChoiceBasisDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ResidencyStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -142588,21 +141136,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SchoolChoiceImplementStatusDescriptor table of the SchoolChoiceImplementStatusDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ResponseIndicatorDescriptor table of the ResponseIndicatorDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SchoolChoiceImplementStatusDescriptor : Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ResponseIndicatorDescriptor : Entities.Common.EdFi.IResponseIndicatorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SchoolChoiceImplementStatusDescriptor"); + private static FullName _fullName = new FullName("edfi", "ResponseIndicatorDescriptor"); // Fluent validator instance (threadsafe) - private static SchoolChoiceImplementStatusDescriptorPutPostRequestValidator _validator = new SchoolChoiceImplementStatusDescriptorPutPostRequestValidator(); + private static ResponseIndicatorDescriptorPutPostRequestValidator _validator = new ResponseIndicatorDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -142621,7 +141169,7 @@ public class SchoolChoiceImplementStatusDescriptor : Entities.Common.EdFi.ISchoo // ------------------------------------------------------------ /// - /// The unique identifier for the SchoolChoiceImplementStatusDescriptor resource. + /// The unique identifier for the ResponseIndicatorDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -142642,12 +141190,12 @@ public class SchoolChoiceImplementStatusDescriptor : Entities.Common.EdFi.ISchoo /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SchoolChoiceImplementStatusDescriptorId { get; set; } + public int ResponseIndicatorDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SchoolChoiceImplementStatusDescriptorId; } - set { SchoolChoiceImplementStatusDescriptorId = value; } + get { return ResponseIndicatorDescriptorId; } + set { ResponseIndicatorDescriptorId = value; } } // ------------------------------------------------------------- @@ -142663,7 +141211,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor; + var compareTo = obj as Entities.Common.EdFi.IResponseIndicatorDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -142673,7 +141221,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor).SchoolChoiceImplementStatusDescriptorId.Equals(compareTo.SchoolChoiceImplementStatusDescriptorId)) + if (!(this as Entities.Common.EdFi.IResponseIndicatorDescriptor).ResponseIndicatorDescriptorId.Equals(compareTo.ResponseIndicatorDescriptorId)) return false; @@ -142691,7 +141239,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor).SchoolChoiceImplementStatusDescriptorId); + hash.Add((this as Entities.Common.EdFi.IResponseIndicatorDescriptor).ResponseIndicatorDescriptorId); return hash.ToHashCode(); } @@ -142808,12 +141356,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolChoiceImplementStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor)target); + return Entities.Common.EdFi.ResponseIndicatorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResponseIndicatorDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolChoiceImplementStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor)target, null); + Entities.Common.EdFi.ResponseIndicatorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResponseIndicatorDescriptor)target, null); } // ------------------------------------------------------------- @@ -142828,9 +141376,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolChoiceImplementStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ResponseIndicatorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -142859,21 +141407,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SchoolFoodServiceProgramServiceDescriptor table of the SchoolFoodServiceProgramServiceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.ResponsibilityDescriptor table of the ResponsibilityDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SchoolFoodServiceProgramServiceDescriptor : Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class ResponsibilityDescriptor : Entities.Common.EdFi.IResponsibilityDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SchoolFoodServiceProgramServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "ResponsibilityDescriptor"); // Fluent validator instance (threadsafe) - private static SchoolFoodServiceProgramServiceDescriptorPutPostRequestValidator _validator = new SchoolFoodServiceProgramServiceDescriptorPutPostRequestValidator(); + private static ResponsibilityDescriptorPutPostRequestValidator _validator = new ResponsibilityDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -142892,7 +141440,7 @@ public class SchoolFoodServiceProgramServiceDescriptor : Entities.Common.EdFi.IS // ------------------------------------------------------------ /// - /// The unique identifier for the SchoolFoodServiceProgramServiceDescriptor resource. + /// The unique identifier for the ResponsibilityDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -142913,12 +141461,12 @@ public class SchoolFoodServiceProgramServiceDescriptor : Entities.Common.EdFi.IS /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SchoolFoodServiceProgramServiceDescriptorId { get; set; } + public int ResponsibilityDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SchoolFoodServiceProgramServiceDescriptorId; } - set { SchoolFoodServiceProgramServiceDescriptorId = value; } + get { return ResponsibilityDescriptorId; } + set { ResponsibilityDescriptorId = value; } } // ------------------------------------------------------------- @@ -142934,7 +141482,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.IResponsibilityDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -142944,7 +141492,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor).SchoolFoodServiceProgramServiceDescriptorId.Equals(compareTo.SchoolFoodServiceProgramServiceDescriptorId)) + if (!(this as Entities.Common.EdFi.IResponsibilityDescriptor).ResponsibilityDescriptorId.Equals(compareTo.ResponsibilityDescriptorId)) return false; @@ -142962,7 +141510,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor).SchoolFoodServiceProgramServiceDescriptorId); + hash.Add((this as Entities.Common.EdFi.IResponsibilityDescriptor).ResponsibilityDescriptorId); return hash.ToHashCode(); } @@ -143079,12 +141627,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolFoodServiceProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor)target); + return Entities.Common.EdFi.ResponsibilityDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResponsibilityDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolFoodServiceProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor)target, null); + Entities.Common.EdFi.ResponsibilityDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResponsibilityDescriptor)target, null); } // ------------------------------------------------------------- @@ -143099,9 +141647,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolFoodServiceProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class ResponsibilityDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -143130,21 +141678,135 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SchoolTypeDescriptor table of the SchoolTypeDescriptor aggregate in the ODS Database. + /// Represents a reference to the RestraintEvent resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class RestraintEventReference : IResourceReference + { + [DataMember(Name="restraintEventIdentifier")] + public string RestraintEventIdentifier { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return RestraintEventIdentifier != default(string) && SchoolId != default(long) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (RestraintEventIdentifier == default) + { + yield return "RestraintEventIdentifier"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "RestraintEvent", + Href = $"/ed-fi/restraintEvents/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.RestraintEvent table of the RestraintEvent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SchoolTypeDescriptor : Entities.Common.EdFi.ISchoolTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class RestraintEvent : Entities.Common.EdFi.IRestraintEvent, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SchoolTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "RestraintEvent"); // Fluent validator instance (threadsafe) - private static SchoolTypeDescriptorPutPostRequestValidator _validator = new SchoolTypeDescriptorPutPostRequestValidator(); + private static RestraintEventPutPostRequestValidator _validator = new RestraintEventPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -143155,6 +141817,11 @@ public class SchoolTypeDescriptor : Entities.Common.EdFi.ISchoolTypeDescriptor, // Constructor // ------------------------------------------------------------- + public RestraintEvent() + { + RestraintEventPrograms = new List(); + RestraintEventReasons = new List(); + } // ------------------------------------------------------------ @@ -143163,7 +141830,7 @@ public class SchoolTypeDescriptor : Entities.Common.EdFi.ISchoolTypeDescriptor, // ------------------------------------------------------------ /// - /// The unique identifier for the SchoolTypeDescriptor resource. + /// The unique identifier for the RestraintEvent resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -143173,6 +141840,106 @@ public class SchoolTypeDescriptor : Entities.Common.EdFi.ISchoolTypeDescriptor, // ============================================================= // References // ------------------------------------------------------------- + + private bool _disciplineIncidentReferenceExplicitlyAssigned; + private DisciplineIncident.EdFi.DisciplineIncidentReference _disciplineIncidentReference; + private DisciplineIncident.EdFi.DisciplineIncidentReference ImplicitDisciplineIncidentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_disciplineIncidentReference == null && !_disciplineIncidentReferenceExplicitlyAssigned) + _disciplineIncidentReference = new DisciplineIncident.EdFi.DisciplineIncidentReference(); + + return _disciplineIncidentReference; + } + } + + [DataMember(Name="disciplineIncidentReference")] + [FullyDefinedReference] + public DisciplineIncident.EdFi.DisciplineIncidentReference DisciplineIncidentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitDisciplineIncidentReference != null + && (_disciplineIncidentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + return ImplicitDisciplineIncidentReference; + + return null; + } + set + { + _disciplineIncidentReferenceExplicitlyAssigned = true; + _disciplineIncidentReference = value; + } + } + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); + + return _schoolReference; + } + } + + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; + + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } + } + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); + + return _studentReference; + } + } + + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; + + return null; + } + set + { + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; + } + } // ------------------------------------------------------------- //============================================================== @@ -143180,16 +141947,67 @@ public class SchoolTypeDescriptor : Entities.Common.EdFi.ISchoolTypeDescriptor, // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// A unique number or alphanumeric code assigned to a restraint event by a school, school system, state, or other agency or entity. /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int SchoolTypeDescriptorId { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(36, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="restraintEventIdentifier")] + public string RestraintEventIdentifier { get; set; } - int IDescriptor.DescriptorId + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IRestraintEvent.SchoolId { - get { return SchoolTypeDescriptorId; } - set { SchoolTypeDescriptorId = value; } + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // DisciplineIncident + _disciplineIncidentReferenceExplicitlyAssigned = false; + ImplicitDisciplineIncidentReference.SchoolId = value; + + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + } + } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IRestraintEvent.StudentUniqueId + { + get + { + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } } // ------------------------------------------------------------- @@ -143205,7 +142023,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.IRestraintEvent; if (ReferenceEquals(this, compareTo)) return true; @@ -143214,8 +142032,18 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.ISchoolTypeDescriptor).SchoolTypeDescriptorId.Equals(compareTo.SchoolTypeDescriptorId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IRestraintEvent).RestraintEventIdentifier, compareTo.RestraintEventIdentifier)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IRestraintEvent).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IRestraintEvent).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -143232,9 +142060,15 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ISchoolTypeDescriptor).SchoolTypeDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IRestraintEvent).RestraintEventIdentifier); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IRestraintEvent).SchoolId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IRestraintEvent).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -143242,60 +142076,54 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The end date of the period when the descriptor is in effect. + /// The setting where the RestraintEvent was exercised. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="educationalEnvironmentDescriptor")][DescriptorExists("EducationalEnvironmentDescriptor")] + public string EducationalEnvironmentDescriptor { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// Month, day, and year of the restraint event. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } /// - /// A shortened description for the descriptor. + /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IRestraintEvent.IncidentIdentifier + { + get + { + if (ImplicitDisciplineIncidentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + { + return ImplicitDisciplineIncidentReference.IncidentIdentifier; + } - // ============================================================= - // Properties - // ------------------------------------------------------------- + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // DisciplineIncident + _disciplineIncidentReferenceExplicitlyAssigned = false; + ImplicitDisciplineIncidentReference.IncidentIdentifier = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -143316,16 +142144,73 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "RestraintEvent", "RestraintEvent")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _restraintEventPrograms; + private ICollection _restraintEventProgramsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="programs")] + public ICollection RestraintEventPrograms + { + get { return _restraintEventPrograms; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IRestraintEventProgram)e.Item).RestraintEvent = this); + _restraintEventPrograms = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IRestraintEventProgram)e.Item).RestraintEvent = this; + _restraintEventProgramsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventPrograms + { + get { return _restraintEventProgramsCovariant; } + set { RestraintEventPrograms = new List(value.Cast()); } + } + + private ICollection _restraintEventReasons; + private ICollection _restraintEventReasonsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reasons")] + public ICollection RestraintEventReasons + { + get { return _restraintEventReasons; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IRestraintEventReason)e.Item).RestraintEvent = this); + _restraintEventReasons = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IRestraintEventReason)e.Item).RestraintEvent = this; + _restraintEventReasonsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IRestraintEvent.RestraintEventReasons + { + get { return _restraintEventReasonsCovariant; } + set { RestraintEventReasons = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -143343,6 +142228,22 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_restraintEventPrograms != null) foreach (var item in _restraintEventPrograms) + { + item.RestraintEvent = this; + } + + if (_restraintEventReasons != null) foreach (var item in _restraintEventReasons) + { + item.RestraintEvent = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -143350,19 +142251,176 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolTypeDescriptor)target); + return Entities.Common.EdFi.RestraintEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEvent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolTypeDescriptor)target, null); + Entities.Common.EdFi.RestraintEventMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEvent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentResourceId + { + get { return null; } + set { ImplicitDisciplineIncidentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitDisciplineIncidentReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IRestraintEvent.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IRestraintEvent.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IRestraintEvent.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (RestraintEventPrograms.Any() && mappingContract?.IsMemberSupported("RestraintEventPrograms") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("RestraintEventPrograms"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(RestraintEventPrograms, validationContext, validationContext.Items.ForCollection("RestraintEventPrograms")))) + { + yield return result; + } + } + + if (RestraintEventReasons.Any() && mappingContract?.IsMemberSupported("RestraintEventReasons") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("RestraintEventReasons"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(RestraintEventReasons, validationContext, validationContext.Items.ForCollection("RestraintEventReasons")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from other references + var valueFromSchoolReference = this.SchoolReference?.SchoolId; + + if (valueFromSchoolReference != null) + { + yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); + } + + // Obtain value from other references + var valueFromDisciplineIncidentReference = this.DisciplineIncidentReference?.SchoolId; + + if (valueFromDisciplineIncidentReference != null) + { + yield return ("disciplineIncidentReference.schoolId", this.DisciplineIncidentReference.SchoolId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -143370,9 +142428,15 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class RestraintEventPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_RestraintEvent = new FullName("edfi", "RestraintEvent"); + + // Declare collection item validators + private RestraintEventProgramPutPostRequestValidator _restraintEventProgramsValidator = new (); + private RestraintEventReasonPutPostRequestValidator _restraintEventReasonsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -143385,6 +142449,39 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (RestraintEventMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_RestraintEvent); + + if (mappingContract != null) + { + if (mappingContract.IsRestraintEventProgramIncluded != null) + { + var hasInvalidRestraintEventProgramsItems = instance.RestraintEventPrograms.Any(x => !mappingContract.IsRestraintEventProgramIncluded(x)); + + if (hasInvalidRestraintEventProgramsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("RestraintEventPrograms", $"A supplied 'RestraintEventProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsRestraintEventReasonIncluded != null) + { + var hasInvalidRestraintEventReasonsItems = instance.RestraintEventReasons.Any(x => !mappingContract.IsRestraintEventReasonIncluded(x)); + + if (hasInvalidRestraintEventReasonsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("RestraintEventReasons", $"A supplied 'RestraintEventReason' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -143400,87 +142497,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the SchoolYearType resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class SchoolYearTypeReference : IResourceReference - { - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return SchoolYear != default(short); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (SchoolYear == default) - { - yield return "SchoolYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "SchoolYearType", - Href = $"/ed-fi/schoolYearTypes/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - /// - /// A class which represents the edfi.SchoolYearType table of the SchoolYearType aggregate in the ODS Database. + /// A class which represents the edfi.RestraintEventProgram table of the RestraintEvent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class SchoolYearType : Entities.Common.EdFi.ISchoolYearType, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class RestraintEventProgram : Entities.Common.EdFi.IRestraintEventProgram, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SchoolYearType"); + private static FullName _fullName = new FullName("edfi", "RestraintEventProgram"); // Fluent validator instance (threadsafe) - private static SchoolYearTypePutPostRequestValidator _validator = new SchoolYearTypePutPostRequestValidator(); + private static RestraintEventProgramPutPostRequestValidator _validator = new RestraintEventProgramPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -143497,31 +142524,139 @@ public class SchoolYearType : Entities.Common.EdFi.ISchoolYearType, IHasETag, ID // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the SchoolYearType resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _programReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _programReference; + private Program.EdFi.ProgramReference ImplicitProgramReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programReference == null && !_programReferenceExplicitlyAssigned) + _programReference = new Program.EdFi.ProgramReference(); + + return _programReference; + } + } + + [DataMember(Name="programReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Program.EdFi.ProgramReference ProgramReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramReference != null + && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference; + + return null; + } + set + { + _programReferenceExplicitlyAssigned = true; + _programReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IRestraintEvent _restraintEvent; + + [IgnoreDataMember] + Entities.Common.EdFi.IRestraintEvent IRestraintEventProgram.RestraintEvent + { + get { return _restraintEvent; } + set { SetRestraintEvent(value); } + } + + public Entities.Common.EdFi.IRestraintEvent RestraintEvent + { + set { SetRestraintEvent(value); } + } + + private void SetRestraintEvent(Entities.Common.EdFi.IRestraintEvent value) + { + _restraintEvent = value; + } /// - /// Key for School Year + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IRestraintEventProgram.EducationOrganizationId + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.EducationOrganizationId = value; + } + } + + /// + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IRestraintEventProgram.ProgramName + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.ProgramName = value; + } + } + + /// + /// The type of program. + /// + + // IS in a reference (RestraintEventProgram.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IRestraintEventProgram.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramReference.ProgramTypeDescriptor = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -143536,7 +142671,7 @@ public class SchoolYearType : Entities.Common.EdFi.ISchoolYearType, IHasETag, ID /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISchoolYearType; + var compareTo = obj as Entities.Common.EdFi.IRestraintEventProgram; if (ReferenceEquals(this, compareTo)) return true; @@ -143544,9 +142679,23 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_restraintEvent == null || !_restraintEvent.Equals(compareTo.RestraintEvent)) + return false; + - // Standard Property - if (!(this as Entities.Common.EdFi.ISchoolYearType).SchoolYear.Equals(compareTo.SchoolYear)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IRestraintEventProgram).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -143562,9 +142711,18 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_restraintEvent != null) + hash.Add(_restraintEvent); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISchoolYearType).SchoolYear); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IRestraintEventProgram).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IRestraintEventProgram).ProgramTypeDescriptor); return hash.ToHashCode(); } @@ -143578,44 +142736,8 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - private bool _currentSchoolYearExplicitlyAssigned = false; - private bool _currentSchoolYear; - - /// - /// The code for the current school year. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="currentSchoolYear")] - public bool CurrentSchoolYear - { - get => _currentSchoolYear; - set - { - _currentSchoolYear = value; - _currentSchoolYearExplicitlyAssigned = true; - } - } - - - /// - /// The description for the SchoolYear type. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="schoolYearDescription")] - public string SchoolYearDescription { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_currentSchoolYearExplicitlyAssigned) - { - yield return "CurrentSchoolYear"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -143634,7 +142756,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SchoolYearType", "SchoolYearType")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "RestraintEvent", "RestraintEventProgram")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -143646,13 +142768,6 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -143665,18 +142780,32 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SchoolYearTypeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolYearType)target); + return Entities.Common.EdFi.RestraintEventProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEventProgram)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SchoolYearTypeMapper.MapTo(this, (Entities.Common.EdFi.ISchoolYearType)target, null); + Entities.Common.EdFi.RestraintEventProgramMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEventProgram)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IRestraintEventProgram.ProgramResourceId + { + get { return null; } + set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IRestraintEventProgram.ProgramDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -143694,6 +142823,7 @@ void IMappable.Map(object target) try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -143744,9 +142874,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SchoolYearTypePutPostRequestValidator : FluentValidation.AbstractValidator + public class RestraintEventProgramPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -143774,143 +142904,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Section resource. + /// A class which represents the edfi.RestraintEventReason table of the RestraintEvent aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionReference : IResourceReference + public class RestraintEventReason : Entities.Common.EdFi.IRestraintEventReason, IValidatableObject { - [DataMember(Name="localCourseCode")] - public string LocalCourseCode { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } - - [DataMember(Name="sectionIdentifier")] - public string SectionIdentifier { get; set; } - - [DataMember(Name="sessionName")] - public string SessionName { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (LocalCourseCode == default) - { - yield return "LocalCourseCode"; - } - - if (SchoolId == default) - { - yield return "SchoolId"; - } - - if (SchoolYear == default) - { - yield return "SchoolYear"; - } - - if (SectionIdentifier == default) - { - yield return "SectionIdentifier"; - } - - if (SessionName == default) - { - yield return "SessionName"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Section", - Href = $"/ed-fi/sections/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.Section table of the Section aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class Section : Entities.Common.EdFi.ISection, IHasETag, IDateVersionedEntity, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "Section"); + private static FullName _fullName = new FullName("edfi", "RestraintEventReason"); // Fluent validator instance (threadsafe) - private static SectionPutPostRequestValidator _validator = new SectionPutPostRequestValidator(); + private static RestraintEventReasonPutPostRequestValidator _validator = new RestraintEventReasonPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -143921,246 +142925,49 @@ public class Section : Entities.Common.EdFi.ISection, IHasETag, IDateVersionedEn // Constructor // ------------------------------------------------------------- - public Section() - { - SectionCharacteristics = new List(); - SectionClassPeriods = new List(); - SectionCourseLevelCharacteristics = new List(); - SectionOfferedGradeLevels = new List(); - SectionPrograms = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the Section resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _courseOfferingReferenceExplicitlyAssigned; - private CourseOffering.EdFi.CourseOfferingReference _courseOfferingReference; - private CourseOffering.EdFi.CourseOfferingReference ImplicitCourseOfferingReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_courseOfferingReference == null && !_courseOfferingReferenceExplicitlyAssigned) - _courseOfferingReference = new CourseOffering.EdFi.CourseOfferingReference(); - - return _courseOfferingReference; - } - } - - [DataMember(Name="courseOfferingReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public CourseOffering.EdFi.CourseOfferingReference CourseOfferingReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCourseOfferingReference != null - && (_courseOfferingReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) - return ImplicitCourseOfferingReference; - - return null; - } - set - { - _courseOfferingReferenceExplicitlyAssigned = true; - _courseOfferingReference = value; - } - } - private bool _locationReferenceExplicitlyAssigned; - private Location.EdFi.LocationReference _locationReference; - private Location.EdFi.LocationReference ImplicitLocationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_locationReference == null && !_locationReferenceExplicitlyAssigned) - _locationReference = new Location.EdFi.LocationReference(); - - return _locationReference; - } - } - - [DataMember(Name="locationReference")] - [FullyDefinedReference] - public Location.EdFi.LocationReference LocationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocationReference != null - && (_locationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocationReference.IsReferenceFullyDefined())) - return ImplicitLocationReference; - - return null; - } - set - { - _locationReferenceExplicitlyAssigned = true; - _locationReference = value; - } - } - private bool _locationSchoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _locationSchoolReference; - private School.EdFi.SchoolReference ImplicitLocationSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_locationSchoolReference == null && !_locationSchoolReferenceExplicitlyAssigned) - _locationSchoolReference = new School.EdFi.SchoolReference(); - - return _locationSchoolReference; - } - } - - [DataMember(Name="locationSchoolReference")] - [FullyDefinedReference] - public School.EdFi.SchoolReference LocationSchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitLocationSchoolReference != null - && (_locationSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocationSchoolReference.IsReferenceFullyDefined())) - return ImplicitLocationSchoolReference; - - return null; - } - set - { - _locationSchoolReferenceExplicitlyAssigned = true; - _locationSchoolReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IRestraintEvent _restraintEvent; - /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISection.LocalCourseCode + [IgnoreDataMember] + Entities.Common.EdFi.IRestraintEvent IRestraintEventReason.RestraintEvent { - get - { - if (ImplicitCourseOfferingReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) - return ImplicitCourseOfferingReference.LocalCourseCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CourseOffering - _courseOfferingReferenceExplicitlyAssigned = false; - ImplicitCourseOfferingReference.LocalCourseCode = value; - } + get { return _restraintEvent; } + set { SetRestraintEvent(value); } } - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ISection.SchoolId + public Entities.Common.EdFi.IRestraintEvent RestraintEvent { - get - { - if (ImplicitCourseOfferingReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) - return ImplicitCourseOfferingReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CourseOffering - _courseOfferingReferenceExplicitlyAssigned = false; - ImplicitCourseOfferingReference.SchoolId = value; - } + set { SetRestraintEvent(value); } } - /// - /// The identifier for the school year. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ISection.SchoolYear + private void SetRestraintEvent(Entities.Common.EdFi.IRestraintEvent value) { - get - { - if (ImplicitCourseOfferingReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) - return ImplicitCourseOfferingReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CourseOffering - _courseOfferingReferenceExplicitlyAssigned = false; - ImplicitCourseOfferingReference.SchoolYear = value; - } + _restraintEvent = value; } /// - /// The local identifier assigned to a section. + /// A categorization of the circumstances or reason for the RestraintEvent. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="sectionIdentifier")] - public string SectionIdentifier { get; set; } - - /// - /// The identifier for the calendar for the academic session. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISection.SessionName - { - get - { - if (ImplicitCourseOfferingReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) - return ImplicitCourseOfferingReference.SessionName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CourseOffering - _courseOfferingReferenceExplicitlyAssigned = false; - ImplicitCourseOfferingReference.SessionName = value; - } - } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="restraintEventReasonDescriptor")][DescriptorExists("RestraintEventReasonDescriptor")] + public string RestraintEventReasonDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -144175,7 +142982,7 @@ string Entities.Common.EdFi.ISection.SessionName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISection; + var compareTo = obj as Entities.Common.EdFi.IRestraintEventReason; if (ReferenceEquals(this, compareTo)) return true; @@ -144183,29 +142990,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISection).LocalCourseCode, compareTo.LocalCourseCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ISection).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ISection).SchoolYear.Equals(compareTo.SchoolYear)) + // Parent Property + if (_restraintEvent == null || !_restraintEvent.Equals(compareTo.RestraintEvent)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISection).SectionIdentifier, compareTo.SectionIdentifier)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISection).SessionName, compareTo.SessionName)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IRestraintEventReason).RestraintEventReasonDescriptor, compareTo.RestraintEventReasonDescriptor)) return false; @@ -144221,22 +143012,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISection).LocalCourseCode); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISection).SchoolId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISection).SchoolYear); + //Parent Property + if (_restraintEvent != null) + hash.Add(_restraintEvent); // Standard Property - hash.Add((this as Entities.Common.EdFi.ISection).SectionIdentifier); - + hash.Add((this as Entities.Common.EdFi.IRestraintEventReason).RestraintEventReasonDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISection).SessionName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -144249,157 +143031,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="availableCreditConversion")] - public decimal? AvailableCreditConversion { get; set; } - - /// - /// The value of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="availableCredits")] - public decimal? AvailableCredits { get; set; } - - /// - /// The type of credits or units of value awarded for the completion of a course. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="availableCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string AvailableCreditTypeDescriptor { get; set; } - - /// - /// The setting in which a student receives education and related services. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="educationalEnvironmentDescriptor")][DescriptorExists("EducationalEnvironmentDescriptor")] - public string EducationalEnvironmentDescriptor { get; set; } - - /// - /// The primary language of instruction. If omitted, English is assumed. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="instructionLanguageDescriptor")][DescriptorExists("LanguageDescriptor")] - public string InstructionLanguageDescriptor { get; set; } - - /// - /// A unique number or alphanumeric code assigned to a room by a school, school system, state, or other agency or entity. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISection.LocationClassroomIdentificationCode - { - get - { - if (ImplicitLocationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocationReference.IsReferenceFullyDefined())) - { - return ImplicitLocationReference.ClassroomIdentificationCode; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Location - _locationReferenceExplicitlyAssigned = false; - ImplicitLocationReference.ClassroomIdentificationCode = value; - } - } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.ISection.LocationSchoolId - { - get - { - if (ImplicitLocationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocationReference.IsReferenceFullyDefined())) - { - return ImplicitLocationReference.SchoolId; - } - - if (ImplicitLocationSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitLocationSchoolReference.IsReferenceFullyDefined())) - { - return ImplicitLocationSchoolReference.SchoolId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Location - _locationReferenceExplicitlyAssigned = false; - ImplicitLocationReference.SchoolId = value.GetValueOrDefault(); - - // LocationSchool - _locationSchoolReferenceExplicitlyAssigned = false; - ImplicitLocationSchoolReference.SchoolId = value.GetValueOrDefault(); - } - } - - /// - /// The media through which teachers provide instruction to students and students and teachers communicate about instructional matters. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="mediumOfInstructionDescriptor")][DescriptorExists("MediumOfInstructionDescriptor")] - public string MediumOfInstructionDescriptor { get; set; } - - /// - /// Indicator of whether this section is used for official daily attendance. Alternatively, official daily attendance may be tied to a class period. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="officialAttendancePeriod")] - public bool? OfficialAttendancePeriod { get; set; } - - /// - /// The type of students the section is offered and tailored to. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] - public string PopulationServedDescriptor { get; set; } - - /// - /// A locally-defined name for the section, generally created to make the section more recognizable in informal contexts and generally distinct from the section identifier. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="sectionName")] - public string SectionName { get; set; } - - /// - /// Specifies whether the section is for attendance only, credit only, or both. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="sectionTypeDescriptor")][DescriptorExists("SectionTypeDescriptor")] - public string SectionTypeDescriptor { get; set; } - - /// - /// When a section is part of a sequence of parts for a course, the number of the sequence. If the course has only one part, the value of this section attribute should be 1. - /// - // NOT in a reference, NOT a lookup column - [Range(1, 8, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="sequenceOfCourse")] - public int? SequenceOfCourse { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -144420,211 +143051,23 @@ string Entities.Common.EdFi.ISection.LocationClassroomIdentificationCode // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "Section")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "RestraintEvent", "RestraintEventReason")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _sectionCharacteristics; - private ICollection _sectionCharacteristicsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="characteristics")] - public ICollection SectionCharacteristics - { - get { return _sectionCharacteristics; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISectionCharacteristic)e.Item).Section = this); - _sectionCharacteristics = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionCharacteristic)e.Item).Section = this; - _sectionCharacteristicsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionCharacteristics - { - get { return _sectionCharacteristicsCovariant; } - set { SectionCharacteristics = new List(value.Cast()); } - } - - private ICollection _sectionClassPeriods; - private ICollection _sectionClassPeriodsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="classPeriods")] - public ICollection SectionClassPeriods - { - get { return _sectionClassPeriods; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISectionClassPeriod)e.Item).Section = this); - _sectionClassPeriods = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionClassPeriod)e.Item).Section = this; - _sectionClassPeriodsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionClassPeriods - { - get { return _sectionClassPeriodsCovariant; } - set { SectionClassPeriods = new List(value.Cast()); } - } - - private ICollection _sectionCourseLevelCharacteristics; - private ICollection _sectionCourseLevelCharacteristicsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="courseLevelCharacteristics")] - public ICollection SectionCourseLevelCharacteristics - { - get { return _sectionCourseLevelCharacteristics; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISectionCourseLevelCharacteristic)e.Item).Section = this); - _sectionCourseLevelCharacteristics = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionCourseLevelCharacteristic)e.Item).Section = this; - _sectionCourseLevelCharacteristicsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionCourseLevelCharacteristics - { - get { return _sectionCourseLevelCharacteristicsCovariant; } - set { SectionCourseLevelCharacteristics = new List(value.Cast()); } - } - - private ICollection _sectionOfferedGradeLevels; - private ICollection _sectionOfferedGradeLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="offeredGradeLevels")] - public ICollection SectionOfferedGradeLevels - { - get { return _sectionOfferedGradeLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISectionOfferedGradeLevel)e.Item).Section = this); - _sectionOfferedGradeLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionOfferedGradeLevel)e.Item).Section = this; - _sectionOfferedGradeLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionOfferedGradeLevels - { - get { return _sectionOfferedGradeLevelsCovariant; } - set { SectionOfferedGradeLevels = new List(value.Cast()); } - } - - private ICollection _sectionPrograms; - private ICollection _sectionProgramsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="programs")] - public ICollection SectionPrograms - { - get { return _sectionPrograms; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISectionProgram)e.Item).Section = this); - _sectionPrograms = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionProgram)e.Item).Section = this; - _sectionProgramsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISection.SectionPrograms - { - get { return _sectionProgramsCovariant; } - set { SectionPrograms = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_sectionCharacteristics != null) foreach (var item in _sectionCharacteristics) - { - item.Section = this; - } - - if (_sectionClassPeriods != null) foreach (var item in _sectionClassPeriods) - { - item.Section = this; - } - - if (_sectionCourseLevelCharacteristics != null) foreach (var item in _sectionCourseLevelCharacteristics) - { - item.Section = this; - } - - if (_sectionOfferedGradeLevels != null) foreach (var item in _sectionOfferedGradeLevels) - { - item.Section = this; - } - - if (_sectionPrograms != null) foreach (var item in _sectionPrograms) - { - item.Section = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -144632,53 +143075,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISection)target); + return Entities.Common.EdFi.RestraintEventReasonMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEventReason)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionMapper.MapTo(this, (Entities.Common.EdFi.ISection)target, null); + Entities.Common.EdFi.RestraintEventReasonMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEventReason)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISection.CourseOfferingResourceId - { - get { return null; } - set { ImplicitCourseOfferingReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISection.CourseOfferingDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCourseOfferingReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ISection.LocationResourceId - { - get { return null; } - set { ImplicitLocationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISection.LocationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitLocationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ISection.LocationSchoolResourceId - { - get { return null; } - set { ImplicitLocationSchoolReference.ResourceId = value ?? default(Guid); } - } - - // ----------------------------------------------------------------- // ================================== @@ -144696,71 +143104,12 @@ string Entities.Common.EdFi.ISection.LocationDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (SectionCharacteristics.Any() && mappingContract?.IsMemberSupported("SectionCharacteristics") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SectionCharacteristics"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionCharacteristics, validationContext, validationContext.Items.ForCollection("SectionCharacteristics")))) - { - yield return result; - } - } - - if (SectionClassPeriods.Any() && mappingContract?.IsMemberSupported("SectionClassPeriods") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SectionClassPeriods"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionClassPeriods, validationContext, validationContext.Items.ForCollection("SectionClassPeriods")))) - { - yield return result; - } - } - - if (SectionCourseLevelCharacteristics.Any() && mappingContract?.IsMemberSupported("SectionCourseLevelCharacteristics") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SectionCourseLevelCharacteristics"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionCourseLevelCharacteristics, validationContext, validationContext.Items.ForCollection("SectionCourseLevelCharacteristics")))) - { - yield return result; - } - } - - if (SectionOfferedGradeLevels.Any() && mappingContract?.IsMemberSupported("SectionOfferedGradeLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SectionOfferedGradeLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionOfferedGradeLevels, validationContext, validationContext.Items.ForCollection("SectionOfferedGradeLevels")))) - { - yield return result; - } - } - - if (SectionPrograms.Any() && mappingContract?.IsMemberSupported("SectionPrograms") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SectionPrograms"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionPrograms, validationContext, validationContext.Items.ForCollection("SectionPrograms")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -144780,45 +143129,6 @@ string Entities.Common.EdFi.ISection.LocationDiscriminator yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForLocationSchoolId = GetLocationSchoolIdSources().ToArray(); - - if (!sourcesForLocationSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForLocationSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForLocationSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'locationSchoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForLocationSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetLocationSchoolIdSources() - { - // Obtain value from other references - var valueFromLocationReference = this.LocationReference?.SchoolId; - - if (valueFromLocationReference != null) - { - yield return ("locationReference.schoolId", this.LocationReference.SchoolId); - } - - // Obtain value from other references - var valueFromLocationSchoolReference = this.LocationSchoolReference?.SchoolId; - - if (valueFromLocationSchoolReference != null) - { - yield return ("locationSchoolReference.schoolId", this.LocationSchoolReference.SchoolId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -144845,18 +143155,9 @@ string Entities.Common.EdFi.ISection.LocationDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionPutPostRequestValidator : FluentValidation.AbstractValidator
+ public class RestraintEventReasonPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Section = new FullName("edfi", "Section"); - - // Declare collection item validators - private SectionCharacteristicPutPostRequestValidator _sectionCharacteristicsValidator = new (); - private SectionClassPeriodPutPostRequestValidator _sectionClassPeriodsValidator = new (); - private SectionCourseLevelCharacteristicPutPostRequestValidator _sectionCourseLevelCharacteristicsValidator = new (); - private SectionOfferedGradeLevelPutPostRequestValidator _sectionOfferedGradeLevelsValidator = new (); - private SectionProgramPutPostRequestValidator _sectionProgramsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext
context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -144869,72 +143170,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext
var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (SectionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Section); - - if (mappingContract != null) - { - if (mappingContract.IsSectionCharacteristicIncluded != null) - { - var hasInvalidSectionCharacteristicsItems = instance.SectionCharacteristics.Any(x => !mappingContract.IsSectionCharacteristicIncluded(x)); - - if (hasInvalidSectionCharacteristicsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SectionCharacteristics", $"A supplied 'SectionCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsSectionClassPeriodIncluded != null) - { - var hasInvalidSectionClassPeriodsItems = instance.SectionClassPeriods.Any(x => !mappingContract.IsSectionClassPeriodIncluded(x)); - - if (hasInvalidSectionClassPeriodsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SectionClassPeriods", $"A supplied 'SectionClassPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsSectionCourseLevelCharacteristicIncluded != null) - { - var hasInvalidSectionCourseLevelCharacteristicsItems = instance.SectionCourseLevelCharacteristics.Any(x => !mappingContract.IsSectionCourseLevelCharacteristicIncluded(x)); - - if (hasInvalidSectionCourseLevelCharacteristicsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SectionCourseLevelCharacteristics", $"A supplied 'SectionCourseLevelCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsSectionOfferedGradeLevelIncluded != null) - { - var hasInvalidSectionOfferedGradeLevelsItems = instance.SectionOfferedGradeLevels.Any(x => !mappingContract.IsSectionOfferedGradeLevelIncluded(x)); - - if (hasInvalidSectionOfferedGradeLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SectionOfferedGradeLevels", $"A supplied 'SectionOfferedGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsSectionProgramIncluded != null) - { - var hasInvalidSectionProgramsItems = instance.SectionPrograms.Any(x => !mappingContract.IsSectionProgramIncluded(x)); - - if (hasInvalidSectionProgramsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SectionPrograms", $"A supplied 'SectionProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -144950,17 +143185,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext
} // ----------------------------------------------------------------- +} +// Aggregate: RestraintEventReasonDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.RestraintEventReasonDescriptor.EdFi +{ /// - /// A class which represents the edfi.SectionCharacteristic table of the Section aggregate in the ODS Database. + /// A class which represents the edfi.RestraintEventReasonDescriptor table of the RestraintEventReasonDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionCharacteristic : Entities.Common.EdFi.ISectionCharacteristic, IValidatableObject + public class RestraintEventReasonDescriptor : Entities.Common.EdFi.IRestraintEventReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SectionCharacteristic"); + private static FullName _fullName = new FullName("edfi", "RestraintEventReasonDescriptor"); // Fluent validator instance (threadsafe) - private static SectionCharacteristicPutPostRequestValidator _validator = new SectionCharacteristicPutPostRequestValidator(); + private static RestraintEventReasonDescriptorPutPostRequestValidator _validator = new RestraintEventReasonDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -144977,6 +143217,13 @@ public class SectionCharacteristic : Entities.Common.EdFi.ISectionCharacteristic // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the RestraintEventReasonDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -144987,33 +143234,19 @@ public class SectionCharacteristic : Entities.Common.EdFi.ISectionCharacteristic //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISection _section; - - [IgnoreDataMember] - Entities.Common.EdFi.ISection ISectionCharacteristic.Section - { - get { return _section; } - set { SetSection(value); } - } - public Entities.Common.EdFi.ISection Section - { - set { SetSection(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int RestraintEventReasonDescriptorId { get; set; } - private void SetSection(Entities.Common.EdFi.ISection value) + int IDescriptor.DescriptorId { - _section = value; + get { return RestraintEventReasonDescriptorId; } + set { RestraintEventReasonDescriptorId = value; } } - - /// - /// Reflects important characteristics of the section, such as whether or not attendance is taken and the section is graded. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="sectionCharacteristicDescriptor")][DescriptorExists("SectionCharacteristicDescriptor")] - public string SectionCharacteristicDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -145028,7 +143261,7 @@ private void SetSection(Entities.Common.EdFi.ISection value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionCharacteristic; + var compareTo = obj as Entities.Common.EdFi.IRestraintEventReasonDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -145036,13 +143269,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_section == null || !_section.Equals(compareTo.Section)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionCharacteristic).SectionCharacteristicDescriptor, compareTo.SectionCharacteristicDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IRestraintEventReasonDescriptor).RestraintEventReasonDescriptorId.Equals(compareTo.RestraintEventReasonDescriptorId)) return false; @@ -145058,12 +143287,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_section != null) - hash.Add(_section); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISectionCharacteristic).SectionCharacteristicDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IRestraintEventReasonDescriptor).RestraintEventReasonDescriptorId); return hash.ToHashCode(); } @@ -145072,14 +143298,63 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } - // ============================================================= + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -145097,8 +143372,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionCharacteristic")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -145109,6 +143387,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -145121,12 +143406,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionCharacteristic)target); + return Entities.Common.EdFi.RestraintEventReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRestraintEventReasonDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ISectionCharacteristic)target, null); + Entities.Common.EdFi.RestraintEventReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRestraintEventReasonDescriptor)target, null); } // ------------------------------------------------------------- @@ -145134,66 +143419,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -145201,9 +143426,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator + public class RestraintEventReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -145231,17 +143456,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SectionClassPeriod table of the Section aggregate in the ODS Database. + /// A class which represents the edfi.ResultDatatypeTypeDescriptor table of the ResultDatatypeTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionClassPeriod : Entities.Common.EdFi.ISectionClassPeriod, IValidatableObject + public class ResultDatatypeTypeDescriptor : Entities.Common.EdFi.IResultDatatypeTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SectionClassPeriod"); + private static FullName _fullName = new FullName("edfi", "ResultDatatypeTypeDescriptor"); // Fluent validator instance (threadsafe) - private static SectionClassPeriodPutPostRequestValidator _validator = new SectionClassPeriodPutPostRequestValidator(); + private static ResultDatatypeTypeDescriptorPutPostRequestValidator _validator = new ResultDatatypeTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -145258,98 +143488,35 @@ public class SectionClassPeriod : Entities.Common.EdFi.ISectionClassPeriod, IVal // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the ResultDatatypeTypeDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _classPeriodReferenceExplicitlyAssigned; - private ClassPeriod.EdFi.ClassPeriodReference _classPeriodReference; - private ClassPeriod.EdFi.ClassPeriodReference ImplicitClassPeriodReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_classPeriodReference == null && !_classPeriodReferenceExplicitlyAssigned) - _classPeriodReference = new ClassPeriod.EdFi.ClassPeriodReference(); - - return _classPeriodReference; - } - } - - [DataMember(Name="classPeriodReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public ClassPeriod.EdFi.ClassPeriodReference ClassPeriodReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitClassPeriodReference != null - && (_classPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) - return ImplicitClassPeriodReference; - - return null; - } - set - { - _classPeriodReferenceExplicitlyAssigned = true; - _classPeriodReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISection _section; - - [IgnoreDataMember] - Entities.Common.EdFi.ISection ISectionClassPeriod.Section - { - get { return _section; } - set { SetSection(value); } - } - - public Entities.Common.EdFi.ISection Section - { - set { SetSection(value); } - } - - private void SetSection(Entities.Common.EdFi.ISection value) - { - _section = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_classPeriodReferenceExplicitlyAssigned) - { - ImplicitClassPeriodReference.SchoolId = _section.SchoolId; - } - } /// - /// An indication of the portion of a typical daily session in which students receive instruction in a specified subject (e.g., morning, sixth period, block period, or AB schedules). + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodName - { - get - { - if (ImplicitClassPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) - return ImplicitClassPeriodReference.ClassPeriodName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int ResultDatatypeTypeDescriptorId { get; set; } - // ClassPeriod - _classPeriodReferenceExplicitlyAssigned = false; - ImplicitClassPeriodReference.ClassPeriodName = value; - } + int IDescriptor.DescriptorId + { + get { return ResultDatatypeTypeDescriptorId; } + set { ResultDatatypeTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -145365,7 +143532,7 @@ string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionClassPeriod; + var compareTo = obj as Entities.Common.EdFi.IResultDatatypeTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -145373,13 +143540,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_section == null || !_section.Equals(compareTo.Section)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionClassPeriod).ClassPeriodName, compareTo.ClassPeriodName)) + // Derived Property + if (!(this as Entities.Common.EdFi.IResultDatatypeTypeDescriptor).ResultDatatypeTypeDescriptorId.Equals(compareTo.ResultDatatypeTypeDescriptorId)) return false; @@ -145395,12 +143558,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_section != null) - hash.Add(_section); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionClassPeriod).ClassPeriodName); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IResultDatatypeTypeDescriptor).ResultDatatypeTypeDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -145408,6 +143569,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -145433,8 +143643,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionClassPeriod")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -145445,17 +143658,18 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -145463,127 +143677,19 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionClassPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionClassPeriod)target); + return Entities.Common.EdFi.ResultDatatypeTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IResultDatatypeTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionClassPeriodMapper.MapTo(this, (Entities.Common.EdFi.ISectionClassPeriod)target, null); + Entities.Common.EdFi.ResultDatatypeTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IResultDatatypeTypeDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodResourceId - { - get { return null; } - set { ImplicitClassPeriodReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitClassPeriodReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetSchoolIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.ISectionClassPeriod).Section.SchoolId); - - // Obtain value from other references - var valueFromClassPeriodReference = this.ClassPeriodReference?.SchoolId; - - if (valueFromClassPeriodReference != null) - { - yield return ("classPeriodReference.schoolId", this.ClassPeriodReference.SchoolId); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -145591,9 +143697,9 @@ string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionClassPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class ResultDatatypeTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -145621,17 +143727,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SectionCourseLevelCharacteristic table of the Section aggregate in the ODS Database. + /// A class which represents the edfi.RetestIndicatorDescriptor table of the RetestIndicatorDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionCourseLevelCharacteristic : Entities.Common.EdFi.ISectionCourseLevelCharacteristic, IValidatableObject + public class RetestIndicatorDescriptor : Entities.Common.EdFi.IRetestIndicatorDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SectionCourseLevelCharacteristic"); + private static FullName _fullName = new FullName("edfi", "RetestIndicatorDescriptor"); // Fluent validator instance (threadsafe) - private static SectionCourseLevelCharacteristicPutPostRequestValidator _validator = new SectionCourseLevelCharacteristicPutPostRequestValidator(); + private static RetestIndicatorDescriptorPutPostRequestValidator _validator = new RetestIndicatorDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -145648,6 +143759,13 @@ public class SectionCourseLevelCharacteristic : Entities.Common.EdFi.ISectionCou // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the RetestIndicatorDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -145658,33 +143776,19 @@ public class SectionCourseLevelCharacteristic : Entities.Common.EdFi.ISectionCou //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISection _section; - - [IgnoreDataMember] - Entities.Common.EdFi.ISection ISectionCourseLevelCharacteristic.Section - { - get { return _section; } - set { SetSection(value); } - } - public Entities.Common.EdFi.ISection Section - { - set { SetSection(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int RetestIndicatorDescriptorId { get; set; } - private void SetSection(Entities.Common.EdFi.ISection value) + int IDescriptor.DescriptorId { - _section = value; + get { return RetestIndicatorDescriptorId; } + set { RetestIndicatorDescriptorId = value; } } - - /// - /// The type of specific program or designation with which the section is associated. This collection should only be populated if it differs from the course level characteristics identified at the course offering level. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="courseLevelCharacteristicDescriptor")][DescriptorExists("CourseLevelCharacteristicDescriptor")] - public string CourseLevelCharacteristicDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -145699,7 +143803,7 @@ private void SetSection(Entities.Common.EdFi.ISection value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionCourseLevelCharacteristic; + var compareTo = obj as Entities.Common.EdFi.IRetestIndicatorDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -145707,13 +143811,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_section == null || !_section.Equals(compareTo.Section)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor, compareTo.CourseLevelCharacteristicDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IRetestIndicatorDescriptor).RetestIndicatorDescriptorId.Equals(compareTo.RetestIndicatorDescriptorId)) return false; @@ -145729,12 +143829,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_section != null) - hash.Add(_section); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISectionCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IRetestIndicatorDescriptor).RetestIndicatorDescriptorId); return hash.ToHashCode(); } @@ -145743,6 +143840,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -145768,8 +143914,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionCourseLevelCharacteristic")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -145780,6 +143929,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -145792,12 +143948,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionCourseLevelCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionCourseLevelCharacteristic)target); + return Entities.Common.EdFi.RetestIndicatorDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IRetestIndicatorDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionCourseLevelCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ISectionCourseLevelCharacteristic)target, null); + Entities.Common.EdFi.RetestIndicatorDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IRetestIndicatorDescriptor)target, null); } // ------------------------------------------------------------- @@ -145805,66 +143961,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -145872,9 +143968,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionCourseLevelCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator + public class RetestIndicatorDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -145902,17 +143998,86 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SectionOfferedGradeLevel table of the Section aggregate in the ODS Database. + /// Represents a reference to the School resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class SchoolReference : IResourceReference + { + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return SchoolId != default(long); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (SchoolId == default) + { + yield return "SchoolId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "School", + Href = $"/ed-fi/schools/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.School table of the School aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionOfferedGradeLevel : Entities.Common.EdFi.ISectionOfferedGradeLevel, IValidatableObject + public class School : Entities.Common.EdFi.ISchool, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SectionOfferedGradeLevel"); + private static FullName _fullName = new FullName("edfi", "School"); // Fluent validator instance (threadsafe) - private static SectionOfferedGradeLevelPutPostRequestValidator _validator = new SectionOfferedGradeLevelPutPostRequestValidator(); + private static SchoolPutPostRequestValidator _validator = new SchoolPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -145923,49 +144088,123 @@ public class SectionOfferedGradeLevel : Entities.Common.EdFi.ISectionOfferedGrad // Constructor // ------------------------------------------------------------- + public School() + { + SchoolCategories = new List(); + SchoolGradeLevels = new List(); + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the School resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.ISection _section; - - [IgnoreDataMember] - Entities.Common.EdFi.ISection ISectionOfferedGradeLevel.Section + private bool _charterApprovalSchoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _charterApprovalSchoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitCharterApprovalSchoolYearTypeReference { - get { return _section; } - set { SetSection(value); } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_charterApprovalSchoolYearTypeReference == null && !_charterApprovalSchoolYearTypeReferenceExplicitlyAssigned) + _charterApprovalSchoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + + return _charterApprovalSchoolYearTypeReference; + } } - public Entities.Common.EdFi.ISection Section + [DataMember(Name="charterApprovalSchoolYearTypeReference")] + [FullyDefinedReference] + public SchoolYearType.EdFi.SchoolYearTypeReference CharterApprovalSchoolYearTypeReference { - set { SetSection(value); } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCharterApprovalSchoolYearTypeReference != null + && (_charterApprovalSchoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCharterApprovalSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitCharterApprovalSchoolYearTypeReference; + + return null; + } + set + { + _charterApprovalSchoolYearTypeReferenceExplicitlyAssigned = true; + _charterApprovalSchoolYearTypeReference = value; + } + } + private bool _localEducationAgencyReferenceExplicitlyAssigned; + private LocalEducationAgency.EdFi.LocalEducationAgencyReference _localEducationAgencyReference; + private LocalEducationAgency.EdFi.LocalEducationAgencyReference ImplicitLocalEducationAgencyReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_localEducationAgencyReference == null && !_localEducationAgencyReferenceExplicitlyAssigned) + _localEducationAgencyReference = new LocalEducationAgency.EdFi.LocalEducationAgencyReference(); + + return _localEducationAgencyReference; + } } - private void SetSection(Entities.Common.EdFi.ISection value) + [DataMember(Name="localEducationAgencyReference")] + [FullyDefinedReference] + public LocalEducationAgency.EdFi.LocalEducationAgencyReference LocalEducationAgencyReference { - _section = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLocalEducationAgencyReference != null + && (_localEducationAgencyReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocalEducationAgencyReference.IsReferenceFullyDefined())) + return ImplicitLocalEducationAgencyReference; + + return null; + } + set + { + _localEducationAgencyReferenceExplicitlyAssigned = true; + _localEducationAgencyReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The grade levels in which the section is offered. This collection should only be populated if it differs from the Offered Grade Levels identified at the course offering level. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + long IEducationOrganization.EducationOrganizationId + { + get { return SchoolId; } + set { SchoolId = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -145980,7 +144219,7 @@ private void SetSection(Entities.Common.EdFi.ISection value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionOfferedGradeLevel; + var compareTo = obj as Entities.Common.EdFi.ISchool; if (ReferenceEquals(this, compareTo)) return true; @@ -145988,13 +144227,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_section == null || !_section.Equals(compareTo.Section)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionOfferedGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.ISchool).SchoolId.Equals(compareTo.SchoolId)) return false; @@ -146010,12 +144245,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_section != null) - hash.Add(_section); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISectionOfferedGradeLevel).GradeLevelDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISchool).SchoolId); return hash.ToHashCode(); } @@ -146024,11 +144256,154 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// The full, legally accepted name of the institution. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } + + /// + /// The current operational status of the education organization (e.g., active, inactive). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } + + /// + /// A short name for the institution. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } + + /// + /// The public web site address (URL) for the education organization. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The type of education institution as classified by its funding source, for example public or private. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="administrativeFundingControlDescriptor")][DescriptorExists("AdministrativeFundingControlDescriptor")] + public string AdministrativeFundingControlDescriptor { get; set; } + + /// + /// The type of agency that approved the establishment or continuation of a charter school. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="charterApprovalAgencyTypeDescriptor")][DescriptorExists("CharterApprovalAgencyTypeDescriptor")] + public string CharterApprovalAgencyTypeDescriptor { get; set; } + + /// + /// The school year in which a charter school was initially approved. + /// + // IS in a reference, NOT a lookup column + short? Entities.Common.EdFi.ISchool.CharterApprovalSchoolYear + { + get + { + if (ImplicitCharterApprovalSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCharterApprovalSchoolYearTypeReference.IsReferenceFullyDefined())) + { + return ImplicitCharterApprovalSchoolYearTypeReference.SchoolYear; + } + + return default(short?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CharterApprovalSchoolYearType + _charterApprovalSchoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitCharterApprovalSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); + } + } + + /// + /// A school or agency providing free public elementary or secondary education to eligible students under a specific charter granted by the state legislature or other appropriate authority and designated by such authority to be a charter school. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="charterStatusDescriptor")][DescriptorExists("CharterStatusDescriptor")] + public string CharterStatusDescriptor { get; set; } + + /// + /// The type of Internet access available. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="internetAccessDescriptor")][DescriptorExists("InternetAccessDescriptor")] + public string InternetAccessDescriptor { get; set; } + + /// + /// The identifier assigned to a local education agency. It must be distinct from any other identifier assigned to educational organizations, such as a SchoolId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ISchool.LocalEducationAgencyId + { + get + { + if (ImplicitLocalEducationAgencyReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocalEducationAgencyReference.IsReferenceFullyDefined())) + { + return ImplicitLocalEducationAgencyReference.LocalEducationAgencyId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // LocalEducationAgency + _localEducationAgencyReferenceExplicitlyAssigned = false; + ImplicitLocalEducationAgencyReference.LocalEducationAgencyId = value.GetValueOrDefault(); + } + } + + /// + /// A school that has been designed: 1) to attract students of different racial/ethnic backgrounds for the purpose of reducing, preventing, or eliminating racial isolation; and/or 2) to provide an academic or social focus on a particular theme (e.g., science/math, performing arts, gifted/talented, or foreign language). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="magnetSpecialProgramEmphasisSchoolDescriptor")][DescriptorExists("MagnetSpecialProgramEmphasisSchoolDescriptor")] + public string MagnetSpecialProgramEmphasisSchoolDescriptor { get; set; } + + /// + /// The type of education institution as classified by its primary focus. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="schoolTypeDescriptor")][DescriptorExists("SchoolTypeDescriptor")] + public string SchoolTypeDescriptor { get; set; } + + /// + /// Denotes the Title I Part A designation for the school. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="titleIPartASchoolDesignationDescriptor")][DescriptorExists("TitleIPartASchoolDesignationDescriptor")] + public string TitleIPartASchoolDesignationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -146044,28 +144419,267 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionOfferedGradeLevel")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses + { + get { return _educationOrganizationAddresses; } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } + } - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="educationOrganizationCategories")] + public ICollection EducationOrganizationCategories + { + get { return _educationOrganizationCategories; } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators + { + get { return _educationOrganizationIndicators; } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + } + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "School", "School")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _schoolCategories; + private ICollection _schoolCategoriesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="schoolCategories")] + public ICollection SchoolCategories + { + get { return _schoolCategories; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISchoolCategory)e.Item).School = this); + _schoolCategories = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISchoolCategory)e.Item).School = this; + _schoolCategoriesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISchool.SchoolCategories + { + get { return _schoolCategoriesCovariant; } + set { SchoolCategories = new List(value.Cast()); } + } + + private ICollection _schoolGradeLevels; + private ICollection _schoolGradeLevelsCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="gradeLevels")] + public ICollection SchoolGradeLevels + { + get { return _schoolGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISchoolGradeLevel)e.Item).School = this); + _schoolGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISchoolGradeLevel)e.Item).School = this; + _schoolGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISchool.SchoolGradeLevels + { + get { return _schoolGradeLevelsCovariant; } + set { SchoolGradeLevels = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; + } + + if (_schoolCategories != null) foreach (var item in _schoolCategories) + { + item.School = this; + } + + if (_schoolGradeLevels != null) foreach (var item in _schoolGradeLevels) + { + item.School = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -146073,18 +144687,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionOfferedGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionOfferedGradeLevel)target); + return Entities.Common.EdFi.SchoolMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchool)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionOfferedGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ISectionOfferedGradeLevel)target, null); + Entities.Common.EdFi.SchoolMapper.MapTo(this, (Entities.Common.EdFi.ISchool)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ISchool.CharterApprovalSchoolYearTypeResourceId + { + get { return null; } + set { ImplicitCharterApprovalSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.ISchool.LocalEducationAgencyResourceId + { + get { return null; } + set { ImplicitLocalEducationAgencyReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- // ================================== @@ -146102,12 +144730,107 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) + { + yield return result; + } + } + + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) + { + yield return result; + } + } + + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) + { + yield return result; + } + } + + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) + { + yield return result; + } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) + { + yield return result; + } + } + + if (SchoolCategories.Any() && mappingContract?.IsMemberSupported("SchoolCategories") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SchoolCategories"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SchoolCategories, validationContext, validationContext.Items.ForCollection("SchoolCategories")))) + { + yield return result; + } + } + + if (SchoolGradeLevels.Any() && mappingContract?.IsMemberSupported("SchoolGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SchoolGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SchoolGradeLevels, validationContext, validationContext.Items.ForCollection("SchoolGradeLevels")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -146153,9 +144876,21 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionOfferedGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_School = new FullName("edfi", "School"); + + // Declare collection item validators + private SchoolCategoryPutPostRequestValidator _schoolCategoriesValidator = new (); + private SchoolGradeLevelPutPostRequestValidator _schoolGradeLevelsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -146168,6 +144903,105 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (SchoolMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_School); + + if (mappingContract != null) + { + if (mappingContract.IsSchoolCategoryIncluded != null) + { + var hasInvalidSchoolCategoriesItems = instance.SchoolCategories.Any(x => !mappingContract.IsSchoolCategoryIncluded(x)); + + if (hasInvalidSchoolCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SchoolCategories", $"A supplied 'SchoolCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsSchoolGradeLevelIncluded != null) + { + var hasInvalidSchoolGradeLevelsItems = instance.SchoolGradeLevels.Any(x => !mappingContract.IsSchoolGradeLevelIncluded(x)); + + if (hasInvalidSchoolGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SchoolGradeLevels", $"A supplied 'SchoolGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationAddressIncluded != null) + { + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); + + if (hasInvalidEducationOrganizationAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -146184,16 +145018,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SectionProgram table of the Section aggregate in the ODS Database. + /// A class which represents the edfi.SchoolCategory table of the School aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionProgram : Entities.Common.EdFi.ISectionProgram, IValidatableObject + public class SchoolCategory : Entities.Common.EdFi.ISchoolCategory, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SectionProgram"); + private static FullName _fullName = new FullName("edfi", "SchoolCategory"); // Fluent validator instance (threadsafe) - private static SectionProgramPutPostRequestValidator _validator = new SectionProgramPutPostRequestValidator(); + private static SchoolCategoryPutPostRequestValidator _validator = new SchoolCategoryPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -146215,134 +145049,38 @@ public class SectionProgram : Entities.Common.EdFi.ISectionProgram, IValidatable // ============================================================= // References // ------------------------------------------------------------- - - private bool _programReferenceExplicitlyAssigned; - private Program.EdFi.ProgramReference _programReference; - private Program.EdFi.ProgramReference ImplicitProgramReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programReference == null && !_programReferenceExplicitlyAssigned) - _programReference = new Program.EdFi.ProgramReference(); - - return _programReference; - } - } - - [DataMember(Name="programReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Program.EdFi.ProgramReference ProgramReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramReference != null - && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference; - - return null; - } - set - { - _programReferenceExplicitlyAssigned = true; - _programReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISection _section; + private Entities.Common.EdFi.ISchool _school; [IgnoreDataMember] - Entities.Common.EdFi.ISection ISectionProgram.Section - { - get { return _section; } - set { SetSection(value); } - } - - public Entities.Common.EdFi.ISection Section - { - set { SetSection(value); } - } - - private void SetSection(Entities.Common.EdFi.ISection value) + Entities.Common.EdFi.ISchool ISchoolCategory.School { - _section = value; + get { return _school; } + set { SetSchool(value); } } - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ISectionProgram.EducationOrganizationId + public Entities.Common.EdFi.ISchool School { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.EducationOrganizationId = value; - } + set { SetSchool(value); } } - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISectionProgram.ProgramName + private void SetSchool(Entities.Common.EdFi.ISchool value) { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.ProgramName = value; - } + _school = value; } /// - /// The type of program. + /// The one or more categories of school. /// - - // IS in a reference (SectionProgram.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.ISectionProgram.ProgramTypeDescriptor - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramReference.ProgramTypeDescriptor = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="schoolCategoryDescriptor")][DescriptorExists("SchoolCategoryDescriptor")] + public string SchoolCategoryDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -146357,7 +145095,7 @@ string Entities.Common.EdFi.ISectionProgram.ProgramTypeDescriptor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionProgram; + var compareTo = obj as Entities.Common.EdFi.ISchoolCategory; if (ReferenceEquals(this, compareTo)) return true; @@ -146366,22 +145104,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_section == null || !_section.Equals(compareTo.Section)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ISectionProgram).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionProgram).ProgramName, compareTo.ProgramName)) + if (_school == null || !_school.Equals(compareTo.School)) return false; - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISchoolCategory).SchoolCategoryDescriptor, compareTo.SchoolCategoryDescriptor)) return false; @@ -146398,17 +145126,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_section != null) - hash.Add(_section); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionProgram).EducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionProgram).ProgramName); + if (_school != null) + hash.Add(_school); - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.ISectionProgram).ProgramTypeDescriptor); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISchoolCategory).SchoolCategoryDescriptor); return hash.ToHashCode(); } @@ -146442,7 +145164,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionProgram")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "School", "SchoolCategory")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -146466,32 +145188,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionProgram)target); + return Entities.Common.EdFi.SchoolCategoryMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolCategory)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionProgramMapper.MapTo(this, (Entities.Common.EdFi.ISectionProgram)target, null); + Entities.Common.EdFi.SchoolCategoryMapper.MapTo(this, (Entities.Common.EdFi.ISchoolCategory)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISectionProgram.ProgramResourceId - { - get { return null; } - set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISectionProgram.ProgramDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitProgramReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -146560,9 +145268,9 @@ string Entities.Common.EdFi.ISectionProgram.ProgramDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionProgramPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolCategoryPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -146590,159 +145298,303 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the SectionAttendanceTakenEvent resource. + /// A class which represents the edfi.SchoolGradeLevel table of the School aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionAttendanceTakenEventReference : IResourceReference + public class SchoolGradeLevel : Entities.Common.EdFi.ISchoolGradeLevel, IValidatableObject { - [DataMember(Name="calendarCode")] - public string CalendarCode { get; set; } + private static FullName _fullName = new FullName("edfi", "SchoolGradeLevel"); - [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime Date { get; set; } + // Fluent validator instance (threadsafe) + private static SchoolGradeLevelPutPostRequestValidator _validator = new SchoolGradeLevelPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - [DataMember(Name="localCourseCode")] - public string LocalCourseCode { get; set; } + // ============================================================= + // Constructor + // ------------------------------------------------------------- - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + + // ------------------------------------------------------------ - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ - [DataMember(Name="sectionIdentifier")] - public string SectionIdentifier { get; set; } + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- - [DataMember(Name="sessionName")] - public string SessionName { get; set; } + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ISchool _school; + + [IgnoreDataMember] + Entities.Common.EdFi.ISchool ISchoolGradeLevel.School + { + get { return _school; } + set { SetSchool(value); } + } + + public Entities.Common.EdFi.ISchool School + { + set { SetSchool(value); } + } + + private void SetSchool(Entities.Common.EdFi.ISchool value) + { + _school = value; + } /// - /// Gets or sets the resource identifier of the referenced resource. + /// The grade levels served at the school. /// - public Guid ResourceId { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. + /// Determines equality based on the natural key properties of the resource. /// - public string Discriminator { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISchoolGradeLevel; + if (ReferenceEquals(this, compareTo)) + return true; - private Link _link; + if (compareTo == null) + return false; - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + // Parent Property + if (_school == null || !_school.Equals(compareTo.School)) + return false; - return _link; - } + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISchoolGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + return false; + + + return true; } /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Builds the hash code based on the unique identifying values. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - return CalendarCode != default(string) && Date != default(DateTime) && LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string); + var hash = new HashCode(); + //Parent Property + if (_school != null) + hash.Add(_school); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISchoolGradeLevel).GradeLevelDescriptor); + + return hash.ToHashCode(); } + // ------------------------------------------------------------- - IEnumerable IResourceReference.GetUndefinedProperties() + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "School", "SchoolGradeLevel")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - if (CalendarCode == default) - { - yield return "CalendarCode"; - } + return Entities.Common.EdFi.SchoolGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolGradeLevel)target); + } - if (Date == default) - { - yield return "Date"; - } + void IMappable.Map(object target) + { + Entities.Common.EdFi.SchoolGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ISchoolGradeLevel)target, null); + } + // ------------------------------------------------------------- - if (LocalCourseCode == default) - { - yield return "LocalCourseCode"; - } + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- - if (SchoolId == default) - { - yield return "SchoolId"; - } + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; - if (SchoolYear == default) + try { - yield return "SchoolYear"; - } + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - if (SectionIdentifier == default) - { - yield return "SectionIdentifier"; - } + // ---------------------- + // Validate collections + // ---------------------- - if (SessionName == default) + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally { - yield return "SessionName"; + // Restore original length + pathBuilder.Length = originalLength; } - + // ---------------------------------- } + } - private Link CreateLink() + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SchoolGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - var link = new Link + if (context.InstanceToValidate == null) { - Rel = "SectionAttendanceTakenEvent", - Href = $"/ed-fi/sectionAttendanceTakenEvents/{ResourceId:n}" - }; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - if (string.IsNullOrEmpty(Discriminator)) - return link; + return false; + } - string[] linkParts = Discriminator.Split('.'); + var instance = context.InstanceToValidate; - if (linkParts.Length < 2) - return link; + var failures = new List(); - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- + +} +// Aggregate: SchoolCategoryDescriptor +namespace EdFi.Ods.Api.Common.Models.Resources.SchoolCategoryDescriptor.EdFi +{ /// - /// A class which represents the edfi.SectionAttendanceTakenEvent table of the SectionAttendanceTakenEvent aggregate in the ODS Database. + /// A class which represents the edfi.SchoolCategoryDescriptor table of the SchoolCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionAttendanceTakenEvent : Entities.Common.EdFi.ISectionAttendanceTakenEvent, IHasETag, IDateVersionedEntity, IValidatableObject + public class SchoolCategoryDescriptor : Entities.Common.EdFi.ISchoolCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SectionAttendanceTakenEvent"); + private static FullName _fullName = new FullName("edfi", "SchoolCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static SectionAttendanceTakenEventPutPostRequestValidator _validator = new SectionAttendanceTakenEventPutPostRequestValidator(); + private static SchoolCategoryDescriptorPutPostRequestValidator _validator = new SchoolCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -146761,7 +145613,7 @@ public class SectionAttendanceTakenEvent : Entities.Common.EdFi.ISectionAttendan // ------------------------------------------------------------ /// - /// The unique identifier for the SectionAttendanceTakenEvent resource. + /// The unique identifier for the SchoolCategoryDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -146771,293 +145623,23 @@ public class SectionAttendanceTakenEvent : Entities.Common.EdFi.ISectionAttendan // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _calendarDateReferenceExplicitlyAssigned; - private CalendarDate.EdFi.CalendarDateReference _calendarDateReference; - private CalendarDate.EdFi.CalendarDateReference ImplicitCalendarDateReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_calendarDateReference == null && !_calendarDateReferenceExplicitlyAssigned) - _calendarDateReference = new CalendarDate.EdFi.CalendarDateReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- - return _calendarDateReference; - } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int SchoolCategoryDescriptorId { get; set; } - [DataMember(Name="calendarDateReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public CalendarDate.EdFi.CalendarDateReference CalendarDateReference + int IDescriptor.DescriptorId { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCalendarDateReference != null - && (_calendarDateReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) - return ImplicitCalendarDateReference; - - return null; - } - set - { - _calendarDateReferenceExplicitlyAssigned = true; - _calendarDateReference = value; - } - } - private bool _sectionReferenceExplicitlyAssigned; - private Section.EdFi.SectionReference _sectionReference; - private Section.EdFi.SectionReference ImplicitSectionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) - _sectionReference = new Section.EdFi.SectionReference(); - - return _sectionReference; - } - } - - [DataMember(Name="sectionReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Section.EdFi.SectionReference SectionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSectionReference != null - && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference; - - return null; - } - set - { - _sectionReferenceExplicitlyAssigned = true; - _sectionReference = value; - } - } - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); - - return _staffReference; - } - } - - [DataMember(Name="staffReference")] - [FullyDefinedReference] - public Staff.EdFi.StaffReference StaffReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; - - return null; - } - set - { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; - } - } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// The identifier for the calendar. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarCode - { - get - { - if (ImplicitCalendarDateReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) - return ImplicitCalendarDateReference.CalendarCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CalendarDate - _calendarDateReferenceExplicitlyAssigned = false; - ImplicitCalendarDateReference.CalendarCode = value; - } - } - - /// - /// The month, day, and year of the calendar event. - /// - // IS in a reference, NOT a lookup column - DateTime Entities.Common.EdFi.ISectionAttendanceTakenEvent.Date - { - get - { - if (ImplicitCalendarDateReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) - return ImplicitCalendarDateReference.Date; - - return default(DateTime); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CalendarDate - _calendarDateReferenceExplicitlyAssigned = false; - ImplicitCalendarDateReference.Date = value; - } - } - - /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.LocalCourseCode - { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.LocalCourseCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.LocalCourseCode = value; - } - } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ISectionAttendanceTakenEvent.SchoolId - { - get - { - if (ImplicitCalendarDateReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) - return ImplicitCalendarDateReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CalendarDate - _calendarDateReferenceExplicitlyAssigned = false; - ImplicitCalendarDateReference.SchoolId = value; - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolId = value; - } - } - - /// - /// The identifier for the school year. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ISectionAttendanceTakenEvent.SchoolYear - { - get - { - if (ImplicitCalendarDateReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) - return ImplicitCalendarDateReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // CalendarDate - _calendarDateReferenceExplicitlyAssigned = false; - ImplicitCalendarDateReference.SchoolYear = value; - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolYear = value; - } - } - - /// - /// The local identifier assigned to a section. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionIdentifier - { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SectionIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SectionIdentifier = value; - } - } - - /// - /// The identifier for the calendar for the academic session. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SessionName - { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SessionName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SessionName = value; - } + get { return SchoolCategoryDescriptorId; } + set { SchoolCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -147073,7 +145655,7 @@ string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SessionName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionAttendanceTakenEvent; + var compareTo = obj as Entities.Common.EdFi.ISchoolCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -147082,38 +145664,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).CalendarCode, compareTo.CalendarCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).Date.Equals(compareTo.Date)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).LocalCourseCode, compareTo.LocalCourseCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolYear.Equals(compareTo.SchoolYear)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SectionIdentifier, compareTo.SectionIdentifier)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SessionName, compareTo.SessionName)) + // Derived Property + if (!(this as Entities.Common.EdFi.ISchoolCategoryDescriptor).SchoolCategoryDescriptorId.Equals(compareTo.SchoolCategoryDescriptorId)) return false; @@ -147130,26 +145682,9 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).CalendarCode); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).Date); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).LocalCourseCode); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolYear); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SectionIdentifier); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISchoolCategoryDescriptor).SchoolCategoryDescriptorId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SessionName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -147157,47 +145692,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// The date the section attendance taken event was submitted, which could be a different date than the instructional day. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// A unique alphanumeric code assigned to a staff. + /// The description of the descriptor. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffUniqueId - { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - { - return ImplicitStaffReference.StaffUniqueId; - } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -147218,8 +145766,11 @@ string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffUniqueId // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SectionAttendanceTakenEvent", "SectionAttendanceTakenEvent")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -147249,191 +145800,19 @@ string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffUniqueId // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionAttendanceTakenEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionAttendanceTakenEvent)target); + return Entities.Common.EdFi.SchoolCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionAttendanceTakenEventMapper.MapTo(this, (Entities.Common.EdFi.ISectionAttendanceTakenEvent)target, null); + Entities.Common.EdFi.SchoolCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolCategoryDescriptor)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateResourceId - { - get { return null; } - set { ImplicitCalendarDateReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCalendarDateReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionResourceId - { - get { return null; } - set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitSectionReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffResourceId - { - get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStaffReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetSchoolIdSources() - { - // Obtain value from other references - var valueFromCalendarDateReference = this.CalendarDateReference?.SchoolId; - - if (valueFromCalendarDateReference != null) - { - yield return ("calendarDateReference.schoolId", this.CalendarDateReference.SchoolId); - } - - // Obtain value from other references - var valueFromSectionReference = this.SectionReference?.SchoolId; - - if (valueFromSectionReference != null) - { - yield return ("sectionReference.schoolId", this.SectionReference.SchoolId); - } - - } - var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); - - if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, short value)> GetSchoolYearSources() - { - // Obtain value from other references - var valueFromCalendarDateReference = this.CalendarDateReference?.SchoolYear; - - if (valueFromCalendarDateReference != null) - { - yield return ("calendarDateReference.schoolYear", this.CalendarDateReference.SchoolYear); - } - - // Obtain value from other references - var valueFromSectionReference = this.SectionReference?.SchoolYear; - - if (valueFromSectionReference != null) - { - yield return ("sectionReference.schoolYear", this.SectionReference.SchoolYear); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -147441,9 +145820,9 @@ string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionAttendanceTakenEventPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -147472,21 +145851,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SectionCharacteristicDescriptor table of the SectionCharacteristicDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.SchoolChoiceBasisDescriptor table of the SchoolChoiceBasisDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionCharacteristicDescriptor : Entities.Common.EdFi.ISectionCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SchoolChoiceBasisDescriptor : Entities.Common.EdFi.ISchoolChoiceBasisDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SectionCharacteristicDescriptor"); + private static FullName _fullName = new FullName("edfi", "SchoolChoiceBasisDescriptor"); // Fluent validator instance (threadsafe) - private static SectionCharacteristicDescriptorPutPostRequestValidator _validator = new SectionCharacteristicDescriptorPutPostRequestValidator(); + private static SchoolChoiceBasisDescriptorPutPostRequestValidator _validator = new SchoolChoiceBasisDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -147505,7 +145884,7 @@ public class SectionCharacteristicDescriptor : Entities.Common.EdFi.ISectionChar // ------------------------------------------------------------ /// - /// The unique identifier for the SectionCharacteristicDescriptor resource. + /// The unique identifier for the SchoolChoiceBasisDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -147526,12 +145905,12 @@ public class SectionCharacteristicDescriptor : Entities.Common.EdFi.ISectionChar /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SectionCharacteristicDescriptorId { get; set; } + public int SchoolChoiceBasisDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SectionCharacteristicDescriptorId; } - set { SectionCharacteristicDescriptorId = value; } + get { return SchoolChoiceBasisDescriptorId; } + set { SchoolChoiceBasisDescriptorId = value; } } // ------------------------------------------------------------- @@ -147547,7 +145926,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionCharacteristicDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISchoolChoiceBasisDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -147557,7 +145936,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISectionCharacteristicDescriptor).SectionCharacteristicDescriptorId.Equals(compareTo.SectionCharacteristicDescriptorId)) + if (!(this as Entities.Common.EdFi.ISchoolChoiceBasisDescriptor).SchoolChoiceBasisDescriptorId.Equals(compareTo.SchoolChoiceBasisDescriptorId)) return false; @@ -147575,7 +145954,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISectionCharacteristicDescriptor).SectionCharacteristicDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISchoolChoiceBasisDescriptor).SchoolChoiceBasisDescriptorId); return hash.ToHashCode(); } @@ -147692,12 +146071,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionCharacteristicDescriptor)target); + return Entities.Common.EdFi.SchoolChoiceBasisDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolChoiceBasisDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISectionCharacteristicDescriptor)target, null); + Entities.Common.EdFi.SchoolChoiceBasisDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolChoiceBasisDescriptor)target, null); } // ------------------------------------------------------------- @@ -147712,9 +146091,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolChoiceBasisDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -147743,21 +146122,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SectionTypeDescriptor table of the SectionTypeDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.SchoolChoiceImplementStatusDescriptor table of the SchoolChoiceImplementStatusDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SectionTypeDescriptor : Entities.Common.EdFi.ISectionTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SchoolChoiceImplementStatusDescriptor : Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SectionTypeDescriptor"); + private static FullName _fullName = new FullName("edfi", "SchoolChoiceImplementStatusDescriptor"); // Fluent validator instance (threadsafe) - private static SectionTypeDescriptorPutPostRequestValidator _validator = new SectionTypeDescriptorPutPostRequestValidator(); + private static SchoolChoiceImplementStatusDescriptorPutPostRequestValidator _validator = new SchoolChoiceImplementStatusDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -147776,7 +146155,7 @@ public class SectionTypeDescriptor : Entities.Common.EdFi.ISectionTypeDescriptor // ------------------------------------------------------------ /// - /// The unique identifier for the SectionTypeDescriptor resource. + /// The unique identifier for the SchoolChoiceImplementStatusDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -147797,12 +146176,12 @@ public class SectionTypeDescriptor : Entities.Common.EdFi.ISectionTypeDescriptor /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SectionTypeDescriptorId { get; set; } + public int SchoolChoiceImplementStatusDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SectionTypeDescriptorId; } - set { SectionTypeDescriptorId = value; } + get { return SchoolChoiceImplementStatusDescriptorId; } + set { SchoolChoiceImplementStatusDescriptorId = value; } } // ------------------------------------------------------------- @@ -147818,7 +146197,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISectionTypeDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -147828,7 +146207,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISectionTypeDescriptor).SectionTypeDescriptorId.Equals(compareTo.SectionTypeDescriptorId)) + if (!(this as Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor).SchoolChoiceImplementStatusDescriptorId.Equals(compareTo.SchoolChoiceImplementStatusDescriptorId)) return false; @@ -147846,7 +146225,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISectionTypeDescriptor).SectionTypeDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor).SchoolChoiceImplementStatusDescriptorId); return hash.ToHashCode(); } @@ -147963,12 +146342,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SectionTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionTypeDescriptor)target); + return Entities.Common.EdFi.SchoolChoiceImplementStatusDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SectionTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISectionTypeDescriptor)target, null); + Entities.Common.EdFi.SchoolChoiceImplementStatusDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor)target, null); } // ------------------------------------------------------------- @@ -147983,9 +146362,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SectionTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolChoiceImplementStatusDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -148014,21 +146393,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SeparationDescriptor table of the SeparationDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.SchoolFoodServiceProgramServiceDescriptor table of the SchoolFoodServiceProgramServiceDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SeparationDescriptor : Entities.Common.EdFi.ISeparationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SchoolFoodServiceProgramServiceDescriptor : Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SeparationDescriptor"); + private static FullName _fullName = new FullName("edfi", "SchoolFoodServiceProgramServiceDescriptor"); // Fluent validator instance (threadsafe) - private static SeparationDescriptorPutPostRequestValidator _validator = new SeparationDescriptorPutPostRequestValidator(); + private static SchoolFoodServiceProgramServiceDescriptorPutPostRequestValidator _validator = new SchoolFoodServiceProgramServiceDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -148047,7 +146426,7 @@ public class SeparationDescriptor : Entities.Common.EdFi.ISeparationDescriptor, // ------------------------------------------------------------ /// - /// The unique identifier for the SeparationDescriptor resource. + /// The unique identifier for the SchoolFoodServiceProgramServiceDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -148068,12 +146447,12 @@ public class SeparationDescriptor : Entities.Common.EdFi.ISeparationDescriptor, /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SeparationDescriptorId { get; set; } + public int SchoolFoodServiceProgramServiceDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SeparationDescriptorId; } - set { SeparationDescriptorId = value; } + get { return SchoolFoodServiceProgramServiceDescriptorId; } + set { SchoolFoodServiceProgramServiceDescriptorId = value; } } // ------------------------------------------------------------- @@ -148089,7 +146468,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISeparationDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -148099,7 +146478,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISeparationDescriptor).SeparationDescriptorId.Equals(compareTo.SeparationDescriptorId)) + if (!(this as Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor).SchoolFoodServiceProgramServiceDescriptorId.Equals(compareTo.SchoolFoodServiceProgramServiceDescriptorId)) return false; @@ -148117,7 +146496,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISeparationDescriptor).SeparationDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor).SchoolFoodServiceProgramServiceDescriptorId); return hash.ToHashCode(); } @@ -148234,12 +146613,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SeparationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISeparationDescriptor)target); + return Entities.Common.EdFi.SchoolFoodServiceProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SeparationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISeparationDescriptor)target, null); + Entities.Common.EdFi.SchoolFoodServiceProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor)target, null); } // ------------------------------------------------------------- @@ -148254,9 +146633,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SeparationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolFoodServiceProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -148285,21 +146664,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SeparationReasonDescriptor table of the SeparationReasonDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.SchoolTypeDescriptor table of the SchoolTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SeparationReasonDescriptor : Entities.Common.EdFi.ISeparationReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SchoolTypeDescriptor : Entities.Common.EdFi.ISchoolTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SeparationReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "SchoolTypeDescriptor"); // Fluent validator instance (threadsafe) - private static SeparationReasonDescriptorPutPostRequestValidator _validator = new SeparationReasonDescriptorPutPostRequestValidator(); + private static SchoolTypeDescriptorPutPostRequestValidator _validator = new SchoolTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -148318,7 +146697,7 @@ public class SeparationReasonDescriptor : Entities.Common.EdFi.ISeparationReason // ------------------------------------------------------------ /// - /// The unique identifier for the SeparationReasonDescriptor resource. + /// The unique identifier for the SchoolTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -148339,12 +146718,12 @@ public class SeparationReasonDescriptor : Entities.Common.EdFi.ISeparationReason /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SeparationReasonDescriptorId { get; set; } + public int SchoolTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SeparationReasonDescriptorId; } - set { SeparationReasonDescriptorId = value; } + get { return SchoolTypeDescriptorId; } + set { SchoolTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -148360,7 +146739,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISeparationReasonDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISchoolTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -148370,7 +146749,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISeparationReasonDescriptor).SeparationReasonDescriptorId.Equals(compareTo.SeparationReasonDescriptorId)) + if (!(this as Entities.Common.EdFi.ISchoolTypeDescriptor).SchoolTypeDescriptorId.Equals(compareTo.SchoolTypeDescriptorId)) return false; @@ -148388,7 +146767,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISeparationReasonDescriptor).SeparationReasonDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISchoolTypeDescriptor).SchoolTypeDescriptorId); return hash.ToHashCode(); } @@ -148505,12 +146884,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SeparationReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISeparationReasonDescriptor)target); + return Entities.Common.EdFi.SchoolTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SeparationReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISeparationReasonDescriptor)target, null); + Entities.Common.EdFi.SchoolTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISchoolTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -148525,9 +146904,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SeparationReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -148556,21 +146935,86 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.ServiceDescriptor table of the ServiceDescriptor aggregate in the ODS Database. + /// Represents a reference to the SchoolYearType resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class SchoolYearTypeReference : IResourceReference + { + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return SchoolYear != default(short); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "SchoolYearType", + Href = $"/ed-fi/schoolYearTypes/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.SchoolYearType table of the SchoolYearType aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class ServiceDescriptor : Entities.Common.EdFi.IServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class SchoolYearType : Entities.Common.EdFi.ISchoolYearType, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "ServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "SchoolYearType"); // Fluent validator instance (threadsafe) - private static ServiceDescriptorPutPostRequestValidator _validator = new ServiceDescriptorPutPostRequestValidator(); + private static SchoolYearTypePutPostRequestValidator _validator = new SchoolYearTypePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -148589,7 +147033,7 @@ public class ServiceDescriptor : Entities.Common.EdFi.IServiceDescriptor, Entiti // ------------------------------------------------------------ /// - /// The unique identifier for the ServiceDescriptor resource. + /// The unique identifier for the SchoolYearType resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -148606,17 +147050,12 @@ public class ServiceDescriptor : Entities.Common.EdFi.IServiceDescriptor, Entiti // ------------------------------------------------------------- /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// Key for School Year /// // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int ServiceDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return ServiceDescriptorId; } - set { ServiceDescriptorId = value; } - } + [RequiredWithNonDefault] + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -148631,7 +147070,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISchoolYearType; if (ReferenceEquals(this, compareTo)) return true; @@ -148640,8 +147079,8 @@ public override bool Equals(object obj) return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IServiceDescriptor).ServiceDescriptorId.Equals(compareTo.ServiceDescriptorId)) + // Standard Property + if (!(this as Entities.Common.EdFi.ISchoolYearType).SchoolYear.Equals(compareTo.SchoolYear)) return false; @@ -148658,8 +147097,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IServiceDescriptor).ServiceDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISchoolYearType).SchoolYear); return hash.ToHashCode(); } @@ -148668,61 +147107,48 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + + private bool _currentSchoolYearExplicitlyAssigned = false; + private bool _currentSchoolYear; /// - /// The end date of the period when the descriptor is in effect. + /// The code for the current school year. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [DataMember(Name="currentSchoolYear")] + public bool CurrentSchoolYear + { + get => _currentSchoolYear; + set + { + _currentSchoolYear = value; + _currentSchoolYearExplicitlyAssigned = true; + } + } - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } /// - /// A shortened description for the descriptor. + /// The description for the SchoolYear type. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="schoolYearDescription")] + public string SchoolYearDescription { get; set; } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_currentSchoolYearExplicitlyAssigned) + { + yield return "CurrentSchoolYear"; + } + } // ============================================================= // One-to-one relationships @@ -148742,11 +147168,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SchoolYearType", "SchoolYearType")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -148776,12 +147199,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.ServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IServiceDescriptor)target); + return Entities.Common.EdFi.SchoolYearTypeMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISchoolYearType)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.ServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IServiceDescriptor)target, null); + Entities.Common.EdFi.SchoolYearTypeMapper.MapTo(this, (Entities.Common.EdFi.ISchoolYearType)target, null); } // ------------------------------------------------------------- @@ -148789,6 +147212,65 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -148796,9 +147278,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class ServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SchoolYearTypePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -148827,23 +147309,29 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Session resource. + /// Represents a reference to the Section resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class SessionReference : IResourceReference + public class SectionReference : IResourceReference { + [DataMember(Name="localCourseCode")] + public string LocalCourseCode { get; set; } + [DataMember(Name="schoolId")] public long SchoolId { get; set; } [DataMember(Name="schoolYear")] public short SchoolYear { get; set; } + [DataMember(Name="sectionIdentifier")] + public string SectionIdentifier { get; set; } + [DataMember(Name="sessionName")] public string SessionName { get; set; } @@ -148883,11 +147371,16 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return SchoolId != default(long) && SchoolYear != default(short) && SessionName != default(string); + return LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { + if (LocalCourseCode == default) + { + yield return "LocalCourseCode"; + } + if (SchoolId == default) { yield return "SchoolId"; @@ -148898,6 +147391,11 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "SchoolYear"; } + if (SectionIdentifier == default) + { + yield return "SectionIdentifier"; + } + if (SessionName == default) { yield return "SessionName"; @@ -148909,8 +147407,8 @@ private Link CreateLink() { var link = new Link { - Rel = "Session", - Href = $"/ed-fi/sessions/{ResourceId:n}" + Rel = "Section", + Href = $"/ed-fi/sections/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -148937,17 +147435,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.Session table of the Session aggregate in the ODS Database. + /// A class which represents the edfi.Section table of the Section aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class Session : Entities.Common.EdFi.ISession, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class Section : Entities.Common.EdFi.ISection, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Session"); + private static FullName _fullName = new FullName("edfi", "Section"); // Fluent validator instance (threadsafe) - private static SessionPutPostRequestValidator _validator = new SessionPutPostRequestValidator(); + private static SectionPutPostRequestValidator _validator = new SectionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -148958,10 +147455,13 @@ public class Session : Entities.Common.EdFi.ISession, IHasETag, IDateVersionedEn // Constructor // ------------------------------------------------------------- - public Session() + public Section() { - SessionAcademicWeeks = new List(); - SessionGradingPeriods = new List(); + SectionCharacteristics = new List(); + SectionClassPeriods = new List(); + SectionCourseLevelCharacteristics = new List(); + SectionOfferedGradeLevels = new List(); + SectionPrograms = new List(); } // ------------------------------------------------------------ @@ -148971,7 +147471,7 @@ public Session() // ------------------------------------------------------------ /// - /// The unique identifier for the Session resource. + /// The unique identifier for the Section resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -148982,70 +147482,103 @@ public Session() // References // ------------------------------------------------------------- - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference + private bool _courseOfferingReferenceExplicitlyAssigned; + private CourseOffering.EdFi.CourseOfferingReference _courseOfferingReference; + private CourseOffering.EdFi.CourseOfferingReference ImplicitCourseOfferingReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); + if (_courseOfferingReference == null && !_courseOfferingReferenceExplicitlyAssigned) + _courseOfferingReference = new CourseOffering.EdFi.CourseOfferingReference(); - return _schoolReference; + return _courseOfferingReference; } } - [DataMember(Name="schoolReference")] + [DataMember(Name="courseOfferingReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference + public CourseOffering.EdFi.CourseOfferingReference CourseOfferingReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; + if (ImplicitCourseOfferingReference != null + && (_courseOfferingReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) + return ImplicitCourseOfferingReference; return null; } set { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; + _courseOfferingReferenceExplicitlyAssigned = true; + _courseOfferingReference = value; } } - private bool _schoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + private bool _locationReferenceExplicitlyAssigned; + private Location.EdFi.LocationReference _locationReference; + private Location.EdFi.LocationReference ImplicitLocationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) - _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + if (_locationReference == null && !_locationReferenceExplicitlyAssigned) + _locationReference = new Location.EdFi.LocationReference(); - return _schoolYearTypeReference; + return _locationReference; } } - [DataMember(Name="schoolYearTypeReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + [DataMember(Name="locationReference")] + [FullyDefinedReference] + public Location.EdFi.LocationReference LocationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolYearTypeReference != null - && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference; + if (ImplicitLocationReference != null + && (_locationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocationReference.IsReferenceFullyDefined())) + return ImplicitLocationReference; return null; } set { - _schoolYearTypeReferenceExplicitlyAssigned = true; - _schoolYearTypeReference = value; + _locationReferenceExplicitlyAssigned = true; + _locationReference = value; + } + } + private bool _locationSchoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _locationSchoolReference; + private School.EdFi.SchoolReference ImplicitLocationSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_locationSchoolReference == null && !_locationSchoolReferenceExplicitlyAssigned) + _locationSchoolReference = new School.EdFi.SchoolReference(); + + return _locationSchoolReference; + } + } + + [DataMember(Name="locationSchoolReference")] + [FullyDefinedReference] + public School.EdFi.SchoolReference LocationSchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitLocationSchoolReference != null + && (_locationSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitLocationSchoolReference.IsReferenceFullyDefined())) + return ImplicitLocationSchoolReference; + + return null; + } + set + { + _locationSchoolReferenceExplicitlyAssigned = true; + _locationSchoolReference = value; } } // ------------------------------------------------------------- @@ -149054,17 +147587,42 @@ public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference // Primary Key // ------------------------------------------------------------- + /// + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISection.LocalCourseCode + { + get + { + if (ImplicitCourseOfferingReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) + return ImplicitCourseOfferingReference.LocalCourseCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CourseOffering + _courseOfferingReferenceExplicitlyAssigned = false; + ImplicitCourseOfferingReference.LocalCourseCode = value; + } + } + /// /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.ISession.SchoolId + long Entities.Common.EdFi.ISection.SchoolId { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + if (ImplicitCourseOfferingReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) + return ImplicitCourseOfferingReference.SchoolId; return default(long); } @@ -149073,9 +147631,9 @@ long Entities.Common.EdFi.ISession.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; + // CourseOffering + _courseOfferingReferenceExplicitlyAssigned = false; + ImplicitCourseOfferingReference.SchoolId = value; } } @@ -149083,13 +147641,13 @@ long Entities.Common.EdFi.ISession.SchoolId /// The identifier for the school year. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.ISession.SchoolYear + short Entities.Common.EdFi.ISection.SchoolYear { get { - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference.SchoolYear; + if (ImplicitCourseOfferingReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) + return ImplicitCourseOfferingReference.SchoolYear; return default(short); } @@ -149098,20 +147656,45 @@ short Entities.Common.EdFi.ISession.SchoolYear // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value; + // CourseOffering + _courseOfferingReferenceExplicitlyAssigned = false; + ImplicitCourseOfferingReference.SchoolYear = value; } } /// - /// The identifier for the calendar for the academic session. + /// The local identifier assigned to a section. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="sessionName")] - public string SessionName { get; set; } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="sectionIdentifier")] + public string SectionIdentifier { get; set; } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISection.SessionName + { + get + { + if (ImplicitCourseOfferingReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCourseOfferingReference.IsReferenceFullyDefined())) + return ImplicitCourseOfferingReference.SessionName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CourseOffering + _courseOfferingReferenceExplicitlyAssigned = false; + ImplicitCourseOfferingReference.SessionName = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -149126,7 +147709,7 @@ short Entities.Common.EdFi.ISession.SchoolYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISession; + var compareTo = obj as Entities.Common.EdFi.ISection; if (ReferenceEquals(this, compareTo)) return true; @@ -149136,17 +147719,27 @@ public override bool Equals(object obj) // Referenced Property - if (!(this as Entities.Common.EdFi.ISession).SchoolId.Equals(compareTo.SchoolId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISection).LocalCourseCode, compareTo.LocalCourseCode)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.ISession).SchoolYear.Equals(compareTo.SchoolYear)) + if (!(this as Entities.Common.EdFi.ISection).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ISection).SchoolYear.Equals(compareTo.SchoolYear)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISession).SessionName, compareTo.SessionName)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISection).SectionIdentifier, compareTo.SectionIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISection).SessionName, compareTo.SessionName)) return false; @@ -149164,14 +147757,20 @@ public override int GetHashCode() var hash = new HashCode(); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISession).SchoolId); + hash.Add((this as Entities.Common.EdFi.ISection).LocalCourseCode); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISession).SchoolYear); + hash.Add((this as Entities.Common.EdFi.ISection).SchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISection).SchoolYear); // Standard Property - hash.Add((this as Entities.Common.EdFi.ISession).SessionName); + hash.Add((this as Entities.Common.EdFi.ISection).SectionIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISection).SessionName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -149186,59 +147785,157 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Month, day, and year of the first day of the session. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="availableCreditConversion")] + public decimal? AvailableCreditConversion { get; set; } /// - /// Month, day and year of the last day of the session. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The value of credits or units of value awarded for the completion of a course. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EndDate { get; set; } + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="availableCredits")] + public decimal? AvailableCredits { get; set; } /// - /// A descriptor value to indicate the term that the session is associated with. + /// The type of credits or units of value awarded for the completion of a course. /// // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] - public string TermDescriptor { get; set; } - - private bool _totalInstructionalDaysExplicitlyAssigned = false; - private int _totalInstructionalDays; + [DataMember(Name="availableCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string AvailableCreditTypeDescriptor { get; set; } /// - /// The total number of instructional days in the school calendar. + /// The setting in which a student receives education and related services. /// - // NOT in a reference, NOT a lookup column - [Range(0, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="totalInstructionalDays")] - public int TotalInstructionalDays - { - get => _totalInstructionalDays; - set - { - _totalInstructionalDays = value; - _totalInstructionalDaysExplicitlyAssigned = true; + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="educationalEnvironmentDescriptor")][DescriptorExists("EducationalEnvironmentDescriptor")] + public string EducationalEnvironmentDescriptor { get; set; } + + /// + /// The primary language of instruction. If omitted, English is assumed. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="instructionLanguageDescriptor")][DescriptorExists("LanguageDescriptor")] + public string InstructionLanguageDescriptor { get; set; } + + /// + /// A unique number or alphanumeric code assigned to a room by a school, school system, state, or other agency or entity. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISection.LocationClassroomIdentificationCode + { + get + { + if (ImplicitLocationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocationReference.IsReferenceFullyDefined())) + { + return ImplicitLocationReference.ClassroomIdentificationCode; + } + + return default(string); } - } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - // ------------------------------------------------------------- + // Location + _locationReferenceExplicitlyAssigned = false; + ImplicitLocationReference.ClassroomIdentificationCode = value; + } + } - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.ISection.LocationSchoolId { - if (!_totalInstructionalDaysExplicitlyAssigned) + get { - yield return "TotalInstructionalDays"; + if (ImplicitLocationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocationReference.IsReferenceFullyDefined())) + { + return ImplicitLocationReference.SchoolId; + } + + if (ImplicitLocationSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitLocationSchoolReference.IsReferenceFullyDefined())) + { + return ImplicitLocationSchoolReference.SchoolId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Location + _locationReferenceExplicitlyAssigned = false; + ImplicitLocationReference.SchoolId = value.GetValueOrDefault(); + + // LocationSchool + _locationSchoolReferenceExplicitlyAssigned = false; + ImplicitLocationSchoolReference.SchoolId = value.GetValueOrDefault(); } } + /// + /// The media through which teachers provide instruction to students and students and teachers communicate about instructional matters. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="mediumOfInstructionDescriptor")][DescriptorExists("MediumOfInstructionDescriptor")] + public string MediumOfInstructionDescriptor { get; set; } + + /// + /// Indicator of whether this section is used for official daily attendance. Alternatively, official daily attendance may be tied to a class period. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="officialAttendancePeriod")] + public bool? OfficialAttendancePeriod { get; set; } + + /// + /// The type of students the section is offered and tailored to. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="populationServedDescriptor")][DescriptorExists("PopulationServedDescriptor")] + public string PopulationServedDescriptor { get; set; } + + /// + /// A locally-defined name for the section, generally created to make the section more recognizable in informal contexts and generally distinct from the section identifier. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="sectionName")] + public string SectionName { get; set; } + + /// + /// Specifies whether the section is for attendance only, credit only, or both. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="sectionTypeDescriptor")][DescriptorExists("SectionTypeDescriptor")] + public string SectionTypeDescriptor { get; set; } + + /// + /// When a section is part of a sequence of parts for a course, the number of the sequence. If the course has only one part, the value of this section attribute should be 1. + /// + // NOT in a reference, NOT a lookup column + [Range(1, 8, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="sequenceOfCourse")] + public int? SequenceOfCourse { get; set; } + // ------------------------------------------------------------- + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -149257,71 +147954,161 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Session", "Session")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "Section")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _sessionAcademicWeeks; - private ICollection _sessionAcademicWeeksCovariant; + private ICollection _sectionCharacteristics; + private ICollection _sectionCharacteristicsCovariant; [NoDuplicateMembers] - [DataMember(Name="academicWeeks")] - public ICollection SessionAcademicWeeks + [DataMember(Name="characteristics")] + public ICollection SectionCharacteristics { - get { return _sessionAcademicWeeks; } + get { return _sectionCharacteristics; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISessionAcademicWeek)e.Item).Session = this); - _sessionAcademicWeeks = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISectionCharacteristic)e.Item).Section = this); + _sectionCharacteristics = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISessionAcademicWeek)e.Item).Session = this; - _sessionAcademicWeeksCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionCharacteristic)e.Item).Section = this; + _sectionCharacteristicsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISession.SessionAcademicWeeks + ICollection Entities.Common.EdFi.ISection.SectionCharacteristics { - get { return _sessionAcademicWeeksCovariant; } - set { SessionAcademicWeeks = new List(value.Cast()); } + get { return _sectionCharacteristicsCovariant; } + set { SectionCharacteristics = new List(value.Cast()); } } - private ICollection _sessionGradingPeriods; - private ICollection _sessionGradingPeriodsCovariant; + private ICollection _sectionClassPeriods; + private ICollection _sectionClassPeriodsCovariant; [NoDuplicateMembers] - [DataMember(Name="gradingPeriods")] - public ICollection SessionGradingPeriods + [DataMember(Name="classPeriods")] + public ICollection SectionClassPeriods { - get { return _sessionGradingPeriods; } + get { return _sectionClassPeriods; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISessionGradingPeriod)e.Item).Session = this); - _sessionGradingPeriods = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISectionClassPeriod)e.Item).Section = this); + _sectionClassPeriods = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISessionGradingPeriod)e.Item).Session = this; - _sessionGradingPeriodsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionClassPeriod)e.Item).Section = this; + _sectionClassPeriodsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISession.SessionGradingPeriods + ICollection Entities.Common.EdFi.ISection.SectionClassPeriods { - get { return _sessionGradingPeriodsCovariant; } - set { SessionGradingPeriods = new List(value.Cast()); } + get { return _sectionClassPeriodsCovariant; } + set { SectionClassPeriods = new List(value.Cast()); } + } + + private ICollection _sectionCourseLevelCharacteristics; + private ICollection _sectionCourseLevelCharacteristicsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="courseLevelCharacteristics")] + public ICollection SectionCourseLevelCharacteristics + { + get { return _sectionCourseLevelCharacteristics; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISectionCourseLevelCharacteristic)e.Item).Section = this); + _sectionCourseLevelCharacteristics = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionCourseLevelCharacteristic)e.Item).Section = this; + _sectionCourseLevelCharacteristicsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISection.SectionCourseLevelCharacteristics + { + get { return _sectionCourseLevelCharacteristicsCovariant; } + set { SectionCourseLevelCharacteristics = new List(value.Cast()); } + } + + private ICollection _sectionOfferedGradeLevels; + private ICollection _sectionOfferedGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="offeredGradeLevels")] + public ICollection SectionOfferedGradeLevels + { + get { return _sectionOfferedGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISectionOfferedGradeLevel)e.Item).Section = this); + _sectionOfferedGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionOfferedGradeLevel)e.Item).Section = this; + _sectionOfferedGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISection.SectionOfferedGradeLevels + { + get { return _sectionOfferedGradeLevelsCovariant; } + set { SectionOfferedGradeLevels = new List(value.Cast()); } + } + + private ICollection _sectionPrograms; + private ICollection _sectionProgramsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="programs")] + public ICollection SectionPrograms + { + get { return _sectionPrograms; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISectionProgram)e.Item).Section = this); + _sectionPrograms = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISectionProgram)e.Item).Section = this; + _sectionProgramsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISection.SectionPrograms + { + get { return _sectionProgramsCovariant; } + set { SectionPrograms = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -149346,14 +148133,29 @@ public ICollection SessionGradingPeriods internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_sessionAcademicWeeks != null) foreach (var item in _sessionAcademicWeeks) + if (_sectionCharacteristics != null) foreach (var item in _sectionCharacteristics) { - item.Session = this; + item.Section = this; } - if (_sessionGradingPeriods != null) foreach (var item in _sessionGradingPeriods) + if (_sectionClassPeriods != null) foreach (var item in _sectionClassPeriods) { - item.Session = this; + item.Section = this; + } + + if (_sectionCourseLevelCharacteristics != null) foreach (var item in _sectionCourseLevelCharacteristics) + { + item.Section = this; + } + + if (_sectionOfferedGradeLevels != null) foreach (var item in _sectionOfferedGradeLevels) + { + item.Section = this; + } + + if (_sectionPrograms != null) foreach (var item in _sectionPrograms) + { + item.Section = this; } } @@ -149364,29 +148166,50 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SessionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISession)target); + return Entities.Common.EdFi.SectionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISection)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SessionMapper.MapTo(this, (Entities.Common.EdFi.ISession)target, null); + Entities.Common.EdFi.SectionMapper.MapTo(this, (Entities.Common.EdFi.ISection)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISession.SchoolResourceId + Guid? Entities.Common.EdFi.ISection.CourseOfferingResourceId { get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitCourseOfferingReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISection.CourseOfferingDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitCourseOfferingReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.ISession.SchoolYearTypeResourceId + Guid? Entities.Common.EdFi.ISection.LocationResourceId { get { return null; } - set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + set { ImplicitLocationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISection.LocationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitLocationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ISection.LocationSchoolResourceId + { + get { return null; } + set { ImplicitLocationSchoolReference.ResourceId = value ?? default(Guid); } } @@ -149412,25 +148235,61 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (SessionAcademicWeeks.Any() && mappingContract?.IsMemberSupported("SessionAcademicWeeks") != false) + if (SectionCharacteristics.Any() && mappingContract?.IsMemberSupported("SectionCharacteristics") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("SessionAcademicWeeks"); + pathBuilder.Append("SectionCharacteristics"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SessionAcademicWeeks, validationContext, validationContext.Items.ForCollection("SessionAcademicWeeks")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionCharacteristics, validationContext, validationContext.Items.ForCollection("SectionCharacteristics")))) { yield return result; } } - if (SessionGradingPeriods.Any() && mappingContract?.IsMemberSupported("SessionGradingPeriods") != false) + if (SectionClassPeriods.Any() && mappingContract?.IsMemberSupported("SectionClassPeriods") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("SessionGradingPeriods"); + pathBuilder.Append("SectionClassPeriods"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SessionGradingPeriods, validationContext, validationContext.Items.ForCollection("SessionGradingPeriods")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionClassPeriods, validationContext, validationContext.Items.ForCollection("SectionClassPeriods")))) + { + yield return result; + } + } + + if (SectionCourseLevelCharacteristics.Any() && mappingContract?.IsMemberSupported("SectionCourseLevelCharacteristics") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SectionCourseLevelCharacteristics"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionCourseLevelCharacteristics, validationContext, validationContext.Items.ForCollection("SectionCourseLevelCharacteristics")))) + { + yield return result; + } + } + + if (SectionOfferedGradeLevels.Any() && mappingContract?.IsMemberSupported("SectionOfferedGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SectionOfferedGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionOfferedGradeLevels, validationContext, validationContext.Items.ForCollection("SectionOfferedGradeLevels")))) + { + yield return result; + } + } + + if (SectionPrograms.Any() && mappingContract?.IsMemberSupported("SectionPrograms") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SectionPrograms"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SectionPrograms, validationContext, validationContext.Items.ForCollection("SectionPrograms")))) { yield return result; } @@ -149455,6 +148314,45 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForLocationSchoolId = GetLocationSchoolIdSources().ToArray(); + + if (!sourcesForLocationSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForLocationSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForLocationSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'locationSchoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForLocationSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetLocationSchoolIdSources() + { + // Obtain value from other references + var valueFromLocationReference = this.LocationReference?.SchoolId; + + if (valueFromLocationReference != null) + { + yield return ("locationReference.schoolId", this.LocationReference.SchoolId); + } + + // Obtain value from other references + var valueFromLocationSchoolReference = this.LocationSchoolReference?.SchoolId; + + if (valueFromLocationSchoolReference != null) + { + yield return ("locationSchoolReference.schoolId", this.LocationSchoolReference.SchoolId); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -149481,15 +148379,18 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SessionPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionPutPostRequestValidator : FluentValidation.AbstractValidator
{ - private static readonly FullName _fullName_edfi_Session = new FullName("edfi", "Session"); + private static readonly FullName _fullName_edfi_Section = new FullName("edfi", "Section"); // Declare collection item validators - private SessionAcademicWeekPutPostRequestValidator _sessionAcademicWeeksValidator = new (); - private SessionGradingPeriodPutPostRequestValidator _sessionGradingPeriodsValidator = new (); + private SectionCharacteristicPutPostRequestValidator _sectionCharacteristicsValidator = new (); + private SectionClassPeriodPutPostRequestValidator _sectionClassPeriodsValidator = new (); + private SectionCourseLevelCharacteristicPutPostRequestValidator _sectionCourseLevelCharacteristicsValidator = new (); + private SectionOfferedGradeLevelPutPostRequestValidator _sectionOfferedGradeLevelsValidator = new (); + private SectionProgramPutPostRequestValidator _sectionProgramsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext
context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -149506,30 +148407,63 @@ protected override bool PreValidate(FluentValidation.ValidationContext string profileName = null; // Get the current mapping contract - var mappingContract = (SessionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Session); + var mappingContract = (SectionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_Section); if (mappingContract != null) { - if (mappingContract.IsSessionAcademicWeekIncluded != null) + if (mappingContract.IsSectionCharacteristicIncluded != null) { - var hasInvalidSessionAcademicWeeksItems = instance.SessionAcademicWeeks.Any(x => !mappingContract.IsSessionAcademicWeekIncluded(x)); + var hasInvalidSectionCharacteristicsItems = instance.SectionCharacteristics.Any(x => !mappingContract.IsSectionCharacteristicIncluded(x)); - if (hasInvalidSessionAcademicWeeksItems) + if (hasInvalidSectionCharacteristicsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SessionAcademicWeeks", $"A supplied 'SessionAcademicWeek' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("SectionCharacteristics", $"A supplied 'SectionCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsSessionGradingPeriodIncluded != null) + if (mappingContract.IsSectionClassPeriodIncluded != null) { - var hasInvalidSessionGradingPeriodsItems = instance.SessionGradingPeriods.Any(x => !mappingContract.IsSessionGradingPeriodIncluded(x)); + var hasInvalidSectionClassPeriodsItems = instance.SectionClassPeriods.Any(x => !mappingContract.IsSectionClassPeriodIncluded(x)); - if (hasInvalidSessionGradingPeriodsItems) + if (hasInvalidSectionClassPeriodsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SessionGradingPeriods", $"A supplied 'SessionGradingPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("SectionClassPeriods", $"A supplied 'SectionClassPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsSectionCourseLevelCharacteristicIncluded != null) + { + var hasInvalidSectionCourseLevelCharacteristicsItems = instance.SectionCourseLevelCharacteristics.Any(x => !mappingContract.IsSectionCourseLevelCharacteristicIncluded(x)); + + if (hasInvalidSectionCourseLevelCharacteristicsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SectionCourseLevelCharacteristics", $"A supplied 'SectionCourseLevelCharacteristic' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsSectionOfferedGradeLevelIncluded != null) + { + var hasInvalidSectionOfferedGradeLevelsItems = instance.SectionOfferedGradeLevels.Any(x => !mappingContract.IsSectionOfferedGradeLevelIncluded(x)); + + if (hasInvalidSectionOfferedGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SectionOfferedGradeLevels", $"A supplied 'SectionOfferedGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsSectionProgramIncluded != null) + { + var hasInvalidSectionProgramsItems = instance.SectionPrograms.Any(x => !mappingContract.IsSectionProgramIncluded(x)); + + if (hasInvalidSectionProgramsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SectionPrograms", $"A supplied 'SectionProgram' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -149551,16 +148485,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext // ----------------------------------------------------------------- /// - /// A class which represents the edfi.SessionAcademicWeek table of the Session aggregate in the ODS Database. + /// A class which represents the edfi.SectionCharacteristic table of the Section aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SessionAcademicWeek : Entities.Common.EdFi.ISessionAcademicWeek, IValidatableObject + public class SectionCharacteristic : Entities.Common.EdFi.ISectionCharacteristic, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SessionAcademicWeek"); + private static FullName _fullName = new FullName("edfi", "SectionCharacteristic"); // Fluent validator instance (threadsafe) - private static SessionAcademicWeekPutPostRequestValidator _validator = new SessionAcademicWeekPutPostRequestValidator(); + private static SectionCharacteristicPutPostRequestValidator _validator = new SectionCharacteristicPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -149582,94 +148516,38 @@ public class SessionAcademicWeek : Entities.Common.EdFi.ISessionAcademicWeek, IV // ============================================================= // References // ------------------------------------------------------------- - - private bool _academicWeekReferenceExplicitlyAssigned; - private AcademicWeek.EdFi.AcademicWeekReference _academicWeekReference; - private AcademicWeek.EdFi.AcademicWeekReference ImplicitAcademicWeekReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_academicWeekReference == null && !_academicWeekReferenceExplicitlyAssigned) - _academicWeekReference = new AcademicWeek.EdFi.AcademicWeekReference(); - - return _academicWeekReference; - } - } - - [DataMember(Name="academicWeekReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public AcademicWeek.EdFi.AcademicWeekReference AcademicWeekReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitAcademicWeekReference != null - && (_academicWeekReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAcademicWeekReference.IsReferenceFullyDefined())) - return ImplicitAcademicWeekReference; - - return null; - } - set - { - _academicWeekReferenceExplicitlyAssigned = true; - _academicWeekReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISession _session; + private Entities.Common.EdFi.ISection _section; [IgnoreDataMember] - Entities.Common.EdFi.ISession ISessionAcademicWeek.Session + Entities.Common.EdFi.ISection ISectionCharacteristic.Section { - get { return _session; } - set { SetSession(value); } + get { return _section; } + set { SetSection(value); } } - public Entities.Common.EdFi.ISession Session + public Entities.Common.EdFi.ISection Section { - set { SetSession(value); } + set { SetSection(value); } } - private void SetSession(Entities.Common.EdFi.ISession value) + private void SetSection(Entities.Common.EdFi.ISection value) { - _session = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_academicWeekReferenceExplicitlyAssigned) - { - ImplicitAcademicWeekReference.SchoolId = _session.SchoolId; - } + _section = value; } /// - /// The school label for the week. + /// Reflects important characteristics of the section, such as whether or not attendance is taken and the section is graded. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISessionAcademicWeek.WeekIdentifier - { - get - { - if (ImplicitAcademicWeekReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAcademicWeekReference.IsReferenceFullyDefined())) - return ImplicitAcademicWeekReference.WeekIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // AcademicWeek - _academicWeekReferenceExplicitlyAssigned = false; - ImplicitAcademicWeekReference.WeekIdentifier = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="sectionCharacteristicDescriptor")][DescriptorExists("SectionCharacteristicDescriptor")] + public string SectionCharacteristicDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -149684,7 +148562,7 @@ string Entities.Common.EdFi.ISessionAcademicWeek.WeekIdentifier /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISessionAcademicWeek; + var compareTo = obj as Entities.Common.EdFi.ISectionCharacteristic; if (ReferenceEquals(this, compareTo)) return true; @@ -149693,12 +148571,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_session == null || !_session.Equals(compareTo.Session)) + if (_section == null || !_section.Equals(compareTo.Section)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISessionAcademicWeek).WeekIdentifier, compareTo.WeekIdentifier)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionCharacteristic).SectionCharacteristicDescriptor, compareTo.SectionCharacteristicDescriptor)) return false; @@ -149715,11 +148593,12 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_session != null) - hash.Add(_session); + if (_section != null) + hash.Add(_section); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISectionCharacteristic).SectionCharacteristicDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISessionAcademicWeek).WeekIdentifier); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -149752,7 +148631,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Session", "SessionAcademicWeek")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionCharacteristic")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -149769,12 +148648,6 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -149782,32 +148655,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SessionAcademicWeekMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISessionAcademicWeek)target); + return Entities.Common.EdFi.SectionCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionCharacteristic)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SessionAcademicWeekMapper.MapTo(this, (Entities.Common.EdFi.ISessionAcademicWeek)target, null); + Entities.Common.EdFi.SectionCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ISectionCharacteristic)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekResourceId - { - get { return null; } - set { ImplicitAcademicWeekReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitAcademicWeekReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -149850,40 +148709,6 @@ string Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekDiscriminator yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetSchoolIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.ISessionAcademicWeek).Session.SchoolId); - - // Obtain value from other references - var valueFromAcademicWeekReference = this.AcademicWeekReference?.SchoolId; - - if (valueFromAcademicWeekReference != null) - { - yield return ("academicWeekReference.schoolId", this.AcademicWeekReference.SchoolId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -149910,9 +148735,9 @@ string Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SessionAcademicWeekPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -149941,16 +148766,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SessionGradingPeriod table of the Session aggregate in the ODS Database. + /// A class which represents the edfi.SectionClassPeriod table of the Section aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SessionGradingPeriod : Entities.Common.EdFi.ISessionGradingPeriod, IValidatableObject + public class SectionClassPeriod : Entities.Common.EdFi.ISectionClassPeriod, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SessionGradingPeriod"); + private static FullName _fullName = new FullName("edfi", "SectionClassPeriod"); // Fluent validator instance (threadsafe) - private static SessionGradingPeriodPutPostRequestValidator _validator = new SessionGradingPeriodPutPostRequestValidator(); + private static SectionClassPeriodPutPostRequestValidator _validator = new SectionClassPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -149973,37 +148798,37 @@ public class SessionGradingPeriod : Entities.Common.EdFi.ISessionGradingPeriod, // References // ------------------------------------------------------------- - private bool _gradingPeriodReferenceExplicitlyAssigned; - private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; - private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference + private bool _classPeriodReferenceExplicitlyAssigned; + private ClassPeriod.EdFi.ClassPeriodReference _classPeriodReference; + private ClassPeriod.EdFi.ClassPeriodReference ImplicitClassPeriodReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) - _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); + if (_classPeriodReference == null && !_classPeriodReferenceExplicitlyAssigned) + _classPeriodReference = new ClassPeriod.EdFi.ClassPeriodReference(); - return _gradingPeriodReference; + return _classPeriodReference; } } - [DataMember(Name="gradingPeriodReference")] + [DataMember(Name="classPeriodReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference + public ClassPeriod.EdFi.ClassPeriodReference ClassPeriodReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGradingPeriodReference != null - && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference; + if (ImplicitClassPeriodReference != null + && (_classPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) + return ImplicitClassPeriodReference; return null; } set { - _gradingPeriodReferenceExplicitlyAssigned = true; - _gradingPeriodReference = value; + _classPeriodReferenceExplicitlyAssigned = true; + _classPeriodReference = value; } } // ------------------------------------------------------------- @@ -150011,64 +148836,42 @@ public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISession _session; + private Entities.Common.EdFi.ISection _section; [IgnoreDataMember] - Entities.Common.EdFi.ISession ISessionGradingPeriod.Session + Entities.Common.EdFi.ISection ISectionClassPeriod.Section { - get { return _session; } - set { SetSession(value); } + get { return _section; } + set { SetSection(value); } } - public Entities.Common.EdFi.ISession Session + public Entities.Common.EdFi.ISection Section { - set { SetSession(value); } + set { SetSection(value); } } - private void SetSession(Entities.Common.EdFi.ISession value) + private void SetSection(Entities.Common.EdFi.ISection value) { - _session = value; + _section = value; // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_gradingPeriodReferenceExplicitlyAssigned) - { - ImplicitGradingPeriodReference.SchoolId = _session.SchoolId; - ImplicitGradingPeriodReference.SchoolYear = _session.SchoolYear; - } - } - - /// - /// The state's name of the period for which grades are reported. - /// - - // IS in a reference (SessionGradingPeriod.GradingPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDescriptor - { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodDescriptor; - - return null; - } - set + if (!_classPeriodReferenceExplicitlyAssigned) { - ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + ImplicitClassPeriodReference.SchoolId = _section.SchoolId; } } /// - /// The school's descriptive name of the grading period. + /// An indication of the portion of a typical daily session in which students receive instruction in a specified subject (e.g., morning, sixth period, block period, or AB schedules). /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodName + string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodName { get { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodName; + if (ImplicitClassPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitClassPeriodReference.IsReferenceFullyDefined())) + return ImplicitClassPeriodReference.ClassPeriodName; return default(string); } @@ -150077,9 +148880,9 @@ string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodName // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.GradingPeriodName = value; + // ClassPeriod + _classPeriodReferenceExplicitlyAssigned = false; + ImplicitClassPeriodReference.ClassPeriodName = value; } } // ------------------------------------------------------------- @@ -150096,7 +148899,7 @@ string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISessionGradingPeriod; + var compareTo = obj as Entities.Common.EdFi.ISectionClassPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -150105,17 +148908,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_session == null || !_session.Equals(compareTo.Session)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) + if (_section == null || !_section.Equals(compareTo.Section)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodName, compareTo.GradingPeriodName)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionClassPeriod).ClassPeriodName, compareTo.ClassPeriodName)) return false; @@ -150132,15 +148930,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_session != null) - hash.Add(_session); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodDescriptor); - + if (_section != null) + hash.Add(_section); //Referenced Property - hash.Add((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodName); + hash.Add((this as Entities.Common.EdFi.ISectionClassPeriod).ClassPeriodName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -150173,7 +148967,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Session", "SessionGradingPeriod")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionClassPeriod")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -150203,29 +148997,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SessionGradingPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISessionGradingPeriod)target); + return Entities.Common.EdFi.SectionClassPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionClassPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SessionGradingPeriodMapper.MapTo(this, (Entities.Common.EdFi.ISessionGradingPeriod)target, null); + Entities.Common.EdFi.SectionClassPeriodMapper.MapTo(this, (Entities.Common.EdFi.ISectionClassPeriod)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodResourceId + Guid? Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodResourceId { get { return null; } - set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } + set { ImplicitClassPeriodReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDiscriminator + string Entities.Common.EdFi.ISectionClassPeriod.ClassPeriodDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitGradingPeriodReference.Discriminator = value; } + set { ImplicitClassPeriodReference.Discriminator = value; } } @@ -150294,47 +149088,20 @@ string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDiscriminator IEnumerable<(string path, long value)> GetSchoolIdSources() { // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.ISessionGradingPeriod).Session.SchoolId); + yield return (null, (this as Entities.Common.EdFi.ISectionClassPeriod).Section.SchoolId); // Obtain value from other references - var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolId; + var valueFromClassPeriodReference = this.ClassPeriodReference?.SchoolId; - if (valueFromGradingPeriodReference != null) + if (valueFromClassPeriodReference != null) { - yield return ("gradingPeriodReference.schoolId", this.GradingPeriodReference.SchoolId); + yield return ("classPeriodReference.schoolId", this.ClassPeriodReference.SchoolId); } } - var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); - - if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, short value)> GetSchoolYearSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.ISessionGradingPeriod).Session.SchoolYear); - - // Obtain value from other references - var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolYear; - - if (valueFromGradingPeriodReference != null) - { - yield return ("gradingPeriodReference.schoolYear", this.GradingPeriodReference.SchoolYear); - } - - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); if (!fluentValidationResult.IsValid) { @@ -150358,9 +149125,9 @@ string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SessionGradingPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionClassPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -150388,22 +149155,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SexDescriptor table of the SexDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.SectionCourseLevelCharacteristic table of the Section aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SexDescriptor : Entities.Common.EdFi.ISexDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SectionCourseLevelCharacteristic : Entities.Common.EdFi.ISectionCourseLevelCharacteristic, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SexDescriptor"); + private static FullName _fullName = new FullName("edfi", "SectionCourseLevelCharacteristic"); // Fluent validator instance (threadsafe) - private static SexDescriptorPutPostRequestValidator _validator = new SexDescriptorPutPostRequestValidator(); + private static SectionCourseLevelCharacteristicPutPostRequestValidator _validator = new SectionCourseLevelCharacteristicPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -150420,13 +149182,6 @@ public class SexDescriptor : Entities.Common.EdFi.ISexDescriptor, Entities.Commo // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the SexDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -150437,19 +149192,33 @@ public class SexDescriptor : Entities.Common.EdFi.ISexDescriptor, Entities.Commo //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ISection _section; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int SexDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.ISection ISectionCourseLevelCharacteristic.Section + { + get { return _section; } + set { SetSection(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.ISection Section { - get { return SexDescriptorId; } - set { SexDescriptorId = value; } + set { SetSection(value); } + } + + private void SetSection(Entities.Common.EdFi.ISection value) + { + _section = value; } + + /// + /// The type of specific program or designation with which the section is associated. This collection should only be populated if it differs from the course level characteristics identified at the course offering level. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="courseLevelCharacteristicDescriptor")][DescriptorExists("CourseLevelCharacteristicDescriptor")] + public string CourseLevelCharacteristicDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -150464,7 +149233,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISexDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISectionCourseLevelCharacteristic; if (ReferenceEquals(this, compareTo)) return true; @@ -150472,9 +149241,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_section == null || !_section.Equals(compareTo.Section)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.ISexDescriptor).SexDescriptorId.Equals(compareTo.SexDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor, compareTo.CourseLevelCharacteristicDescriptor)) return false; @@ -150490,9 +149263,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_section != null) + hash.Add(_section); - //Derived Property - hash.Add((this as Entities.Common.EdFi.ISexDescriptor).SexDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISectionCourseLevelCharacteristic).CourseLevelCharacteristicDescriptor); return hash.ToHashCode(); } @@ -150501,55 +149277,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -150575,11 +149302,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionCourseLevelCharacteristic")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -150590,13 +149314,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -150609,12 +149326,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SexDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISexDescriptor)target); + return Entities.Common.EdFi.SectionCourseLevelCharacteristicMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionCourseLevelCharacteristic)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SexDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISexDescriptor)target, null); + Entities.Common.EdFi.SectionCourseLevelCharacteristicMapper.MapTo(this, (Entities.Common.EdFi.ISectionCourseLevelCharacteristic)target, null); } // ------------------------------------------------------------- @@ -150622,6 +149339,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -150629,9 +149406,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SexDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionCourseLevelCharacteristicPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -150659,120 +149436,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the SourceDimension resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class SourceDimensionReference : IResourceReference - { - [DataMember(Name="code")] - public string Code { get; set; } - - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return Code != default(string) && FiscalYear != default(int); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (Code == default) - { - yield return "Code"; - } - - if (FiscalYear == default) - { - yield return "FiscalYear"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "SourceDimension", - Href = $"/ed-fi/sourceDimensions/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.SourceDimension table of the SourceDimension aggregate in the ODS Database. + /// A class which represents the edfi.SectionOfferedGradeLevel table of the Section aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class SourceDimension : Entities.Common.EdFi.ISourceDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class SectionOfferedGradeLevel : Entities.Common.EdFi.ISectionOfferedGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SourceDimension"); + private static FullName _fullName = new FullName("edfi", "SectionOfferedGradeLevel"); // Fluent validator instance (threadsafe) - private static SourceDimensionPutPostRequestValidator _validator = new SourceDimensionPutPostRequestValidator(); + private static SectionOfferedGradeLevelPutPostRequestValidator _validator = new SectionOfferedGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -150783,23 +149457,12 @@ public class SourceDimension : Entities.Common.EdFi.ISourceDimension, IHasETag, // Constructor // ------------------------------------------------------------- - public SourceDimension() - { - SourceDimensionReportingTags = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the SourceDimension resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -150810,35 +149473,33 @@ public SourceDimension() //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.ISection _section; - /// - /// The code representation of the account source dimension. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="code")] - public string Code { get; set; } - - private bool _fiscalYearExplicitlyAssigned = false; - private int _fiscalYear; + [IgnoreDataMember] + Entities.Common.EdFi.ISection ISectionOfferedGradeLevel.Section + { + get { return _section; } + set { SetSection(value); } + } - /// - /// The fiscal year for which the account source dimension is valid. - /// - // NOT in a reference, NOT a lookup column - [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fiscalYear")] - public int FiscalYear - { - get => _fiscalYear; - set - { - _fiscalYear = value; - _fiscalYearExplicitlyAssigned = true; - } + public Entities.Common.EdFi.ISection Section + { + set { SetSection(value); } + } + + private void SetSection(Entities.Common.EdFi.ISection value) + { + _section = value; } + /// + /// The grade levels in which the section is offered. This collection should only be populated if it differs from the Offered Grade Levels identified at the course offering level. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -150853,7 +149514,7 @@ public int FiscalYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISourceDimension; + var compareTo = obj as Entities.Common.EdFi.ISectionOfferedGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -150861,14 +149522,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISourceDimension).Code, compareTo.Code)) + // Parent Property + if (_section == null || !_section.Equals(compareTo.Section)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.ISourceDimension).FiscalYear.Equals(compareTo.FiscalYear)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionOfferedGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -150884,13 +149544,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_section != null) + hash.Add(_section); // Standard Property - hash.Add((this as Entities.Common.EdFi.ISourceDimension).Code); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISourceDimension).FiscalYear); + hash.Add((this as Entities.Common.EdFi.ISectionOfferedGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -150904,24 +149563,8 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// A description of the account source dimension. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeName")] - public string CodeName { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_fiscalYearExplicitlyAssigned) - { - yield return "FiscalYear"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -150940,71 +149583,23 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SourceDimension", "SourceDimension")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionOfferedGradeLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _sourceDimensionReportingTags; - private ICollection _sourceDimensionReportingTagsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="reportingTags")] - public ICollection SourceDimensionReportingTags - { - get { return _sourceDimensionReportingTags; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.ISourceDimensionReportingTag)e.Item).SourceDimension = this); - _sourceDimensionReportingTags = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISourceDimensionReportingTag)e.Item).SourceDimension = this; - _sourceDimensionReportingTagsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ISourceDimension.SourceDimensionReportingTags - { - get { return _sourceDimensionReportingTagsCovariant; } - set { SourceDimensionReportingTags = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_sourceDimensionReportingTags != null) foreach (var item in _sourceDimensionReportingTags) - { - item.SourceDimension = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -151012,12 +149607,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SourceDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISourceDimension)target); + return Entities.Common.EdFi.SectionOfferedGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionOfferedGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SourceDimensionMapper.MapTo(this, (Entities.Common.EdFi.ISourceDimension)target, null); + Entities.Common.EdFi.SectionOfferedGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.ISectionOfferedGradeLevel)target, null); } // ------------------------------------------------------------- @@ -151041,23 +149636,12 @@ void IMappable.Map(object target) try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (SourceDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("SourceDimensionReportingTags") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("SourceDimensionReportingTags"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SourceDimensionReportingTags, validationContext, validationContext.Items.ForCollection("SourceDimensionReportingTags")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -151103,14 +149687,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SourceDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionOfferedGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_SourceDimension = new FullName("edfi", "SourceDimension"); - - // Declare collection item validators - private SourceDimensionReportingTagPutPostRequestValidator _sourceDimensionReportingTagsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -151123,28 +149702,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (SourceDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_SourceDimension); - - if (mappingContract != null) - { - if (mappingContract.IsSourceDimensionReportingTagIncluded != null) - { - var hasInvalidSourceDimensionReportingTagsItems = instance.SourceDimensionReportingTags.Any(x => !mappingContract.IsSourceDimensionReportingTagIncluded(x)); - - if (hasInvalidSourceDimensionReportingTagsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("SourceDimensionReportingTags", $"A supplied 'SourceDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -151161,16 +149718,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SourceDimensionReportingTag table of the SourceDimension aggregate in the ODS Database. + /// A class which represents the edfi.SectionProgram table of the Section aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SourceDimensionReportingTag : Entities.Common.EdFi.ISourceDimensionReportingTag, IValidatableObject + public class SectionProgram : Entities.Common.EdFi.ISectionProgram, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SourceDimensionReportingTag"); + private static FullName _fullName = new FullName("edfi", "SectionProgram"); // Fluent validator instance (threadsafe) - private static SourceDimensionReportingTagPutPostRequestValidator _validator = new SourceDimensionReportingTagPutPostRequestValidator(); + private static SectionProgramPutPostRequestValidator _validator = new SectionProgramPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -151192,38 +149749,134 @@ public class SourceDimensionReportingTag : Entities.Common.EdFi.ISourceDimension // ============================================================= // References // ------------------------------------------------------------- + + private bool _programReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _programReference; + private Program.EdFi.ProgramReference ImplicitProgramReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programReference == null && !_programReferenceExplicitlyAssigned) + _programReference = new Program.EdFi.ProgramReference(); + + return _programReference; + } + } + + [DataMember(Name="programReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Program.EdFi.ProgramReference ProgramReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramReference != null + && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference; + + return null; + } + set + { + _programReferenceExplicitlyAssigned = true; + _programReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.ISourceDimension _sourceDimension; + private Entities.Common.EdFi.ISection _section; [IgnoreDataMember] - Entities.Common.EdFi.ISourceDimension ISourceDimensionReportingTag.SourceDimension + Entities.Common.EdFi.ISection ISectionProgram.Section { - get { return _sourceDimension; } - set { SetSourceDimension(value); } + get { return _section; } + set { SetSection(value); } } - public Entities.Common.EdFi.ISourceDimension SourceDimension + public Entities.Common.EdFi.ISection Section { - set { SetSourceDimension(value); } + set { SetSection(value); } } - private void SetSourceDimension(Entities.Common.EdFi.ISourceDimension value) + private void SetSection(Entities.Common.EdFi.ISection value) { - _sourceDimension = value; + _section = value; } /// - /// Optional tag for accountability reporting. + /// The identifier assigned to an education organization. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] - public string ReportingTagDescriptor { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ISectionProgram.EducationOrganizationId + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.EducationOrganizationId = value; + } + } + + /// + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISectionProgram.ProgramName + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.ProgramName = value; + } + } + + /// + /// The type of program. + /// + + // IS in a reference (SectionProgram.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.ISectionProgram.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramReference.ProgramTypeDescriptor = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -151238,7 +149891,7 @@ private void SetSourceDimension(Entities.Common.EdFi.ISourceDimension value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISourceDimensionReportingTag; + var compareTo = obj as Entities.Common.EdFi.ISectionProgram; if (ReferenceEquals(this, compareTo)) return true; @@ -151247,12 +149900,22 @@ public override bool Equals(object obj) return false; // Parent Property - if (_sourceDimension == null || !_sourceDimension.Equals(compareTo.SourceDimension)) + if (_section == null || !_section.Equals(compareTo.Section)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISourceDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + // Referenced Property + if (!(this as Entities.Common.EdFi.ISectionProgram).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionProgram).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISectionProgram).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -151269,11 +149932,17 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_sourceDimension != null) - hash.Add(_sourceDimension); + if (_section != null) + hash.Add(_section); - // Standard Property - hash.Add((this as Entities.Common.EdFi.ISourceDimensionReportingTag).ReportingTagDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionProgram).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionProgram).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.ISectionProgram).ProgramTypeDescriptor); return hash.ToHashCode(); } @@ -151307,7 +149976,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SourceDimension", "SourceDimensionReportingTag")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Section", "SectionProgram")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -151331,18 +150000,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SourceDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISourceDimensionReportingTag)target); + return Entities.Common.EdFi.SectionProgramMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionProgram)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SourceDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.ISourceDimensionReportingTag)target, null); + Entities.Common.EdFi.SectionProgramMapper.MapTo(this, (Entities.Common.EdFi.ISectionProgram)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ISectionProgram.ProgramResourceId + { + get { return null; } + set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISectionProgram.ProgramDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -151411,9 +150094,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SourceDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionProgramPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -151442,21 +150125,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SourceSystemDescriptor table of the SourceSystemDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.Section504DisabilityTypeDescriptor table of the Section504DisabilityTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SourceSystemDescriptor : Entities.Common.EdFi.ISourceSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class Section504DisabilityTypeDescriptor : Entities.Common.EdFi.ISection504DisabilityTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SourceSystemDescriptor"); + private static FullName _fullName = new FullName("edfi", "Section504DisabilityTypeDescriptor"); // Fluent validator instance (threadsafe) - private static SourceSystemDescriptorPutPostRequestValidator _validator = new SourceSystemDescriptorPutPostRequestValidator(); + private static Section504DisabilityTypeDescriptorPutPostRequestValidator _validator = new Section504DisabilityTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -151475,7 +150158,7 @@ public class SourceSystemDescriptor : Entities.Common.EdFi.ISourceSystemDescript // ------------------------------------------------------------ /// - /// The unique identifier for the SourceSystemDescriptor resource. + /// The unique identifier for the Section504DisabilityTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -151496,12 +150179,12 @@ public class SourceSystemDescriptor : Entities.Common.EdFi.ISourceSystemDescript /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SourceSystemDescriptorId { get; set; } + public int Section504DisabilityTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SourceSystemDescriptorId; } - set { SourceSystemDescriptorId = value; } + get { return Section504DisabilityTypeDescriptorId; } + set { Section504DisabilityTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -151517,7 +150200,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISourceSystemDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISection504DisabilityTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -151527,7 +150210,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISourceSystemDescriptor).SourceSystemDescriptorId.Equals(compareTo.SourceSystemDescriptorId)) + if (!(this as Entities.Common.EdFi.ISection504DisabilityTypeDescriptor).Section504DisabilityTypeDescriptorId.Equals(compareTo.Section504DisabilityTypeDescriptorId)) return false; @@ -151545,7 +150228,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISourceSystemDescriptor).SourceSystemDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISection504DisabilityTypeDescriptor).Section504DisabilityTypeDescriptorId); return hash.ToHashCode(); } @@ -151662,12 +150345,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SourceSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISourceSystemDescriptor)target); + return Entities.Common.EdFi.Section504DisabilityTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISection504DisabilityTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SourceSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISourceSystemDescriptor)target, null); + Entities.Common.EdFi.Section504DisabilityTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISection504DisabilityTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -151682,9 +150365,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SourceSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class Section504DisabilityTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -151713,21 +150396,158 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SpecialEducationExitReasonDescriptor table of the SpecialEducationExitReasonDescriptor aggregate in the ODS Database. + /// Represents a reference to the SectionAttendanceTakenEvent resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class SectionAttendanceTakenEventReference : IResourceReference + { + [DataMember(Name="calendarCode")] + public string CalendarCode { get; set; } + + [DataMember(Name="date")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime Date { get; set; } + + [DataMember(Name="localCourseCode")] + public string LocalCourseCode { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + + [DataMember(Name="sectionIdentifier")] + public string SectionIdentifier { get; set; } + + [DataMember(Name="sessionName")] + public string SessionName { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return CalendarCode != default(string) && Date != default(DateTime) && LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (CalendarCode == default) + { + yield return "CalendarCode"; + } + + if (Date == default) + { + yield return "Date"; + } + + if (LocalCourseCode == default) + { + yield return "LocalCourseCode"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + + if (SectionIdentifier == default) + { + yield return "SectionIdentifier"; + } + + if (SessionName == default) + { + yield return "SessionName"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "SectionAttendanceTakenEvent", + Href = $"/ed-fi/sectionAttendanceTakenEvents/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.SectionAttendanceTakenEvent table of the SectionAttendanceTakenEvent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SpecialEducationExitReasonDescriptor : Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SectionAttendanceTakenEvent : Entities.Common.EdFi.ISectionAttendanceTakenEvent, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "SpecialEducationExitReasonDescriptor"); + private static FullName _fullName = new FullName("edfi", "SectionAttendanceTakenEvent"); // Fluent validator instance (threadsafe) - private static SpecialEducationExitReasonDescriptorPutPostRequestValidator _validator = new SpecialEducationExitReasonDescriptorPutPostRequestValidator(); + private static SectionAttendanceTakenEventPutPostRequestValidator _validator = new SectionAttendanceTakenEventPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -151746,7 +150566,7 @@ public class SpecialEducationExitReasonDescriptor : Entities.Common.EdFi.ISpecia // ------------------------------------------------------------ /// - /// The unique identifier for the SpecialEducationExitReasonDescriptor resource. + /// The unique identifier for the SectionAttendanceTakenEvent resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -151756,67 +150576,811 @@ public class SpecialEducationExitReasonDescriptor : Entities.Common.EdFi.ISpecia // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int SpecialEducationExitReasonDescriptorId { get; set; } - - int IDescriptor.DescriptorId + private bool _calendarDateReferenceExplicitlyAssigned; + private CalendarDate.EdFi.CalendarDateReference _calendarDateReference; + private CalendarDate.EdFi.CalendarDateReference ImplicitCalendarDateReference { - get { return SpecialEducationExitReasonDescriptorId; } - set { SpecialEducationExitReasonDescriptorId = value; } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_calendarDateReference == null && !_calendarDateReferenceExplicitlyAssigned) + _calendarDateReference = new CalendarDate.EdFi.CalendarDateReference(); + + return _calendarDateReference; + } } - // ------------------------------------------------------------- - // ============================================================= - // Equality - // ------------------------------------------------------------- + [DataMember(Name="calendarDateReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public CalendarDate.EdFi.CalendarDateReference CalendarDateReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCalendarDateReference != null + && (_calendarDateReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) + return ImplicitCalendarDateReference; - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + return null; + } + set + { + _calendarDateReferenceExplicitlyAssigned = true; + _calendarDateReference = value; + } + } + private bool _sectionReferenceExplicitlyAssigned; + private Section.EdFi.SectionReference _sectionReference; + private Section.EdFi.SectionReference ImplicitSectionReference { - var compareTo = obj as Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor; + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) + _sectionReference = new Section.EdFi.SectionReference(); - if (ReferenceEquals(this, compareTo)) - return true; + return _sectionReference; + } + } - if (compareTo == null) - return false; + [DataMember(Name="sectionReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Section.EdFi.SectionReference SectionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSectionReference != null + && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference; + return null; + } + set + { + _sectionReferenceExplicitlyAssigned = true; + _sectionReference = value; + } + } + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); - // Derived Property - if (!(this as Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor).SpecialEducationExitReasonDescriptorId.Equals(compareTo.SpecialEducationExitReasonDescriptorId)) - return false; + return _staffReference; + } + } + [DataMember(Name="staffReference")] + [FullyDefinedReference] + public Staff.EdFi.StaffReference StaffReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; - return true; + return null; + } + set + { + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// Builds the hash code based on the unique identifying values. + /// The identifier for the calendar. /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarCode + { + get + { + if (ImplicitCalendarDateReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) + return ImplicitCalendarDateReference.CalendarCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CalendarDate + _calendarDateReferenceExplicitlyAssigned = false; + ImplicitCalendarDateReference.CalendarCode = value; + } + } + + /// + /// The month, day, and year of the calendar event. + /// + // IS in a reference, NOT a lookup column + DateTime Entities.Common.EdFi.ISectionAttendanceTakenEvent.Date + { + get + { + if (ImplicitCalendarDateReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) + return ImplicitCalendarDateReference.Date; + + return default(DateTime); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CalendarDate + _calendarDateReferenceExplicitlyAssigned = false; + ImplicitCalendarDateReference.Date = value; + } + } + + /// + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.LocalCourseCode + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.LocalCourseCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.LocalCourseCode = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ISectionAttendanceTakenEvent.SchoolId + { + get + { + if (ImplicitCalendarDateReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) + return ImplicitCalendarDateReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CalendarDate + _calendarDateReferenceExplicitlyAssigned = false; + ImplicitCalendarDateReference.SchoolId = value; + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolId = value; + } + } + + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.ISectionAttendanceTakenEvent.SchoolYear + { + get + { + if (ImplicitCalendarDateReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarDateReference.IsReferenceFullyDefined())) + return ImplicitCalendarDateReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // CalendarDate + _calendarDateReferenceExplicitlyAssigned = false; + ImplicitCalendarDateReference.SchoolYear = value; + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolYear = value; + } + } + + /// + /// The local identifier assigned to a section. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionIdentifier + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SectionIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SectionIdentifier = value; + } + } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SessionName + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SessionName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SessionName = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISectionAttendanceTakenEvent; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).CalendarCode, compareTo.CalendarCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).Date.Equals(compareTo.Date)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).LocalCourseCode, compareTo.LocalCourseCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolYear.Equals(compareTo.SchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SectionIdentifier, compareTo.SectionIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SessionName, compareTo.SessionName)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).CalendarCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).Date); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).LocalCourseCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SectionIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISectionAttendanceTakenEvent).SessionName); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The date the section attendance taken event was submitted, which could be a different date than the instructional day. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } + + /// + /// A unique alphanumeric code assigned to a staff. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffUniqueId + { + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + { + return ImplicitStaffReference.StaffUniqueId; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SectionAttendanceTakenEvent", "SectionAttendanceTakenEvent")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SectionAttendanceTakenEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionAttendanceTakenEvent)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SectionAttendanceTakenEventMapper.MapTo(this, (Entities.Common.EdFi.ISectionAttendanceTakenEvent)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateResourceId + { + get { return null; } + set { ImplicitCalendarDateReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitCalendarDateReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionResourceId + { + get { return null; } + set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitSectionReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISectionAttendanceTakenEvent.StaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from other references + var valueFromCalendarDateReference = this.CalendarDateReference?.SchoolId; + + if (valueFromCalendarDateReference != null) + { + yield return ("calendarDateReference.schoolId", this.CalendarDateReference.SchoolId); + } + + // Obtain value from other references + var valueFromSectionReference = this.SectionReference?.SchoolId; + + if (valueFromSectionReference != null) + { + yield return ("sectionReference.schoolId", this.SectionReference.SchoolId); + } + + } + var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); + + if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, short value)> GetSchoolYearSources() + { + // Obtain value from other references + var valueFromCalendarDateReference = this.CalendarDateReference?.SchoolYear; + + if (valueFromCalendarDateReference != null) + { + yield return ("calendarDateReference.schoolYear", this.CalendarDateReference.SchoolYear); + } + + // Obtain value from other references + var valueFromSectionReference = this.SectionReference?.SchoolYear; + + if (valueFromSectionReference != null) + { + yield return ("sectionReference.schoolYear", this.SectionReference.SchoolYear); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SectionAttendanceTakenEventPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: SectionCharacteristicDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.SectionCharacteristicDescriptor.EdFi +{ + /// + /// A class which represents the edfi.SectionCharacteristicDescriptor table of the SectionCharacteristicDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SectionCharacteristicDescriptor : Entities.Common.EdFi.ISectionCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "SectionCharacteristicDescriptor"); + + // Fluent validator instance (threadsafe) + private static SectionCharacteristicDescriptorPutPostRequestValidator _validator = new SectionCharacteristicDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the SectionCharacteristicDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int SectionCharacteristicDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return SectionCharacteristicDescriptorId; } + set { SectionCharacteristicDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISectionCharacteristicDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.ISectionCharacteristicDescriptor).SectionCharacteristicDescriptorId.Equals(compareTo.SectionCharacteristicDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor).SpecialEducationExitReasonDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISectionCharacteristicDescriptor).SectionCharacteristicDescriptorId); return hash.ToHashCode(); } @@ -151933,12 +151497,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SpecialEducationExitReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor)target); + return Entities.Common.EdFi.SectionCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionCharacteristicDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SpecialEducationExitReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor)target, null); + Entities.Common.EdFi.SectionCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISectionCharacteristicDescriptor)target, null); } // ------------------------------------------------------------- @@ -151953,9 +151517,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SpecialEducationExitReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -151984,21 +151548,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SpecialEducationProgramServiceDescriptor table of the SpecialEducationProgramServiceDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.SectionTypeDescriptor table of the SectionTypeDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SpecialEducationProgramServiceDescriptor : Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SectionTypeDescriptor : Entities.Common.EdFi.ISectionTypeDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SpecialEducationProgramServiceDescriptor"); + private static FullName _fullName = new FullName("edfi", "SectionTypeDescriptor"); // Fluent validator instance (threadsafe) - private static SpecialEducationProgramServiceDescriptorPutPostRequestValidator _validator = new SpecialEducationProgramServiceDescriptorPutPostRequestValidator(); + private static SectionTypeDescriptorPutPostRequestValidator _validator = new SectionTypeDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -152017,7 +151581,7 @@ public class SpecialEducationProgramServiceDescriptor : Entities.Common.EdFi.ISp // ------------------------------------------------------------ /// - /// The unique identifier for the SpecialEducationProgramServiceDescriptor resource. + /// The unique identifier for the SectionTypeDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -152038,12 +151602,12 @@ public class SpecialEducationProgramServiceDescriptor : Entities.Common.EdFi.ISp /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SpecialEducationProgramServiceDescriptorId { get; set; } + public int SectionTypeDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SpecialEducationProgramServiceDescriptorId; } - set { SpecialEducationProgramServiceDescriptorId = value; } + get { return SectionTypeDescriptorId; } + set { SectionTypeDescriptorId = value; } } // ------------------------------------------------------------- @@ -152059,7 +151623,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISectionTypeDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -152069,7 +151633,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor).SpecialEducationProgramServiceDescriptorId.Equals(compareTo.SpecialEducationProgramServiceDescriptorId)) + if (!(this as Entities.Common.EdFi.ISectionTypeDescriptor).SectionTypeDescriptorId.Equals(compareTo.SectionTypeDescriptorId)) return false; @@ -152087,7 +151651,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor).SpecialEducationProgramServiceDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISectionTypeDescriptor).SectionTypeDescriptorId); return hash.ToHashCode(); } @@ -152204,12 +151768,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SpecialEducationProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor)target); + return Entities.Common.EdFi.SectionTypeDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISectionTypeDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SpecialEducationProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor)target, null); + Entities.Common.EdFi.SectionTypeDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISectionTypeDescriptor)target, null); } // ------------------------------------------------------------- @@ -152224,9 +151788,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SpecialEducationProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SectionTypeDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -152255,21 +151819,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.SpecialEducationSettingDescriptor table of the SpecialEducationSettingDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.SeparationDescriptor table of the SeparationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class SpecialEducationSettingDescriptor : Entities.Common.EdFi.ISpecialEducationSettingDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class SeparationDescriptor : Entities.Common.EdFi.ISeparationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "SpecialEducationSettingDescriptor"); + private static FullName _fullName = new FullName("edfi", "SeparationDescriptor"); // Fluent validator instance (threadsafe) - private static SpecialEducationSettingDescriptorPutPostRequestValidator _validator = new SpecialEducationSettingDescriptorPutPostRequestValidator(); + private static SeparationDescriptorPutPostRequestValidator _validator = new SeparationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -152288,7 +151852,7 @@ public class SpecialEducationSettingDescriptor : Entities.Common.EdFi.ISpecialEd // ------------------------------------------------------------ /// - /// The unique identifier for the SpecialEducationSettingDescriptor resource. + /// The unique identifier for the SeparationDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -152309,12 +151873,12 @@ public class SpecialEducationSettingDescriptor : Entities.Common.EdFi.ISpecialEd /// // NOT in a reference, NOT a lookup column [JsonIgnore] - public int SpecialEducationSettingDescriptorId { get; set; } + public int SeparationDescriptorId { get; set; } int IDescriptor.DescriptorId { - get { return SpecialEducationSettingDescriptorId; } - set { SpecialEducationSettingDescriptorId = value; } + get { return SeparationDescriptorId; } + set { SeparationDescriptorId = value; } } // ------------------------------------------------------------- @@ -152330,7 +151894,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.ISpecialEducationSettingDescriptor; + var compareTo = obj as Entities.Common.EdFi.ISeparationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -152340,7 +151904,7 @@ public override bool Equals(object obj) // Derived Property - if (!(this as Entities.Common.EdFi.ISpecialEducationSettingDescriptor).SpecialEducationSettingDescriptorId.Equals(compareTo.SpecialEducationSettingDescriptorId)) + if (!(this as Entities.Common.EdFi.ISeparationDescriptor).SeparationDescriptorId.Equals(compareTo.SeparationDescriptorId)) return false; @@ -152358,7 +151922,7 @@ public override int GetHashCode() var hash = new HashCode(); //Derived Property - hash.Add((this as Entities.Common.EdFi.ISpecialEducationSettingDescriptor).SpecialEducationSettingDescriptorId); + hash.Add((this as Entities.Common.EdFi.ISeparationDescriptor).SeparationDescriptorId); return hash.ToHashCode(); } @@ -152475,12 +152039,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.SpecialEducationSettingDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISpecialEducationSettingDescriptor)target); + return Entities.Common.EdFi.SeparationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISeparationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.SpecialEducationSettingDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISpecialEducationSettingDescriptor)target, null); + Entities.Common.EdFi.SeparationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISeparationDescriptor)target, null); } // ------------------------------------------------------------- @@ -152495,9 +152059,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class SpecialEducationSettingDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class SeparationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -152526,119 +152090,21 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Staff resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class StaffReference : IResourceReference - { - [DataMember(Name="staffUniqueId")] - public string StaffUniqueId - { - get => _staffUniqueId; - set - { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } - private string _staffUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return StaffUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (StaffUniqueId == default) - { - yield return "StaffUniqueId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Staff", - Href = $"/ed-fi/staffs/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - - /// - /// A class which represents the edfi.Staff table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.SeparationReasonDescriptor table of the SeparationReasonDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Staff : Entities.Common.EdFi.IStaff, IHasETag, IDateVersionedEntity, IValidatableObject + public class SeparationReasonDescriptor : Entities.Common.EdFi.ISeparationReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "Staff"); + private static FullName _fullName = new FullName("edfi", "SeparationReasonDescriptor"); // Fluent validator instance (threadsafe) - private static StaffPutPostRequestValidator _validator = new StaffPutPostRequestValidator(); + private static SeparationReasonDescriptorPutPostRequestValidator _validator = new SeparationReasonDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -152649,24 +152115,6 @@ public class Staff : Entities.Common.EdFi.IStaff, IHasETag, IDateVersionedEntity // Constructor // ------------------------------------------------------------- - public Staff() - { - StaffAddresses = new List(); - StaffAncestryEthnicOrigins = new List(); - StaffCredentials = new List(); - StaffElectronicMails = new List(); - StaffIdentificationCodes = new List(); - StaffIdentificationDocuments = new List(); - StaffInternationalAddresses = new List(); - StaffLanguages = new List(); - StaffOtherNames = new List(); - StaffPersonalIdentificationDocuments = new List(); - StaffRaces = new List(); - StaffRecognitions = new List(); - StaffTelephones = new List(); - StaffTribalAffiliations = new List(); - StaffVisas = new List(); - } // ------------------------------------------------------------ @@ -152675,7 +152123,7 @@ public Staff() // ------------------------------------------------------------ /// - /// The unique identifier for the Staff resource. + /// The unique identifier for the SeparationReasonDescriptor resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -152685,40 +152133,6 @@ public Staff() // ============================================================= // References // ------------------------------------------------------------- - - private bool _personReferenceExplicitlyAssigned; - private Person.EdFi.PersonReference _personReference; - private Person.EdFi.PersonReference ImplicitPersonReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_personReference == null && !_personReferenceExplicitlyAssigned) - _personReference = new Person.EdFi.PersonReference(); - - return _personReference; - } - } - - [DataMember(Name="personReference")] - [FullyDefinedReference] - public Person.EdFi.PersonReference PersonReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitPersonReference != null - && (_personReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - return ImplicitPersonReference; - - return null; - } - set - { - _personReferenceExplicitlyAssigned = true; - _personReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -152726,24 +152140,17 @@ public Person.EdFi.PersonReference PersonReference // ------------------------------------------------------------- /// - /// A unique alphanumeric code assigned to a staff. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [UniqueId][DataMember(Name="staffUniqueId")] - public string StaffUniqueId + [JsonIgnore] + public int SeparationReasonDescriptorId { get; set; } + + int IDescriptor.DescriptorId { - get => _staffUniqueId; - set - { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } + get { return SeparationReasonDescriptorId; } + set { SeparationReasonDescriptorId = value; } } - private string _staffUniqueId; - - string IIdentifiablePerson.UniqueId { get { return StaffUniqueId; } } // ------------------------------------------------------------- // ============================================================= @@ -152758,7 +152165,7 @@ public string StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaff; + var compareTo = obj as Entities.Common.EdFi.ISeparationReasonDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -152766,10 +152173,12 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Property - if (!((this as Entities.Common.EdFi.IStaff).StaffUniqueId.Equals(compareTo.StaffUniqueId))) + + // Derived Property + if (!(this as Entities.Common.EdFi.ISeparationReasonDescriptor).SeparationReasonDescriptorId.Equals(compareTo.SeparationReasonDescriptorId)) return false; + return true; } @@ -152783,8 +152192,8 @@ public override int GetHashCode() { var hash = new HashCode(); - //Property - hash.Add((this as Entities.Common.EdFi.IStaff).StaffUniqueId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISeparationReasonDescriptor).SeparationReasonDescriptorId); return hash.ToHashCode(); } @@ -152793,205 +152202,331 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// The month, day, and year on which an individual was born. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="birthDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BirthDate { get; set; } - - /// - /// An indicator of whether or not the person is a U.S. citizen. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="citizenshipStatusDescriptor")][DescriptorExists("CitizenshipStatusDescriptor")] - public string CitizenshipStatusDescriptor { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="firstName")] - public string FirstName { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The gender the staff member identifies themselves as. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="genderIdentity")] - public string GenderIdentity { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="generationCodeSuffix")] - public string GenerationCodeSuffix { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The extent of formal instruction an individual has received (e.g., the highest grade in school completed or its equivalent or the highest degree received). + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="highestCompletedLevelOfEducationDescriptor")][DescriptorExists("LevelOfEducationDescriptor")] - public string HighestCompletedLevelOfEducationDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// An indication of whether a teacher is classified as highly qualified for his/her assignment according to state definition. This attribute indicates the teacher is highly qualified for ALL Sections being taught. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="highlyQualifiedTeacher")] - public bool? HighlyQualifiedTeacher { get; set; } - - /// - /// An indication that the individual traces his or her origin or descent to Mexico, Puerto Rico, Cuba, Central, and South America, and other Spanish cultures, regardless of race. The term, \"Spanish origin,\" can be used in addition to \"Hispanic or Latino.\" - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="hispanicLatinoEthnicity")] - public bool? HispanicLatinoEthnicity { get; set; } - - /// - /// The name borne in common by members of a family. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="lastSurname")] - public string LastSurname { get; set; } + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - /// - /// The login ID for the user; used for security access control interface. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="loginId")] - public string LoginId { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SeparationReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISeparationReasonDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SeparationReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISeparationReasonDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SeparationReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: ServiceDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.ServiceDescriptor.EdFi +{ + /// + /// A class which represents the edfi.ServiceDescriptor table of the ServiceDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class ServiceDescriptor : Entities.Common.EdFi.IServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "ServiceDescriptor"); + + // Fluent validator instance (threadsafe) + private static ServiceDescriptorPutPostRequestValidator _validator = new ServiceDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ /// - /// The individual's maiden name. + /// The unique identifier for the ServiceDescriptor resource. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maidenName")] - public string MaidenName { get; set; } + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="middleName")] - public string MiddleName { get; set; } + [JsonIgnore] + public int ServiceDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return ServiceDescriptorId; } + set { ServiceDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// Determines equality based on the natural key properties of the resource. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="personalTitlePrefix")] - public string PersonalTitlePrefix { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IServiceDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IServiceDescriptor).ServiceDescriptorId.Equals(compareTo.ServiceDescriptorId)) + return false; + + + return true; + } /// - /// A unique alphanumeric code assigned to a person. + /// Builds the hash code based on the unique identifying values. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaff.PersonId + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - get - { - if (ImplicitPersonReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - { - return ImplicitPersonReference.PersonId; - } + var hash = new HashCode(); - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + //Derived Property + hash.Add((this as Entities.Common.EdFi.IServiceDescriptor).ServiceDescriptorId); - // Person - _personReferenceExplicitlyAssigned = false; - ImplicitPersonReference.PersonId = value; - } + return hash.ToHashCode(); } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- /// - /// The first name the individual prefers, if different from their legal first name + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="preferredFirstName")] - public string PreferredFirstName { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The last name the individual prefers, if different from their legal last name + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="preferredLastSurname")] - public string PreferredLastSurname { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The birth sex of the staff member. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] - public string SexDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// This descriptor defines the originating record source system for the person. + /// The end date of the period when the descriptor is in effect. /// - - // IS in a reference (Staff.SourceSystemDescriptorId), IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - string Entities.Common.EdFi.IStaff.SourceSystemDescriptor - { - get - { - if (ImplicitPersonReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - { - return ImplicitPersonReference.SourceSystemDescriptor; - } - - return null; - } - set - { - ImplicitPersonReference.SourceSystemDescriptor = value; - } - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The total number of years that an individual has previously held a similar professional position in one or more education institutions prior to the current school year. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.99", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="yearsOfPriorProfessionalExperience")] - public decimal? YearsOfPriorProfessionalExperience { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The total number of years that an individual has previously held a teaching position in one or more education institutions prior to the current school year. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-999.99", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="yearsOfPriorTeachingExperience")] - public decimal? YearsOfPriorTeachingExperience { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -153012,561 +152547,6655 @@ string Entities.Common.EdFi.IStaff.SourceSystemDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "Staff")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _staffAddresses; - private ICollection _staffAddressesCovariant; + // ------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection StaffAddresses - { - get { return _staffAddresses; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffAddress)e.Item).Staff = this); - _staffAddresses = list; + // ============================================================= + // Versioning + // ------------------------------------------------------------- - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffAddress)e.Item).Staff = this; - _staffAddressesCovariant = covariantList; - } - } + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffAddresses - { - get { return _staffAddressesCovariant; } - set { StaffAddresses = new List(value.Cast()); } - } + // ------------------------------------------------------------- - private ICollection _staffAncestryEthnicOrigins; - private ICollection _staffAncestryEthnicOriginsCovariant; + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ - [NoDuplicateMembers] - [DataMember(Name="ancestryEthnicOrigins")] - public ICollection StaffAncestryEthnicOrigins + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - get { return _staffAncestryEthnicOrigins; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffAncestryEthnicOrigin)e.Item).Staff = this); - _staffAncestryEthnicOrigins = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffAncestryEthnicOrigin)e.Item).Staff = this; - _staffAncestryEthnicOriginsCovariant = covariantList; - } + return Entities.Common.EdFi.ServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IServiceDescriptor)target); } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffAncestryEthnicOrigins + void IMappable.Map(object target) { - get { return _staffAncestryEthnicOriginsCovariant; } - set { StaffAncestryEthnicOrigins = new List(value.Cast()); } + Entities.Common.EdFi.ServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IServiceDescriptor)target, null); } + // ------------------------------------------------------------- - private ICollection _staffCredentials; - private ICollection _staffCredentialsCovariant; + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } - [NoDuplicateMembers] - [DataMember(Name="credentials")] - public ICollection StaffCredentials + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class ServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - get { return _staffCredentials; } - set + if (context.InstanceToValidate == null) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffCredential)e.Item).Staff = this); - _staffCredentials = list; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffCredential)e.Item).Staff = this; - _staffCredentialsCovariant = covariantList; + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffCredentials - { - get { return _staffCredentialsCovariant; } - set { StaffCredentials = new List(value.Cast()); } - } + var instance = context.InstanceToValidate; - private ICollection _staffElectronicMails; - private ICollection _staffElectronicMailsCovariant; + var failures = new List(); - [NoDuplicateMembers] - [DataMember(Name="electronicMails")] - public ICollection StaffElectronicMails - { - get { return _staffElectronicMails; } - set + if (failures.Any()) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffElectronicMail)e.Item).Staff = this); - _staffElectronicMails = list; + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffElectronicMail)e.Item).Staff = this; - _staffElectronicMailsCovariant = covariantList; + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffElectronicMails - { - get { return _staffElectronicMailsCovariant; } - set { StaffElectronicMails = new List(value.Cast()); } + return true; } + } + // ----------------------------------------------------------------- - private ICollection _staffIdentificationCodes; - private ICollection _staffIdentificationCodesCovariant; +} +// Aggregate: Session - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection StaffIdentificationCodes - { - get { return _staffIdentificationCodes; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffIdentificationCode)e.Item).Staff = this); - _staffIdentificationCodes = list; +namespace EdFi.Ods.Api.Common.Models.Resources.Session.EdFi +{ + /// + /// Represents a reference to the Session resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class SessionReference : IResourceReference + { + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffIdentificationCode)e.Item).Staff = this; - _staffIdentificationCodesCovariant = covariantList; - } - } + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffIdentificationCodes - { - get { return _staffIdentificationCodesCovariant; } - set { StaffIdentificationCodes = new List(value.Cast()); } - } + [DataMember(Name="sessionName")] + public string SessionName { get; set; } - private ICollection _staffIdentificationDocuments; - private ICollection _staffIdentificationDocumentsCovariant; + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } - [NoDuplicateMembers] - [DataMember(Name="identificationDocuments")] - public ICollection StaffIdentificationDocuments + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link { - get { return _staffIdentificationDocuments; } - set + get { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffIdentificationDocument)e.Item).Staff = this); - _staffIdentificationDocuments = list; + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffIdentificationDocument)e.Item).Staff = this; - _staffIdentificationDocumentsCovariant = covariantList; + return _link; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffIdentificationDocuments + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() { - get { return _staffIdentificationDocumentsCovariant; } - set { StaffIdentificationDocuments = new List(value.Cast()); } + return SchoolId != default(long) && SchoolYear != default(short) && SessionName != default(string); } - private ICollection _staffInternationalAddresses; - private ICollection _staffInternationalAddressesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection StaffInternationalAddresses + IEnumerable IResourceReference.GetUndefinedProperties() { - get { return _staffInternationalAddresses; } - set + if (SchoolId == default) { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffInternationalAddress)e.Item).Staff = this); - _staffInternationalAddresses = list; + yield return "SchoolId"; + } - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffInternationalAddress)e.Item).Staff = this; - _staffInternationalAddressesCovariant = covariantList; + if (SchoolYear == default) + { + yield return "SchoolYear"; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffInternationalAddresses - { - get { return _staffInternationalAddressesCovariant; } - set { StaffInternationalAddresses = new List(value.Cast()); } - } + if (SessionName == default) + { + yield return "SessionName"; + } - private ICollection _staffLanguages; - private ICollection _staffLanguagesCovariant; + } - [NoDuplicateMembers] - [DataMember(Name="languages")] - public ICollection StaffLanguages + private Link CreateLink() { - get { return _staffLanguages; } - set + var link = new Link { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffLanguage)e.Item).Staff = this); - _staffLanguages = list; + Rel = "Session", + Href = $"/ed-fi/sessions/{ResourceId:n}" + }; - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffLanguage)e.Item).Staff = this; - _staffLanguagesCovariant = covariantList; - } - } + if (string.IsNullOrEmpty(Discriminator)) + return link; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffLanguages - { - get { return _staffLanguagesCovariant; } - set { StaffLanguages = new List(value.Cast()); } - } + string[] linkParts = Discriminator.Split('.'); - private ICollection _staffOtherNames; - private ICollection _staffOtherNamesCovariant; + if (linkParts.Length < 2) + return link; - [NoDuplicateMembers] - [DataMember(Name="otherNames")] - public ICollection StaffOtherNames - { - get { return _staffOtherNames; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffOtherName)e.Item).Staff = this); - _staffOtherNames = list; + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffOtherName)e.Item).Staff = this; - _staffOtherNamesCovariant = covariantList; - } - } + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffOtherNames - { - get { return _staffOtherNamesCovariant; } - set { StaffOtherNames = new List(value.Cast()); } + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } + } // Aggregate reference - private ICollection _staffPersonalIdentificationDocuments; - private ICollection _staffPersonalIdentificationDocumentsCovariant; + /// + /// A class which represents the edfi.Session table of the Session aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class Session : Entities.Common.EdFi.ISession, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "Session"); - [NoDuplicateMembers] - [DataMember(Name="personalIdentificationDocuments")] - public ICollection StaffPersonalIdentificationDocuments - { - get { return _staffPersonalIdentificationDocuments; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffPersonalIdentificationDocument)e.Item).Staff = this); - _staffPersonalIdentificationDocuments = list; + // Fluent validator instance (threadsafe) + private static SessionPutPostRequestValidator _validator = new SessionPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffPersonalIdentificationDocument)e.Item).Staff = this; - _staffPersonalIdentificationDocumentsCovariant = covariantList; - } - } + // ============================================================= + // Constructor + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffPersonalIdentificationDocuments + public Session() { - get { return _staffPersonalIdentificationDocumentsCovariant; } - set { StaffPersonalIdentificationDocuments = new List(value.Cast()); } + SessionAcademicWeeks = new List(); + SessionGradingPeriods = new List(); } + + // ------------------------------------------------------------ - private ICollection _staffRaces; - private ICollection _staffRacesCovariant; + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ - [NoDuplicateMembers] - [DataMember(Name="races")] - public ICollection StaffRaces + /// + /// The unique identifier for the Session resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference { - get { return _staffRaces; } - set + get { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffRace)e.Item).Staff = this); - _staffRaces = list; + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffRace)e.Item).Staff = this; - _staffRacesCovariant = covariantList; + return _schoolReference; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffRaces + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference { - get { return _staffRacesCovariant; } - set { StaffRaces = new List(value.Cast()); } - } - - private ICollection _staffRecognitions; - private ICollection _staffRecognitionsCovariant; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; - [NoDuplicateMembers] - [DataMember(Name="recognitions")] - public ICollection StaffRecognitions - { - get { return _staffRecognitions; } + return null; + } set { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffRecognition)e.Item).Staff = this); - _staffRecognitions = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffRecognition)e.Item).Staff = this; - _staffRecognitionsCovariant = covariantList; + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; } } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffRecognitions - { - get { return _staffRecognitionsCovariant; } - set { StaffRecognitions = new List(value.Cast()); } - } - - private ICollection _staffTelephones; - private ICollection _staffTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="telephones")] - public ICollection StaffTelephones + private bool _schoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference { - get { return _staffTelephones; } - set + get { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffTelephone)e.Item).Staff = this); - _staffTelephones = list; + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) + _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffTelephone)e.Item).Staff = this; - _staffTelephonesCovariant = covariantList; + return _schoolYearTypeReference; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffTelephones + [DataMember(Name="schoolYearTypeReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference { - get { return _staffTelephonesCovariant; } - set { StaffTelephones = new List(value.Cast()); } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolYearTypeReference != null + && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference; + + return null; + } + set + { + _schoolYearTypeReferenceExplicitlyAssigned = true; + _schoolYearTypeReference = value; + } } + // ------------------------------------------------------------- - private ICollection _staffTribalAffiliations; - private ICollection _staffTribalAffiliationsCovariant; + //============================================================== + // Primary Key + // ------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="tribalAffiliations")] - public ICollection StaffTribalAffiliations + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.ISession.SchoolId { - get { return _staffTribalAffiliations; } + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; + + return default(long); + } set { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffTribalAffiliation)e.Item).Staff = this); - _staffTribalAffiliations = list; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffTribalAffiliation)e.Item).Staff = this; - _staffTribalAffiliationsCovariant = covariantList; + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffTribalAffiliations + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.ISession.SchoolYear { - get { return _staffTribalAffiliationsCovariant; } - set { StaffTribalAffiliations = new List(value.Cast()); } - } - - private ICollection _staffVisas; - private ICollection _staffVisasCovariant; + get + { + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference.SchoolYear; - [NoDuplicateMembers] - [DataMember(Name="visas")] - public ICollection StaffVisas - { - get { return _staffVisas; } + return default(short); + } set { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffVisa)e.Item).Staff = this); - _staffVisas = list; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffVisa)e.Item).Staff = this; - _staffVisasCovariant = covariantList; + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaff.StaffVisas - { - get { return _staffVisasCovariant; } - set { StaffVisas = new List(value.Cast()); } - } - + /// + /// The identifier for the calendar for the academic session. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="sessionName")] + public string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= - // Versioning + // Equality // ------------------------------------------------------------- - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISession; - // ------------------------------------------------------------- + if (ReferenceEquals(this, compareTo)) + return true; - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- + if (compareTo == null) + return false; - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_staffAddresses != null) foreach (var item in _staffAddresses) - { - item.Staff = this; - } - if (_staffAncestryEthnicOrigins != null) foreach (var item in _staffAncestryEthnicOrigins) - { - item.Staff = this; - } + // Referenced Property + if (!(this as Entities.Common.EdFi.ISession).SchoolId.Equals(compareTo.SchoolId)) + return false; - if (_staffCredentials != null) foreach (var item in _staffCredentials) - { - item.Staff = this; - } - if (_staffElectronicMails != null) foreach (var item in _staffElectronicMails) - { - item.Staff = this; - } + // Referenced Property + if (!(this as Entities.Common.EdFi.ISession).SchoolYear.Equals(compareTo.SchoolYear)) + return false; - if (_staffIdentificationCodes != null) foreach (var item in _staffIdentificationCodes) - { - item.Staff = this; - } - if (_staffIdentificationDocuments != null) foreach (var item in _staffIdentificationDocuments) - { - item.Staff = this; - } + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISession).SessionName, compareTo.SessionName)) + return false; - if (_staffInternationalAddresses != null) foreach (var item in _staffInternationalAddresses) - { - item.Staff = this; - } - if (_staffLanguages != null) foreach (var item in _staffLanguages) - { - item.Staff = this; - } + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISession).SchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISession).SchoolYear); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISession).SessionName); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// Month, day, and year of the first day of the session. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } + + /// + /// Month, day and year of the last day of the session. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EndDate { get; set; } + + /// + /// A descriptor value to indicate the term that the session is associated with. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] + public string TermDescriptor { get; set; } + + private bool _totalInstructionalDaysExplicitlyAssigned = false; + private int _totalInstructionalDays; + + /// + /// The total number of instructional days in the school calendar. + /// + // NOT in a reference, NOT a lookup column + [Range(0, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="totalInstructionalDays")] + public int TotalInstructionalDays + { + get => _totalInstructionalDays; + set + { + _totalInstructionalDays = value; + _totalInstructionalDaysExplicitlyAssigned = true; + } + } + + // ------------------------------------------------------------- + + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_totalInstructionalDaysExplicitlyAssigned) + { + yield return "TotalInstructionalDays"; + } + } + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Session", "Session")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _sessionAcademicWeeks; + private ICollection _sessionAcademicWeeksCovariant; + + [NoDuplicateMembers] + [DataMember(Name="academicWeeks")] + public ICollection SessionAcademicWeeks + { + get { return _sessionAcademicWeeks; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISessionAcademicWeek)e.Item).Session = this); + _sessionAcademicWeeks = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISessionAcademicWeek)e.Item).Session = this; + _sessionAcademicWeeksCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISession.SessionAcademicWeeks + { + get { return _sessionAcademicWeeksCovariant; } + set { SessionAcademicWeeks = new List(value.Cast()); } + } + + private ICollection _sessionGradingPeriods; + private ICollection _sessionGradingPeriodsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="gradingPeriods")] + public ICollection SessionGradingPeriods + { + get { return _sessionGradingPeriods; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISessionGradingPeriod)e.Item).Session = this); + _sessionGradingPeriods = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISessionGradingPeriod)e.Item).Session = this; + _sessionGradingPeriodsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISession.SessionGradingPeriods + { + get { return _sessionGradingPeriodsCovariant; } + set { SessionGradingPeriods = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_sessionAcademicWeeks != null) foreach (var item in _sessionAcademicWeeks) + { + item.Session = this; + } + + if (_sessionGradingPeriods != null) foreach (var item in _sessionGradingPeriods) + { + item.Session = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SessionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISession)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SessionMapper.MapTo(this, (Entities.Common.EdFi.ISession)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ISession.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.ISession.SchoolYearTypeResourceId + { + get { return null; } + set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (SessionAcademicWeeks.Any() && mappingContract?.IsMemberSupported("SessionAcademicWeeks") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SessionAcademicWeeks"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SessionAcademicWeeks, validationContext, validationContext.Items.ForCollection("SessionAcademicWeeks")))) + { + yield return result; + } + } + + if (SessionGradingPeriods.Any() && mappingContract?.IsMemberSupported("SessionGradingPeriods") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SessionGradingPeriods"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SessionGradingPeriods, validationContext, validationContext.Items.ForCollection("SessionGradingPeriods")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SessionPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_Session = new FullName("edfi", "Session"); + + // Declare collection item validators + private SessionAcademicWeekPutPostRequestValidator _sessionAcademicWeeksValidator = new (); + private SessionGradingPeriodPutPostRequestValidator _sessionGradingPeriodsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (SessionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_Session); + + if (mappingContract != null) + { + if (mappingContract.IsSessionAcademicWeekIncluded != null) + { + var hasInvalidSessionAcademicWeeksItems = instance.SessionAcademicWeeks.Any(x => !mappingContract.IsSessionAcademicWeekIncluded(x)); + + if (hasInvalidSessionAcademicWeeksItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SessionAcademicWeeks", $"A supplied 'SessionAcademicWeek' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsSessionGradingPeriodIncluded != null) + { + var hasInvalidSessionGradingPeriodsItems = instance.SessionGradingPeriods.Any(x => !mappingContract.IsSessionGradingPeriodIncluded(x)); + + if (hasInvalidSessionGradingPeriodsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SessionGradingPeriods", $"A supplied 'SessionGradingPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.SessionAcademicWeek table of the Session aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SessionAcademicWeek : Entities.Common.EdFi.ISessionAcademicWeek, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "SessionAcademicWeek"); + + // Fluent validator instance (threadsafe) + private static SessionAcademicWeekPutPostRequestValidator _validator = new SessionAcademicWeekPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _academicWeekReferenceExplicitlyAssigned; + private AcademicWeek.EdFi.AcademicWeekReference _academicWeekReference; + private AcademicWeek.EdFi.AcademicWeekReference ImplicitAcademicWeekReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_academicWeekReference == null && !_academicWeekReferenceExplicitlyAssigned) + _academicWeekReference = new AcademicWeek.EdFi.AcademicWeekReference(); + + return _academicWeekReference; + } + } + + [DataMember(Name="academicWeekReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public AcademicWeek.EdFi.AcademicWeekReference AcademicWeekReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAcademicWeekReference != null + && (_academicWeekReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAcademicWeekReference.IsReferenceFullyDefined())) + return ImplicitAcademicWeekReference; + + return null; + } + set + { + _academicWeekReferenceExplicitlyAssigned = true; + _academicWeekReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ISession _session; + + [IgnoreDataMember] + Entities.Common.EdFi.ISession ISessionAcademicWeek.Session + { + get { return _session; } + set { SetSession(value); } + } + + public Entities.Common.EdFi.ISession Session + { + set { SetSession(value); } + } + + private void SetSession(Entities.Common.EdFi.ISession value) + { + _session = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_academicWeekReferenceExplicitlyAssigned) + { + ImplicitAcademicWeekReference.SchoolId = _session.SchoolId; + } + } + + /// + /// The school label for the week. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISessionAcademicWeek.WeekIdentifier + { + get + { + if (ImplicitAcademicWeekReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAcademicWeekReference.IsReferenceFullyDefined())) + return ImplicitAcademicWeekReference.WeekIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AcademicWeek + _academicWeekReferenceExplicitlyAssigned = false; + ImplicitAcademicWeekReference.WeekIdentifier = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISessionAcademicWeek; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_session == null || !_session.Equals(compareTo.Session)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISessionAcademicWeek).WeekIdentifier, compareTo.WeekIdentifier)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_session != null) + hash.Add(_session); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISessionAcademicWeek).WeekIdentifier); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Session", "SessionAcademicWeek")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SessionAcademicWeekMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISessionAcademicWeek)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SessionAcademicWeekMapper.MapTo(this, (Entities.Common.EdFi.ISessionAcademicWeek)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekResourceId + { + get { return null; } + set { ImplicitAcademicWeekReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISessionAcademicWeek.AcademicWeekDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAcademicWeekReference.Discriminator = value; } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.ISessionAcademicWeek).Session.SchoolId); + + // Obtain value from other references + var valueFromAcademicWeekReference = this.AcademicWeekReference?.SchoolId; + + if (valueFromAcademicWeekReference != null) + { + yield return ("academicWeekReference.schoolId", this.AcademicWeekReference.SchoolId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SessionAcademicWeekPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.SessionGradingPeriod table of the Session aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SessionGradingPeriod : Entities.Common.EdFi.ISessionGradingPeriod, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "SessionGradingPeriod"); + + // Fluent validator instance (threadsafe) + private static SessionGradingPeriodPutPostRequestValidator _validator = new SessionGradingPeriodPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _gradingPeriodReferenceExplicitlyAssigned; + private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; + private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) + _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); + + return _gradingPeriodReference; + } + } + + [DataMember(Name="gradingPeriodReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitGradingPeriodReference != null + && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference; + + return null; + } + set + { + _gradingPeriodReferenceExplicitlyAssigned = true; + _gradingPeriodReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ISession _session; + + [IgnoreDataMember] + Entities.Common.EdFi.ISession ISessionGradingPeriod.Session + { + get { return _session; } + set { SetSession(value); } + } + + public Entities.Common.EdFi.ISession Session + { + set { SetSession(value); } + } + + private void SetSession(Entities.Common.EdFi.ISession value) + { + _session = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_gradingPeriodReferenceExplicitlyAssigned) + { + ImplicitGradingPeriodReference.SchoolId = _session.SchoolId; + ImplicitGradingPeriodReference.SchoolYear = _session.SchoolYear; + } + } + + /// + /// The state's name of the period for which grades are reported. + /// + + // IS in a reference (SessionGradingPeriod.GradingPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDescriptor + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodDescriptor; + + return null; + } + set + { + ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + } + } + + /// + /// The school's descriptive name of the grading period. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodName + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.GradingPeriodName = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISessionGradingPeriod; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_session == null || !_session.Equals(compareTo.Session)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodName, compareTo.GradingPeriodName)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_session != null) + hash.Add(_session); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.ISessionGradingPeriod).GradingPeriodName); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Session", "SessionGradingPeriod")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SessionGradingPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISessionGradingPeriod)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SessionGradingPeriodMapper.MapTo(this, (Entities.Common.EdFi.ISessionGradingPeriod)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodResourceId + { + get { return null; } + set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.ISessionGradingPeriod.GradingPeriodDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitGradingPeriodReference.Discriminator = value; } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.ISessionGradingPeriod).Session.SchoolId); + + // Obtain value from other references + var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolId; + + if (valueFromGradingPeriodReference != null) + { + yield return ("gradingPeriodReference.schoolId", this.GradingPeriodReference.SchoolId); + } + + } + var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); + + if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, short value)> GetSchoolYearSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.ISessionGradingPeriod).Session.SchoolYear); + + // Obtain value from other references + var valueFromGradingPeriodReference = this.GradingPeriodReference?.SchoolYear; + + if (valueFromGradingPeriodReference != null) + { + yield return ("gradingPeriodReference.schoolYear", this.GradingPeriodReference.SchoolYear); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SessionGradingPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: SexDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.SexDescriptor.EdFi +{ + /// + /// A class which represents the edfi.SexDescriptor table of the SexDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SexDescriptor : Entities.Common.EdFi.ISexDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "SexDescriptor"); + + // Fluent validator instance (threadsafe) + private static SexDescriptorPutPostRequestValidator _validator = new SexDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the SexDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int SexDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return SexDescriptorId; } + set { SexDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISexDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.ISexDescriptor).SexDescriptorId.Equals(compareTo.SexDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISexDescriptor).SexDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SexDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISexDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SexDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISexDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SexDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: SourceDimension + +namespace EdFi.Ods.Api.Common.Models.Resources.SourceDimension.EdFi +{ + /// + /// Represents a reference to the SourceDimension resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class SourceDimensionReference : IResourceReference + { + [DataMember(Name="code")] + public string Code { get; set; } + + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return Code != default(string) && FiscalYear != default(int); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (Code == default) + { + yield return "Code"; + } + + if (FiscalYear == default) + { + yield return "FiscalYear"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "SourceDimension", + Href = $"/ed-fi/sourceDimensions/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.SourceDimension table of the SourceDimension aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class SourceDimension : Entities.Common.EdFi.ISourceDimension, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "SourceDimension"); + + // Fluent validator instance (threadsafe) + private static SourceDimensionPutPostRequestValidator _validator = new SourceDimensionPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public SourceDimension() + { + SourceDimensionReportingTags = new List(); + } + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the SourceDimension resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// The code representation of the account source dimension. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(16, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="code")] + public string Code { get; set; } + + private bool _fiscalYearExplicitlyAssigned = false; + private int _fiscalYear; + + /// + /// The fiscal year for which the account source dimension is valid. + /// + // NOT in a reference, NOT a lookup column + [Range(2020, 2040, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fiscalYear")] + public int FiscalYear + { + get => _fiscalYear; + set + { + _fiscalYear = value; + _fiscalYearExplicitlyAssigned = true; + } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISourceDimension; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.ISourceDimension).Code, compareTo.Code)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.ISourceDimension).FiscalYear.Equals(compareTo.FiscalYear)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISourceDimension).Code); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISourceDimension).FiscalYear); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// A description of the account source dimension. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeName")] + public string CodeName { get; set; } + // ------------------------------------------------------------- + + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_fiscalYearExplicitlyAssigned) + { + yield return "FiscalYear"; + } + } + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SourceDimension", "SourceDimension")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _sourceDimensionReportingTags; + private ICollection _sourceDimensionReportingTagsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportingTags")] + public ICollection SourceDimensionReportingTags + { + get { return _sourceDimensionReportingTags; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.ISourceDimensionReportingTag)e.Item).SourceDimension = this); + _sourceDimensionReportingTags = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.ISourceDimensionReportingTag)e.Item).SourceDimension = this; + _sourceDimensionReportingTagsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ISourceDimension.SourceDimensionReportingTags + { + get { return _sourceDimensionReportingTagsCovariant; } + set { SourceDimensionReportingTags = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_sourceDimensionReportingTags != null) foreach (var item in _sourceDimensionReportingTags) + { + item.SourceDimension = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SourceDimensionMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISourceDimension)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SourceDimensionMapper.MapTo(this, (Entities.Common.EdFi.ISourceDimension)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (SourceDimensionReportingTags.Any() && mappingContract?.IsMemberSupported("SourceDimensionReportingTags") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("SourceDimensionReportingTags"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(SourceDimensionReportingTags, validationContext, validationContext.Items.ForCollection("SourceDimensionReportingTags")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SourceDimensionPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_SourceDimension = new FullName("edfi", "SourceDimension"); + + // Declare collection item validators + private SourceDimensionReportingTagPutPostRequestValidator _sourceDimensionReportingTagsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (SourceDimensionMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_SourceDimension); + + if (mappingContract != null) + { + if (mappingContract.IsSourceDimensionReportingTagIncluded != null) + { + var hasInvalidSourceDimensionReportingTagsItems = instance.SourceDimensionReportingTags.Any(x => !mappingContract.IsSourceDimensionReportingTagIncluded(x)); + + if (hasInvalidSourceDimensionReportingTagsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("SourceDimensionReportingTags", $"A supplied 'SourceDimensionReportingTag' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.SourceDimensionReportingTag table of the SourceDimension aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SourceDimensionReportingTag : Entities.Common.EdFi.ISourceDimensionReportingTag, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "SourceDimensionReportingTag"); + + // Fluent validator instance (threadsafe) + private static SourceDimensionReportingTagPutPostRequestValidator _validator = new SourceDimensionReportingTagPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.ISourceDimension _sourceDimension; + + [IgnoreDataMember] + Entities.Common.EdFi.ISourceDimension ISourceDimensionReportingTag.SourceDimension + { + get { return _sourceDimension; } + set { SetSourceDimension(value); } + } + + public Entities.Common.EdFi.ISourceDimension SourceDimension + { + set { SetSourceDimension(value); } + } + + private void SetSourceDimension(Entities.Common.EdFi.ISourceDimension value) + { + _sourceDimension = value; + } + + /// + /// Optional tag for accountability reporting. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="reportingTagDescriptor")][DescriptorExists("ReportingTagDescriptor")] + public string ReportingTagDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISourceDimensionReportingTag; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_sourceDimension == null || !_sourceDimension.Equals(compareTo.SourceDimension)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.ISourceDimensionReportingTag).ReportingTagDescriptor, compareTo.ReportingTagDescriptor)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_sourceDimension != null) + hash.Add(_sourceDimension); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.ISourceDimensionReportingTag).ReportingTagDescriptor); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "SourceDimension", "SourceDimensionReportingTag")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SourceDimensionReportingTagMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISourceDimensionReportingTag)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SourceDimensionReportingTagMapper.MapTo(this, (Entities.Common.EdFi.ISourceDimensionReportingTag)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SourceDimensionReportingTagPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: SourceSystemDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.SourceSystemDescriptor.EdFi +{ + /// + /// A class which represents the edfi.SourceSystemDescriptor table of the SourceSystemDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SourceSystemDescriptor : Entities.Common.EdFi.ISourceSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "SourceSystemDescriptor"); + + // Fluent validator instance (threadsafe) + private static SourceSystemDescriptorPutPostRequestValidator _validator = new SourceSystemDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the SourceSystemDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int SourceSystemDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return SourceSystemDescriptorId; } + set { SourceSystemDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISourceSystemDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.ISourceSystemDescriptor).SourceSystemDescriptorId.Equals(compareTo.SourceSystemDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISourceSystemDescriptor).SourceSystemDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SourceSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISourceSystemDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SourceSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISourceSystemDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SourceSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: SpecialEducationExitReasonDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.SpecialEducationExitReasonDescriptor.EdFi +{ + /// + /// A class which represents the edfi.SpecialEducationExitReasonDescriptor table of the SpecialEducationExitReasonDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SpecialEducationExitReasonDescriptor : Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "SpecialEducationExitReasonDescriptor"); + + // Fluent validator instance (threadsafe) + private static SpecialEducationExitReasonDescriptorPutPostRequestValidator _validator = new SpecialEducationExitReasonDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the SpecialEducationExitReasonDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int SpecialEducationExitReasonDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return SpecialEducationExitReasonDescriptorId; } + set { SpecialEducationExitReasonDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor).SpecialEducationExitReasonDescriptorId.Equals(compareTo.SpecialEducationExitReasonDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor).SpecialEducationExitReasonDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SpecialEducationExitReasonDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SpecialEducationExitReasonDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SpecialEducationExitReasonDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: SpecialEducationProgramServiceDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.SpecialEducationProgramServiceDescriptor.EdFi +{ + /// + /// A class which represents the edfi.SpecialEducationProgramServiceDescriptor table of the SpecialEducationProgramServiceDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SpecialEducationProgramServiceDescriptor : Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "SpecialEducationProgramServiceDescriptor"); + + // Fluent validator instance (threadsafe) + private static SpecialEducationProgramServiceDescriptorPutPostRequestValidator _validator = new SpecialEducationProgramServiceDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the SpecialEducationProgramServiceDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int SpecialEducationProgramServiceDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return SpecialEducationProgramServiceDescriptorId; } + set { SpecialEducationProgramServiceDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor).SpecialEducationProgramServiceDescriptorId.Equals(compareTo.SpecialEducationProgramServiceDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor).SpecialEducationProgramServiceDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SpecialEducationProgramServiceDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SpecialEducationProgramServiceDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SpecialEducationProgramServiceDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: SpecialEducationSettingDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.SpecialEducationSettingDescriptor.EdFi +{ + /// + /// A class which represents the edfi.SpecialEducationSettingDescriptor table of the SpecialEducationSettingDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class SpecialEducationSettingDescriptor : Entities.Common.EdFi.ISpecialEducationSettingDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "SpecialEducationSettingDescriptor"); + + // Fluent validator instance (threadsafe) + private static SpecialEducationSettingDescriptorPutPostRequestValidator _validator = new SpecialEducationSettingDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the SpecialEducationSettingDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int SpecialEducationSettingDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return SpecialEducationSettingDescriptorId; } + set { SpecialEducationSettingDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.ISpecialEducationSettingDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.ISpecialEducationSettingDescriptor).SpecialEducationSettingDescriptorId.Equals(compareTo.SpecialEducationSettingDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.ISpecialEducationSettingDescriptor).SpecialEducationSettingDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.SpecialEducationSettingDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.ISpecialEducationSettingDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.SpecialEducationSettingDescriptorMapper.MapTo(this, (Entities.Common.EdFi.ISpecialEducationSettingDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class SpecialEducationSettingDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: Staff + +namespace EdFi.Ods.Api.Common.Models.Resources.Staff.EdFi +{ + /// + /// Represents a reference to the Staff resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StaffReference : IResourceReference + { + [DataMember(Name="staffUniqueId")] + public string StaffUniqueId + { + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + private string _staffUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return StaffUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (StaffUniqueId == default) + { + yield return "StaffUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "Staff", + Href = $"/ed-fi/staffs/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.Staff table of the Staff aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class Staff : Entities.Common.EdFi.IStaff, IHasETag, IDateVersionedEntity, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "Staff"); + + // Fluent validator instance (threadsafe) + private static StaffPutPostRequestValidator _validator = new StaffPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public Staff() + { + StaffAddresses = new List(); + StaffAncestryEthnicOrigins = new List(); + StaffCredentials = new List(); + StaffElectronicMails = new List(); + StaffIdentificationCodes = new List(); + StaffIdentificationDocuments = new List(); + StaffInternationalAddresses = new List(); + StaffLanguages = new List(); + StaffOtherNames = new List(); + StaffPersonalIdentificationDocuments = new List(); + StaffRaces = new List(); + StaffRecognitions = new List(); + StaffTelephones = new List(); + StaffTribalAffiliations = new List(); + StaffVisas = new List(); + } + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the Staff resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _personReferenceExplicitlyAssigned; + private Person.EdFi.PersonReference _personReference; + private Person.EdFi.PersonReference ImplicitPersonReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_personReference == null && !_personReferenceExplicitlyAssigned) + _personReference = new Person.EdFi.PersonReference(); + + return _personReference; + } + } + + [DataMember(Name="personReference")] + [FullyDefinedReference] + public Person.EdFi.PersonReference PersonReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitPersonReference != null + && (_personReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + return ImplicitPersonReference; + + return null; + } + set + { + _personReferenceExplicitlyAssigned = true; + _personReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique alphanumeric code assigned to a staff. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [UniqueId][DataMember(Name="staffUniqueId")] + public string StaffUniqueId + { + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + private string _staffUniqueId; + + string IIdentifiablePerson.UniqueId { get { return StaffUniqueId; } } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStaff; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Property + if (!((this as Entities.Common.EdFi.IStaff).StaffUniqueId.Equals(compareTo.StaffUniqueId))) + return false; + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Property + hash.Add((this as Entities.Common.EdFi.IStaff).StaffUniqueId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The month, day, and year on which an individual was born. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="birthDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BirthDate { get; set; } + + /// + /// An indicator of whether or not the person is a U.S. citizen. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="citizenshipStatusDescriptor")][DescriptorExists("CitizenshipStatusDescriptor")] + public string CitizenshipStatusDescriptor { get; set; } + + /// + /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="firstName")] + public string FirstName { get; set; } + + /// + /// The gender the staff member identifies themselves as. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="genderIdentity")] + public string GenderIdentity { get; set; } + + /// + /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="generationCodeSuffix")] + public string GenerationCodeSuffix { get; set; } + + /// + /// The extent of formal instruction an individual has received (e.g., the highest grade in school completed or its equivalent or the highest degree received). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="highestCompletedLevelOfEducationDescriptor")][DescriptorExists("LevelOfEducationDescriptor")] + public string HighestCompletedLevelOfEducationDescriptor { get; set; } + + /// + /// An indication of whether a teacher is classified as highly qualified for his/her assignment according to state definition. This attribute indicates the teacher is highly qualified for ALL Sections being taught. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="highlyQualifiedTeacher")] + public bool? HighlyQualifiedTeacher { get; set; } + + /// + /// An indication that the individual traces his or her origin or descent to Mexico, Puerto Rico, Cuba, Central, and South America, and other Spanish cultures, regardless of race. The term, \"Spanish origin,\" can be used in addition to \"Hispanic or Latino.\" + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="hispanicLatinoEthnicity")] + public bool? HispanicLatinoEthnicity { get; set; } + + /// + /// The name borne in common by members of a family. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } + + /// + /// The login ID for the user; used for security access control interface. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="loginId")] + public string LoginId { get; set; } + + /// + /// The individual's maiden name. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maidenName")] + public string MaidenName { get; set; } + + /// + /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="middleName")] + public string MiddleName { get; set; } + + /// + /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="personalTitlePrefix")] + public string PersonalTitlePrefix { get; set; } + + /// + /// A unique alphanumeric code assigned to a person. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaff.PersonId + { + get + { + if (ImplicitPersonReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + { + return ImplicitPersonReference.PersonId; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Person + _personReferenceExplicitlyAssigned = false; + ImplicitPersonReference.PersonId = value; + } + } + + /// + /// The first name the individual prefers, if different from their legal first name + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="preferredFirstName")] + public string PreferredFirstName { get; set; } + + /// + /// The last name the individual prefers, if different from their legal last name + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="preferredLastSurname")] + public string PreferredLastSurname { get; set; } + + /// + /// The birth sex of the staff member. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="sexDescriptor")][DescriptorExists("SexDescriptor")] + public string SexDescriptor { get; set; } + + /// + /// This descriptor defines the originating record source system for the person. + /// + + // IS in a reference (Staff.SourceSystemDescriptorId), IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + string Entities.Common.EdFi.IStaff.SourceSystemDescriptor + { + get + { + if (ImplicitPersonReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + { + return ImplicitPersonReference.SourceSystemDescriptor; + } + + return null; + } + set + { + ImplicitPersonReference.SourceSystemDescriptor = value; + } + } + + /// + /// The total number of years that an individual has previously held a similar professional position in one or more education institutions prior to the current school year. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-999.99", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="yearsOfPriorProfessionalExperience")] + public decimal? YearsOfPriorProfessionalExperience { get; set; } + + /// + /// The total number of years that an individual has previously held a teaching position in one or more education institutions prior to the current school year. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-999.99", "999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="yearsOfPriorTeachingExperience")] + public decimal? YearsOfPriorTeachingExperience { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "Staff")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _staffAddresses; + private ICollection _staffAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection StaffAddresses + { + get { return _staffAddresses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffAddress)e.Item).Staff = this); + _staffAddresses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffAddress)e.Item).Staff = this; + _staffAddressesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffAddresses + { + get { return _staffAddressesCovariant; } + set { StaffAddresses = new List(value.Cast()); } + } + + private ICollection _staffAncestryEthnicOrigins; + private ICollection _staffAncestryEthnicOriginsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="ancestryEthnicOrigins")] + public ICollection StaffAncestryEthnicOrigins + { + get { return _staffAncestryEthnicOrigins; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffAncestryEthnicOrigin)e.Item).Staff = this); + _staffAncestryEthnicOrigins = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffAncestryEthnicOrigin)e.Item).Staff = this; + _staffAncestryEthnicOriginsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffAncestryEthnicOrigins + { + get { return _staffAncestryEthnicOriginsCovariant; } + set { StaffAncestryEthnicOrigins = new List(value.Cast()); } + } + + private ICollection _staffCredentials; + private ICollection _staffCredentialsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="credentials")] + public ICollection StaffCredentials + { + get { return _staffCredentials; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffCredential)e.Item).Staff = this); + _staffCredentials = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffCredential)e.Item).Staff = this; + _staffCredentialsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffCredentials + { + get { return _staffCredentialsCovariant; } + set { StaffCredentials = new List(value.Cast()); } + } + + private ICollection _staffElectronicMails; + private ICollection _staffElectronicMailsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="electronicMails")] + public ICollection StaffElectronicMails + { + get { return _staffElectronicMails; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffElectronicMail)e.Item).Staff = this); + _staffElectronicMails = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffElectronicMail)e.Item).Staff = this; + _staffElectronicMailsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffElectronicMails + { + get { return _staffElectronicMailsCovariant; } + set { StaffElectronicMails = new List(value.Cast()); } + } + + private ICollection _staffIdentificationCodes; + private ICollection _staffIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection StaffIdentificationCodes + { + get { return _staffIdentificationCodes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffIdentificationCode)e.Item).Staff = this); + _staffIdentificationCodes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffIdentificationCode)e.Item).Staff = this; + _staffIdentificationCodesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffIdentificationCodes + { + get { return _staffIdentificationCodesCovariant; } + set { StaffIdentificationCodes = new List(value.Cast()); } + } + + private ICollection _staffIdentificationDocuments; + private ICollection _staffIdentificationDocumentsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationDocuments")] + public ICollection StaffIdentificationDocuments + { + get { return _staffIdentificationDocuments; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffIdentificationDocument)e.Item).Staff = this); + _staffIdentificationDocuments = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffIdentificationDocument)e.Item).Staff = this; + _staffIdentificationDocumentsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffIdentificationDocuments + { + get { return _staffIdentificationDocumentsCovariant; } + set { StaffIdentificationDocuments = new List(value.Cast()); } + } + + private ICollection _staffInternationalAddresses; + private ICollection _staffInternationalAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection StaffInternationalAddresses + { + get { return _staffInternationalAddresses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffInternationalAddress)e.Item).Staff = this); + _staffInternationalAddresses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffInternationalAddress)e.Item).Staff = this; + _staffInternationalAddressesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffInternationalAddresses + { + get { return _staffInternationalAddressesCovariant; } + set { StaffInternationalAddresses = new List(value.Cast()); } + } + + private ICollection _staffLanguages; + private ICollection _staffLanguagesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="languages")] + public ICollection StaffLanguages + { + get { return _staffLanguages; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffLanguage)e.Item).Staff = this); + _staffLanguages = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffLanguage)e.Item).Staff = this; + _staffLanguagesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffLanguages + { + get { return _staffLanguagesCovariant; } + set { StaffLanguages = new List(value.Cast()); } + } + + private ICollection _staffOtherNames; + private ICollection _staffOtherNamesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="otherNames")] + public ICollection StaffOtherNames + { + get { return _staffOtherNames; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffOtherName)e.Item).Staff = this); + _staffOtherNames = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffOtherName)e.Item).Staff = this; + _staffOtherNamesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffOtherNames + { + get { return _staffOtherNamesCovariant; } + set { StaffOtherNames = new List(value.Cast()); } + } + + private ICollection _staffPersonalIdentificationDocuments; + private ICollection _staffPersonalIdentificationDocumentsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="personalIdentificationDocuments")] + public ICollection StaffPersonalIdentificationDocuments + { + get { return _staffPersonalIdentificationDocuments; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffPersonalIdentificationDocument)e.Item).Staff = this); + _staffPersonalIdentificationDocuments = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffPersonalIdentificationDocument)e.Item).Staff = this; + _staffPersonalIdentificationDocumentsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffPersonalIdentificationDocuments + { + get { return _staffPersonalIdentificationDocumentsCovariant; } + set { StaffPersonalIdentificationDocuments = new List(value.Cast()); } + } + + private ICollection _staffRaces; + private ICollection _staffRacesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="races")] + public ICollection StaffRaces + { + get { return _staffRaces; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffRace)e.Item).Staff = this); + _staffRaces = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffRace)e.Item).Staff = this; + _staffRacesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffRaces + { + get { return _staffRacesCovariant; } + set { StaffRaces = new List(value.Cast()); } + } + + private ICollection _staffRecognitions; + private ICollection _staffRecognitionsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="recognitions")] + public ICollection StaffRecognitions + { + get { return _staffRecognitions; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffRecognition)e.Item).Staff = this); + _staffRecognitions = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffRecognition)e.Item).Staff = this; + _staffRecognitionsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffRecognitions + { + get { return _staffRecognitionsCovariant; } + set { StaffRecognitions = new List(value.Cast()); } + } + + private ICollection _staffTelephones; + private ICollection _staffTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="telephones")] + public ICollection StaffTelephones + { + get { return _staffTelephones; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffTelephone)e.Item).Staff = this); + _staffTelephones = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffTelephone)e.Item).Staff = this; + _staffTelephonesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffTelephones + { + get { return _staffTelephonesCovariant; } + set { StaffTelephones = new List(value.Cast()); } + } + + private ICollection _staffTribalAffiliations; + private ICollection _staffTribalAffiliationsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="tribalAffiliations")] + public ICollection StaffTribalAffiliations + { + get { return _staffTribalAffiliations; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffTribalAffiliation)e.Item).Staff = this); + _staffTribalAffiliations = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffTribalAffiliation)e.Item).Staff = this; + _staffTribalAffiliationsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffTribalAffiliations + { + get { return _staffTribalAffiliationsCovariant; } + set { StaffTribalAffiliations = new List(value.Cast()); } + } + + private ICollection _staffVisas; + private ICollection _staffVisasCovariant; + + [NoDuplicateMembers] + [DataMember(Name="visas")] + public ICollection StaffVisas + { + get { return _staffVisas; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffVisa)e.Item).Staff = this); + _staffVisas = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffVisa)e.Item).Staff = this; + _staffVisasCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaff.StaffVisas + { + get { return _staffVisasCovariant; } + set { StaffVisas = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_staffAddresses != null) foreach (var item in _staffAddresses) + { + item.Staff = this; + } + + if (_staffAncestryEthnicOrigins != null) foreach (var item in _staffAncestryEthnicOrigins) + { + item.Staff = this; + } + + if (_staffCredentials != null) foreach (var item in _staffCredentials) + { + item.Staff = this; + } + + if (_staffElectronicMails != null) foreach (var item in _staffElectronicMails) + { + item.Staff = this; + } + + if (_staffIdentificationCodes != null) foreach (var item in _staffIdentificationCodes) + { + item.Staff = this; + } + + if (_staffIdentificationDocuments != null) foreach (var item in _staffIdentificationDocuments) + { + item.Staff = this; + } + + if (_staffInternationalAddresses != null) foreach (var item in _staffInternationalAddresses) + { + item.Staff = this; + } + + if (_staffLanguages != null) foreach (var item in _staffLanguages) + { + item.Staff = this; + } if (_staffOtherNames != null) foreach (var item in _staffOtherNames) { - item.Staff = this; + item.Staff = this; + } + + if (_staffPersonalIdentificationDocuments != null) foreach (var item in _staffPersonalIdentificationDocuments) + { + item.Staff = this; + } + + if (_staffRaces != null) foreach (var item in _staffRaces) + { + item.Staff = this; + } + + if (_staffRecognitions != null) foreach (var item in _staffRecognitions) + { + item.Staff = this; + } + + if (_staffTelephones != null) foreach (var item in _staffTelephones) + { + item.Staff = this; + } + + if (_staffTribalAffiliations != null) foreach (var item in _staffTribalAffiliations) + { + item.Staff = this; + } + + if (_staffVisas != null) foreach (var item in _staffVisas) + { + item.Staff = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaff)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StaffMapper.MapTo(this, (Entities.Common.EdFi.IStaff)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStaff.PersonResourceId + { + get { return null; } + set { ImplicitPersonReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaff.PersonDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitPersonReference.Discriminator = value; } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (StaffAddresses.Any() && mappingContract?.IsMemberSupported("StaffAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffAddresses, validationContext, validationContext.Items.ForCollection("StaffAddresses")))) + { + yield return result; + } + } + + if (StaffAncestryEthnicOrigins.Any() && mappingContract?.IsMemberSupported("StaffAncestryEthnicOrigins") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffAncestryEthnicOrigins"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffAncestryEthnicOrigins, validationContext, validationContext.Items.ForCollection("StaffAncestryEthnicOrigins")))) + { + yield return result; + } + } + + if (StaffCredentials.Any() && mappingContract?.IsMemberSupported("StaffCredentials") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffCredentials"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffCredentials, validationContext, validationContext.Items.ForCollection("StaffCredentials")))) + { + yield return result; + } + } + + if (StaffElectronicMails.Any() && mappingContract?.IsMemberSupported("StaffElectronicMails") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffElectronicMails"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffElectronicMails, validationContext, validationContext.Items.ForCollection("StaffElectronicMails")))) + { + yield return result; + } + } + + if (StaffIdentificationCodes.Any() && mappingContract?.IsMemberSupported("StaffIdentificationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffIdentificationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffIdentificationCodes, validationContext, validationContext.Items.ForCollection("StaffIdentificationCodes")))) + { + yield return result; + } + } + + if (StaffIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StaffIdentificationDocuments") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffIdentificationDocuments"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StaffIdentificationDocuments")))) + { + yield return result; + } + } + + if (StaffInternationalAddresses.Any() && mappingContract?.IsMemberSupported("StaffInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffInternationalAddresses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffInternationalAddresses, validationContext, validationContext.Items.ForCollection("StaffInternationalAddresses")))) + { + yield return result; + } + } + + if (StaffLanguages.Any() && mappingContract?.IsMemberSupported("StaffLanguages") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffLanguages"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffLanguages, validationContext, validationContext.Items.ForCollection("StaffLanguages")))) + { + yield return result; + } + } + + if (StaffOtherNames.Any() && mappingContract?.IsMemberSupported("StaffOtherNames") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffOtherNames"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffOtherNames, validationContext, validationContext.Items.ForCollection("StaffOtherNames")))) + { + yield return result; + } + } + + if (StaffPersonalIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StaffPersonalIdentificationDocuments") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffPersonalIdentificationDocuments"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffPersonalIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StaffPersonalIdentificationDocuments")))) + { + yield return result; + } + } + + if (StaffRaces.Any() && mappingContract?.IsMemberSupported("StaffRaces") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffRaces"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffRaces, validationContext, validationContext.Items.ForCollection("StaffRaces")))) + { + yield return result; + } + } + + if (StaffRecognitions.Any() && mappingContract?.IsMemberSupported("StaffRecognitions") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffRecognitions"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffRecognitions, validationContext, validationContext.Items.ForCollection("StaffRecognitions")))) + { + yield return result; + } + } + + if (StaffTelephones.Any() && mappingContract?.IsMemberSupported("StaffTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffTelephones, validationContext, validationContext.Items.ForCollection("StaffTelephones")))) + { + yield return result; + } + } + + if (StaffTribalAffiliations.Any() && mappingContract?.IsMemberSupported("StaffTribalAffiliations") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffTribalAffiliations"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffTribalAffiliations, validationContext, validationContext.Items.ForCollection("StaffTribalAffiliations")))) + { + yield return result; + } + } + + if (StaffVisas.Any() && mappingContract?.IsMemberSupported("StaffVisas") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffVisas"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffVisas, validationContext, validationContext.Items.ForCollection("StaffVisas")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StaffPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_Staff = new FullName("edfi", "Staff"); + + // Declare collection item validators + private StaffAddressPutPostRequestValidator _staffAddressesValidator = new (); + private StaffAncestryEthnicOriginPutPostRequestValidator _staffAncestryEthnicOriginsValidator = new (); + private StaffCredentialPutPostRequestValidator _staffCredentialsValidator = new (); + private StaffElectronicMailPutPostRequestValidator _staffElectronicMailsValidator = new (); + private StaffIdentificationCodePutPostRequestValidator _staffIdentificationCodesValidator = new (); + private StaffIdentificationDocumentPutPostRequestValidator _staffIdentificationDocumentsValidator = new (); + private StaffInternationalAddressPutPostRequestValidator _staffInternationalAddressesValidator = new (); + private StaffLanguagePutPostRequestValidator _staffLanguagesValidator = new (); + private StaffOtherNamePutPostRequestValidator _staffOtherNamesValidator = new (); + private StaffPersonalIdentificationDocumentPutPostRequestValidator _staffPersonalIdentificationDocumentsValidator = new (); + private StaffRacePutPostRequestValidator _staffRacesValidator = new (); + private StaffRecognitionPutPostRequestValidator _staffRecognitionsValidator = new (); + private StaffTelephonePutPostRequestValidator _staffTelephonesValidator = new (); + private StaffTribalAffiliationPutPostRequestValidator _staffTribalAffiliationsValidator = new (); + private StaffVisaPutPostRequestValidator _staffVisasValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StaffMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_Staff); + + if (mappingContract != null) + { + if (mappingContract.IsStaffAddressIncluded != null) + { + var hasInvalidStaffAddressesItems = instance.StaffAddresses.Any(x => !mappingContract.IsStaffAddressIncluded(x)); + + if (hasInvalidStaffAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffAddresses", $"A supplied 'StaffAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffAncestryEthnicOriginIncluded != null) + { + var hasInvalidStaffAncestryEthnicOriginsItems = instance.StaffAncestryEthnicOrigins.Any(x => !mappingContract.IsStaffAncestryEthnicOriginIncluded(x)); + + if (hasInvalidStaffAncestryEthnicOriginsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffAncestryEthnicOrigins", $"A supplied 'StaffAncestryEthnicOrigin' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffCredentialIncluded != null) + { + var hasInvalidStaffCredentialsItems = instance.StaffCredentials.Any(x => !mappingContract.IsStaffCredentialIncluded(x)); + + if (hasInvalidStaffCredentialsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffCredentials", $"A supplied 'StaffCredential' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffElectronicMailIncluded != null) + { + var hasInvalidStaffElectronicMailsItems = instance.StaffElectronicMails.Any(x => !mappingContract.IsStaffElectronicMailIncluded(x)); + + if (hasInvalidStaffElectronicMailsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffElectronicMails", $"A supplied 'StaffElectronicMail' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffIdentificationCodeIncluded != null) + { + var hasInvalidStaffIdentificationCodesItems = instance.StaffIdentificationCodes.Any(x => !mappingContract.IsStaffIdentificationCodeIncluded(x)); + + if (hasInvalidStaffIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffIdentificationCodes", $"A supplied 'StaffIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffIdentificationDocumentIncluded != null) + { + var hasInvalidStaffIdentificationDocumentsItems = instance.StaffIdentificationDocuments.Any(x => !mappingContract.IsStaffIdentificationDocumentIncluded(x)); + + if (hasInvalidStaffIdentificationDocumentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffIdentificationDocuments", $"A supplied 'StaffIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffInternationalAddressIncluded != null) + { + var hasInvalidStaffInternationalAddressesItems = instance.StaffInternationalAddresses.Any(x => !mappingContract.IsStaffInternationalAddressIncluded(x)); + + if (hasInvalidStaffInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffInternationalAddresses", $"A supplied 'StaffInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffLanguageIncluded != null) + { + var hasInvalidStaffLanguagesItems = instance.StaffLanguages.Any(x => !mappingContract.IsStaffLanguageIncluded(x)); + + if (hasInvalidStaffLanguagesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffLanguages", $"A supplied 'StaffLanguage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffOtherNameIncluded != null) + { + var hasInvalidStaffOtherNamesItems = instance.StaffOtherNames.Any(x => !mappingContract.IsStaffOtherNameIncluded(x)); + + if (hasInvalidStaffOtherNamesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffOtherNames", $"A supplied 'StaffOtherName' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffPersonalIdentificationDocumentIncluded != null) + { + var hasInvalidStaffPersonalIdentificationDocumentsItems = instance.StaffPersonalIdentificationDocuments.Any(x => !mappingContract.IsStaffPersonalIdentificationDocumentIncluded(x)); + + if (hasInvalidStaffPersonalIdentificationDocumentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffPersonalIdentificationDocuments", $"A supplied 'StaffPersonalIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffRaceIncluded != null) + { + var hasInvalidStaffRacesItems = instance.StaffRaces.Any(x => !mappingContract.IsStaffRaceIncluded(x)); + + if (hasInvalidStaffRacesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffRaces", $"A supplied 'StaffRace' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffRecognitionIncluded != null) + { + var hasInvalidStaffRecognitionsItems = instance.StaffRecognitions.Any(x => !mappingContract.IsStaffRecognitionIncluded(x)); + + if (hasInvalidStaffRecognitionsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffRecognitions", $"A supplied 'StaffRecognition' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffTelephoneIncluded != null) + { + var hasInvalidStaffTelephonesItems = instance.StaffTelephones.Any(x => !mappingContract.IsStaffTelephoneIncluded(x)); + + if (hasInvalidStaffTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffTelephones", $"A supplied 'StaffTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffTribalAffiliationIncluded != null) + { + var hasInvalidStaffTribalAffiliationsItems = instance.StaffTribalAffiliations.Any(x => !mappingContract.IsStaffTribalAffiliationIncluded(x)); + + if (hasInvalidStaffTribalAffiliationsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffTribalAffiliations", $"A supplied 'StaffTribalAffiliation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStaffVisaIncluded != null) + { + var hasInvalidStaffVisasItems = instance.StaffVisas.Any(x => !mappingContract.IsStaffVisaIncluded(x)); + + if (hasInvalidStaffVisasItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffVisas", $"A supplied 'StaffVisa' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StaffAddress table of the Staff aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StaffAddress : Entities.Common.EdFi.IStaffAddress, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StaffAddress"); + + // Fluent validator instance (threadsafe) + private static StaffAddressPutPostRequestValidator _validator = new StaffAddressPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public StaffAddress() + { + StaffAddressPeriods = new List(); + } + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaff _staff; + + [IgnoreDataMember] + Entities.Common.EdFi.IStaff IStaffAddress.Staff + { + get { return _staff; } + set { SetStaff(value); } + } + + public Entities.Common.EdFi.IStaff Staff + { + set { SetStaff(value); } + } + + private void SetStaff(Entities.Common.EdFi.IStaff value) + { + _staff = value; + } + + /// + /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] + public string AddressTypeDescriptor { get; set; } + + /// + /// The name of the city in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="city")] + public string City { get; set; } + + /// + /// The five or nine digit zip code or overseas postal code portion of an address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="postalCode")] + public string PostalCode { get; set; } + + /// + /// The abbreviation for the state (within the United States) or outlying area in which an address is located. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string StateAbbreviationDescriptor { get; set; } + + /// + /// The street number and street name or post office box number of an address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="streetNumberName")] + public string StreetNumberName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStaffAddress; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_staff == null || !_staff.Equals(compareTo.Staff)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAddress).City, compareTo.City)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAddress).PostalCode, compareTo.PostalCode)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAddress).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAddress).StreetNumberName, compareTo.StreetNumberName)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_staff != null) + hash.Add(_staff); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAddress).AddressTypeDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAddress).City); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAddress).PostalCode); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAddress).StateAbbreviationDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAddress).StreetNumberName); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The apartment, room, or suite number of an address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="apartmentRoomSuiteNumber")] + public string ApartmentRoomSuiteNumber { get; set; } + + /// + /// The number of the building on the site, if more than one building shares the same address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="buildingSiteNumber")] + public string BuildingSiteNumber { get; set; } + + /// + /// The congressional district in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="congressionalDistrict")] + public string CongressionalDistrict { get; set; } + + /// + /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="countyFIPSCode")] + public string CountyFIPSCode { get; set; } + + /// + /// An indication that the address should not be published. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } + + /// + /// The geographic latitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="latitude")] + public string Latitude { get; set; } + + /// + /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] + public string LocaleDescriptor { get; set; } + + /// + /// The geographic longitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="longitude")] + public string Longitude { get; set; } + + /// + /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfCounty")] + public string NameOfCounty { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffAddress")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _staffAddressPeriods; + private ICollection _staffAddressPeriodsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="periods")] + public ICollection StaffAddressPeriods + { + get { return _staffAddressPeriods; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffAddressPeriod)e.Item).StaffAddress = this); + _staffAddressPeriods = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffAddressPeriod)e.Item).StaffAddress = this; + _staffAddressPeriodsCovariant = covariantList; } + } - if (_staffPersonalIdentificationDocuments != null) foreach (var item in _staffPersonalIdentificationDocuments) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaffAddress.StaffAddressPeriods + { + get { return _staffAddressPeriodsCovariant; } + set { StaffAddressPeriods = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_staffAddressPeriods != null) foreach (var item in _staffAddressPeriods) { - item.Staff = this; + item.StaffAddress = this; } - if (_staffRaces != null) foreach (var item in _staffRaces) + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StaffAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAddress)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StaffAddressMapper.MapTo(this, (Entities.Common.EdFi.IStaffAddress)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - item.Staff = this; + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (StaffAddressPeriods.Any() && mappingContract?.IsMemberSupported("StaffAddressPeriods") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffAddressPeriods"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffAddressPeriods, validationContext, validationContext.Items.ForCollection("StaffAddressPeriods")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; } + // ---------------------------------- + } + } - if (_staffRecognitions != null) foreach (var item in _staffRecognitions) + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StaffAddressPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_StaffAddress = new FullName("edfi", "StaffAddress"); + + // Declare collection item validators + private StaffAddressPeriodPutPostRequestValidator _staffAddressPeriodsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) { - item.Staff = this; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; } - if (_staffTelephones != null) foreach (var item in _staffTelephones) + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StaffAddressMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StaffAddress); + + if (mappingContract != null) { - item.Staff = this; + if (mappingContract.IsStaffAddressPeriodIncluded != null) + { + var hasInvalidStaffAddressPeriodsItems = instance.StaffAddressPeriods.Any(x => !mappingContract.IsStaffAddressPeriodIncluded(x)); + + if (hasInvalidStaffAddressPeriodsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffAddressPeriods", $"A supplied 'StaffAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + } - if (_staffTribalAffiliations != null) foreach (var item in _staffTribalAffiliations) + if (failures.Any()) { - item.Staff = this; + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; } - if (_staffVisas != null) foreach (var item in _staffVisas) + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StaffAddressPeriod table of the Staff aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StaffAddressPeriod : Entities.Common.EdFi.IStaffAddressPeriod, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StaffAddressPeriod"); + + // Fluent validator instance (threadsafe) + private static StaffAddressPeriodPutPostRequestValidator _validator = new StaffAddressPeriodPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaffAddress _staffAddress; + + [IgnoreDataMember] + Entities.Common.EdFi.IStaffAddress IStaffAddressPeriod.StaffAddress + { + get { return _staffAddress; } + set { SetStaffAddress(value); } + } + + public Entities.Common.EdFi.IStaffAddress StaffAddress + { + set { SetStaffAddress(value); } + } + + private void SetStaffAddress(Entities.Common.EdFi.IStaffAddress value) + { + _staffAddress = value; + } + + /// + /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStaffAddressPeriod; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_staffAddress == null || !_staffAddress.Equals(compareTo.StaffAddress)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IStaffAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_staffAddress != null) + hash.Add(_staffAddress); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAddressPeriod).BeginDate); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffAddressPeriod")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StaffAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAddressPeriod)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StaffAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IStaffAddressPeriod)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - item.Staff = this; + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StaffAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StaffAncestryEthnicOrigin table of the Staff aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StaffAncestryEthnicOrigin : Entities.Common.EdFi.IStaffAncestryEthnicOrigin, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StaffAncestryEthnicOrigin"); + + // Fluent validator instance (threadsafe) + private static StaffAncestryEthnicOriginPutPostRequestValidator _validator = new StaffAncestryEthnicOriginPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaff _staff; + + [IgnoreDataMember] + Entities.Common.EdFi.IStaff IStaffAncestryEthnicOrigin.Staff + { + get { return _staff; } + set { SetStaff(value); } + } + + public Entities.Common.EdFi.IStaff Staff + { + set { SetStaff(value); } + } + + private void SetStaff(Entities.Common.EdFi.IStaff value) + { + _staff = value; + } + + /// + /// The original peoples or cultures with which the individual identifies. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="ancestryEthnicOriginDescriptor")][DescriptorExists("AncestryEthnicOriginDescriptor")] + public string AncestryEthnicOriginDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStaffAncestryEthnicOrigin; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_staff == null || !_staff.Equals(compareTo.Staff)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAncestryEthnicOrigin).AncestryEthnicOriginDescriptor, compareTo.AncestryEthnicOriginDescriptor)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_staff != null) + hash.Add(_staff); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAncestryEthnicOrigin).AncestryEthnicOriginDescriptor); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffAncestryEthnicOrigin")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StaffAncestryEthnicOriginMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAncestryEthnicOrigin)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StaffAncestryEthnicOriginMapper.MapTo(this, (Entities.Common.EdFi.IStaffAncestryEthnicOrigin)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StaffAncestryEthnicOriginPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StaffCredential table of the Staff aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StaffCredential : Entities.Common.EdFi.IStaffCredential, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StaffCredential"); + + // Fluent validator instance (threadsafe) + private static StaffCredentialPutPostRequestValidator _validator = new StaffCredentialPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _credentialReferenceExplicitlyAssigned; + private Credential.EdFi.CredentialReference _credentialReference; + private Credential.EdFi.CredentialReference ImplicitCredentialReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_credentialReference == null && !_credentialReferenceExplicitlyAssigned) + _credentialReference = new Credential.EdFi.CredentialReference(); + + return _credentialReference; + } + } + + [DataMember(Name="credentialReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Credential.EdFi.CredentialReference CredentialReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCredentialReference != null + && (_credentialReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + return ImplicitCredentialReference; + + return null; + } + set + { + _credentialReferenceExplicitlyAssigned = true; + _credentialReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaff _staff; + + [IgnoreDataMember] + Entities.Common.EdFi.IStaff IStaffCredential.Staff + { + get { return _staff; } + set { SetStaff(value); } + } + + public Entities.Common.EdFi.IStaff Staff + { + set { SetStaff(value); } + } + + private void SetStaff(Entities.Common.EdFi.IStaff value) + { + _staff = value; + } + + /// + /// Identifier or serial number assigned to the credential. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffCredential.CredentialIdentifier + { + get + { + if (ImplicitCredentialReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + return ImplicitCredentialReference.CredentialIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Credential + _credentialReferenceExplicitlyAssigned = false; + ImplicitCredentialReference.CredentialIdentifier = value; + } + } + + /// + /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which a license/credential was issued. + /// + + // IS in a reference (StaffCredential.StateOfIssueStateAbbreviationDescriptorId), IS a lookup column + string Entities.Common.EdFi.IStaffCredential.StateOfIssueStateAbbreviationDescriptor + { + get + { + if (ImplicitCredentialReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + return ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor; + + return null; + } + set + { + ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStaffCredential; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_staff == null || !_staff.Equals(compareTo.Staff)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffCredential).CredentialIdentifier, compareTo.CredentialIdentifier)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffCredential).StateOfIssueStateAbbreviationDescriptor, compareTo.StateOfIssueStateAbbreviationDescriptor)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_staff != null) + hash.Add(_staff); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffCredential).CredentialIdentifier); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStaffCredential).StateOfIssueStateAbbreviationDescriptor); + return hash.ToHashCode(); } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffCredential")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- // ------------------------------------------------------------ // ============================================================ @@ -153574,29 +159203,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaff)target); + return Entities.Common.EdFi.StaffCredentialMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffCredential)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffMapper.MapTo(this, (Entities.Common.EdFi.IStaff)target, null); + Entities.Common.EdFi.StaffCredentialMapper.MapTo(this, (Entities.Common.EdFi.IStaffCredential)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaff.PersonResourceId + Guid? Entities.Common.EdFi.IStaffCredential.CredentialResourceId { get { return null; } - set { ImplicitPersonReference.ResourceId = value ?? default(Guid); } + set { ImplicitCredentialReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaff.PersonDiscriminator + string Entities.Common.EdFi.IStaffCredential.CredentialDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitPersonReference.Discriminator = value; } + set { ImplicitCredentialReference.Discriminator = value; } } @@ -153617,191 +159246,12 @@ string Entities.Common.EdFi.IStaff.PersonDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (StaffAddresses.Any() && mappingContract?.IsMemberSupported("StaffAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffAddresses, validationContext, validationContext.Items.ForCollection("StaffAddresses")))) - { - yield return result; - } - } - - if (StaffAncestryEthnicOrigins.Any() && mappingContract?.IsMemberSupported("StaffAncestryEthnicOrigins") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffAncestryEthnicOrigins"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffAncestryEthnicOrigins, validationContext, validationContext.Items.ForCollection("StaffAncestryEthnicOrigins")))) - { - yield return result; - } - } - - if (StaffCredentials.Any() && mappingContract?.IsMemberSupported("StaffCredentials") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffCredentials"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffCredentials, validationContext, validationContext.Items.ForCollection("StaffCredentials")))) - { - yield return result; - } - } - - if (StaffElectronicMails.Any() && mappingContract?.IsMemberSupported("StaffElectronicMails") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffElectronicMails"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffElectronicMails, validationContext, validationContext.Items.ForCollection("StaffElectronicMails")))) - { - yield return result; - } - } - - if (StaffIdentificationCodes.Any() && mappingContract?.IsMemberSupported("StaffIdentificationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffIdentificationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffIdentificationCodes, validationContext, validationContext.Items.ForCollection("StaffIdentificationCodes")))) - { - yield return result; - } - } - - if (StaffIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StaffIdentificationDocuments") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffIdentificationDocuments"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StaffIdentificationDocuments")))) - { - yield return result; - } - } - - if (StaffInternationalAddresses.Any() && mappingContract?.IsMemberSupported("StaffInternationalAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffInternationalAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffInternationalAddresses, validationContext, validationContext.Items.ForCollection("StaffInternationalAddresses")))) - { - yield return result; - } - } - - if (StaffLanguages.Any() && mappingContract?.IsMemberSupported("StaffLanguages") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffLanguages"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffLanguages, validationContext, validationContext.Items.ForCollection("StaffLanguages")))) - { - yield return result; - } - } - - if (StaffOtherNames.Any() && mappingContract?.IsMemberSupported("StaffOtherNames") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffOtherNames"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffOtherNames, validationContext, validationContext.Items.ForCollection("StaffOtherNames")))) - { - yield return result; - } - } - - if (StaffPersonalIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StaffPersonalIdentificationDocuments") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffPersonalIdentificationDocuments"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffPersonalIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StaffPersonalIdentificationDocuments")))) - { - yield return result; - } - } - - if (StaffRaces.Any() && mappingContract?.IsMemberSupported("StaffRaces") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffRaces"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffRaces, validationContext, validationContext.Items.ForCollection("StaffRaces")))) - { - yield return result; - } - } - - if (StaffRecognitions.Any() && mappingContract?.IsMemberSupported("StaffRecognitions") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffRecognitions"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffRecognitions, validationContext, validationContext.Items.ForCollection("StaffRecognitions")))) - { - yield return result; - } - } - - if (StaffTelephones.Any() && mappingContract?.IsMemberSupported("StaffTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffTelephones"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffTelephones, validationContext, validationContext.Items.ForCollection("StaffTelephones")))) - { - yield return result; - } - } - - if (StaffTribalAffiliations.Any() && mappingContract?.IsMemberSupported("StaffTribalAffiliations") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffTribalAffiliations"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffTribalAffiliations, validationContext, validationContext.Items.ForCollection("StaffTribalAffiliations")))) - { - yield return result; - } - } - - if (StaffVisas.Any() && mappingContract?.IsMemberSupported("StaffVisas") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffVisas"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffVisas, validationContext, validationContext.Items.ForCollection("StaffVisas")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -153847,28 +159297,9 @@ string Entities.Common.EdFi.IStaff.PersonDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffCredentialPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Staff = new FullName("edfi", "Staff"); - - // Declare collection item validators - private StaffAddressPutPostRequestValidator _staffAddressesValidator = new (); - private StaffAncestryEthnicOriginPutPostRequestValidator _staffAncestryEthnicOriginsValidator = new (); - private StaffCredentialPutPostRequestValidator _staffCredentialsValidator = new (); - private StaffElectronicMailPutPostRequestValidator _staffElectronicMailsValidator = new (); - private StaffIdentificationCodePutPostRequestValidator _staffIdentificationCodesValidator = new (); - private StaffIdentificationDocumentPutPostRequestValidator _staffIdentificationDocumentsValidator = new (); - private StaffInternationalAddressPutPostRequestValidator _staffInternationalAddressesValidator = new (); - private StaffLanguagePutPostRequestValidator _staffLanguagesValidator = new (); - private StaffOtherNamePutPostRequestValidator _staffOtherNamesValidator = new (); - private StaffPersonalIdentificationDocumentPutPostRequestValidator _staffPersonalIdentificationDocumentsValidator = new (); - private StaffRacePutPostRequestValidator _staffRacesValidator = new (); - private StaffRecognitionPutPostRequestValidator _staffRecognitionsValidator = new (); - private StaffTelephonePutPostRequestValidator _staffTelephonesValidator = new (); - private StaffTribalAffiliationPutPostRequestValidator _staffTribalAffiliationsValidator = new (); - private StaffVisaPutPostRequestValidator _staffVisasValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -153881,182 +159312,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext co var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StaffMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Staff); - - if (mappingContract != null) - { - if (mappingContract.IsStaffAddressIncluded != null) - { - var hasInvalidStaffAddressesItems = instance.StaffAddresses.Any(x => !mappingContract.IsStaffAddressIncluded(x)); - - if (hasInvalidStaffAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffAddresses", $"A supplied 'StaffAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffAncestryEthnicOriginIncluded != null) - { - var hasInvalidStaffAncestryEthnicOriginsItems = instance.StaffAncestryEthnicOrigins.Any(x => !mappingContract.IsStaffAncestryEthnicOriginIncluded(x)); - - if (hasInvalidStaffAncestryEthnicOriginsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffAncestryEthnicOrigins", $"A supplied 'StaffAncestryEthnicOrigin' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffCredentialIncluded != null) - { - var hasInvalidStaffCredentialsItems = instance.StaffCredentials.Any(x => !mappingContract.IsStaffCredentialIncluded(x)); - - if (hasInvalidStaffCredentialsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffCredentials", $"A supplied 'StaffCredential' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffElectronicMailIncluded != null) - { - var hasInvalidStaffElectronicMailsItems = instance.StaffElectronicMails.Any(x => !mappingContract.IsStaffElectronicMailIncluded(x)); - - if (hasInvalidStaffElectronicMailsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffElectronicMails", $"A supplied 'StaffElectronicMail' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffIdentificationCodeIncluded != null) - { - var hasInvalidStaffIdentificationCodesItems = instance.StaffIdentificationCodes.Any(x => !mappingContract.IsStaffIdentificationCodeIncluded(x)); - - if (hasInvalidStaffIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffIdentificationCodes", $"A supplied 'StaffIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffIdentificationDocumentIncluded != null) - { - var hasInvalidStaffIdentificationDocumentsItems = instance.StaffIdentificationDocuments.Any(x => !mappingContract.IsStaffIdentificationDocumentIncluded(x)); - - if (hasInvalidStaffIdentificationDocumentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffIdentificationDocuments", $"A supplied 'StaffIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffInternationalAddressIncluded != null) - { - var hasInvalidStaffInternationalAddressesItems = instance.StaffInternationalAddresses.Any(x => !mappingContract.IsStaffInternationalAddressIncluded(x)); - - if (hasInvalidStaffInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffInternationalAddresses", $"A supplied 'StaffInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffLanguageIncluded != null) - { - var hasInvalidStaffLanguagesItems = instance.StaffLanguages.Any(x => !mappingContract.IsStaffLanguageIncluded(x)); - - if (hasInvalidStaffLanguagesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffLanguages", $"A supplied 'StaffLanguage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffOtherNameIncluded != null) - { - var hasInvalidStaffOtherNamesItems = instance.StaffOtherNames.Any(x => !mappingContract.IsStaffOtherNameIncluded(x)); - - if (hasInvalidStaffOtherNamesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffOtherNames", $"A supplied 'StaffOtherName' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffPersonalIdentificationDocumentIncluded != null) - { - var hasInvalidStaffPersonalIdentificationDocumentsItems = instance.StaffPersonalIdentificationDocuments.Any(x => !mappingContract.IsStaffPersonalIdentificationDocumentIncluded(x)); - - if (hasInvalidStaffPersonalIdentificationDocumentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffPersonalIdentificationDocuments", $"A supplied 'StaffPersonalIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffRaceIncluded != null) - { - var hasInvalidStaffRacesItems = instance.StaffRaces.Any(x => !mappingContract.IsStaffRaceIncluded(x)); - - if (hasInvalidStaffRacesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffRaces", $"A supplied 'StaffRace' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffRecognitionIncluded != null) - { - var hasInvalidStaffRecognitionsItems = instance.StaffRecognitions.Any(x => !mappingContract.IsStaffRecognitionIncluded(x)); - - if (hasInvalidStaffRecognitionsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffRecognitions", $"A supplied 'StaffRecognition' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffTelephoneIncluded != null) - { - var hasInvalidStaffTelephonesItems = instance.StaffTelephones.Any(x => !mappingContract.IsStaffTelephoneIncluded(x)); - - if (hasInvalidStaffTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffTelephones", $"A supplied 'StaffTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffTribalAffiliationIncluded != null) - { - var hasInvalidStaffTribalAffiliationsItems = instance.StaffTribalAffiliations.Any(x => !mappingContract.IsStaffTribalAffiliationIncluded(x)); - - if (hasInvalidStaffTribalAffiliationsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffTribalAffiliations", $"A supplied 'StaffTribalAffiliation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStaffVisaIncluded != null) - { - var hasInvalidStaffVisasItems = instance.StaffVisas.Any(x => !mappingContract.IsStaffVisaIncluded(x)); - - if (hasInvalidStaffVisasItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffVisas", $"A supplied 'StaffVisa' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -154073,16 +159328,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext co // ----------------------------------------------------------------- /// - /// A class which represents the edfi.StaffAddress table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffElectronicMail table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffAddress : Entities.Common.EdFi.IStaffAddress, IValidatableObject + public class StaffElectronicMail : Entities.Common.EdFi.IStaffElectronicMail, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffAddress"); + private static FullName _fullName = new FullName("edfi", "StaffElectronicMail"); // Fluent validator instance (threadsafe) - private static StaffAddressPutPostRequestValidator _validator = new StaffAddressPutPostRequestValidator(); + private static StaffElectronicMailPutPostRequestValidator _validator = new StaffElectronicMailPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -154093,10 +159348,6 @@ public class StaffAddress : Entities.Common.EdFi.IStaffAddress, IValidatableObje // Constructor // ------------------------------------------------------------- - public StaffAddress() - { - StaffAddressPeriods = new List(); - } // ------------------------------------------------------------ @@ -154116,7 +159367,7 @@ public StaffAddress() private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffAddress.Staff + Entities.Common.EdFi.IStaff IStaffElectronicMail.Staff { get { return _staff; } set { SetStaff(value); } @@ -154133,49 +159384,22 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] - public string AddressTypeDescriptor { get; set; } - - /// - /// The name of the city in which an address is located. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="city")] - public string City { get; set; } - - /// - /// The five or nine digit zip code or overseas postal code portion of an address. + /// The electronic mail (e-mail) address listed for an individual or organization. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="postalCode")] - public string PostalCode { get; set; } + [NonDefaultStringLength(128, MinimumLength=7, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="electronicMailAddress")] + public string ElectronicMailAddress { get; set; } /// - /// The abbreviation for the state (within the United States) or outlying area in which an address is located. + /// The type of email listed for an individual or organization. For example: Home/Personal, Work, etc.) /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string StateAbbreviationDescriptor { get; set; } - - /// - /// The street number and street name or post office box number of an address. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="streetNumberName")] - public string StreetNumberName { get; set; } + [DataMember(Name="electronicMailTypeDescriptor")][DescriptorExists("ElectronicMailTypeDescriptor")] + public string ElectronicMailTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -154190,7 +159414,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffAddress; + var compareTo = obj as Entities.Common.EdFi.IStaffElectronicMail; if (ReferenceEquals(this, compareTo)) return true; @@ -154204,27 +159428,12 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAddress).City, compareTo.City)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAddress).PostalCode, compareTo.PostalCode)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAddress).StateAbbreviationDescriptor, compareTo.StateAbbreviationDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailAddress, compareTo.ElectronicMailAddress)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAddress).StreetNumberName, compareTo.StreetNumberName)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailTypeDescriptor, compareTo.ElectronicMailTypeDescriptor)) return false; @@ -154245,23 +159454,11 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAddress).AddressTypeDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAddress).City); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAddress).PostalCode); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAddress).StateAbbreviationDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailAddress); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAddress).StreetNumberName); + hash.Add((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailTypeDescriptor); return hash.ToHashCode(); } @@ -154277,75 +159474,316 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The apartment, room, or suite number of an address. + /// An indication that the electronic email address should not be published. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="apartmentRoomSuiteNumber")] - public string ApartmentRoomSuiteNumber { get; set; } + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } /// - /// The number of the building on the site, if more than one building shares the same address. + /// An indication that the electronic mail address should be used as the principal electronic mail address for an individual or organization. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="buildingSiteNumber")] - public string BuildingSiteNumber { get; set; } + [DataMember(Name="primaryEmailAddressIndicator")] + public bool? PrimaryEmailAddressIndicator { get; set; } + // ------------------------------------------------------------- - /// - /// The congressional district in which an address is located. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="congressionalDistrict")] - public string CongressionalDistrict { get; set; } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="countyFIPSCode")] - public string CountyFIPSCode { get; set; } + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffElectronicMail")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StaffElectronicMailMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffElectronicMail)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StaffElectronicMailMapper.MapTo(this, (Entities.Common.EdFi.IStaffElectronicMail)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StaffElectronicMailPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StaffIdentificationCode table of the Staff aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StaffIdentificationCode : Entities.Common.EdFi.IStaffIdentificationCode, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StaffIdentificationCode"); + + // Fluent validator instance (threadsafe) + private static StaffIdentificationCodePutPostRequestValidator _validator = new StaffIdentificationCodePutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaff _staff; + + [IgnoreDataMember] + Entities.Common.EdFi.IStaff IStaffIdentificationCode.Staff + { + get { return _staff; } + set { SetStaff(value); } + } + + public Entities.Common.EdFi.IStaff Staff + { + set { SetStaff(value); } + } + + private void SetStaff(Entities.Common.EdFi.IStaff value) + { + _staff = value; + } /// - /// An indication that the address should not be published. + /// A coding scheme that is used for identification and record-keeping purposes by schools, social services, or other agencies to refer to a staff member. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="staffIdentificationSystemDescriptor")][DescriptorExists("StaffIdentificationSystemDescriptor")] + public string StaffIdentificationSystemDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// The geographic latitude of the physical address. + /// Determines equality based on the natural key properties of the resource. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="latitude")] - public string Latitude { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStaffIdentificationCode; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_staff == null || !_staff.Equals(compareTo.Staff)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffIdentificationCode).StaffIdentificationSystemDescriptor, compareTo.StaffIdentificationSystemDescriptor)) + return false; + + + return true; + } /// - /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). + /// Builds the hash code based on the unique identifying values. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] - public string LocaleDescriptor { get; set; } + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_staff != null) + hash.Add(_staff); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffIdentificationCode).StaffIdentificationSystemDescriptor); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The geographic longitude of the physical address. + /// The organization code or name assigning the staff Identification Code. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="longitude")] - public string Longitude { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assigningOrganizationIdentificationCode")] + public string AssigningOrganizationIdentificationCode { get; set; } /// - /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. + /// A unique number or alphanumeric code assigned to a staff member by a school, school system, a state, or other agency or entity. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfCounty")] - public string NameOfCounty { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="identificationCode")] + public string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -154366,43 +159804,13 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffAddress")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffIdentificationCode")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _staffAddressPeriods; - private ICollection _staffAddressPeriodsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="periods")] - public ICollection StaffAddressPeriods - { - get { return _staffAddressPeriods; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffAddressPeriod)e.Item).StaffAddress = this); - _staffAddressPeriods = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffAddressPeriod)e.Item).StaffAddress = this; - _staffAddressPeriodsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaffAddress.StaffAddressPeriods - { - get { return _staffAddressPeriodsCovariant; } - set { StaffAddressPeriods = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -154413,17 +159821,6 @@ public ICollection StaffAddressPeriods // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_staffAddressPeriods != null) foreach (var item in _staffAddressPeriods) - { - item.StaffAddress = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -154431,12 +159828,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAddress)target); + return Entities.Common.EdFi.StaffIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffIdentificationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffAddressMapper.MapTo(this, (Entities.Common.EdFi.IStaffAddress)target, null); + Entities.Common.EdFi.StaffIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStaffIdentificationCode)target, null); } // ------------------------------------------------------------- @@ -154466,18 +159863,6 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (StaffAddressPeriods.Any() && mappingContract?.IsMemberSupported("StaffAddressPeriods") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffAddressPeriods"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffAddressPeriods, validationContext, validationContext.Items.ForCollection("StaffAddressPeriods")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -154523,14 +159908,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffAddressPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StaffAddress = new FullName("edfi", "StaffAddress"); - - // Declare collection item validators - private StaffAddressPeriodPutPostRequestValidator _staffAddressPeriodsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -154543,28 +159923,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StaffAddressMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StaffAddress); - - if (mappingContract != null) - { - if (mappingContract.IsStaffAddressPeriodIncluded != null) - { - var hasInvalidStaffAddressPeriodsItems = instance.StaffAddressPeriods.Any(x => !mappingContract.IsStaffAddressPeriodIncluded(x)); - - if (hasInvalidStaffAddressPeriodsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffAddressPeriods", $"A supplied 'StaffAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -154581,16 +159939,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffAddressPeriod table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffIdentificationDocument table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffAddressPeriod : Entities.Common.EdFi.IStaffAddressPeriod, IValidatableObject + public class StaffIdentificationDocument : Entities.Common.EdFi.IStaffIdentificationDocument, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffAddressPeriod"); + private static FullName _fullName = new FullName("edfi", "StaffIdentificationDocument"); // Fluent validator instance (threadsafe) - private static StaffAddressPeriodPutPostRequestValidator _validator = new StaffAddressPeriodPutPostRequestValidator(); + private static StaffIdentificationDocumentPutPostRequestValidator _validator = new StaffIdentificationDocumentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -154617,32 +159975,42 @@ public class StaffAddressPeriod : Entities.Common.EdFi.IStaffAddressPeriod, IVal //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffAddress _staffAddress; + private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaffAddress IStaffAddressPeriod.StaffAddress + Entities.Common.EdFi.IStaff IStaffIdentificationDocument.Staff { - get { return _staffAddress; } - set { SetStaffAddress(value); } + get { return _staff; } + set { SetStaff(value); } } - public Entities.Common.EdFi.IStaffAddress StaffAddress + public Entities.Common.EdFi.IStaff Staff { - set { SetStaffAddress(value); } + set { SetStaff(value); } } - private void SetStaffAddress(Entities.Common.EdFi.IStaffAddress value) + private void SetStaff(Entities.Common.EdFi.IStaff value) { - _staffAddress = value; + _staff = value; } /// - /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The primary function of the document used for establishing identity. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] + public string IdentificationDocumentUseDescriptor { get; set; } + + /// + /// The category of the document relative to its purpose. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] + public string PersonalInformationVerificationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -154657,7 +160025,7 @@ private void SetStaffAddress(Entities.Common.EdFi.IStaffAddress value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffAddressPeriod; + var compareTo = obj as Entities.Common.EdFi.IStaffIdentificationDocument; if (ReferenceEquals(this, compareTo)) return true; @@ -154666,12 +160034,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_staffAddress == null || !_staffAddress.Equals(compareTo.StaffAddress)) + if (_staff == null || !_staff.Equals(compareTo.Staff)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.IStaffAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) return false; @@ -154688,11 +160061,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_staffAddress != null) - hash.Add(_staffAddress); + if (_staff != null) + hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAddressPeriod).BeginDate); + hash.Add((this as Entities.Common.EdFi.IStaffIdentificationDocument).IdentificationDocumentUseDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffIdentificationDocument).PersonalInformationVerificationDescriptor); return hash.ToHashCode(); } @@ -154708,11 +160085,43 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The day when the document expires, if null then never expires. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DocumentExpirationDate { get; set; } + + /// + /// The title of the document given by the issuer. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="documentTitle")] + public string DocumentTitle { get; set; } + + /// + /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] + public string IssuerCountryDescriptor { get; set; } + + /// + /// The unique identifier on the issuer's identification system. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerDocumentIdentificationCode")] + public string IssuerDocumentIdentificationCode { get; set; } + + /// + /// Name of the entity or institution that issued the document. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerName")] + public string IssuerName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -154733,7 +160142,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffAddressPeriod")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffIdentificationDocument")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -154757,12 +160166,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAddressPeriod)target); + return Entities.Common.EdFi.StaffIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffIdentificationDocument)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IStaffAddressPeriod)target, null); + Entities.Common.EdFi.StaffIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStaffIdentificationDocument)target, null); } // ------------------------------------------------------------- @@ -154837,9 +160246,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -154868,16 +160277,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffAncestryEthnicOrigin table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffInternationalAddress table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffAncestryEthnicOrigin : Entities.Common.EdFi.IStaffAncestryEthnicOrigin, IValidatableObject + public class StaffInternationalAddress : Entities.Common.EdFi.IStaffInternationalAddress, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffAncestryEthnicOrigin"); + private static FullName _fullName = new FullName("edfi", "StaffInternationalAddress"); // Fluent validator instance (threadsafe) - private static StaffAncestryEthnicOriginPutPostRequestValidator _validator = new StaffAncestryEthnicOriginPutPostRequestValidator(); + private static StaffInternationalAddressPutPostRequestValidator _validator = new StaffInternationalAddressPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -154907,7 +160316,7 @@ public class StaffAncestryEthnicOrigin : Entities.Common.EdFi.IStaffAncestryEthn private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffAncestryEthnicOrigin.Staff + Entities.Common.EdFi.IStaff IStaffInternationalAddress.Staff { get { return _staff; } set { SetStaff(value); } @@ -154924,13 +160333,13 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// The original peoples or cultures with which the individual identifies. + /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="ancestryEthnicOriginDescriptor")][DescriptorExists("AncestryEthnicOriginDescriptor")] - public string AncestryEthnicOriginDescriptor { get; set; } + [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] + public string AddressTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -154945,7 +160354,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffAncestryEthnicOrigin; + var compareTo = obj as Entities.Common.EdFi.IStaffInternationalAddress; if (ReferenceEquals(this, compareTo)) return true; @@ -154959,7 +160368,7 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAncestryEthnicOrigin).AncestryEthnicOriginDescriptor, compareTo.AncestryEthnicOriginDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffInternationalAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) return false; @@ -154980,7 +160389,7 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAncestryEthnicOrigin).AncestryEthnicOriginDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffInternationalAddress).AddressTypeDescriptor); return hash.ToHashCode(); } @@ -154994,6 +160403,78 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The first line of the address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine1")] + public string AddressLine1 { get; set; } + + /// + /// The second line of the address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine2")] + public string AddressLine2 { get; set; } + + /// + /// The third line of the address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine3")] + public string AddressLine3 { get; set; } + + /// + /// The fourth line of the address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressLine4")] + public string AddressLine4 { get; set; } + + /// + /// The first date the address is valid. For physical addresses, the date the individual moved to that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BeginDate { get; set; } + + /// + /// The name of the country. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="countryDescriptor")][DescriptorExists("CountryDescriptor")] + public string CountryDescriptor { get; set; } + + /// + /// The last date the address is valid. For physical addresses, the date the individual moved from that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } + + /// + /// The geographic latitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="latitude")] + public string Latitude { get; set; } + + /// + /// The geographic longitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="longitude")] + public string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -155014,7 +160495,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffAncestryEthnicOrigin")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffInternationalAddress")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -155038,12 +160519,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffAncestryEthnicOriginMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAncestryEthnicOrigin)target); + return Entities.Common.EdFi.StaffInternationalAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffInternationalAddress)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffAncestryEthnicOriginMapper.MapTo(this, (Entities.Common.EdFi.IStaffAncestryEthnicOrigin)target, null); + Entities.Common.EdFi.StaffInternationalAddressMapper.MapTo(this, (Entities.Common.EdFi.IStaffInternationalAddress)target, null); } // ------------------------------------------------------------- @@ -155118,9 +160599,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffAncestryEthnicOriginPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffInternationalAddressPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -155149,16 +160630,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffCredential table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffLanguage table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffCredential : Entities.Common.EdFi.IStaffCredential, IValidatableObject + public class StaffLanguage : Entities.Common.EdFi.IStaffLanguage, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffCredential"); + private static FullName _fullName = new FullName("edfi", "StaffLanguage"); // Fluent validator instance (threadsafe) - private static StaffCredentialPutPostRequestValidator _validator = new StaffCredentialPutPostRequestValidator(); + private static StaffLanguagePutPostRequestValidator _validator = new StaffLanguagePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -155169,6 +160650,10 @@ public class StaffCredential : Entities.Common.EdFi.IStaffCredential, IValidatab // Constructor // ------------------------------------------------------------- + public StaffLanguage() + { + StaffLanguageUses = new List(); + } // ------------------------------------------------------------ @@ -155180,40 +160665,6 @@ public class StaffCredential : Entities.Common.EdFi.IStaffCredential, IValidatab // ============================================================= // References // ------------------------------------------------------------- - - private bool _credentialReferenceExplicitlyAssigned; - private Credential.EdFi.CredentialReference _credentialReference; - private Credential.EdFi.CredentialReference ImplicitCredentialReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_credentialReference == null && !_credentialReferenceExplicitlyAssigned) - _credentialReference = new Credential.EdFi.CredentialReference(); - - return _credentialReference; - } - } - - [DataMember(Name="credentialReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Credential.EdFi.CredentialReference CredentialReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCredentialReference != null - && (_credentialReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) - return ImplicitCredentialReference; - - return null; - } - set - { - _credentialReferenceExplicitlyAssigned = true; - _credentialReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -155222,7 +160673,7 @@ public Credential.EdFi.CredentialReference CredentialReference private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffCredential.Staff + Entities.Common.EdFi.IStaff IStaffLanguage.Staff { get { return _staff; } set { SetStaff(value); } @@ -155239,50 +160690,13 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// Identifier or serial number assigned to the credential. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffCredential.CredentialIdentifier - { - get - { - if (ImplicitCredentialReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) - return ImplicitCredentialReference.CredentialIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Credential - _credentialReferenceExplicitlyAssigned = false; - ImplicitCredentialReference.CredentialIdentifier = value; - } - } - - /// - /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which a license/credential was issued. + /// A specification of which written or spoken communication is being used. /// - - // IS in a reference (StaffCredential.StateOfIssueStateAbbreviationDescriptorId), IS a lookup column - string Entities.Common.EdFi.IStaffCredential.StateOfIssueStateAbbreviationDescriptor - { - get - { - if (ImplicitCredentialReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) - return ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor; - - return null; - } - set - { - ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="languageDescriptor")][DescriptorExists("LanguageDescriptor")] + public string LanguageDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -155297,7 +160711,7 @@ string Entities.Common.EdFi.IStaffCredential.StateOfIssueStateAbbreviationDescri /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffCredential; + var compareTo = obj as Entities.Common.EdFi.IStaffLanguage; if (ReferenceEquals(this, compareTo)) return true; @@ -155310,13 +160724,8 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffCredential).CredentialIdentifier, compareTo.CredentialIdentifier)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffCredential).StateOfIssueStateAbbreviationDescriptor, compareTo.StateOfIssueStateAbbreviationDescriptor)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffLanguage).LanguageDescriptor, compareTo.LanguageDescriptor)) return false; @@ -155336,11 +160745,8 @@ public override int GetHashCode() if (_staff != null) hash.Add(_staff); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffCredential).CredentialIdentifier); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStaffCredential).StateOfIssueStateAbbreviationDescriptor); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffLanguage).LanguageDescriptor); return hash.ToHashCode(); } @@ -155374,13 +160780,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffCredential")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffLanguage")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _staffLanguageUses; + private ICollection _staffLanguageUsesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="uses")] + public ICollection StaffLanguageUses + { + get { return _staffLanguageUses; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffLanguageUse)e.Item).StaffLanguage = this); + _staffLanguageUses = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffLanguageUse)e.Item).StaffLanguage = this; + _staffLanguageUsesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaffLanguage.StaffLanguageUses + { + get { return _staffLanguageUsesCovariant; } + set { StaffLanguageUses = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -155391,6 +160827,17 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_staffLanguageUses != null) foreach (var item in _staffLanguageUses) + { + item.StaffLanguage = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -155398,32 +160845,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffCredentialMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffCredential)target); + return Entities.Common.EdFi.StaffLanguageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLanguage)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffCredentialMapper.MapTo(this, (Entities.Common.EdFi.IStaffCredential)target, null); + Entities.Common.EdFi.StaffLanguageMapper.MapTo(this, (Entities.Common.EdFi.IStaffLanguage)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffCredential.CredentialResourceId - { - get { return null; } - set { ImplicitCredentialReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffCredential.CredentialDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCredentialReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -155447,6 +160880,18 @@ string Entities.Common.EdFi.IStaffCredential.CredentialDiscriminator // ---------------------- // Validate collections // ---------------------- + if (StaffLanguageUses.Any() && mappingContract?.IsMemberSupported("StaffLanguageUses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffLanguageUses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffLanguageUses, validationContext, validationContext.Items.ForCollection("StaffLanguageUses")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -155492,9 +160937,14 @@ string Entities.Common.EdFi.IStaffCredential.CredentialDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffCredentialPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffLanguagePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StaffLanguage = new FullName("edfi", "StaffLanguage"); + + // Declare collection item validators + private StaffLanguageUsePutPostRequestValidator _staffLanguageUsesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -155507,6 +160957,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StaffLanguageMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StaffLanguage); + + if (mappingContract != null) + { + if (mappingContract.IsStaffLanguageUseIncluded != null) + { + var hasInvalidStaffLanguageUsesItems = instance.StaffLanguageUses.Any(x => !mappingContract.IsStaffLanguageUseIncluded(x)); + + if (hasInvalidStaffLanguageUsesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffLanguageUses", $"A supplied 'StaffLanguageUse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -155523,16 +160995,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffElectronicMail table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffLanguageUse table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffElectronicMail : Entities.Common.EdFi.IStaffElectronicMail, IValidatableObject + public class StaffLanguageUse : Entities.Common.EdFi.IStaffLanguageUse, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffElectronicMail"); + private static FullName _fullName = new FullName("edfi", "StaffLanguageUse"); // Fluent validator instance (threadsafe) - private static StaffElectronicMailPutPostRequestValidator _validator = new StaffElectronicMailPutPostRequestValidator(); + private static StaffLanguageUsePutPostRequestValidator _validator = new StaffLanguageUsePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -155559,42 +161031,33 @@ public class StaffElectronicMail : Entities.Common.EdFi.IStaffElectronicMail, IV //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaff _staff; + private Entities.Common.EdFi.IStaffLanguage _staffLanguage; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffElectronicMail.Staff + Entities.Common.EdFi.IStaffLanguage IStaffLanguageUse.StaffLanguage { - get { return _staff; } - set { SetStaff(value); } + get { return _staffLanguage; } + set { SetStaffLanguage(value); } } - public Entities.Common.EdFi.IStaff Staff + public Entities.Common.EdFi.IStaffLanguage StaffLanguage { - set { SetStaff(value); } + set { SetStaffLanguage(value); } } - private void SetStaff(Entities.Common.EdFi.IStaff value) + private void SetStaffLanguage(Entities.Common.EdFi.IStaffLanguage value) { - _staff = value; + _staffLanguage = value; } /// - /// The electronic mail (e-mail) address listed for an individual or organization. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(128, MinimumLength=7, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="electronicMailAddress")] - public string ElectronicMailAddress { get; set; } - - /// - /// The type of email listed for an individual or organization. For example: Home/Personal, Work, etc.) + /// A description of how the language is used (e.g. Home Language, Native Language, Spoken Language). /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="electronicMailTypeDescriptor")][DescriptorExists("ElectronicMailTypeDescriptor")] - public string ElectronicMailTypeDescriptor { get; set; } + [DataMember(Name="languageUseDescriptor")][DescriptorExists("LanguageUseDescriptor")] + public string LanguageUseDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -155609,7 +161072,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffElectronicMail; + var compareTo = obj as Entities.Common.EdFi.IStaffLanguageUse; if (ReferenceEquals(this, compareTo)) return true; @@ -155618,17 +161081,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_staff == null || !_staff.Equals(compareTo.Staff)) - return false; - - - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailAddress, compareTo.ElectronicMailAddress)) + if (_staffLanguage == null || !_staffLanguage.Equals(compareTo.StaffLanguage)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailTypeDescriptor, compareTo.ElectronicMailTypeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffLanguageUse).LanguageUseDescriptor, compareTo.LanguageUseDescriptor)) return false; @@ -155645,15 +161103,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_staff != null) - hash.Add(_staff); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailAddress); - + if (_staffLanguage != null) + hash.Add(_staffLanguage); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffElectronicMail).ElectronicMailTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffLanguageUse).LanguageUseDescriptor); return hash.ToHashCode(); } @@ -155667,20 +161121,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// An indication that the electronic email address should not be published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } - - /// - /// An indication that the electronic mail address should be used as the principal electronic mail address for an individual or organization. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="primaryEmailAddressIndicator")] - public bool? PrimaryEmailAddressIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -155701,7 +161141,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffElectronicMail")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffLanguageUse")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -155725,12 +161165,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffElectronicMailMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffElectronicMail)target); + return Entities.Common.EdFi.StaffLanguageUseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLanguageUse)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffElectronicMailMapper.MapTo(this, (Entities.Common.EdFi.IStaffElectronicMail)target, null); + Entities.Common.EdFi.StaffLanguageUseMapper.MapTo(this, (Entities.Common.EdFi.IStaffLanguageUse)target, null); } // ------------------------------------------------------------- @@ -155805,9 +161245,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffElectronicMailPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffLanguageUsePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -155836,16 +161276,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffIdentificationCode table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffOtherName table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffIdentificationCode : Entities.Common.EdFi.IStaffIdentificationCode, IValidatableObject + public class StaffOtherName : Entities.Common.EdFi.IStaffOtherName, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffIdentificationCode"); + private static FullName _fullName = new FullName("edfi", "StaffOtherName"); // Fluent validator instance (threadsafe) - private static StaffIdentificationCodePutPostRequestValidator _validator = new StaffIdentificationCodePutPostRequestValidator(); + private static StaffOtherNamePutPostRequestValidator _validator = new StaffOtherNamePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -155875,7 +161315,7 @@ public class StaffIdentificationCode : Entities.Common.EdFi.IStaffIdentification private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffIdentificationCode.Staff + Entities.Common.EdFi.IStaff IStaffOtherName.Staff { get { return _staff; } set { SetStaff(value); } @@ -155892,13 +161332,13 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// A coding scheme that is used for identification and record-keeping purposes by schools, social services, or other agencies to refer to a staff member. + /// The types of alternate names for an individual. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="staffIdentificationSystemDescriptor")][DescriptorExists("StaffIdentificationSystemDescriptor")] - public string StaffIdentificationSystemDescriptor { get; set; } + [DataMember(Name="otherNameTypeDescriptor")][DescriptorExists("OtherNameTypeDescriptor")] + public string OtherNameTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -155913,7 +161353,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffIdentificationCode; + var compareTo = obj as Entities.Common.EdFi.IStaffOtherName; if (ReferenceEquals(this, compareTo)) return true; @@ -155927,7 +161367,7 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffIdentificationCode).StaffIdentificationSystemDescriptor, compareTo.StaffIdentificationSystemDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffOtherName).OtherNameTypeDescriptor, compareTo.OtherNameTypeDescriptor)) return false; @@ -155948,7 +161388,7 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffIdentificationCode).StaffIdentificationSystemDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffOtherName).OtherNameTypeDescriptor); return hash.ToHashCode(); } @@ -155964,21 +161404,46 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The organization code or name assigning the staff Identification Code. + /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assigningOrganizationIdentificationCode")] - public string AssigningOrganizationIdentificationCode { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="firstName")] + public string FirstName { get; set; } /// - /// A unique number or alphanumeric code assigned to a staff member by a school, school system, a state, or other agency or entity. + /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="generationCodeSuffix")] + public string GenerationCodeSuffix { get; set; } + + /// + /// The name borne in common by members of a family. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="identificationCode")] - public string IdentificationCode { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } + + /// + /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="middleName")] + public string MiddleName { get; set; } + + /// + /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="personalTitlePrefix")] + public string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -155999,7 +161464,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffIdentificationCode")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffOtherName")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -156023,12 +161488,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffIdentificationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffIdentificationCode)target); + return Entities.Common.EdFi.StaffOtherNameMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffOtherName)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffIdentificationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStaffIdentificationCode)target, null); + Entities.Common.EdFi.StaffOtherNameMapper.MapTo(this, (Entities.Common.EdFi.IStaffOtherName)target, null); } // ------------------------------------------------------------- @@ -156103,9 +161568,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffIdentificationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffOtherNamePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -156134,16 +161599,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffIdentificationDocument table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffPersonalIdentificationDocument table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffIdentificationDocument : Entities.Common.EdFi.IStaffIdentificationDocument, IValidatableObject + public class StaffPersonalIdentificationDocument : Entities.Common.EdFi.IStaffPersonalIdentificationDocument, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffIdentificationDocument"); + private static FullName _fullName = new FullName("edfi", "StaffPersonalIdentificationDocument"); // Fluent validator instance (threadsafe) - private static StaffIdentificationDocumentPutPostRequestValidator _validator = new StaffIdentificationDocumentPutPostRequestValidator(); + private static StaffPersonalIdentificationDocumentPutPostRequestValidator _validator = new StaffPersonalIdentificationDocumentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -156173,7 +161638,7 @@ public class StaffIdentificationDocument : Entities.Common.EdFi.IStaffIdentifica private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffIdentificationDocument.Staff + Entities.Common.EdFi.IStaff IStaffPersonalIdentificationDocument.Staff { get { return _staff; } set { SetStaff(value); } @@ -156220,7 +161685,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffIdentificationDocument; + var compareTo = obj as Entities.Common.EdFi.IStaffPersonalIdentificationDocument; if (ReferenceEquals(this, compareTo)) return true; @@ -156234,12 +161699,12 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) return false; @@ -156260,11 +161725,11 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffIdentificationDocument).IdentificationDocumentUseDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).IdentificationDocumentUseDescriptor); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffIdentificationDocument).PersonalInformationVerificationDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).PersonalInformationVerificationDescriptor); return hash.ToHashCode(); } @@ -156337,7 +161802,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffIdentificationDocument")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffPersonalIdentificationDocument")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -156361,12 +161826,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffIdentificationDocument)target); + return Entities.Common.EdFi.StaffPersonalIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffPersonalIdentificationDocument)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStaffIdentificationDocument)target, null); + Entities.Common.EdFi.StaffPersonalIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStaffPersonalIdentificationDocument)target, null); } // ------------------------------------------------------------- @@ -156441,9 +161906,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffPersonalIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -156472,16 +161937,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffInternationalAddress table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffRace table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffInternationalAddress : Entities.Common.EdFi.IStaffInternationalAddress, IValidatableObject + public class StaffRace : Entities.Common.EdFi.IStaffRace, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffInternationalAddress"); + private static FullName _fullName = new FullName("edfi", "StaffRace"); // Fluent validator instance (threadsafe) - private static StaffInternationalAddressPutPostRequestValidator _validator = new StaffInternationalAddressPutPostRequestValidator(); + private static StaffRacePutPostRequestValidator _validator = new StaffRacePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -156511,7 +161976,7 @@ public class StaffInternationalAddress : Entities.Common.EdFi.IStaffInternationa private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffInternationalAddress.Staff + Entities.Common.EdFi.IStaff IStaffRace.Staff { get { return _staff; } set { SetStaff(value); } @@ -156528,13 +161993,13 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) + /// The general racial category which most clearly reflects the individual's recognition of his or her community or with which the individual most identifies. The way this data element is listed, it must allow for multiple entries so that each individual can specify all appropriate races. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] - public string AddressTypeDescriptor { get; set; } + [DataMember(Name="raceDescriptor")][DescriptorExists("RaceDescriptor")] + public string RaceDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -156549,7 +162014,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffInternationalAddress; + var compareTo = obj as Entities.Common.EdFi.IStaffRace; if (ReferenceEquals(this, compareTo)) return true; @@ -156563,7 +162028,7 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffInternationalAddress).AddressTypeDescriptor, compareTo.AddressTypeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffRace).RaceDescriptor, compareTo.RaceDescriptor)) return false; @@ -156584,7 +162049,7 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffInternationalAddress).AddressTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffRace).RaceDescriptor); return hash.ToHashCode(); } @@ -156598,78 +162063,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The first line of the address. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine1")] - public string AddressLine1 { get; set; } - - /// - /// The second line of the address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine2")] - public string AddressLine2 { get; set; } - - /// - /// The third line of the address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine3")] - public string AddressLine3 { get; set; } - - /// - /// The fourth line of the address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressLine4")] - public string AddressLine4 { get; set; } - - /// - /// The first date the address is valid. For physical addresses, the date the individual moved to that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BeginDate { get; set; } - - /// - /// The name of the country. It is strongly recommended that entries use only ISO 3166 2-letter country codes. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="countryDescriptor")][DescriptorExists("CountryDescriptor")] - public string CountryDescriptor { get; set; } - - /// - /// The last date the address is valid. For physical addresses, the date the individual moved from that address. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } - - /// - /// The geographic latitude of the physical address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="latitude")] - public string Latitude { get; set; } - - /// - /// The geographic longitude of the physical address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="longitude")] - public string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -156690,7 +162083,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffInternationalAddress")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffRace")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -156714,12 +162107,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffInternationalAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffInternationalAddress)target); + return Entities.Common.EdFi.StaffRaceMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffRace)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffInternationalAddressMapper.MapTo(this, (Entities.Common.EdFi.IStaffInternationalAddress)target, null); + Entities.Common.EdFi.StaffRaceMapper.MapTo(this, (Entities.Common.EdFi.IStaffRace)target, null); } // ------------------------------------------------------------- @@ -156794,9 +162187,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffInternationalAddressPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffRacePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -156825,16 +162218,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffLanguage table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffRecognition table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffLanguage : Entities.Common.EdFi.IStaffLanguage, IValidatableObject + public class StaffRecognition : Entities.Common.EdFi.IStaffRecognition, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffLanguage"); + private static FullName _fullName = new FullName("edfi", "StaffRecognition"); // Fluent validator instance (threadsafe) - private static StaffLanguagePutPostRequestValidator _validator = new StaffLanguagePutPostRequestValidator(); + private static StaffRecognitionPutPostRequestValidator _validator = new StaffRecognitionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -156845,10 +162238,6 @@ public class StaffLanguage : Entities.Common.EdFi.IStaffLanguage, IValidatableOb // Constructor // ------------------------------------------------------------- - public StaffLanguage() - { - StaffLanguageUses = new List(); - } // ------------------------------------------------------------ @@ -156868,7 +162257,7 @@ public StaffLanguage() private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffLanguage.Staff + Entities.Common.EdFi.IStaff IStaffRecognition.Staff { get { return _staff; } set { SetStaff(value); } @@ -156885,13 +162274,13 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// A specification of which written or spoken communication is being used. + /// The nature of recognition given to the individual for accomplishments in a co-curricular, or extra-curricular activity. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="languageDescriptor")][DescriptorExists("LanguageDescriptor")] - public string LanguageDescriptor { get; set; } + [DataMember(Name="recognitionTypeDescriptor")][DescriptorExists("RecognitionTypeDescriptor")] + public string RecognitionTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -156906,7 +162295,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffLanguage; + var compareTo = obj as Entities.Common.EdFi.IStaffRecognition; if (ReferenceEquals(this, compareTo)) return true; @@ -156920,7 +162309,7 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffLanguage).LanguageDescriptor, compareTo.LanguageDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffRecognition).RecognitionTypeDescriptor, compareTo.RecognitionTypeDescriptor)) return false; @@ -156941,7 +162330,7 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffLanguage).LanguageDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffRecognition).RecognitionTypeDescriptor); return hash.ToHashCode(); } @@ -156955,6 +162344,100 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The category of achievement attributed to the individual. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] + public string AchievementCategoryDescriptor { get; set; } + + /// + /// The system that defines the categories by which an achievement is attributed to the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategorySystem")] + public string AchievementCategorySystem { get; set; } + + /// + /// The title assigned to the achievement. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementTitle")] + public string AchievementTitle { get; set; } + + /// + /// The criteria for competency-based completion of the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="criteria")] + public string Criteria { get; set; } + + /// + /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="criteriaURL")] + public string CriteriaURL { get; set; } + + /// + /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="evidenceStatement")] + public string EvidenceStatement { get; set; } + + /// + /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="imageURL")] + public string ImageURL { get; set; } + + /// + /// The name of the agent, entity, or institution issuing the element. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerName")] + public string IssuerName { get; set; } + + /// + /// The Uniform Resource Locator (URL) from which the award was issued. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="issuerOriginURL")] + public string IssuerOriginURL { get; set; } + + /// + /// The date the recognition was awarded or earned. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="recognitionAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? RecognitionAwardDate { get; set; } + + /// + /// Date on which the recognition expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="recognitionAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? RecognitionAwardExpiresDate { get; set; } + + /// + /// A description of the type of recognition earned by or awarded to the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="recognitionDescription")] + public string RecognitionDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -156975,43 +162458,13 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffLanguage")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffRecognition")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _staffLanguageUses; - private ICollection _staffLanguageUsesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="uses")] - public ICollection StaffLanguageUses - { - get { return _staffLanguageUses; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffLanguageUse)e.Item).StaffLanguage = this); - _staffLanguageUses = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffLanguageUse)e.Item).StaffLanguage = this; - _staffLanguageUsesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaffLanguage.StaffLanguageUses - { - get { return _staffLanguageUsesCovariant; } - set { StaffLanguageUses = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -157022,17 +162475,6 @@ public ICollection StaffLanguageUses // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_staffLanguageUses != null) foreach (var item in _staffLanguageUses) - { - item.StaffLanguage = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -157040,12 +162482,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffLanguageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLanguage)target); + return Entities.Common.EdFi.StaffRecognitionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffRecognition)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffLanguageMapper.MapTo(this, (Entities.Common.EdFi.IStaffLanguage)target, null); + Entities.Common.EdFi.StaffRecognitionMapper.MapTo(this, (Entities.Common.EdFi.IStaffRecognition)target, null); } // ------------------------------------------------------------- @@ -157075,18 +162517,6 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- - if (StaffLanguageUses.Any() && mappingContract?.IsMemberSupported("StaffLanguageUses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffLanguageUses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffLanguageUses, validationContext, validationContext.Items.ForCollection("StaffLanguageUses")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -157132,14 +162562,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffLanguagePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffRecognitionPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StaffLanguage = new FullName("edfi", "StaffLanguage"); - - // Declare collection item validators - private StaffLanguageUsePutPostRequestValidator _staffLanguageUsesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -157152,28 +162577,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StaffLanguageMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StaffLanguage); - - if (mappingContract != null) - { - if (mappingContract.IsStaffLanguageUseIncluded != null) - { - var hasInvalidStaffLanguageUsesItems = instance.StaffLanguageUses.Any(x => !mappingContract.IsStaffLanguageUseIncluded(x)); - - if (hasInvalidStaffLanguageUsesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffLanguageUses", $"A supplied 'StaffLanguageUse' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -157190,16 +162593,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffLanguageUse table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffTelephone table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffLanguageUse : Entities.Common.EdFi.IStaffLanguageUse, IValidatableObject + public class StaffTelephone : Entities.Common.EdFi.IStaffTelephone, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffLanguageUse"); + private static FullName _fullName = new FullName("edfi", "StaffTelephone"); // Fluent validator instance (threadsafe) - private static StaffLanguageUsePutPostRequestValidator _validator = new StaffLanguageUsePutPostRequestValidator(); + private static StaffTelephonePutPostRequestValidator _validator = new StaffTelephonePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -157226,33 +162629,42 @@ public class StaffLanguageUse : Entities.Common.EdFi.IStaffLanguageUse, IValidat //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffLanguage _staffLanguage; + private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaffLanguage IStaffLanguageUse.StaffLanguage + Entities.Common.EdFi.IStaff IStaffTelephone.Staff { - get { return _staffLanguage; } - set { SetStaffLanguage(value); } + get { return _staff; } + set { SetStaff(value); } } - public Entities.Common.EdFi.IStaffLanguage StaffLanguage + public Entities.Common.EdFi.IStaff Staff { - set { SetStaffLanguage(value); } + set { SetStaff(value); } } - private void SetStaffLanguage(Entities.Common.EdFi.IStaffLanguage value) + private void SetStaff(Entities.Common.EdFi.IStaff value) { - _staffLanguage = value; + _staff = value; } /// - /// A description of how the language is used (e.g. Home Language, Native Language, Spoken Language). + /// The telephone number including the area code, and extension, if applicable. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="telephoneNumber")] + public string TelephoneNumber { get; set; } + + /// + /// The type of communication number listed for an individual or organization. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="languageUseDescriptor")][DescriptorExists("LanguageUseDescriptor")] - public string LanguageUseDescriptor { get; set; } + [DataMember(Name="telephoneNumberTypeDescriptor")][DescriptorExists("TelephoneNumberTypeDescriptor")] + public string TelephoneNumberTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -157267,7 +162679,7 @@ private void SetStaffLanguage(Entities.Common.EdFi.IStaffLanguage value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffLanguageUse; + var compareTo = obj as Entities.Common.EdFi.IStaffTelephone; if (ReferenceEquals(this, compareTo)) return true; @@ -157276,12 +162688,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_staffLanguage == null || !_staffLanguage.Equals(compareTo.StaffLanguage)) + if (_staff == null || !_staff.Equals(compareTo.Staff)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffLanguageUse).LanguageUseDescriptor, compareTo.LanguageUseDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumber, compareTo.TelephoneNumber)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumberTypeDescriptor, compareTo.TelephoneNumberTypeDescriptor)) return false; @@ -157298,11 +162715,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_staffLanguage != null) - hash.Add(_staffLanguage); + if (_staff != null) + hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffLanguageUse).LanguageUseDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumber); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumberTypeDescriptor); return hash.ToHashCode(); } @@ -157316,6 +162737,28 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// An indication that the telephone number should not be published. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } + + /// + /// The order of priority assigned to telephone numbers to define which number to attempt first, second, etc. + /// + // NOT in a reference, NOT a lookup column + [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="orderOfPriority")] + public int? OrderOfPriority { get; set; } + + /// + /// An indication that the telephone number is technically capable of sending and receiving Short Message Service (SMS) text messages. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="textMessageCapabilityIndicator")] + public bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -157336,7 +162779,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffLanguageUse")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffTelephone")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -157360,12 +162803,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffLanguageUseMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLanguageUse)target); + return Entities.Common.EdFi.StaffTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffTelephone)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffLanguageUseMapper.MapTo(this, (Entities.Common.EdFi.IStaffLanguageUse)target, null); + Entities.Common.EdFi.StaffTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IStaffTelephone)target, null); } // ------------------------------------------------------------- @@ -157440,9 +162883,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffLanguageUsePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffTelephonePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -157471,16 +162914,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffOtherName table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffTribalAffiliation table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffOtherName : Entities.Common.EdFi.IStaffOtherName, IValidatableObject + public class StaffTribalAffiliation : Entities.Common.EdFi.IStaffTribalAffiliation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffOtherName"); + private static FullName _fullName = new FullName("edfi", "StaffTribalAffiliation"); // Fluent validator instance (threadsafe) - private static StaffOtherNamePutPostRequestValidator _validator = new StaffOtherNamePutPostRequestValidator(); + private static StaffTribalAffiliationPutPostRequestValidator _validator = new StaffTribalAffiliationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -157510,7 +162953,7 @@ public class StaffOtherName : Entities.Common.EdFi.IStaffOtherName, IValidatable private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffOtherName.Staff + Entities.Common.EdFi.IStaff IStaffTribalAffiliation.Staff { get { return _staff; } set { SetStaff(value); } @@ -157527,13 +162970,13 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// The types of alternate names for an individual. + /// An American Indian tribe with which the staff member is affiliated. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="otherNameTypeDescriptor")][DescriptorExists("OtherNameTypeDescriptor")] - public string OtherNameTypeDescriptor { get; set; } + [DataMember(Name="tribalAffiliationDescriptor")][DescriptorExists("TribalAffiliationDescriptor")] + public string TribalAffiliationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -157548,7 +162991,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffOtherName; + var compareTo = obj as Entities.Common.EdFi.IStaffTribalAffiliation; if (ReferenceEquals(this, compareTo)) return true; @@ -157562,7 +163005,7 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffOtherName).OtherNameTypeDescriptor, compareTo.OtherNameTypeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffTribalAffiliation).TribalAffiliationDescriptor, compareTo.TribalAffiliationDescriptor)) return false; @@ -157583,7 +163026,7 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffOtherName).OtherNameTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffTribalAffiliation).TribalAffiliationDescriptor); return hash.ToHashCode(); } @@ -157597,48 +163040,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="firstName")] - public string FirstName { get; set; } - - /// - /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="generationCodeSuffix")] - public string GenerationCodeSuffix { get; set; } - - /// - /// The name borne in common by members of a family. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="lastSurname")] - public string LastSurname { get; set; } - - /// - /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="middleName")] - public string MiddleName { get; set; } - - /// - /// A prefix used to denote the title, degree, position, or seniority of the individual. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="personalTitlePrefix")] - public string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -157659,7 +163060,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffOtherName")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffTribalAffiliation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -157683,12 +163084,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffOtherNameMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffOtherName)target); + return Entities.Common.EdFi.StaffTribalAffiliationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffTribalAffiliation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffOtherNameMapper.MapTo(this, (Entities.Common.EdFi.IStaffOtherName)target, null); + Entities.Common.EdFi.StaffTribalAffiliationMapper.MapTo(this, (Entities.Common.EdFi.IStaffTribalAffiliation)target, null); } // ------------------------------------------------------------- @@ -157763,9 +163164,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffOtherNamePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffTribalAffiliationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -157794,16 +163195,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffPersonalIdentificationDocument table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffVisa table of the Staff aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffPersonalIdentificationDocument : Entities.Common.EdFi.IStaffPersonalIdentificationDocument, IValidatableObject + public class StaffVisa : Entities.Common.EdFi.IStaffVisa, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffPersonalIdentificationDocument"); + private static FullName _fullName = new FullName("edfi", "StaffVisa"); // Fluent validator instance (threadsafe) - private static StaffPersonalIdentificationDocumentPutPostRequestValidator _validator = new StaffPersonalIdentificationDocumentPutPostRequestValidator(); + private static StaffVisaPutPostRequestValidator _validator = new StaffVisaPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -157833,7 +163234,7 @@ public class StaffPersonalIdentificationDocument : Entities.Common.EdFi.IStaffPe private Entities.Common.EdFi.IStaff _staff; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffPersonalIdentificationDocument.Staff + Entities.Common.EdFi.IStaff IStaffVisa.Staff { get { return _staff; } set { SetStaff(value); } @@ -157850,22 +163251,13 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) } /// - /// The primary function of the document used for establishing identity. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] - public string IdentificationDocumentUseDescriptor { get; set; } - - /// - /// The category of the document relative to its purpose. + /// An indicator of a non-US citizen's Visa type. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] - public string PersonalInformationVerificationDescriptor { get; set; } + [DataMember(Name="visaDescriptor")][DescriptorExists("VisaDescriptor")] + public string VisaDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -157880,7 +163272,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffPersonalIdentificationDocument; + var compareTo = obj as Entities.Common.EdFi.IStaffVisa; if (ReferenceEquals(this, compareTo)) return true; @@ -157894,12 +163286,7 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffVisa).VisaDescriptor, compareTo.VisaDescriptor)) return false; @@ -157920,11 +163307,7 @@ public override int GetHashCode() hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).IdentificationDocumentUseDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffPersonalIdentificationDocument).PersonalInformationVerificationDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffVisa).VisaDescriptor); return hash.ToHashCode(); } @@ -157938,45 +163321,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The day when the document expires, if null then never expires. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DocumentExpirationDate { get; set; } - - /// - /// The title of the document given by the issuer. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="documentTitle")] - public string DocumentTitle { get; set; } - - /// - /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] - public string IssuerCountryDescriptor { get; set; } - - /// - /// The unique identifier on the issuer's identification system. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerDocumentIdentificationCode")] - public string IssuerDocumentIdentificationCode { get; set; } - - /// - /// Name of the entity or institution that issued the document. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerName")] - public string IssuerName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -157997,7 +163341,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffPersonalIdentificationDocument")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffVisa")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -158021,12 +163365,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffPersonalIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffPersonalIdentificationDocument)target); + return Entities.Common.EdFi.StaffVisaMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffVisa)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffPersonalIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStaffPersonalIdentificationDocument)target, null); + Entities.Common.EdFi.StaffVisaMapper.MapTo(this, (Entities.Common.EdFi.IStaffVisa)target, null); } // ------------------------------------------------------------- @@ -158101,9 +163445,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffPersonalIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffVisaPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -158126,22 +163470,141 @@ protected override bool PreValidate(FluentValidation.ValidationContext + /// Represents a reference to the StaffAbsenceEvent resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StaffAbsenceEventReference : IResourceReference + { + [DataMember(Name="absenceEventCategoryDescriptor")][DescriptorExists("AbsenceEventCategoryDescriptor")] + public string AbsenceEventCategoryDescriptor { get; set; } + + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } + + [DataMember(Name="staffUniqueId")] + public string StaffUniqueId + { + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + private string _staffUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AbsenceEventCategoryDescriptor != default(string) && EventDate != default(DateTime) && StaffUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AbsenceEventCategoryDescriptor == default) + { + yield return "AbsenceEventCategoryDescriptor"; + } + + if (EventDate == default) + { + yield return "EventDate"; + } + + if (StaffUniqueId == default) + { + yield return "StaffUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "StaffAbsenceEvent", + Href = $"/ed-fi/staffAbsenceEvents/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } - } - // ----------------------------------------------------------------- + } // Aggregate reference /// - /// A class which represents the edfi.StaffRace table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffAbsenceEvent table of the StaffAbsenceEvent aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffRace : Entities.Common.EdFi.IStaffRace, IValidatableObject + public class StaffAbsenceEvent : Entities.Common.EdFi.IStaffAbsenceEvent, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffRace"); + private static FullName _fullName = new FullName("edfi", "StaffAbsenceEvent"); // Fluent validator instance (threadsafe) - private static StaffRacePutPostRequestValidator _validator = new StaffRacePutPostRequestValidator(); + private static StaffAbsenceEventPutPostRequestValidator _validator = new StaffAbsenceEventPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -158158,43 +163621,100 @@ public class StaffRace : Entities.Common.EdFi.IStaffRace, IValidatableObject // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StaffAbsenceEvent resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaff _staff; - [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffRace.Staff + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference { - get { return _staff; } - set { SetStaff(value); } - } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); - public Entities.Common.EdFi.IStaff Staff - { - set { SetStaff(value); } + return _staffReference; + } } - private void SetStaff(Entities.Common.EdFi.IStaff value) + [DataMember(Name="staffReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Staff.EdFi.StaffReference StaffReference { - _staff = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; + + return null; + } + set + { + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The general racial category which most clearly reflects the individual's recognition of his or her community or with which the individual most identifies. The way this data element is listed, it must allow for multiple entries so that each individual can specify all appropriate races. + /// The code describing the type of absence. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="raceDescriptor")][DescriptorExists("RaceDescriptor")] - public string RaceDescriptor { get; set; } + [DataMember(Name="absenceEventCategoryDescriptor")][DescriptorExists("AbsenceEventCategoryDescriptor")] + public string AbsenceEventCategoryDescriptor { get; set; } + + /// + /// Date for this leave event. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } + + /// + /// A unique alphanumeric code assigned to a staff. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffAbsenceEvent.StaffUniqueId + { + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } // ------------------------------------------------------------- // ============================================================= @@ -158209,7 +163729,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffRace; + var compareTo = obj as Entities.Common.EdFi.IStaffAbsenceEvent; if (ReferenceEquals(this, compareTo)) return true; @@ -158217,13 +163737,19 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_staff == null || !_staff.Equals(compareTo.Staff)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAbsenceEvent).AbsenceEventCategoryDescriptor, compareTo.AbsenceEventCategoryDescriptor)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffRace).RaceDescriptor, compareTo.RaceDescriptor)) + if (!(this as Entities.Common.EdFi.IStaffAbsenceEvent).EventDate.Equals(compareTo.EventDate)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAbsenceEvent).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -158239,13 +163765,17 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_staff != null) - hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffRace).RaceDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffAbsenceEvent).AbsenceEventCategoryDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffAbsenceEvent).EventDate); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffAbsenceEvent).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -158258,6 +163788,22 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// Expanded reason for the staff absence. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(40, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="absenceEventReason")] + public string AbsenceEventReason { get; set; } + + /// + /// The hours the staff was absent, if not the entire working day. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999999999999.99", "9999999999999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="hoursAbsent")] + public decimal? HoursAbsent { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -158278,7 +163824,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffRace")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffAbsenceEvent", "StaffAbsenceEvent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -158290,6 +163836,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -158302,18 +163855,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffRaceMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffRace)target); + return Entities.Common.EdFi.StaffAbsenceEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAbsenceEvent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffRaceMapper.MapTo(this, (Entities.Common.EdFi.IStaffRace)target, null); + Entities.Common.EdFi.StaffAbsenceEventMapper.MapTo(this, (Entities.Common.EdFi.IStaffAbsenceEvent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStaffAbsenceEvent.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaffAbsenceEvent.StaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -158331,7 +163898,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -158382,9 +163948,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffRacePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffAbsenceEventPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -158412,17 +163978,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffRecognition table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffClassificationDescriptor table of the StaffClassificationDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffRecognition : Entities.Common.EdFi.IStaffRecognition, IValidatableObject + public class StaffClassificationDescriptor : Entities.Common.EdFi.IStaffClassificationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "StaffRecognition"); + private static FullName _fullName = new FullName("edfi", "StaffClassificationDescriptor"); // Fluent validator instance (threadsafe) - private static StaffRecognitionPutPostRequestValidator _validator = new StaffRecognitionPutPostRequestValidator(); + private static StaffClassificationDescriptorPutPostRequestValidator _validator = new StaffClassificationDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -158439,6 +164010,13 @@ public class StaffRecognition : Entities.Common.EdFi.IStaffRecognition, IValidat // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StaffClassificationDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -158449,33 +164027,19 @@ public class StaffRecognition : Entities.Common.EdFi.IStaffRecognition, IValidat //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaff _staff; - [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffRecognition.Staff - { - get { return _staff; } - set { SetStaff(value); } - } - - public Entities.Common.EdFi.IStaff Staff - { - set { SetStaff(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int StaffClassificationDescriptorId { get; set; } - private void SetStaff(Entities.Common.EdFi.IStaff value) + int IDescriptor.DescriptorId { - _staff = value; + get { return StaffClassificationDescriptorId; } + set { StaffClassificationDescriptorId = value; } } - - /// - /// The nature of recognition given to the individual for accomplishments in a co-curricular, or extra-curricular activity. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="recognitionTypeDescriptor")][DescriptorExists("RecognitionTypeDescriptor")] - public string RecognitionTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -158490,7 +164054,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffRecognition; + var compareTo = obj as Entities.Common.EdFi.IStaffClassificationDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -158498,13 +164062,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_staff == null || !_staff.Equals(compareTo.Staff)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffRecognition).RecognitionTypeDescriptor, compareTo.RecognitionTypeDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IStaffClassificationDescriptor).StaffClassificationDescriptorId.Equals(compareTo.StaffClassificationDescriptorId)) return false; @@ -158520,12 +164080,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_staff != null) - hash.Add(_staff); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffRecognition).RecognitionTypeDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IStaffClassificationDescriptor).StaffClassificationDescriptorId); return hash.ToHashCode(); } @@ -158534,105 +164091,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The category of achievement attributed to the individual. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] - public string AchievementCategoryDescriptor { get; set; } - - /// - /// The system that defines the categories by which an achievement is attributed to the individual. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategorySystem")] - public string AchievementCategorySystem { get; set; } - - /// - /// The title assigned to the achievement. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementTitle")] - public string AchievementTitle { get; set; } - - /// - /// The criteria for competency-based completion of the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="criteria")] - public string Criteria { get; set; } - - /// - /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="criteriaURL")] - public string CriteriaURL { get; set; } /// - /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="evidenceStatement")] - public string EvidenceStatement { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="imageURL")] - public string ImageURL { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The name of the agent, entity, or institution issuing the element. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerName")] - public string IssuerName { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The Uniform Resource Locator (URL) from which the award was issued. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="issuerOriginURL")] - public string IssuerOriginURL { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The date the recognition was awarded or earned. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="recognitionAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? RecognitionAwardDate { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// Date on which the recognition expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="recognitionAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? RecognitionAwardExpiresDate { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- - /// - /// A description of the type of recognition earned by or awarded to the individual. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="recognitionDescription")] - public string RecognitionDescription { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -158653,8 +164165,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffRecognition")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -158665,6 +164180,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -158677,12 +164199,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffRecognitionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffRecognition)target); + return Entities.Common.EdFi.StaffClassificationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffClassificationDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffRecognitionMapper.MapTo(this, (Entities.Common.EdFi.IStaffRecognition)target, null); + Entities.Common.EdFi.StaffClassificationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStaffClassificationDescriptor)target, null); } // ------------------------------------------------------------- @@ -158690,66 +164212,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -158757,9 +164219,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffRecognitionPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffClassificationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -158787,17 +164249,144 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffTelephone table of the Staff aggregate in the ODS Database. + /// Represents a reference to the StaffCohortAssociation resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StaffCohortAssociationReference : IResourceReference + { + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } + + [DataMember(Name="cohortIdentifier")] + public string CohortIdentifier { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="staffUniqueId")] + public string StaffUniqueId + { + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + private string _staffUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return BeginDate != default(DateTime) && CohortIdentifier != default(string) && EducationOrganizationId != default(long) && StaffUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (BeginDate == default) + { + yield return "BeginDate"; + } + + if (CohortIdentifier == default) + { + yield return "CohortIdentifier"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (StaffUniqueId == default) + { + yield return "StaffUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "StaffCohortAssociation", + Href = $"/ed-fi/staffCohortAssociations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.StaffCohortAssociation table of the StaffCohortAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffTelephone : Entities.Common.EdFi.IStaffTelephone, IValidatableObject + public class StaffCohortAssociation : Entities.Common.EdFi.IStaffCohortAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffTelephone"); + private static FullName _fullName = new FullName("edfi", "StaffCohortAssociation"); // Fluent validator instance (threadsafe) - private static StaffTelephonePutPostRequestValidator _validator = new StaffTelephonePutPostRequestValidator(); + private static StaffCohortAssociationPutPostRequestValidator _validator = new StaffCohortAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -158814,52 +164403,174 @@ public class StaffTelephone : Entities.Common.EdFi.IStaffTelephone, IValidatable // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StaffCohortAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - // ------------------------------------------------------------- - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaff _staff; - - [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffTelephone.Staff + private bool _cohortReferenceExplicitlyAssigned; + private Cohort.EdFi.CohortReference _cohortReference; + private Cohort.EdFi.CohortReference ImplicitCohortReference { - get { return _staff; } - set { SetStaff(value); } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_cohortReference == null && !_cohortReferenceExplicitlyAssigned) + _cohortReference = new Cohort.EdFi.CohortReference(); + + return _cohortReference; + } } - public Entities.Common.EdFi.IStaff Staff + [DataMember(Name="cohortReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Cohort.EdFi.CohortReference CohortReference { - set { SetStaff(value); } + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCohortReference != null + && (_cohortReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) + return ImplicitCohortReference; + + return null; + } + set + { + _cohortReferenceExplicitlyAssigned = true; + _cohortReference = value; + } + } + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); + + return _staffReference; + } } - private void SetStaff(Entities.Common.EdFi.IStaff value) + [DataMember(Name="staffReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Staff.EdFi.StaffReference StaffReference { - _staff = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; + + return null; + } + set + { + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; + } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The telephone number including the area code, and extension, if applicable. + /// Start date for the association of staff to this cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="telephoneNumber")] - public string TelephoneNumber { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } /// - /// The type of communication number listed for an individual or organization. + /// The name or ID for the cohort. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="telephoneNumberTypeDescriptor")][DescriptorExists("TelephoneNumberTypeDescriptor")] - public string TelephoneNumberTypeDescriptor { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffCohortAssociation.CohortIdentifier + { + get + { + if (ImplicitCohortReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) + return ImplicitCohortReference.CohortIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Cohort + _cohortReferenceExplicitlyAssigned = false; + ImplicitCohortReference.CohortIdentifier = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStaffCohortAssociation.EducationOrganizationId + { + get + { + if (ImplicitCohortReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) + return ImplicitCohortReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Cohort + _cohortReferenceExplicitlyAssigned = false; + ImplicitCohortReference.EducationOrganizationId = value; + } + } + + /// + /// A unique alphanumeric code assigned to a staff. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffCohortAssociation.StaffUniqueId + { + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } // ------------------------------------------------------------- // ============================================================= @@ -158874,7 +164585,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffTelephone; + var compareTo = obj as Entities.Common.EdFi.IStaffCohortAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -158882,18 +164593,24 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_staff == null || !_staff.Equals(compareTo.Staff)) + + // Standard Property + if (!(this as Entities.Common.EdFi.IStaffCohortAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumber, compareTo.TelephoneNumber)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffCohortAssociation).CohortIdentifier, compareTo.CohortIdentifier)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumberTypeDescriptor, compareTo.TelephoneNumberTypeDescriptor)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStaffCohortAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffCohortAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -158909,17 +164626,19 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_staff != null) - hash.Add(_staff); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumber); + hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).BeginDate); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffTelephone).TelephoneNumberTypeDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).CohortIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).EducationOrganizationId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -158934,26 +164653,18 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// An indication that the telephone number should not be published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } - - /// - /// The order of priority assigned to telephone numbers to define which number to attempt first, second, etc. + /// End date for the association of staff to this cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="orderOfPriority")] - public int? OrderOfPriority { get; set; } + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } /// - /// An indication that the telephone number is technically capable of sending and receiving Short Message Service (SMS) text messages. + /// Indicator of whether the staff has access to the student records of the cohort per district interpretation of FERPA and other privacy laws, regulations, and policies. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="textMessageCapabilityIndicator")] - public bool? TextMessageCapabilityIndicator { get; set; } + [DataMember(Name="studentRecordAccess")] + public bool? StudentRecordAccess { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -158974,7 +164685,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffTelephone")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffCohortAssociation", "StaffCohortAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -158986,6 +164697,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -158998,18 +164716,46 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffTelephone)target); + return Entities.Common.EdFi.StaffCohortAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffCohortAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IStaffTelephone)target, null); + Entities.Common.EdFi.StaffCohortAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffCohortAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStaffCohortAssociation.CohortResourceId + { + get { return null; } + set { ImplicitCohortReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaffCohortAssociation.CohortDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitCohortReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStaffCohortAssociation.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaffCohortAssociation.StaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -159027,7 +164773,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -159078,9 +164823,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffTelephonePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffCohortAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -159108,70 +164853,316 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffTribalAffiliation table of the Staff aggregate in the ODS Database. + /// Represents a reference to the StaffDisciplineIncidentAssociation resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StaffDisciplineIncidentAssociationReference : IResourceReference + { + [DataMember(Name="incidentIdentifier")] + public string IncidentIdentifier { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + [DataMember(Name="staffUniqueId")] + public string StaffUniqueId + { + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } + private string _staffUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return IncidentIdentifier != default(string) && SchoolId != default(long) && StaffUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (IncidentIdentifier == default) + { + yield return "IncidentIdentifier"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + if (StaffUniqueId == default) + { + yield return "StaffUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "StaffDisciplineIncidentAssociation", + Href = $"/ed-fi/staffDisciplineIncidentAssociations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.StaffDisciplineIncidentAssociation table of the StaffDisciplineIncidentAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffTribalAffiliation : Entities.Common.EdFi.IStaffTribalAffiliation, IValidatableObject + public class StaffDisciplineIncidentAssociation : Entities.Common.EdFi.IStaffDisciplineIncidentAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffTribalAffiliation"); + private static FullName _fullName = new FullName("edfi", "StaffDisciplineIncidentAssociation"); // Fluent validator instance (threadsafe) - private static StaffTribalAffiliationPutPostRequestValidator _validator = new StaffTribalAffiliationPutPostRequestValidator(); + private static StaffDisciplineIncidentAssociationPutPostRequestValidator _validator = new StaffDisciplineIncidentAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } #pragma warning restore 414 - // ============================================================= - // Constructor - // ------------------------------------------------------------- + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public StaffDisciplineIncidentAssociation() + { + StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes = new List(); + } + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the StaffDisciplineIncidentAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _disciplineIncidentReferenceExplicitlyAssigned; + private DisciplineIncident.EdFi.DisciplineIncidentReference _disciplineIncidentReference; + private DisciplineIncident.EdFi.DisciplineIncidentReference ImplicitDisciplineIncidentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_disciplineIncidentReference == null && !_disciplineIncidentReferenceExplicitlyAssigned) + _disciplineIncidentReference = new DisciplineIncident.EdFi.DisciplineIncidentReference(); + + return _disciplineIncidentReference; + } + } + + [DataMember(Name="disciplineIncidentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public DisciplineIncident.EdFi.DisciplineIncidentReference DisciplineIncidentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitDisciplineIncidentReference != null + && (_disciplineIncidentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + return ImplicitDisciplineIncidentReference; + + return null; + } + set + { + _disciplineIncidentReferenceExplicitlyAssigned = true; + _disciplineIncidentReference = value; + } + } + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); - - // ------------------------------------------------------------ + return _staffReference; + } + } - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ + [DataMember(Name="staffReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Staff.EdFi.StaffReference StaffReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; - // ============================================================= - // References - // ------------------------------------------------------------- + return null; + } + set + { + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaff _staff; - [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffTribalAffiliation.Staff + /// + /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.IncidentIdentifier { - get { return _staff; } - set { SetStaff(value); } - } + get + { + if (ImplicitDisciplineIncidentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + return ImplicitDisciplineIncidentReference.IncidentIdentifier; - public Entities.Common.EdFi.IStaff Staff - { - set { SetStaff(value); } + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // DisciplineIncident + _disciplineIncidentReferenceExplicitlyAssigned = false; + ImplicitDisciplineIncidentReference.IncidentIdentifier = value; + } } - private void SetStaff(Entities.Common.EdFi.IStaff value) + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.SchoolId { - _staff = value; + get + { + if (ImplicitDisciplineIncidentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + return ImplicitDisciplineIncidentReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // DisciplineIncident + _disciplineIncidentReferenceExplicitlyAssigned = false; + ImplicitDisciplineIncidentReference.SchoolId = value; + } } /// - /// An American Indian tribe with which the staff member is affiliated. + /// A unique alphanumeric code assigned to a staff. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="tribalAffiliationDescriptor")][DescriptorExists("TribalAffiliationDescriptor")] - public string TribalAffiliationDescriptor { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffUniqueId + { + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } // ------------------------------------------------------------- // ============================================================= @@ -159186,7 +165177,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffTribalAffiliation; + var compareTo = obj as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -159194,13 +165185,19 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_staff == null || !_staff.Equals(compareTo.Staff)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffTribalAffiliation).TribalAffiliationDescriptor, compareTo.TribalAffiliationDescriptor)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -159216,13 +165213,15 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_staff != null) - hash.Add(_staff); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffTribalAffiliation).TribalAffiliationDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).IncidentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).SchoolId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -159255,23 +165254,71 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffTribalAffiliation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes; + private ICollection _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="disciplineIncidentParticipationCodes")] + public ICollection StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes + { + get { return _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)e.Item).StaffDisciplineIncidentAssociation = this); + _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)e.Item).StaffDisciplineIncidentAssociation = this; + _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes + { + get { return _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesCovariant; } + set { StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes != null) foreach (var item in _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes) + { + item.StaffDisciplineIncidentAssociation = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -159279,18 +165326,46 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffTribalAffiliationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffTribalAffiliation)target); + return Entities.Common.EdFi.StaffDisciplineIncidentAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffTribalAffiliationMapper.MapTo(this, (Entities.Common.EdFi.IStaffTribalAffiliation)target, null); + Entities.Common.EdFi.StaffDisciplineIncidentAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.DisciplineIncidentResourceId + { + get { return null; } + set { ImplicitDisciplineIncidentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.DisciplineIncidentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitDisciplineIncidentReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -159308,12 +165383,23 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes.Any() && mappingContract?.IsMemberSupported("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes, validationContext, validationContext.Items.ForCollection("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -159359,9 +165445,14 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffTribalAffiliationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffDisciplineIncidentAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StaffDisciplineIncidentAssociation = new FullName("edfi", "StaffDisciplineIncidentAssociation"); + + // Declare collection item validators + private StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -159374,6 +165465,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StaffDisciplineIncidentAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StaffDisciplineIncidentAssociation); + + if (mappingContract != null) + { + if (mappingContract.IsStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeIncluded != null) + { + var hasInvalidStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesItems = instance.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes.Any(x => !mappingContract.IsStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeIncluded(x)); + + if (hasInvalidStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes", $"A supplied 'StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -159390,16 +165503,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffVisa table of the Staff aggregate in the ODS Database. + /// A class which represents the edfi.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode table of the StaffDisciplineIncidentAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffVisa : Entities.Common.EdFi.IStaffVisa, IValidatableObject + public class StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode : Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffVisa"); + private static FullName _fullName = new FullName("edfi", "StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode"); // Fluent validator instance (threadsafe) - private static StaffVisaPutPostRequestValidator _validator = new StaffVisaPutPostRequestValidator(); + private static StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _validator = new StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -159426,33 +165539,33 @@ public class StaffVisa : Entities.Common.EdFi.IStaffVisa, IValidatableObject //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaff _staff; + private Entities.Common.EdFi.IStaffDisciplineIncidentAssociation _staffDisciplineIncidentAssociation; [IgnoreDataMember] - Entities.Common.EdFi.IStaff IStaffVisa.Staff + Entities.Common.EdFi.IStaffDisciplineIncidentAssociation IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode.StaffDisciplineIncidentAssociation { - get { return _staff; } - set { SetStaff(value); } + get { return _staffDisciplineIncidentAssociation; } + set { SetStaffDisciplineIncidentAssociation(value); } } - public Entities.Common.EdFi.IStaff Staff + public Entities.Common.EdFi.IStaffDisciplineIncidentAssociation StaffDisciplineIncidentAssociation { - set { SetStaff(value); } + set { SetStaffDisciplineIncidentAssociation(value); } } - private void SetStaff(Entities.Common.EdFi.IStaff value) + private void SetStaffDisciplineIncidentAssociation(Entities.Common.EdFi.IStaffDisciplineIncidentAssociation value) { - _staff = value; + _staffDisciplineIncidentAssociation = value; } /// - /// An indicator of a non-US citizen's Visa type. + /// The role or type of participation of a student in a discipline incident. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="visaDescriptor")][DescriptorExists("VisaDescriptor")] - public string VisaDescriptor { get; set; } + [DataMember(Name="disciplineIncidentParticipationCodeDescriptor")][DescriptorExists("DisciplineIncidentParticipationCodeDescriptor")] + public string DisciplineIncidentParticipationCodeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -159467,7 +165580,7 @@ private void SetStaff(Entities.Common.EdFi.IStaff value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffVisa; + var compareTo = obj as Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode; if (ReferenceEquals(this, compareTo)) return true; @@ -159476,12 +165589,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_staff == null || !_staff.Equals(compareTo.Staff)) + if (_staffDisciplineIncidentAssociation == null || !_staffDisciplineIncidentAssociation.Equals(compareTo.StaffDisciplineIncidentAssociation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffVisa).VisaDescriptor, compareTo.VisaDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) return false; @@ -159498,11 +165611,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_staff != null) - hash.Add(_staff); + if (_staffDisciplineIncidentAssociation != null) + hash.Add(_staffDisciplineIncidentAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffVisa).VisaDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor); return hash.ToHashCode(); } @@ -159536,7 +165649,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Staff", "StaffVisa")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -159560,12 +165673,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffVisaMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffVisa)target); + return Entities.Common.EdFi.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffVisaMapper.MapTo(this, (Entities.Common.EdFi.IStaffVisa)target, null); + Entities.Common.EdFi.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)target, null); } // ------------------------------------------------------------- @@ -159640,9 +165753,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffVisaPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -159671,22 +165784,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffAbsenceEvent resource. + /// Represents a reference to the StaffEducationOrganizationAssignmentAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffAbsenceEventReference : IResourceReference + public class StaffEducationOrganizationAssignmentAssociationReference : IResourceReference { - [DataMember(Name="absenceEventCategoryDescriptor")][DescriptorExists("AbsenceEventCategoryDescriptor")] - public string AbsenceEventCategoryDescriptor { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="staffClassificationDescriptor")][DescriptorExists("StaffClassificationDescriptor")] + public string StaffClassificationDescriptor { get; set; } [DataMember(Name="staffUniqueId")] public string StaffUniqueId @@ -159736,19 +165852,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AbsenceEventCategoryDescriptor != default(string) && EventDate != default(DateTime) && StaffUniqueId != default(string); + return BeginDate != default(DateTime) && EducationOrganizationId != default(long) && StaffClassificationDescriptor != default(string) && StaffUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (AbsenceEventCategoryDescriptor == default) + if (BeginDate == default) { - yield return "AbsenceEventCategoryDescriptor"; + yield return "BeginDate"; } - if (EventDate == default) + if (EducationOrganizationId == default) { - yield return "EventDate"; + yield return "EducationOrganizationId"; + } + + if (StaffClassificationDescriptor == default) + { + yield return "StaffClassificationDescriptor"; } if (StaffUniqueId == default) @@ -159762,8 +165883,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StaffAbsenceEvent", - Href = $"/ed-fi/staffAbsenceEvents/{ResourceId:n}" + Rel = "StaffEducationOrganizationAssignmentAssociation", + Href = $"/ed-fi/staffEducationOrganizationAssignmentAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -159790,16 +165911,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StaffAbsenceEvent table of the StaffAbsenceEvent aggregate in the ODS Database. + /// A class which represents the edfi.StaffEducationOrganizationAssignmentAssociation table of the StaffEducationOrganizationAssignmentAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffAbsenceEvent : Entities.Common.EdFi.IStaffAbsenceEvent, IHasETag, IDateVersionedEntity, IValidatableObject + public class StaffEducationOrganizationAssignmentAssociation : Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffAbsenceEvent"); + private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationAssignmentAssociation"); // Fluent validator instance (threadsafe) - private static StaffAbsenceEventPutPostRequestValidator _validator = new StaffAbsenceEventPutPostRequestValidator(); + private static StaffEducationOrganizationAssignmentAssociationPutPostRequestValidator _validator = new StaffEducationOrganizationAssignmentAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -159818,7 +165939,7 @@ public class StaffAbsenceEvent : Entities.Common.EdFi.IStaffAbsenceEvent, IHasET // ------------------------------------------------------------ /// - /// The unique identifier for the StaffAbsenceEvent resource. + /// The unique identifier for the StaffEducationOrganizationAssignmentAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -159829,6 +165950,105 @@ public class StaffAbsenceEvent : Entities.Common.EdFi.IStaffAbsenceEvent, IHasET // References // ------------------------------------------------------------- + private bool _credentialReferenceExplicitlyAssigned; + private Credential.EdFi.CredentialReference _credentialReference; + private Credential.EdFi.CredentialReference ImplicitCredentialReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_credentialReference == null && !_credentialReferenceExplicitlyAssigned) + _credentialReference = new Credential.EdFi.CredentialReference(); + + return _credentialReference; + } + } + + [DataMember(Name="credentialReference")] + [FullyDefinedReference] + public Credential.EdFi.CredentialReference CredentialReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitCredentialReference != null + && (_credentialReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + return ImplicitCredentialReference; + + return null; + } + set + { + _credentialReferenceExplicitlyAssigned = true; + _credentialReference = value; + } + } + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } + private bool _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned; + private StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference _employmentStaffEducationOrganizationEmploymentAssociationReference; + private StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_employmentStaffEducationOrganizationEmploymentAssociationReference == null && !_employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned) + _employmentStaffEducationOrganizationEmploymentAssociationReference = new StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference(); + + return _employmentStaffEducationOrganizationEmploymentAssociationReference; + } + } + + [DataMember(Name="employmentStaffEducationOrganizationEmploymentAssociationReference")] + [FullyDefinedReference] + public StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference EmploymentStaffEducationOrganizationEmploymentAssociationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null + && (_employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) + return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference; + + return null; + } + set + { + _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = true; + _employmentStaffEducationOrganizationEmploymentAssociationReference = value; + } + } private bool _staffReferenceExplicitlyAssigned; private Staff.EdFi.StaffReference _staffReference; private Staff.EdFi.StaffReference ImplicitStaffReference @@ -159869,27 +166089,52 @@ public Staff.EdFi.StaffReference StaffReference // ------------------------------------------------------------- /// - /// The code describing the type of absence. + /// Month, day, and year of the start or effective date of a staff member's employment, contract, or relationship with the education organization. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="absenceEventCategoryDescriptor")][DescriptorExists("AbsenceEventCategoryDescriptor")] - public string AbsenceEventCategoryDescriptor { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } /// - /// Date for this leave event. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EducationOrganizationId + { + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } + + /// + /// The titles of employment, official status, or rank of education staff. + /// + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="staffClassificationDescriptor")][DescriptorExists("StaffClassificationDescriptor")] + public string StaffClassificationDescriptor { get; set; } /// /// A unique alphanumeric code assigned to a staff. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffAbsenceEvent.StaffUniqueId + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StaffUniqueId { get { @@ -159904,6 +166149,10 @@ string Entities.Common.EdFi.IStaffAbsenceEvent.StaffUniqueId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced + // EmploymentStaffEducationOrganizationEmploymentAssociation + _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = false; + ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.StaffUniqueId = value; + // Staff _staffReferenceExplicitlyAssigned = false; ImplicitStaffReference.StaffUniqueId = value; @@ -159924,7 +166173,7 @@ string Entities.Common.EdFi.IStaffAbsenceEvent.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffAbsenceEvent; + var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -159934,17 +166183,22 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffAbsenceEvent).AbsenceEventCategoryDescriptor, compareTo.AbsenceEventCategoryDescriptor)) + if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).BeginDate.Equals(compareTo.BeginDate)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.IStaffAbsenceEvent).EventDate.Equals(compareTo.EventDate)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffClassificationDescriptor, compareTo.StaffClassificationDescriptor)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffAbsenceEvent).StaffUniqueId, compareTo.StaffUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -159962,15 +166216,18 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAbsenceEvent).AbsenceEventCategoryDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).BeginDate); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).EducationOrganizationId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffAbsenceEvent).EventDate); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffClassificationDescriptor); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffAbsenceEvent).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -159985,20 +166242,163 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Expanded reason for the staff absence. + /// Identifier or serial number assigned to the credential. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.CredentialIdentifier + { + get + { + if (ImplicitCredentialReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + { + return ImplicitCredentialReference.CredentialIdentifier; + } + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Credential + _credentialReferenceExplicitlyAssigned = false; + ImplicitCredentialReference.CredentialIdentifier = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentEducationOrganizationId + { + get + { + if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) + { + return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EducationOrganizationId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EmploymentStaffEducationOrganizationEmploymentAssociation + _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = false; + ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EducationOrganizationId = value.GetValueOrDefault(); + } + } + + /// + /// The month, day, and year on which an individual was hired for a position. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // IS in a reference, NOT a lookup column + DateTime? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentHireDate + { + get + { + if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) + { + return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.HireDate; + } + + return default(DateTime?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EmploymentStaffEducationOrganizationEmploymentAssociation + _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = false; + ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.HireDate = value.GetValueOrDefault(); + } + } + + /// + /// Reflects the type of employment or contract. + /// + + // IS in a reference (StaffEducationOrganizationAssignmentAssociation.EmploymentStatusDescriptorId), IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentStatusDescriptor + { + get + { + if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) + { + return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EmploymentStatusDescriptor; + } + + return null; + } + set + { + ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EmploymentStatusDescriptor = value; + } + } + + /// + /// Month, day, and year of the end or termination date of a staff member's employment, contract, or relationship with the education organization. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(40, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="absenceEventReason")] - public string AbsenceEventReason { get; set; } + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } /// - /// The hours the staff was absent, if not the entire working day. + /// The ratio between the hours of work expected in a position and the hours of work normally expected in a full-time position in the same setting. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999999999999.99", "9999999999999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="hoursAbsent")] - public decimal? HoursAbsent { get; set; } + [Range(typeof(decimal), "0", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="fullTimeEquivalency")] + public decimal? FullTimeEquivalency { get; set; } + + /// + /// Describes whether the assignment is this the staff member's primary assignment, secondary assignment, etc. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="orderOfAssignment")] + public int? OrderOfAssignment { get; set; } + + /// + /// The descriptive name of an individual's position. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="positionTitle")] + public string PositionTitle { get; set; } + + /// + /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which a license/credential was issued. + /// + + // IS in a reference (StaffEducationOrganizationAssignmentAssociation.StateOfIssueStateAbbreviationDescriptorId), IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StateOfIssueStateAbbreviationDescriptor + { + get + { + if (ImplicitCredentialReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + { + return ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor; + } + + return null; + } + set + { + ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -160019,7 +166419,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffAbsenceEvent", "StaffAbsenceEvent")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationAssignmentAssociation", "StaffEducationOrganizationAssignmentAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -160050,363 +166450,173 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffAbsenceEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffAbsenceEvent)target); + return Entities.Common.EdFi.StaffEducationOrganizationAssignmentAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffAbsenceEventMapper.MapTo(this, (Entities.Common.EdFi.IStaffAbsenceEvent)target, null); + Entities.Common.EdFi.StaffEducationOrganizationAssignmentAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffAbsenceEvent.StaffResourceId + Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.CredentialResourceId { get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + set { ImplicitCredentialReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffAbsenceEvent.StaffDiscriminator + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.CredentialDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitStaffReference.Discriminator = value; } + set { ImplicitCredentialReference.Discriminator = value; } } - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EducationOrganizationResourceId { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - [ExcludeFromCodeCoverage] - public class StaffAbsenceEventPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EducationOrganizationDiscriminator { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } } - } - // ----------------------------------------------------------------- - -} -// Aggregate: StaffClassificationDescriptor -namespace EdFi.Ods.Api.Common.Models.Resources.StaffClassificationDescriptor.EdFi -{ - /// - /// A class which represents the edfi.StaffClassificationDescriptor table of the StaffClassificationDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class StaffClassificationDescriptor : Entities.Common.EdFi.IStaffClassificationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity - { - private static FullName _fullName = new FullName("edfi", "StaffClassificationDescriptor"); - - // Fluent validator instance (threadsafe) - private static StaffClassificationDescriptorPutPostRequestValidator _validator = new StaffClassificationDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the StaffClassificationDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int StaffClassificationDescriptorId { get; set; } - int IDescriptor.DescriptorId + Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentStaffEducationOrganizationEmploymentAssociationResourceId { - get { return StaffClassificationDescriptorId; } - set { StaffClassificationDescriptorId = value; } + get { return null; } + set { ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.ResourceId = value ?? default(Guid); } } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentStaffEducationOrganizationEmploymentAssociationDiscriminator { - var compareTo = obj as Entities.Common.EdFi.IStaffClassificationDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IStaffClassificationDescriptor).StaffClassificationDescriptorId.Equals(compareTo.StaffClassificationDescriptorId)) - return false; + // Not supported for Resources + get { return null; } + set { ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.Discriminator = value; } + } - return true; + Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StaffDiscriminator { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IStaffClassificationDescriptor).StaffClassificationDescriptorId); - - return hash.ToHashCode(); + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // ----------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // ---------------------- + // Validate collections + // ---------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- + // --------------------------- + // Validate embedded objects + // --------------------------- - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } - // ============================================================= - // Versioning - // ------------------------------------------------------------- + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } + var sourcesForStaffUniqueId = GetStaffUniqueIdSources().ToArray(); - // ------------------------------------------------------------- + if (!sourcesForStaffUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ + string values = string.Join("', '", sourcesForStaffUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStaffUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.StaffClassificationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffClassificationDescriptor)target); - } + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'staffUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStaffUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetStaffUniqueIdSources() + { + // Obtain value from other references + var valueFromStaffReference = this.StaffReference?.StaffUniqueId; + + if (valueFromStaffReference != null) + { + yield return ("staffReference.staffUniqueId", this.StaffReference.StaffUniqueId); + } + + // Obtain value from other references + var valueFromEmploymentStaffEducationOrganizationEmploymentAssociationReference = this.EmploymentStaffEducationOrganizationEmploymentAssociationReference?.StaffUniqueId; + + if (valueFromEmploymentStaffEducationOrganizationEmploymentAssociationReference != null) + { + yield return ("employmentStaffEducationOrganizationEmploymentAssociationReference.staffUniqueId", this.EmploymentStaffEducationOrganizationEmploymentAssociationReference.StaffUniqueId); + } + + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); - void IMappable.Map(object target) - { - Entities.Common.EdFi.StaffClassificationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStaffClassificationDescriptor)target, null); + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- } // ================================================================= @@ -160414,9 +166624,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffClassificationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffEducationOrganizationAssignmentAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -160445,22 +166655,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffCohortAssociation resource. + /// Represents a reference to the StaffEducationOrganizationContactAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffCohortAssociationReference : IResourceReference + public class StaffEducationOrganizationContactAssociationReference : IResourceReference { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - [DataMember(Name="cohortIdentifier")] - public string CohortIdentifier { get; set; } + [DataMember(Name="contactTitle")] + public string ContactTitle { get; set; } [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } @@ -160513,19 +166720,14 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BeginDate != default(DateTime) && CohortIdentifier != default(string) && EducationOrganizationId != default(long) && StaffUniqueId != default(string); + return ContactTitle != default(string) && EducationOrganizationId != default(long) && StaffUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BeginDate == default) - { - yield return "BeginDate"; - } - - if (CohortIdentifier == default) + if (ContactTitle == default) { - yield return "CohortIdentifier"; + yield return "ContactTitle"; } if (EducationOrganizationId == default) @@ -160544,8 +166746,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StaffCohortAssociation", - Href = $"/ed-fi/staffCohortAssociations/{ResourceId:n}" + Rel = "StaffEducationOrganizationContactAssociation", + Href = $"/ed-fi/staffEducationOrganizationContactAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -160572,16 +166774,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StaffCohortAssociation table of the StaffCohortAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffEducationOrganizationContactAssociation table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffCohortAssociation : Entities.Common.EdFi.IStaffCohortAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StaffEducationOrganizationContactAssociation : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffCohortAssociation"); + private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociation"); // Fluent validator instance (threadsafe) - private static StaffCohortAssociationPutPostRequestValidator _validator = new StaffCohortAssociationPutPostRequestValidator(); + private static StaffEducationOrganizationContactAssociationPutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -160592,6 +166794,10 @@ public class StaffCohortAssociation : Entities.Common.EdFi.IStaffCohortAssociati // Constructor // ------------------------------------------------------------- + public StaffEducationOrganizationContactAssociation() + { + StaffEducationOrganizationContactAssociationTelephones = new List(); + } // ------------------------------------------------------------ @@ -160600,7 +166806,7 @@ public class StaffCohortAssociation : Entities.Common.EdFi.IStaffCohortAssociati // ------------------------------------------------------------ /// - /// The unique identifier for the StaffCohortAssociation resource. + /// The unique identifier for the StaffEducationOrganizationContactAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -160611,37 +166817,37 @@ public class StaffCohortAssociation : Entities.Common.EdFi.IStaffCohortAssociati // References // ------------------------------------------------------------- - private bool _cohortReferenceExplicitlyAssigned; - private Cohort.EdFi.CohortReference _cohortReference; - private Cohort.EdFi.CohortReference ImplicitCohortReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_cohortReference == null && !_cohortReferenceExplicitlyAssigned) - _cohortReference = new Cohort.EdFi.CohortReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _cohortReference; + return _educationOrganizationReference; } } - [DataMember(Name="cohortReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Cohort.EdFi.CohortReference CohortReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCohortReference != null - && (_cohortReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) - return ImplicitCohortReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _cohortReferenceExplicitlyAssigned = true; - _cohortReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } private bool _staffReferenceExplicitlyAssigned; @@ -160684,49 +166890,25 @@ public Staff.EdFi.StaffReference StaffReference // ------------------------------------------------------------- /// - /// Start date for the association of staff to this cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The title of the contact in the context of the education organization. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - /// - /// The name or ID for the cohort. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffCohortAssociation.CohortIdentifier - { - get - { - if (ImplicitCohortReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) - return ImplicitCohortReference.CohortIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Cohort - _cohortReferenceExplicitlyAssigned = false; - ImplicitCohortReference.CohortIdentifier = value; - } - } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="contactTitle")] + public string ContactTitle { get; set; } /// /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffCohortAssociation.EducationOrganizationId + long Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.EducationOrganizationId { get { - if (ImplicitCohortReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) - return ImplicitCohortReference.EducationOrganizationId; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -160735,9 +166917,9 @@ long Entities.Common.EdFi.IStaffCohortAssociation.EducationOrganizationId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Cohort - _cohortReferenceExplicitlyAssigned = false; - ImplicitCohortReference.EducationOrganizationId = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } @@ -160745,7 +166927,7 @@ long Entities.Common.EdFi.IStaffCohortAssociation.EducationOrganizationId /// A unique alphanumeric code assigned to a staff. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffCohortAssociation.StaffUniqueId + string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffUniqueId { get { @@ -160780,7 +166962,7 @@ string Entities.Common.EdFi.IStaffCohortAssociation.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffCohortAssociation; + var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -160790,22 +166972,17 @@ public override bool Equals(object obj) // Standard Property - if (!(this as Entities.Common.EdFi.IStaffCohortAssociation).BeginDate.Equals(compareTo.BeginDate)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffCohortAssociation).CohortIdentifier, compareTo.CohortIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).ContactTitle, compareTo.ContactTitle)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffCohortAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffCohortAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -160823,17 +167000,14 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).BeginDate); - + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).ContactTitle); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).CohortIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).EducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffCohortAssociation).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -160848,23 +167022,39 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// End date for the association of staff to this cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Indicates the type for the contact information. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="contactTypeDescriptor")][DescriptorExists("ContactTypeDescriptor")] + public string ContactTypeDescriptor { get; set; } /// - /// Indicator of whether the staff has access to the student records of the cohort per district interpretation of FERPA and other privacy laws, regulations, and policies. + /// The email for the contact associated with the education organization. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="studentRecordAccess")] - public bool? StudentRecordAccess { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(128, MinimumLength=7, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="electronicMailAddress")] + public string ElectronicMailAddress { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + /// + /// address + /// + + [DataMember(Name = "address")] + public StaffEducationOrganizationContactAssociationAddress StaffEducationOrganizationContactAssociationAddress { get; set; } + + Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffEducationOrganizationContactAssociationAddress + { + get { return StaffEducationOrganizationContactAssociationAddress; } + set { StaffEducationOrganizationContactAssociationAddress = (StaffEducationOrganizationContactAssociationAddress) value; } + } + // ------------------------------------------------------------- // ============================================================= @@ -160880,13 +167070,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffCohortAssociation", "StaffCohortAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _staffEducationOrganizationContactAssociationTelephones; + private ICollection _staffEducationOrganizationContactAssociationTelephonesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="telephones")] + public ICollection StaffEducationOrganizationContactAssociationTelephones + { + get { return _staffEducationOrganizationContactAssociationTelephones; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)e.Item).StaffEducationOrganizationContactAssociation = this); + _staffEducationOrganizationContactAssociationTelephones = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)e.Item).StaffEducationOrganizationContactAssociation = this; + _staffEducationOrganizationContactAssociationTelephonesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffEducationOrganizationContactAssociationTelephones + { + get { return _staffEducationOrganizationContactAssociationTelephonesCovariant; } + set { StaffEducationOrganizationContactAssociationTelephones = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -160904,6 +167124,17 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_staffEducationOrganizationContactAssociationTelephones != null) foreach (var item in _staffEducationOrganizationContactAssociationTelephones) + { + item.StaffEducationOrganizationContactAssociation = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -160911,39 +167142,39 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffCohortAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffCohortAssociation)target); + return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffCohortAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffCohortAssociation)target, null); + Entities.Common.EdFi.StaffEducationOrganizationContactAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffCohortAssociation.CohortResourceId + Guid? Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.EducationOrganizationResourceId { get { return null; } - set { ImplicitCohortReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffCohortAssociation.CohortDiscriminator + string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitCohortReference.Discriminator = value; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IStaffCohortAssociation.StaffResourceId + Guid? Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffResourceId { get { return null; } set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffCohortAssociation.StaffDiscriminator + string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffDiscriminator { // Not supported for Resources get { return null; } @@ -160973,10 +167204,34 @@ string Entities.Common.EdFi.IStaffCohortAssociation.StaffDiscriminator // ---------------------- // Validate collections // ---------------------- + if (StaffEducationOrganizationContactAssociationTelephones.Any() && mappingContract?.IsMemberSupported("StaffEducationOrganizationContactAssociationTelephones") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffEducationOrganizationContactAssociationTelephones"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffEducationOrganizationContactAssociationTelephones, validationContext, validationContext.Items.ForCollection("StaffEducationOrganizationContactAssociationTelephones")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects // --------------------------- + if (StaffEducationOrganizationContactAssociationAddress != null && mappingContract?.IsMemberSupported("StaffEducationOrganizationContactAssociationAddress") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffEducationOrganizationContactAssociationAddress"); + + foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(StaffEducationOrganizationContactAssociationAddress, validationContext, validationContext.Items.ForEmbeddedObject("StaffEducationOrganizationContactAssociationAddress")))) + { + yield return result; + } + } + // --------------------- // Validate Extensions @@ -161018,9 +167273,14 @@ string Entities.Common.EdFi.IStaffCohortAssociation.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffCohortAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffEducationOrganizationContactAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StaffEducationOrganizationContactAssociation = new FullName("edfi", "StaffEducationOrganizationContactAssociation"); + + // Declare collection item validators + private StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator _staffEducationOrganizationContactAssociationTelephonesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -161033,6 +167293,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StaffEducationOrganizationContactAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StaffEducationOrganizationContactAssociation); + + if (mappingContract != null) + { + if (mappingContract.IsStaffEducationOrganizationContactAssociationTelephoneIncluded != null) + { + var hasInvalidStaffEducationOrganizationContactAssociationTelephonesItems = instance.StaffEducationOrganizationContactAssociationTelephones.Any(x => !mappingContract.IsStaffEducationOrganizationContactAssociationTelephoneIncluded(x)); + + if (hasInvalidStaffEducationOrganizationContactAssociationTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffEducationOrganizationContactAssociationTelephones", $"A supplied 'StaffEducationOrganizationContactAssociationTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -161048,316 +167330,532 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffDisciplineIncidentAssociation resource. + /// A class which represents the edfi.StaffEducationOrganizationContactAssociationAddress table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. /// - [DataContract] + [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffDisciplineIncidentAssociationReference : IResourceReference + public class StaffEducationOrganizationContactAssociationAddress : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress, IValidatableObject { - [DataMember(Name="incidentIdentifier")] - public string IncidentIdentifier { get; set; } + private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociationAddress"); - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + // Fluent validator instance (threadsafe) + private static StaffEducationOrganizationContactAssociationAddressPutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationAddressPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 - [DataMember(Name="staffUniqueId")] - public string StaffUniqueId + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public StaffEducationOrganizationContactAssociationAddress() { - get => _staffUniqueId; - set - { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } + StaffEducationOrganizationContactAssociationAddressPeriods = new List(); } - private string _staffUniqueId; + + // ------------------------------------------------------------ - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation _staffEducationOrganizationContactAssociation; - private Link _link; + [IgnoreDataMember] + Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducationOrganizationContactAssociationAddress.StaffEducationOrganizationContactAssociation + { + get { return _staffEducationOrganizationContactAssociation; } + set { SetStaffEducationOrganizationContactAssociation(value); } + } - [DataMember(Name="link")] - public Link Link + public Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation StaffEducationOrganizationContactAssociation { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } + set { SetStaffEducationOrganizationContactAssociation(value); } + } - return _link; - } + private void SetStaffEducationOrganizationContactAssociation(Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation value) + { + _staffEducationOrganizationContactAssociation = value; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// Determines equality based on the natural key properties of the resource. /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - return IncidentIdentifier != default(string) && SchoolId != default(long) && StaffUniqueId != default(string); - } + var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress; - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (IncidentIdentifier == default) - { - yield return "IncidentIdentifier"; - } + if (ReferenceEquals(this, compareTo)) + return true; - if (SchoolId == default) - { - yield return "SchoolId"; - } + if (compareTo == null) + return false; - if (StaffUniqueId == default) - { - yield return "StaffUniqueId"; - } + // Parent Property + if (_staffEducationOrganizationContactAssociation == null || !_staffEducationOrganizationContactAssociation.Equals(compareTo.StaffEducationOrganizationContactAssociation)) + return false; + + return true; } - private Link CreateLink() + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - var link = new Link - { - Rel = "StaffDisciplineIncidentAssociation", - Href = $"/ed-fi/staffDisciplineIncidentAssociations/{ResourceId:n}" - }; + var hash = new HashCode(); + //Parent Property + if (_staffEducationOrganizationContactAssociation != null) + hash.Add(_staffEducationOrganizationContactAssociation); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- - if (string.IsNullOrEmpty(Discriminator)) - return link; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - string[] linkParts = Discriminator.Split('.'); + // ============================================================= + // Properties + // ------------------------------------------------------------- - if (linkParts.Length < 2) - return link; + /// + /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] + public string AddressTypeDescriptor { get; set; } - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + /// + /// The apartment, room, or suite number of an address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="apartmentRoomSuiteNumber")] + public string ApartmentRoomSuiteNumber { get; set; } - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + /// + /// The number of the building on the site, if more than one building shares the same address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="buildingSiteNumber")] + public string BuildingSiteNumber { get; set; } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference + /// + /// The name of the city in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="city")] + public string City { get; set; } - /// - /// A class which represents the edfi.StaffDisciplineIncidentAssociation table of the StaffDisciplineIncidentAssociation aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class StaffDisciplineIncidentAssociation : Entities.Common.EdFi.IStaffDisciplineIncidentAssociation, IHasETag, IDateVersionedEntity, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "StaffDisciplineIncidentAssociation"); + /// + /// The congressional district in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="congressionalDistrict")] + public string CongressionalDistrict { get; set; } - // Fluent validator instance (threadsafe) - private static StaffDisciplineIncidentAssociationPutPostRequestValidator _validator = new StaffDisciplineIncidentAssociationPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 + /// + /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="countyFIPSCode")] + public string CountyFIPSCode { get; set; } - // ============================================================= - // Constructor - // ------------------------------------------------------------- + /// + /// An indication that the address should not be published. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } - public StaffDisciplineIncidentAssociation() - { - StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes = new List(); - } - - // ------------------------------------------------------------ + /// + /// The geographic latitude of the physical address. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="latitude")] + public string Latitude { get; set; } - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ + /// + /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] + public string LocaleDescriptor { get; set; } /// - /// The unique identifier for the StaffDisciplineIncidentAssociation resource. + /// The geographic longitude of the physical address. /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="longitude")] + public string Longitude { get; set; } + + /// + /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfCounty")] + public string NameOfCounty { get; set; } + + /// + /// The five or nine digit zip code or overseas postal code portion of an address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="postalCode")] + public string PostalCode { get; set; } + + /// + /// The abbreviation for the state (within the United States) or outlying area in which an address is located. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string StateAbbreviationDescriptor { get; set; } + + /// + /// The street number and street name or post office box number of an address. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="streetNumberName")] + public string StreetNumberName { get; set; } + // ------------------------------------------------------------- // ============================================================= - // References + // One-to-one relationships + // ------------------------------------------------------------- // ------------------------------------------------------------- - private bool _disciplineIncidentReferenceExplicitlyAssigned; - private DisciplineIncident.EdFi.DisciplineIncidentReference _disciplineIncidentReference; - private DisciplineIncident.EdFi.DisciplineIncidentReference ImplicitDisciplineIncidentReference + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddress")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _staffEducationOrganizationContactAssociationAddressPeriods; + private ICollection _staffEducationOrganizationContactAssociationAddressPeriodsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="periods")] + public ICollection StaffEducationOrganizationContactAssociationAddressPeriods { - get + get { return _staffEducationOrganizationContactAssociationAddressPeriods; } + set { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_disciplineIncidentReference == null && !_disciplineIncidentReferenceExplicitlyAssigned) - _disciplineIncidentReference = new DisciplineIncident.EdFi.DisciplineIncidentReference(); + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)e.Item).StaffEducationOrganizationContactAssociationAddress = this); + _staffEducationOrganizationContactAssociationAddressPeriods = list; - return _disciplineIncidentReference; + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)e.Item).StaffEducationOrganizationContactAssociationAddress = this; + _staffEducationOrganizationContactAssociationAddressPeriodsCovariant = covariantList; } } - [DataMember(Name="disciplineIncidentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public DisciplineIncident.EdFi.DisciplineIncidentReference DisciplineIncidentReference + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress.StaffEducationOrganizationContactAssociationAddressPeriods { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitDisciplineIncidentReference != null - && (_disciplineIncidentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - return ImplicitDisciplineIncidentReference; + get { return _staffEducationOrganizationContactAssociationAddressPeriodsCovariant; } + set { StaffEducationOrganizationContactAssociationAddressPeriods = new List(value.Cast()); } + } - return null; - } - set + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_staffEducationOrganizationContactAssociationAddressPeriods != null) foreach (var item in _staffEducationOrganizationContactAssociationAddressPeriods) { - _disciplineIncidentReferenceExplicitlyAssigned = true; - _disciplineIncidentReference = value; + item.StaffEducationOrganizationContactAssociationAddress = this; } + } - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); + return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress)target); + } - return _staffReference; - } + void IMappable.Map(object target) + { + Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress)target, null); } + // ------------------------------------------------------------- - [DataMember(Name="staffReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - get + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; - return null; + // ---------------------- + // Validate collections + // ---------------------- + if (StaffEducationOrganizationContactAssociationAddressPeriods.Any() && mappingContract?.IsMemberSupported("StaffEducationOrganizationContactAssociationAddressPeriods") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffEducationOrganizationContactAssociationAddressPeriods"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffEducationOrganizationContactAssociationAddressPeriods, validationContext, validationContext.Items.ForCollection("StaffEducationOrganizationContactAssociationAddressPeriods")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } } - set + finally { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; + // Restore original length + pathBuilder.Length = originalLength; } + // ---------------------------------- } - // ------------------------------------------------------------- + } - //============================================================== - // Primary Key - // ------------------------------------------------------------- + // ================================================================= + // Validators + // ----------------------------------------------------------------- - /// - /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.IncidentIdentifier + [ExcludeFromCodeCoverage] + public class StaffEducationOrganizationContactAssociationAddressPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_StaffEducationOrganizationContactAssociationAddress = new FullName("edfi", "StaffEducationOrganizationContactAssociationAddress"); + + // Declare collection item validators + private StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator _staffEducationOrganizationContactAssociationAddressPeriodsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - get + if (context.InstanceToValidate == null) { - if (ImplicitDisciplineIncidentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - return ImplicitDisciplineIncidentReference.IncidentIdentifier; + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - return default(string); + return false; } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - // DisciplineIncident - _disciplineIncidentReferenceExplicitlyAssigned = false; - ImplicitDisciplineIncidentReference.IncidentIdentifier = value; - } - } + var instance = context.InstanceToValidate; - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.SchoolId - { - get + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StaffEducationOrganizationContactAssociationAddressMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StaffEducationOrganizationContactAssociationAddress); + + if (mappingContract != null) { - if (ImplicitDisciplineIncidentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - return ImplicitDisciplineIncidentReference.SchoolId; + if (mappingContract.IsStaffEducationOrganizationContactAssociationAddressPeriodIncluded != null) + { + var hasInvalidStaffEducationOrganizationContactAssociationAddressPeriodsItems = instance.StaffEducationOrganizationContactAssociationAddressPeriods.Any(x => !mappingContract.IsStaffEducationOrganizationContactAssociationAddressPeriodIncluded(x)); + + if (hasInvalidStaffEducationOrganizationContactAssociationAddressPeriodsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffEducationOrganizationContactAssociationAddressPeriods", $"A supplied 'StaffEducationOrganizationContactAssociationAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } - return default(long); } - set + + if (failures.Any()) { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // DisciplineIncident - _disciplineIncidentReferenceExplicitlyAssigned = false; - ImplicitDisciplineIncidentReference.SchoolId = value; + return false; } + + return true; } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StaffEducationOrganizationContactAssociationAddressPeriod table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StaffEducationOrganizationContactAssociationAddressPeriod : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociationAddressPeriod"); + + // Fluent validator instance (threadsafe) + private static StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress _staffEducationOrganizationContactAssociationAddress; - /// - /// A unique alphanumeric code assigned to a staff. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffUniqueId + [IgnoreDataMember] + Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress IStaffEducationOrganizationContactAssociationAddressPeriod.StaffEducationOrganizationContactAssociationAddress { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; + get { return _staffEducationOrganizationContactAssociationAddress; } + set { SetStaffEducationOrganizationContactAssociationAddress(value); } + } - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + public Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress StaffEducationOrganizationContactAssociationAddress + { + set { SetStaffEducationOrganizationContactAssociationAddress(value); } + } - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } + private void SetStaffEducationOrganizationContactAssociationAddress(Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress value) + { + _staffEducationOrganizationContactAssociationAddress = value; } + + /// + /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -161372,7 +167870,7 @@ string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation; + var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -161380,19 +167878,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).SchoolId.Equals(compareTo.SchoolId)) + // Parent Property + if (_staffEducationOrganizationContactAssociationAddress == null || !_staffEducationOrganizationContactAssociationAddress.Equals(compareTo.StaffEducationOrganizationContactAssociationAddress)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + // Standard Property + if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) return false; @@ -161408,15 +167900,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_staffEducationOrganizationContactAssociationAddress != null) + hash.Add(_staffEducationOrganizationContactAssociationAddress); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).IncidentIdentifier); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).SchoolId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod).BeginDate); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -161429,6 +167919,13 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -161449,71 +167946,23 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddressPeriod")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes; - private ICollection _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesCovariant; - - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="disciplineIncidentParticipationCodes")] - public ICollection StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes - { - get { return _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)e.Item).StaffDisciplineIncidentAssociation = this); - _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)e.Item).StaffDisciplineIncidentAssociation = this; - _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes - { - get { return _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesCovariant; } - set { StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes != null) foreach (var item in _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes) - { - item.StaffDisciplineIncidentAssociation = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -161521,46 +167970,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffDisciplineIncidentAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociation)target); + return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffDisciplineIncidentAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociation)target, null); + Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.DisciplineIncidentResourceId - { - get { return null; } - set { ImplicitDisciplineIncidentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.DisciplineIncidentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitDisciplineIncidentReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffResourceId - { - get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStaffReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -161578,23 +167999,12 @@ string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffDiscriminat try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes.Any() && mappingContract?.IsMemberSupported("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes, validationContext, validationContext.Items.ForCollection("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -161640,14 +168050,9 @@ string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffDiscriminat // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffDisciplineIncidentAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StaffDisciplineIncidentAssociation = new FullName("edfi", "StaffDisciplineIncidentAssociation"); - - // Declare collection item validators - private StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -161660,28 +168065,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StaffDisciplineIncidentAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StaffDisciplineIncidentAssociation); - - if (mappingContract != null) - { - if (mappingContract.IsStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeIncluded != null) - { - var hasInvalidStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesItems = instance.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes.Any(x => !mappingContract.IsStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeIncluded(x)); - - if (hasInvalidStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes", $"A supplied 'StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -161698,16 +168081,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode table of the StaffDisciplineIncidentAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffEducationOrganizationContactAssociationTelephone table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode : Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode, IValidatableObject + public class StaffEducationOrganizationContactAssociationTelephone : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode"); + private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociationTelephone"); // Fluent validator instance (threadsafe) - private static StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _validator = new StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator(); + private static StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -161734,33 +168117,42 @@ public class StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCo //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffDisciplineIncidentAssociation _staffDisciplineIncidentAssociation; + private Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation _staffEducationOrganizationContactAssociation; [IgnoreDataMember] - Entities.Common.EdFi.IStaffDisciplineIncidentAssociation IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode.StaffDisciplineIncidentAssociation + Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducationOrganizationContactAssociationTelephone.StaffEducationOrganizationContactAssociation { - get { return _staffDisciplineIncidentAssociation; } - set { SetStaffDisciplineIncidentAssociation(value); } + get { return _staffEducationOrganizationContactAssociation; } + set { SetStaffEducationOrganizationContactAssociation(value); } } - public Entities.Common.EdFi.IStaffDisciplineIncidentAssociation StaffDisciplineIncidentAssociation + public Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation StaffEducationOrganizationContactAssociation { - set { SetStaffDisciplineIncidentAssociation(value); } + set { SetStaffEducationOrganizationContactAssociation(value); } } - private void SetStaffDisciplineIncidentAssociation(Entities.Common.EdFi.IStaffDisciplineIncidentAssociation value) + private void SetStaffEducationOrganizationContactAssociation(Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation value) { - _staffDisciplineIncidentAssociation = value; + _staffEducationOrganizationContactAssociation = value; } /// - /// The role or type of participation of a student in a discipline incident. + /// The telephone number including the area code, and extension, if applicable. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="telephoneNumber")] + public string TelephoneNumber { get; set; } + + /// + /// The type of communication number listed for an individual or organization. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="disciplineIncidentParticipationCodeDescriptor")][DescriptorExists("DisciplineIncidentParticipationCodeDescriptor")] - public string DisciplineIncidentParticipationCodeDescriptor { get; set; } + [DataMember(Name="telephoneNumberTypeDescriptor")][DescriptorExists("TelephoneNumberTypeDescriptor")] + public string TelephoneNumberTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -161775,7 +168167,7 @@ private void SetStaffDisciplineIncidentAssociation(Entities.Common.EdFi.IStaffDi /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode; + var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone; if (ReferenceEquals(this, compareTo)) return true; @@ -161784,12 +168176,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_staffDisciplineIncidentAssociation == null || !_staffDisciplineIncidentAssociation.Equals(compareTo.StaffDisciplineIncidentAssociation)) + if (_staffEducationOrganizationContactAssociation == null || !_staffEducationOrganizationContactAssociation.Equals(compareTo.StaffEducationOrganizationContactAssociation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumber, compareTo.TelephoneNumber)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumberTypeDescriptor, compareTo.TelephoneNumberTypeDescriptor)) return false; @@ -161806,11 +168203,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_staffDisciplineIncidentAssociation != null) - hash.Add(_staffDisciplineIncidentAssociation); + if (_staffEducationOrganizationContactAssociation != null) + hash.Add(_staffEducationOrganizationContactAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumber); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumberTypeDescriptor); return hash.ToHashCode(); } @@ -161824,6 +168225,28 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// An indication that the telephone number should not be published. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="doNotPublishIndicator")] + public bool? DoNotPublishIndicator { get; set; } + + /// + /// The order of priority assigned to telephone numbers to define which number to attempt first, second, etc. + /// + // NOT in a reference, NOT a lookup column + [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] + [DataMember(Name="orderOfPriority")] + public int? OrderOfPriority { get; set; } + + /// + /// An indication that the telephone number is technically capable of sending and receiving Short Message Service (SMS) text messages. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="textMessageCapabilityIndicator")] + public bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -161844,7 +168267,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationTelephone")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -161868,12 +168291,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)target); + return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode)target, null); + Entities.Common.EdFi.StaffEducationOrganizationContactAssociationTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)target, null); } // ------------------------------------------------------------- @@ -161948,9 +168371,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -161979,25 +168402,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffEducationOrganizationAssignmentAssociation resource. + /// Represents a reference to the StaffEducationOrganizationEmploymentAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationAssignmentAssociationReference : IResourceReference + public class StaffEducationOrganizationEmploymentAssociationReference : IResourceReference { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } - [DataMember(Name="staffClassificationDescriptor")][DescriptorExists("StaffClassificationDescriptor")] - public string StaffClassificationDescriptor { get; set; } + [DataMember(Name="employmentStatusDescriptor")][DescriptorExists("EmploymentStatusDescriptor")] + public string EmploymentStatusDescriptor { get; set; } + + [DataMember(Name="hireDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime HireDate { get; set; } [DataMember(Name="staffUniqueId")] public string StaffUniqueId @@ -162047,24 +168470,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BeginDate != default(DateTime) && EducationOrganizationId != default(long) && StaffClassificationDescriptor != default(string) && StaffUniqueId != default(string); + return EducationOrganizationId != default(long) && EmploymentStatusDescriptor != default(string) && HireDate != default(DateTime) && StaffUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BeginDate == default) + if (EducationOrganizationId == default) { - yield return "BeginDate"; + yield return "EducationOrganizationId"; } - if (EducationOrganizationId == default) + if (EmploymentStatusDescriptor == default) { - yield return "EducationOrganizationId"; + yield return "EmploymentStatusDescriptor"; } - if (StaffClassificationDescriptor == default) + if (HireDate == default) { - yield return "StaffClassificationDescriptor"; + yield return "HireDate"; } if (StaffUniqueId == default) @@ -162078,8 +168501,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StaffEducationOrganizationAssignmentAssociation", - Href = $"/ed-fi/staffEducationOrganizationAssignmentAssociations/{ResourceId:n}" + Rel = "StaffEducationOrganizationEmploymentAssociation", + Href = $"/ed-fi/staffEducationOrganizationEmploymentAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -162106,16 +168529,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StaffEducationOrganizationAssignmentAssociation table of the StaffEducationOrganizationAssignmentAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffEducationOrganizationEmploymentAssociation table of the StaffEducationOrganizationEmploymentAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationAssignmentAssociation : Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StaffEducationOrganizationEmploymentAssociation : Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationAssignmentAssociation"); + private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationEmploymentAssociation"); // Fluent validator instance (threadsafe) - private static StaffEducationOrganizationAssignmentAssociationPutPostRequestValidator _validator = new StaffEducationOrganizationAssignmentAssociationPutPostRequestValidator(); + private static StaffEducationOrganizationEmploymentAssociationPutPostRequestValidator _validator = new StaffEducationOrganizationEmploymentAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -162134,7 +168557,7 @@ public class StaffEducationOrganizationAssignmentAssociation : Entities.Common.E // ------------------------------------------------------------ /// - /// The unique identifier for the StaffEducationOrganizationAssignmentAssociation resource. + /// The unique identifier for the StaffEducationOrganizationEmploymentAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -162211,39 +168634,6 @@ public EducationOrganization.EdFi.EducationOrganizationReference EducationOrgani _educationOrganizationReference = value; } } - private bool _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned; - private StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference _employmentStaffEducationOrganizationEmploymentAssociationReference; - private StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_employmentStaffEducationOrganizationEmploymentAssociationReference == null && !_employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned) - _employmentStaffEducationOrganizationEmploymentAssociationReference = new StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference(); - - return _employmentStaffEducationOrganizationEmploymentAssociationReference; - } - } - - [DataMember(Name="employmentStaffEducationOrganizationEmploymentAssociationReference")] - [FullyDefinedReference] - public StaffEducationOrganizationEmploymentAssociation.EdFi.StaffEducationOrganizationEmploymentAssociationReference EmploymentStaffEducationOrganizationEmploymentAssociationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null - && (_employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) - return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference; - - return null; - } - set - { - _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = true; - _employmentStaffEducationOrganizationEmploymentAssociationReference = value; - } - } private bool _staffReferenceExplicitlyAssigned; private Staff.EdFi.StaffReference _staffReference; private Staff.EdFi.StaffReference ImplicitStaffReference @@ -162283,19 +168673,11 @@ public Staff.EdFi.StaffReference StaffReference // Primary Key // ------------------------------------------------------------- - /// - /// Month, day, and year of the start or effective date of a staff member's employment, contract, or relationship with the education organization. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - /// /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EducationOrganizationId + long Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.EducationOrganizationId { get { @@ -162317,19 +168699,27 @@ long Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Educa } /// - /// The titles of employment, official status, or rank of education staff. + /// Reflects the type of employment or contract. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="staffClassificationDescriptor")][DescriptorExists("StaffClassificationDescriptor")] - public string StaffClassificationDescriptor { get; set; } + [DataMember(Name="employmentStatusDescriptor")][DescriptorExists("EmploymentStatusDescriptor")] + public string EmploymentStatusDescriptor { get; set; } + + /// + /// The month, day, and year on which an individual was hired for a position. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="hireDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime HireDate { get; set; } /// /// A unique alphanumeric code assigned to a staff. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StaffUniqueId + string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StaffUniqueId { get { @@ -162344,10 +168734,6 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Sta // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // EmploymentStaffEducationOrganizationEmploymentAssociation - _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = false; - ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.StaffUniqueId = value; - // Staff _staffReferenceExplicitlyAssigned = false; ImplicitStaffReference.StaffUniqueId = value; @@ -162368,7 +168754,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Sta /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation; + var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -162377,23 +168763,23 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).BeginDate.Equals(compareTo.BeginDate)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EmploymentStatusDescriptor, compareTo.EmploymentStatusDescriptor)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffClassificationDescriptor, compareTo.StaffClassificationDescriptor)) + if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).HireDate.Equals(compareTo.HireDate)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -162410,19 +168796,19 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).BeginDate); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EducationOrganizationId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EmploymentStatusDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).EducationOrganizationId); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffClassificationDescriptor); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).HireDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -162436,11 +168822,19 @@ public override int GetHashCode() // Properties // ------------------------------------------------------------- + /// + /// Annual wage associated with the employment position being reported. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="annualWage")] + public decimal? AnnualWage { get; set; } + /// /// Identifier or serial number assigned to the credential. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.CredentialIdentifier + string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.CredentialIdentifier { get { @@ -162464,85 +168858,15 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Cre } /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentEducationOrganizationId - { - get - { - if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) - { - return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EducationOrganizationId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EmploymentStaffEducationOrganizationEmploymentAssociation - _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = false; - ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EducationOrganizationId = value.GetValueOrDefault(); - } - } - - /// - /// The month, day, and year on which an individual was hired for a position. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // IS in a reference, NOT a lookup column - DateTime? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentHireDate - { - get - { - if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) - { - return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.HireDate; - } - - return default(DateTime?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EmploymentStaffEducationOrganizationEmploymentAssociation - _employmentStaffEducationOrganizationEmploymentAssociationReferenceExplicitlyAssigned = false; - ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.HireDate = value.GetValueOrDefault(); - } - } - - /// - /// Reflects the type of employment or contract. + /// The department or suborganization the employee/contractor is associated with in the education organization. /// - - // IS in a reference (StaffEducationOrganizationAssignmentAssociation.EmploymentStatusDescriptorId), IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentStatusDescriptor - { - get - { - if (ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.IsReferenceFullyDefined())) - { - return ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EmploymentStatusDescriptor; - } - - return null; - } - set - { - ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.EmploymentStatusDescriptor = value; - } - } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="department")] + public string Department { get; set; } /// - /// Month, day, and year of the end or termination date of a staff member's employment, contract, or relationship with the education organization. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The month, day, and year on which a contract between an individual and a governing authority ends or is terminated under the provisions of the contract (or the date on which the agreement is made invalid). Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] @@ -162557,27 +168881,43 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Emp public decimal? FullTimeEquivalency { get; set; } /// - /// Describes whether the assignment is this the staff member's primary assignment, secondary assignment, etc. + /// Hourly wage associated with the employment position being reported. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="orderOfAssignment")] - public int? OrderOfAssignment { get; set; } + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="hourlyWage")] + public decimal? HourlyWage { get; set; } /// - /// The descriptive name of an individual's position. + /// Date at which the staff member was made an official offer for this employment. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(100, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="positionTitle")] - public string PositionTitle { get; set; } + [DataMember(Name="offerDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? OfferDate { get; set; } + + /// + /// Type of employment separation. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="separationDescriptor")][DescriptorExists("SeparationDescriptor")] + public string SeparationDescriptor { get; set; } + + /// + /// Reason for terminating the employment. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="separationReasonDescriptor")][DescriptorExists("SeparationReasonDescriptor")] + public string SeparationReasonDescriptor { get; set; } /// /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which a license/credential was issued. /// - // IS in a reference (StaffEducationOrganizationAssignmentAssociation.StateOfIssueStateAbbreviationDescriptorId), IS a lookup column + // IS in a reference (StaffEducationOrganizationEmploymentAssociation.StateOfIssueStateAbbreviationDescriptorId), IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StateOfIssueStateAbbreviationDescriptor + string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StateOfIssueStateAbbreviationDescriptor { get { @@ -162614,7 +168954,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Sta // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationAssignmentAssociation", "StaffEducationOrganizationAssignmentAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationEmploymentAssociation", "StaffEducationOrganizationEmploymentAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -162645,25 +168985,25 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Sta // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffEducationOrganizationAssignmentAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation)target); + return Entities.Common.EdFi.StaffEducationOrganizationEmploymentAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffEducationOrganizationAssignmentAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation)target, null); + Entities.Common.EdFi.StaffEducationOrganizationEmploymentAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.CredentialResourceId + Guid? Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.CredentialResourceId { get { return null; } set { ImplicitCredentialReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.CredentialDiscriminator + string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.CredentialDiscriminator { // Not supported for Resources get { return null; } @@ -162671,13 +169011,13 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Cre } - Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.EducationOrganizationResourceId { get { return null; } set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } @@ -162685,27 +169025,13 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Edu } - Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentStaffEducationOrganizationEmploymentAssociationResourceId - { - get { return null; } - set { ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.EmploymentStaffEducationOrganizationEmploymentAssociationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEmploymentStaffEducationOrganizationEmploymentAssociationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StaffResourceId + Guid? Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StaffResourceId { get { return null; } set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.StaffDiscriminator + string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StaffDiscriminator { // Not supported for Resources get { return null; } @@ -162754,45 +169080,6 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Sta yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForStaffUniqueId = GetStaffUniqueIdSources().ToArray(); - - if (!sourcesForStaffUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForStaffUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForStaffUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'staffUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForStaffUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetStaffUniqueIdSources() - { - // Obtain value from other references - var valueFromStaffReference = this.StaffReference?.StaffUniqueId; - - if (valueFromStaffReference != null) - { - yield return ("staffReference.staffUniqueId", this.StaffReference.StaffUniqueId); - } - - // Obtain value from other references - var valueFromEmploymentStaffEducationOrganizationEmploymentAssociationReference = this.EmploymentStaffEducationOrganizationEmploymentAssociationReference?.StaffUniqueId; - - if (valueFromEmploymentStaffEducationOrganizationEmploymentAssociationReference != null) - { - yield return ("employmentStaffEducationOrganizationEmploymentAssociationReference.staffUniqueId", this.EmploymentStaffEducationOrganizationEmploymentAssociationReference.StaffUniqueId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -162819,9 +169106,9 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Sta // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationAssignmentAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffEducationOrganizationEmploymentAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -162850,22 +169137,293 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffEducationOrganizationContactAssociation resource. + /// A class which represents the edfi.StaffIdentificationSystemDescriptor table of the StaffIdentificationSystemDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StaffIdentificationSystemDescriptor : Entities.Common.EdFi.IStaffIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "StaffIdentificationSystemDescriptor"); + + // Fluent validator instance (threadsafe) + private static StaffIdentificationSystemDescriptorPutPostRequestValidator _validator = new StaffIdentificationSystemDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the StaffIdentificationSystemDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int StaffIdentificationSystemDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return StaffIdentificationSystemDescriptorId; } + set { StaffIdentificationSystemDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStaffIdentificationSystemDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IStaffIdentificationSystemDescriptor).StaffIdentificationSystemDescriptorId.Equals(compareTo.StaffIdentificationSystemDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IStaffIdentificationSystemDescriptor).StaffIdentificationSystemDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StaffIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffIdentificationSystemDescriptor)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StaffIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStaffIdentificationSystemDescriptor)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StaffIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: StaffLeave + +namespace EdFi.Ods.Api.Common.Models.Resources.StaffLeave.EdFi +{ + /// + /// Represents a reference to the StaffLeave resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationReference : IResourceReference + public class StaffLeaveReference : IResourceReference { - [DataMember(Name="contactTitle")] - public string ContactTitle { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + [DataMember(Name="staffLeaveEventCategoryDescriptor")][DescriptorExists("StaffLeaveEventCategoryDescriptor")] + public string StaffLeaveEventCategoryDescriptor { get; set; } [DataMember(Name="staffUniqueId")] public string StaffUniqueId @@ -162915,19 +169473,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return ContactTitle != default(string) && EducationOrganizationId != default(long) && StaffUniqueId != default(string); + return BeginDate != default(DateTime) && StaffLeaveEventCategoryDescriptor != default(string) && StaffUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (ContactTitle == default) + if (BeginDate == default) { - yield return "ContactTitle"; + yield return "BeginDate"; } - if (EducationOrganizationId == default) + if (StaffLeaveEventCategoryDescriptor == default) { - yield return "EducationOrganizationId"; + yield return "StaffLeaveEventCategoryDescriptor"; } if (StaffUniqueId == default) @@ -162941,8 +169499,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StaffEducationOrganizationContactAssociation", - Href = $"/ed-fi/staffEducationOrganizationContactAssociations/{ResourceId:n}" + Rel = "StaffLeave", + Href = $"/ed-fi/staffLeaves/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -162969,16 +169527,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StaffEducationOrganizationContactAssociation table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffLeave table of the StaffLeave aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociation : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StaffLeave : Entities.Common.EdFi.IStaffLeave, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociation"); + private static FullName _fullName = new FullName("edfi", "StaffLeave"); // Fluent validator instance (threadsafe) - private static StaffEducationOrganizationContactAssociationPutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationPutPostRequestValidator(); + private static StaffLeavePutPostRequestValidator _validator = new StaffLeavePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -162989,10 +169547,6 @@ public class StaffEducationOrganizationContactAssociation : Entities.Common.EdFi // Constructor // ------------------------------------------------------------- - public StaffEducationOrganizationContactAssociation() - { - StaffEducationOrganizationContactAssociationTelephones = new List(); - } // ------------------------------------------------------------ @@ -163001,7 +169555,7 @@ public StaffEducationOrganizationContactAssociation() // ------------------------------------------------------------ /// - /// The unique identifier for the StaffEducationOrganizationContactAssociation resource. + /// The unique identifier for the StaffLeave resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -163012,39 +169566,6 @@ public StaffEducationOrganizationContactAssociation() // References // ------------------------------------------------------------- - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } private bool _staffReferenceExplicitlyAssigned; private Staff.EdFi.StaffReference _staffReference; private Staff.EdFi.StaffReference ImplicitStaffReference @@ -163085,44 +169606,27 @@ public Staff.EdFi.StaffReference StaffReference // ------------------------------------------------------------- /// - /// The title of the contact in the context of the education organization. + /// The begin date of the staff leave. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="contactTitle")] - public string ContactTitle { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } /// - /// The identifier assigned to an education organization. + /// The code describing the type of leave taken. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="staffLeaveEventCategoryDescriptor")][DescriptorExists("StaffLeaveEventCategoryDescriptor")] + public string StaffLeaveEventCategoryDescriptor { get; set; } /// /// A unique alphanumeric code assigned to a staff. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffUniqueId + string Entities.Common.EdFi.IStaffLeave.StaffUniqueId { get { @@ -163157,7 +169661,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffU /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation; + var compareTo = obj as Entities.Common.EdFi.IStaffLeave; if (ReferenceEquals(this, compareTo)) return true; @@ -163167,17 +169671,17 @@ public override bool Equals(object obj) // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).ContactTitle, compareTo.ContactTitle)) + if (!(this as Entities.Common.EdFi.IStaffLeave).BeginDate.Equals(compareTo.BeginDate)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffLeave).StaffLeaveEventCategoryDescriptor, compareTo.StaffLeaveEventCategoryDescriptor)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffLeave).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -163195,14 +169699,15 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).ContactTitle); + hash.Add((this as Entities.Common.EdFi.IStaffLeave).BeginDate); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).EducationOrganizationId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffLeave).StaffLeaveEventCategoryDescriptor); + //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.IStaffLeave).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -163217,39 +169722,31 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Indicates the type for the contact information. + /// The end date of the staff leave. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="contactTypeDescriptor")][DescriptorExists("ContactTypeDescriptor")] - public string ContactTypeDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } /// - /// The email for the contact associated with the education organization. + /// Expanded reason for the staff leave. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(128, MinimumLength=7, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="electronicMailAddress")] - public string ElectronicMailAddress { get; set; } + [NonDefaultStringLength(40, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="reason")] + public string Reason { get; set; } + + /// + /// Indicator of whether a substitute was assigned during the period of staff leave. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="substituteAssigned")] + public bool? SubstituteAssigned { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- - /// - /// address - /// - - [DataMember(Name = "address")] - public StaffEducationOrganizationContactAssociationAddress StaffEducationOrganizationContactAssociationAddress { get; set; } - - Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffEducationOrganizationContactAssociationAddress - { - get { return StaffEducationOrganizationContactAssociationAddress; } - set { StaffEducationOrganizationContactAssociationAddress = (StaffEducationOrganizationContactAssociationAddress) value; } - } - // ------------------------------------------------------------- // ============================================================= @@ -163265,43 +169762,13 @@ Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress Entiti // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffLeave", "StaffLeave")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _staffEducationOrganizationContactAssociationTelephones; - private ICollection _staffEducationOrganizationContactAssociationTelephonesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="telephones")] - public ICollection StaffEducationOrganizationContactAssociationTelephones - { - get { return _staffEducationOrganizationContactAssociationTelephones; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)e.Item).StaffEducationOrganizationContactAssociation = this); - _staffEducationOrganizationContactAssociationTelephones = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)e.Item).StaffEducationOrganizationContactAssociation = this; - _staffEducationOrganizationContactAssociationTelephonesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffEducationOrganizationContactAssociationTelephones - { - get { return _staffEducationOrganizationContactAssociationTelephonesCovariant; } - set { StaffEducationOrganizationContactAssociationTelephones = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -163319,17 +169786,6 @@ public ICollection StaffE // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_staffEducationOrganizationContactAssociationTelephones != null) foreach (var item in _staffEducationOrganizationContactAssociationTelephones) - { - item.StaffEducationOrganizationContactAssociation = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -163337,39 +169793,25 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation)target); + return Entities.Common.EdFi.StaffLeaveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLeave)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffEducationOrganizationContactAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation)target, null); + Entities.Common.EdFi.StaffLeaveMapper.MapTo(this, (Entities.Common.EdFi.IStaffLeave)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffResourceId + Guid? Entities.Common.EdFi.IStaffLeave.StaffResourceId { get { return null; } set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffDiscriminator + string Entities.Common.EdFi.IStaffLeave.StaffDiscriminator { // Not supported for Resources get { return null; } @@ -163399,34 +169841,10 @@ string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffD // ---------------------- // Validate collections // ---------------------- - if (StaffEducationOrganizationContactAssociationTelephones.Any() && mappingContract?.IsMemberSupported("StaffEducationOrganizationContactAssociationTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffEducationOrganizationContactAssociationTelephones"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffEducationOrganizationContactAssociationTelephones, validationContext, validationContext.Items.ForCollection("StaffEducationOrganizationContactAssociationTelephones")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects // --------------------------- - if (StaffEducationOrganizationContactAssociationAddress != null && mappingContract?.IsMemberSupported("StaffEducationOrganizationContactAssociationAddress") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffEducationOrganizationContactAssociationAddress"); - - foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(StaffEducationOrganizationContactAssociationAddress, validationContext, validationContext.Items.ForEmbeddedObject("StaffEducationOrganizationContactAssociationAddress")))) - { - yield return result; - } - } - // --------------------- // Validate Extensions @@ -163468,14 +169886,9 @@ string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffD // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffLeavePutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StaffEducationOrganizationContactAssociation = new FullName("edfi", "StaffEducationOrganizationContactAssociation"); - - // Declare collection item validators - private StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator _staffEducationOrganizationContactAssociationTelephonesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -163488,28 +169901,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StaffEducationOrganizationContactAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StaffEducationOrganizationContactAssociation); - - if (mappingContract != null) - { - if (mappingContract.IsStaffEducationOrganizationContactAssociationTelephoneIncluded != null) - { - var hasInvalidStaffEducationOrganizationContactAssociationTelephonesItems = instance.StaffEducationOrganizationContactAssociationTelephones.Any(x => !mappingContract.IsStaffEducationOrganizationContactAssociationTelephoneIncluded(x)); - - if (hasInvalidStaffEducationOrganizationContactAssociationTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffEducationOrganizationContactAssociationTelephones", $"A supplied 'StaffEducationOrganizationContactAssociationTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -163525,17 +169916,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffEducationOrganizationContactAssociationAddress table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffLeaveEventCategoryDescriptor table of the StaffLeaveEventCategoryDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationAddress : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress, IValidatableObject + public class StaffLeaveEventCategoryDescriptor : Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociationAddress"); + private static FullName _fullName = new FullName("edfi", "StaffLeaveEventCategoryDescriptor"); // Fluent validator instance (threadsafe) - private static StaffEducationOrganizationContactAssociationAddressPutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationAddressPutPostRequestValidator(); + private static StaffLeaveEventCategoryDescriptorPutPostRequestValidator _validator = new StaffLeaveEventCategoryDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -163546,16 +169942,19 @@ public class StaffEducationOrganizationContactAssociationAddress : Entities.Comm // Constructor // ------------------------------------------------------------- - public StaffEducationOrganizationContactAssociationAddress() - { - StaffEducationOrganizationContactAssociationAddressPeriods = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StaffLeaveEventCategoryDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -163566,23 +169965,18 @@ public StaffEducationOrganizationContactAssociationAddress() //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation _staffEducationOrganizationContactAssociation; - - [IgnoreDataMember] - Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducationOrganizationContactAssociationAddress.StaffEducationOrganizationContactAssociation - { - get { return _staffEducationOrganizationContactAssociation; } - set { SetStaffEducationOrganizationContactAssociation(value); } - } - public Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation StaffEducationOrganizationContactAssociation - { - set { SetStaffEducationOrganizationContactAssociation(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int StaffLeaveEventCategoryDescriptorId { get; set; } - private void SetStaffEducationOrganizationContactAssociation(Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation value) + int IDescriptor.DescriptorId { - _staffEducationOrganizationContactAssociation = value; + get { return StaffLeaveEventCategoryDescriptorId; } + set { StaffLeaveEventCategoryDescriptorId = value; } } // ------------------------------------------------------------- @@ -163598,7 +169992,7 @@ private void SetStaffEducationOrganizationContactAssociation(Entities.Common.EdF /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress; + var compareTo = obj as Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -163606,8 +170000,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_staffEducationOrganizationContactAssociation == null || !_staffEducationOrganizationContactAssociation.Equals(compareTo.StaffEducationOrganizationContactAssociation)) + + // Derived Property + if (!(this as Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor).StaffLeaveEventCategoryDescriptorId.Equals(compareTo.StaffLeaveEventCategoryDescriptorId)) return false; @@ -163623,9 +170018,10 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_staffEducationOrganizationContactAssociation != null) - hash.Add(_staffEducationOrganizationContactAssociation); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor).StaffLeaveEventCategoryDescriptorId); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -163633,127 +170029,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The type of address listed for an individual or organization. For example: Physical Address, Mailing Address, Home Address, etc.) - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="addressTypeDescriptor")][DescriptorExists("AddressTypeDescriptor")] - public string AddressTypeDescriptor { get; set; } - - /// - /// The apartment, room, or suite number of an address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="apartmentRoomSuiteNumber")] - public string ApartmentRoomSuiteNumber { get; set; } - - /// - /// The number of the building on the site, if more than one building shares the same address. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="buildingSiteNumber")] - public string BuildingSiteNumber { get; set; } /// - /// The name of the city in which an address is located. + /// A code or abbreviation that is used to refer to the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="city")] - public string City { get; set; } - - /// - /// The congressional district in which an address is located. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="congressionalDistrict")] - public string CongressionalDistrict { get; set; } - - /// - /// The Federal Information Processing Standards (FIPS) numeric code for the county issued by the National Institute of Standards and Technology (NIST). Counties are considered to be the \"first-order subdivisions\" of each State and statistically equivalent entity, regardless of their local designations (county, parish, borough, etc.) Counties in different States will have the same code. A unique county number is created when combined with the 2-digit FIPS State Code. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(5, MinimumLength=3, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="countyFIPSCode")] - public string CountyFIPSCode { get; set; } - - /// - /// An indication that the address should not be published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The geographic latitude of the physical address. + /// The description of the descriptor. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="latitude")] - public string Latitude { get; set; } - - /// - /// A general geographic indicator that categorizes U.S. territory (e.g., City, Suburban). - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="localeDescriptor")][DescriptorExists("LocaleDescriptor")] - public string LocaleDescriptor { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } /// - /// The geographic longitude of the physical address. + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(20, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="longitude")] - public string Longitude { get; set; } + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } /// - /// The name of the county, parish, borough, or comparable unit (within a state) in which an address is located. + /// The end date of the period when the descriptor is in effect. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfCounty")] - public string NameOfCounty { get; set; } + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } /// - /// The five or nine digit zip code or overseas postal code portion of an address. + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(17, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="postalCode")] - public string PostalCode { get; set; } - - /// - /// The abbreviation for the state (within the United States) or outlying area in which an address is located. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="stateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string StateAbbreviationDescriptor { get; set; } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The street number and street name or post office box number of an address. + /// A shortened description for the descriptor. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="streetNumberName")] - public string StreetNumberName { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -163774,64 +170103,33 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddress")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _staffEducationOrganizationContactAssociationAddressPeriods; - private ICollection _staffEducationOrganizationContactAssociationAddressPeriodsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="periods")] - public ICollection StaffEducationOrganizationContactAssociationAddressPeriods - { - get { return _staffEducationOrganizationContactAssociationAddressPeriods; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)e.Item).StaffEducationOrganizationContactAssociationAddress = this); - _staffEducationOrganizationContactAssociationAddressPeriods = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)e.Item).StaffEducationOrganizationContactAssociationAddress = this; - _staffEducationOrganizationContactAssociationAddressPeriodsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress.StaffEducationOrganizationContactAssociationAddressPeriods - { - get { return _staffEducationOrganizationContactAssociationAddressPeriodsCovariant; } - set { StaffEducationOrganizationContactAssociationAddressPeriods = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_staffEducationOrganizationContactAssociationAddressPeriods != null) foreach (var item in _staffEducationOrganizationContactAssociationAddressPeriods) - { - item.StaffEducationOrganizationContactAssociationAddress = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -163839,12 +170137,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress)target); + return Entities.Common.EdFi.StaffLeaveEventCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress)target, null); + Entities.Common.EdFi.StaffLeaveEventCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor)target, null); } // ------------------------------------------------------------- @@ -163852,78 +170150,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - if (StaffEducationOrganizationContactAssociationAddressPeriods.Any() && mappingContract?.IsMemberSupported("StaffEducationOrganizationContactAssociationAddressPeriods") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StaffEducationOrganizationContactAssociationAddressPeriods"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffEducationOrganizationContactAssociationAddressPeriods, validationContext, validationContext.Items.ForCollection("StaffEducationOrganizationContactAssociationAddressPeriods")))) - { - yield return result; - } - } - - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -163931,14 +170157,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationAddressPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffLeaveEventCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StaffEducationOrganizationContactAssociationAddress = new FullName("edfi", "StaffEducationOrganizationContactAssociationAddress"); - - // Declare collection item validators - private StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator _staffEducationOrganizationContactAssociationAddressPeriodsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -163951,28 +170172,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StaffEducationOrganizationContactAssociationAddressMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StaffEducationOrganizationContactAssociationAddress); - - if (mappingContract != null) - { - if (mappingContract.IsStaffEducationOrganizationContactAssociationAddressPeriodIncluded != null) - { - var hasInvalidStaffEducationOrganizationContactAssociationAddressPeriodsItems = instance.StaffEducationOrganizationContactAssociationAddressPeriods.Any(x => !mappingContract.IsStaffEducationOrganizationContactAssociationAddressPeriodIncluded(x)); - - if (hasInvalidStaffEducationOrganizationContactAssociationAddressPeriodsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffEducationOrganizationContactAssociationAddressPeriods", $"A supplied 'StaffEducationOrganizationContactAssociationAddressPeriod' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -163988,304 +170187,152 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffEducationOrganizationContactAssociationAddressPeriod table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. + /// Represents a reference to the StaffProgramAssociation resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationAddressPeriod : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod, IValidatableObject + public class StaffProgramAssociationReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociationAddressPeriod"); - - // Fluent validator instance (threadsafe) - private static StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress _staffEducationOrganizationContactAssociationAddress; + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } - [IgnoreDataMember] - Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress IStaffEducationOrganizationContactAssociationAddressPeriod.StaffEducationOrganizationContactAssociationAddress - { - get { return _staffEducationOrganizationContactAssociationAddress; } - set { SetStaffEducationOrganizationContactAssociationAddress(value); } - } + [DataMember(Name="programName")] + public string ProgramName { get; set; } - public Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress StaffEducationOrganizationContactAssociationAddress - { - set { SetStaffEducationOrganizationContactAssociationAddress(value); } - } + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } - private void SetStaffEducationOrganizationContactAssociationAddress(Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress value) + [DataMember(Name="staffUniqueId")] + public string StaffUniqueId { - _staffEducationOrganizationContactAssociationAddress = value; + get => _staffUniqueId; + set + { + _staffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } } + private string _staffUniqueId; /// - /// The month, day, and year for the start of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Gets or sets the resource identifier of the referenced resource. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + public Guid ResourceId { get; set; } /// - /// Determines equality based on the natural key properties of the resource. + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_staffEducationOrganizationContactAssociationAddress == null || !_staffEducationOrganizationContactAssociationAddress.Equals(compareTo.StaffEducationOrganizationContactAssociationAddress)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod).BeginDate.Equals(compareTo.BeginDate)) - return false; + public string Discriminator { get; set; } - return true; - } + private Link _link; - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + [DataMember(Name="link")] + public Link Link { - var hash = new HashCode(); - //Parent Property - if (_staffEducationOrganizationContactAssociationAddress != null) - hash.Add(_staffEducationOrganizationContactAssociationAddress); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod).BeginDate); + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } - return hash.ToHashCode(); + return _link; + } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- /// - /// The month, day, and year for the end of the period. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddressPeriod")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)target); - } - - void IMappable.Map(object target) + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() { - Entities.Common.EdFi.StaffEducationOrganizationContactAssociationAddressPeriodMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod)target, null); + return BeginDate != default(DateTime) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StaffUniqueId != default(string); } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IResourceReference.GetUndefinedProperties() { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try + if (BeginDate == default) { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- + yield return "BeginDate"; + } - // --------------------------- - // Validate embedded objects - // --------------------------- + if (ProgramEducationOrganizationId == default) + { + yield return "ProgramEducationOrganizationId"; + } - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); + if (ProgramName == default) + { + yield return "ProgramName"; + } - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } + if (ProgramTypeDescriptor == default) + { + yield return "ProgramTypeDescriptor"; } - finally + + if (StaffUniqueId == default) { - // Restore original length - pathBuilder.Length = originalLength; + yield return "StaffUniqueId"; } - // ---------------------------------- - } - } - // ================================================================= - // Validators - // ----------------------------------------------------------------- + } - [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationAddressPeriodPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private Link CreateLink() { - if (context.InstanceToValidate == null) + var link = new Link { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + Rel = "StaffProgramAssociation", + Href = $"/ed-fi/staffProgramAssociations/{ResourceId:n}" + }; - return false; - } + if (string.IsNullOrEmpty(Discriminator)) + return link; - var instance = context.InstanceToValidate; + string[] linkParts = Discriminator.Split('.'); - var failures = new List(); + if (linkParts.Length < 2) + return link; - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - return false; - } + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; - return true; + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } - } - // ----------------------------------------------------------------- + } // Aggregate reference /// - /// A class which represents the edfi.StaffEducationOrganizationContactAssociationTelephone table of the StaffEducationOrganizationContactAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffProgramAssociation table of the StaffProgramAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationTelephone : Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone, IValidatableObject + public class StaffProgramAssociation : Entities.Common.EdFi.IStaffProgramAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationContactAssociationTelephone"); + private static FullName _fullName = new FullName("edfi", "StaffProgramAssociation"); // Fluent validator instance (threadsafe) - private static StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator _validator = new StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator(); + private static StaffProgramAssociationPutPostRequestValidator _validator = new StaffProgramAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -164302,52 +170349,195 @@ public class StaffEducationOrganizationContactAssociationTelephone : Entities.Co // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StaffProgramAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _programReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _programReference; + private Program.EdFi.ProgramReference ImplicitProgramReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programReference == null && !_programReferenceExplicitlyAssigned) + _programReference = new Program.EdFi.ProgramReference(); + + return _programReference; + } + } + + [DataMember(Name="programReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Program.EdFi.ProgramReference ProgramReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramReference != null + && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference; + + return null; + } + set + { + _programReferenceExplicitlyAssigned = true; + _programReference = value; + } + } + private bool _staffReferenceExplicitlyAssigned; + private Staff.EdFi.StaffReference _staffReference; + private Staff.EdFi.StaffReference ImplicitStaffReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_staffReference == null && !_staffReferenceExplicitlyAssigned) + _staffReference = new Staff.EdFi.StaffReference(); + + return _staffReference; + } + } + + [DataMember(Name="staffReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Staff.EdFi.StaffReference StaffReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStaffReference != null + && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference; + + return null; + } + set + { + _staffReferenceExplicitlyAssigned = true; + _staffReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation _staffEducationOrganizationContactAssociation; - [IgnoreDataMember] - Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducationOrganizationContactAssociationTelephone.StaffEducationOrganizationContactAssociation - { - get { return _staffEducationOrganizationContactAssociation; } - set { SetStaffEducationOrganizationContactAssociation(value); } - } + /// + /// Start date for the association of staff to this program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - public Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation StaffEducationOrganizationContactAssociation + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStaffProgramAssociation.ProgramEducationOrganizationId { - set { SetStaffEducationOrganizationContactAssociation(value); } + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.EducationOrganizationId = value; + } } - private void SetStaffEducationOrganizationContactAssociation(Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation value) + /// + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffProgramAssociation.ProgramName { - _staffEducationOrganizationContactAssociation = value; + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.ProgramName = value; + } } /// - /// The telephone number including the area code, and extension, if applicable. + /// The type of program. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(24, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="telephoneNumber")] - public string TelephoneNumber { get; set; } + + // IS in a reference (StaffProgramAssociation.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IStaffProgramAssociation.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramReference.ProgramTypeDescriptor = value; + } + } /// - /// The type of communication number listed for an individual or organization. + /// A unique alphanumeric code assigned to a staff. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="telephoneNumberTypeDescriptor")][DescriptorExists("TelephoneNumberTypeDescriptor")] - public string TelephoneNumberTypeDescriptor { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffProgramAssociation.StaffUniqueId + { + get + { + if (ImplicitStaffReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) + return ImplicitStaffReference.StaffUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Staff + _staffReferenceExplicitlyAssigned = false; + ImplicitStaffReference.StaffUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + } + } // ------------------------------------------------------------- // ============================================================= @@ -164362,7 +170552,7 @@ private void SetStaffEducationOrganizationContactAssociation(Entities.Common.EdF /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone; + var compareTo = obj as Entities.Common.EdFi.IStaffProgramAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -164370,18 +170560,29 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_staffEducationOrganizationContactAssociation == null || !_staffEducationOrganizationContactAssociation.Equals(compareTo.StaffEducationOrganizationContactAssociation)) + + // Standard Property + if (!(this as Entities.Common.EdFi.IStaffProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; - // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumber, compareTo.TelephoneNumber)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumberTypeDescriptor, compareTo.TelephoneNumberTypeDescriptor)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramName, compareTo.ProgramName)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffProgramAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -164397,17 +170598,23 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_staffEducationOrganizationContactAssociation != null) - hash.Add(_staffEducationOrganizationContactAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumber); + hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).BeginDate); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone).TelephoneNumberTypeDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramTypeDescriptor); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -164422,26 +170629,18 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// An indication that the telephone number should not be published. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="doNotPublishIndicator")] - public bool? DoNotPublishIndicator { get; set; } - - /// - /// The order of priority assigned to telephone numbers to define which number to attempt first, second, etc. + /// End date for the association of staff to this program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [Range(1, 2147483647, ErrorMessage=ValidationHelpers.RangeMinOnlyMessageFormat)] - [DataMember(Name="orderOfPriority")] - public int? OrderOfPriority { get; set; } + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } /// - /// An indication that the telephone number is technically capable of sending and receiving Short Message Service (SMS) text messages. + /// Indicator of whether the staff has access to the student records of the program per district interpretation of FERPA and other privacy laws, regulations, and policies. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="textMessageCapabilityIndicator")] - public bool? TextMessageCapabilityIndicator { get; set; } + [DataMember(Name="studentRecordAccess")] + public bool? StudentRecordAccess { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -164462,7 +170661,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationTelephone")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffProgramAssociation", "StaffProgramAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -164474,6 +170673,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -164486,18 +170692,46 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffEducationOrganizationContactAssociationTelephoneMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)target); + return Entities.Common.EdFi.StaffProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffProgramAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffEducationOrganizationContactAssociationTelephoneMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone)target, null); + Entities.Common.EdFi.StaffProgramAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffProgramAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStaffProgramAssociation.ProgramResourceId + { + get { return null; } + set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaffProgramAssociation.ProgramDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStaffProgramAssociation.StaffResourceId + { + get { return null; } + set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStaffProgramAssociation.StaffDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStaffReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -164515,7 +170749,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -164566,9 +170799,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationContactAssociationTelephonePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -164597,25 +170830,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffEducationOrganizationEmploymentAssociation resource. + /// Represents a reference to the StaffSchoolAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationEmploymentAssociationReference : IResourceReference + public class StaffSchoolAssociationReference : IResourceReference { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="employmentStatusDescriptor")][DescriptorExists("EmploymentStatusDescriptor")] - public string EmploymentStatusDescriptor { get; set; } + [DataMember(Name="programAssignmentDescriptor")][DescriptorExists("ProgramAssignmentDescriptor")] + public string ProgramAssignmentDescriptor { get; set; } - [DataMember(Name="hireDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime HireDate { get; set; } + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } [DataMember(Name="staffUniqueId")] public string StaffUniqueId @@ -164665,24 +170895,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EducationOrganizationId != default(long) && EmploymentStatusDescriptor != default(string) && HireDate != default(DateTime) && StaffUniqueId != default(string); + return ProgramAssignmentDescriptor != default(string) && SchoolId != default(long) && StaffUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (EmploymentStatusDescriptor == default) + if (ProgramAssignmentDescriptor == default) { - yield return "EmploymentStatusDescriptor"; + yield return "ProgramAssignmentDescriptor"; } - if (HireDate == default) + if (SchoolId == default) { - yield return "HireDate"; + yield return "SchoolId"; } if (StaffUniqueId == default) @@ -164696,8 +170921,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StaffEducationOrganizationEmploymentAssociation", - Href = $"/ed-fi/staffEducationOrganizationEmploymentAssociations/{ResourceId:n}" + Rel = "StaffSchoolAssociation", + Href = $"/ed-fi/staffSchoolAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -164724,16 +170949,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StaffEducationOrganizationEmploymentAssociation table of the StaffEducationOrganizationEmploymentAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffSchoolAssociation table of the StaffSchoolAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationEmploymentAssociation : Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StaffSchoolAssociation : Entities.Common.EdFi.IStaffSchoolAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffEducationOrganizationEmploymentAssociation"); + private static FullName _fullName = new FullName("edfi", "StaffSchoolAssociation"); // Fluent validator instance (threadsafe) - private static StaffEducationOrganizationEmploymentAssociationPutPostRequestValidator _validator = new StaffEducationOrganizationEmploymentAssociationPutPostRequestValidator(); + private static StaffSchoolAssociationPutPostRequestValidator _validator = new StaffSchoolAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -164744,6 +170969,11 @@ public class StaffEducationOrganizationEmploymentAssociation : Entities.Common.E // Constructor // ------------------------------------------------------------- + public StaffSchoolAssociation() + { + StaffSchoolAssociationAcademicSubjects = new List(); + StaffSchoolAssociationGradeLevels = new List(); + } // ------------------------------------------------------------ @@ -164752,7 +170982,7 @@ public class StaffEducationOrganizationEmploymentAssociation : Entities.Common.E // ------------------------------------------------------------ /// - /// The unique identifier for the StaffEducationOrganizationEmploymentAssociation resource. + /// The unique identifier for the StaffSchoolAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -164763,70 +170993,103 @@ public class StaffEducationOrganizationEmploymentAssociation : Entities.Common.E // References // ------------------------------------------------------------- - private bool _credentialReferenceExplicitlyAssigned; - private Credential.EdFi.CredentialReference _credentialReference; - private Credential.EdFi.CredentialReference ImplicitCredentialReference + private bool _calendarReferenceExplicitlyAssigned; + private Calendar.EdFi.CalendarReference _calendarReference; + private Calendar.EdFi.CalendarReference ImplicitCalendarReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_credentialReference == null && !_credentialReferenceExplicitlyAssigned) - _credentialReference = new Credential.EdFi.CredentialReference(); + if (_calendarReference == null && !_calendarReferenceExplicitlyAssigned) + _calendarReference = new Calendar.EdFi.CalendarReference(); - return _credentialReference; + return _calendarReference; } } - [DataMember(Name="credentialReference")] + [DataMember(Name="calendarReference")] [FullyDefinedReference] - public Credential.EdFi.CredentialReference CredentialReference + public Calendar.EdFi.CalendarReference CalendarReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCredentialReference != null - && (_credentialReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) - return ImplicitCredentialReference; + if (ImplicitCalendarReference != null + && (_calendarReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) + return ImplicitCalendarReference; return null; } set { - _credentialReferenceExplicitlyAssigned = true; - _credentialReference = value; + _calendarReferenceExplicitlyAssigned = true; + _calendarReference = value; } } - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); - return _educationOrganizationReference; + return _schoolReference; } } - [DataMember(Name="educationOrganizationReference")] + [DataMember(Name="schoolReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + public School.EdFi.SchoolReference SchoolReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; return null; } set { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } + } + private bool _schoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) + _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + + return _schoolYearTypeReference; + } + } + + [DataMember(Name="schoolYearTypeReference")] + [FullyDefinedReference] + public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolYearTypeReference != null + && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference; + + return null; + } + set + { + _schoolYearTypeReferenceExplicitlyAssigned = true; + _schoolYearTypeReference = value; } } private bool _staffReferenceExplicitlyAssigned; @@ -164869,16 +171132,25 @@ public Staff.EdFi.StaffReference StaffReference // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. + /// The name of the program for which the individual is assigned. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="programAssignmentDescriptor")][DescriptorExists("ProgramAssignmentDescriptor")] + public string ProgramAssignmentDescriptor { get; set; } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.EducationOrganizationId + long Entities.Common.EdFi.IStaffSchoolAssociation.SchoolId { get { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; return default(long); } @@ -164887,34 +171159,21 @@ long Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Educa // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; + // Calendar + _calendarReferenceExplicitlyAssigned = false; + ImplicitCalendarReference.SchoolId = value; + + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; } } - /// - /// Reflects the type of employment or contract. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="employmentStatusDescriptor")][DescriptorExists("EmploymentStatusDescriptor")] - public string EmploymentStatusDescriptor { get; set; } - - /// - /// The month, day, and year on which an individual was hired for a position. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="hireDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime HireDate { get; set; } - /// /// A unique alphanumeric code assigned to a staff. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StaffUniqueId + string Entities.Common.EdFi.IStaffSchoolAssociation.StaffUniqueId { get { @@ -164949,7 +171208,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Sta /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation; + var compareTo = obj as Entities.Common.EdFi.IStaffSchoolAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -164958,23 +171217,18 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EmploymentStatusDescriptor, compareTo.EmploymentStatusDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociation).ProgramAssignmentDescriptor, compareTo.ProgramAssignmentDescriptor)) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).HireDate.Equals(compareTo.HireDate)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStaffSchoolAssociation).SchoolId.Equals(compareTo.SchoolId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -164991,19 +171245,15 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EducationOrganizationId); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).EmploymentStatusDescriptor); - + hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociation).ProgramAssignmentDescriptor); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).HireDate); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociation).SchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -165018,25 +171268,17 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Annual wage associated with the employment position being reported. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="annualWage")] - public decimal? AnnualWage { get; set; } - - /// - /// Identifier or serial number assigned to the credential. + /// The identifier for the calendar. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.CredentialIdentifier + string Entities.Common.EdFi.IStaffSchoolAssociation.CalendarCode { get { - if (ImplicitCredentialReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + if (ImplicitCalendarReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) { - return ImplicitCredentialReference.CredentialIdentifier; + return ImplicitCalendarReference.CalendarCode; } return default(string); @@ -165046,87 +171288,46 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Cre // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Credential - _credentialReferenceExplicitlyAssigned = false; - ImplicitCredentialReference.CredentialIdentifier = value; + // Calendar + _calendarReferenceExplicitlyAssigned = false; + ImplicitCalendarReference.CalendarCode = value; } } /// - /// The department or suborganization the employee/contractor is associated with in the education organization. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="department")] - public string Department { get; set; } - - /// - /// The month, day, and year on which a contract between an individual and a governing authority ends or is terminated under the provisions of the contract (or the date on which the agreement is made invalid). Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } - - /// - /// The ratio between the hours of work expected in a position and the hours of work normally expected in a full-time position in the same setting. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="fullTimeEquivalency")] - public decimal? FullTimeEquivalency { get; set; } - - /// - /// Hourly wage associated with the employment position being reported. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="hourlyWage")] - public decimal? HourlyWage { get; set; } - - /// - /// Date at which the staff member was made an official offer for this employment. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="offerDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? OfferDate { get; set; } - - /// - /// Type of employment separation. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="separationDescriptor")][DescriptorExists("SeparationDescriptor")] - public string SeparationDescriptor { get; set; } - - /// - /// Reason for terminating the employment. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="separationReasonDescriptor")][DescriptorExists("SeparationReasonDescriptor")] - public string SeparationReasonDescriptor { get; set; } - - /// - /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which a license/credential was issued. + /// Identifier for a school year. /// - - // IS in a reference (StaffEducationOrganizationEmploymentAssociation.StateOfIssueStateAbbreviationDescriptorId), IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StateOfIssueStateAbbreviationDescriptor + // IS in a reference, NOT a lookup column + short? Entities.Common.EdFi.IStaffSchoolAssociation.SchoolYear { get { - if (ImplicitCredentialReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCredentialReference.IsReferenceFullyDefined())) + if (ImplicitCalendarReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) { - return ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor; + return ImplicitCalendarReference.SchoolYear; } - return null; + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + { + return ImplicitSchoolYearTypeReference.SchoolYear; + } + + return default(short?); } set { - ImplicitCredentialReference.StateOfIssueStateAbbreviationDescriptor = value; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Calendar + _calendarReferenceExplicitlyAssigned = false; + ImplicitCalendarReference.SchoolYear = value.GetValueOrDefault(); + + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); } } // ------------------------------------------------------------- @@ -165149,13 +171350,73 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Sta // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffEducationOrganizationEmploymentAssociation", "StaffEducationOrganizationEmploymentAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSchoolAssociation", "StaffSchoolAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _staffSchoolAssociationAcademicSubjects; + private ICollection _staffSchoolAssociationAcademicSubjectsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="academicSubjects")] + public ICollection StaffSchoolAssociationAcademicSubjects + { + get { return _staffSchoolAssociationAcademicSubjects; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)e.Item).StaffSchoolAssociation = this); + _staffSchoolAssociationAcademicSubjects = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)e.Item).StaffSchoolAssociation = this; + _staffSchoolAssociationAcademicSubjectsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaffSchoolAssociation.StaffSchoolAssociationAcademicSubjects + { + get { return _staffSchoolAssociationAcademicSubjectsCovariant; } + set { StaffSchoolAssociationAcademicSubjects = new List(value.Cast()); } + } + + private ICollection _staffSchoolAssociationGradeLevels; + private ICollection _staffSchoolAssociationGradeLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="gradeLevels")] + public ICollection StaffSchoolAssociationGradeLevels + { + get { return _staffSchoolAssociationGradeLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)e.Item).StaffSchoolAssociation = this); + _staffSchoolAssociationGradeLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)e.Item).StaffSchoolAssociation = this; + _staffSchoolAssociationGradeLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStaffSchoolAssociation.StaffSchoolAssociationGradeLevels + { + get { return _staffSchoolAssociationGradeLevelsCovariant; } + set { StaffSchoolAssociationGradeLevels = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -165173,6 +171434,22 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Sta // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_staffSchoolAssociationAcademicSubjects != null) foreach (var item in _staffSchoolAssociationAcademicSubjects) + { + item.StaffSchoolAssociation = this; + } + + if (_staffSchoolAssociationGradeLevels != null) foreach (var item in _staffSchoolAssociationGradeLevels) + { + item.StaffSchoolAssociation = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -165180,53 +171457,53 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Sta // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffEducationOrganizationEmploymentAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation)target); + return Entities.Common.EdFi.StaffSchoolAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSchoolAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffEducationOrganizationEmploymentAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation)target, null); + Entities.Common.EdFi.StaffSchoolAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffSchoolAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.CredentialResourceId + Guid? Entities.Common.EdFi.IStaffSchoolAssociation.CalendarResourceId { get { return null; } - set { ImplicitCredentialReference.ResourceId = value ?? default(Guid); } + set { ImplicitCalendarReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.CredentialDiscriminator + string Entities.Common.EdFi.IStaffSchoolAssociation.CalendarDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitCredentialReference.Discriminator = value; } + set { ImplicitCalendarReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IStaffSchoolAssociation.SchoolResourceId { get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.EducationOrganizationDiscriminator + + Guid? Entities.Common.EdFi.IStaffSchoolAssociation.SchoolYearTypeResourceId { - // Not supported for Resources get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } + set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } } - Guid? Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StaffResourceId + Guid? Entities.Common.EdFi.IStaffSchoolAssociation.StaffResourceId { get { return null; } set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.StaffDiscriminator + string Entities.Common.EdFi.IStaffSchoolAssociation.StaffDiscriminator { // Not supported for Resources get { return null; } @@ -165256,6 +171533,30 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Sta // ---------------------- // Validate collections // ---------------------- + if (StaffSchoolAssociationAcademicSubjects.Any() && mappingContract?.IsMemberSupported("StaffSchoolAssociationAcademicSubjects") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffSchoolAssociationAcademicSubjects"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffSchoolAssociationAcademicSubjects, validationContext, validationContext.Items.ForCollection("StaffSchoolAssociationAcademicSubjects")))) + { + yield return result; + } + } + + if (StaffSchoolAssociationGradeLevels.Any() && mappingContract?.IsMemberSupported("StaffSchoolAssociationGradeLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StaffSchoolAssociationGradeLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffSchoolAssociationGradeLevels, validationContext, validationContext.Items.ForCollection("StaffSchoolAssociationGradeLevels")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -165275,6 +171576,77 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Sta yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from other references + var valueFromSchoolReference = this.SchoolReference?.SchoolId; + + if (valueFromSchoolReference != null) + { + yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); + } + + // Obtain value from other references + var valueFromCalendarReference = this.CalendarReference?.SchoolId; + + if (valueFromCalendarReference != null) + { + yield return ("calendarReference.schoolId", this.CalendarReference.SchoolId); + } + + } + var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); + + if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, short value)> GetSchoolYearSources() + { + // Obtain value from other references + var valueFromCalendarReference = this.CalendarReference?.SchoolYear; + + if (valueFromCalendarReference != null) + { + yield return ("calendarReference.schoolYear", this.CalendarReference.SchoolYear); + } + + // Obtain value from other references + var valueFromSchoolYearTypeReference = this.SchoolYearTypeReference?.SchoolYear; + + if (valueFromSchoolYearTypeReference != null) + { + yield return ("schoolYearTypeReference.schoolYear", this.SchoolYearTypeReference.SchoolYear); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -165301,280 +171673,15 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Sta // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffEducationOrganizationEmploymentAssociationPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: StaffIdentificationSystemDescriptor - -namespace EdFi.Ods.Api.Common.Models.Resources.StaffIdentificationSystemDescriptor.EdFi -{ - /// - /// A class which represents the edfi.StaffIdentificationSystemDescriptor table of the StaffIdentificationSystemDescriptor aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class StaffIdentificationSystemDescriptor : Entities.Common.EdFi.IStaffIdentificationSystemDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class StaffSchoolAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static FullName _fullName = new FullName("edfi", "StaffIdentificationSystemDescriptor"); - - // Fluent validator instance (threadsafe) - private static StaffIdentificationSystemDescriptorPutPostRequestValidator _validator = new StaffIdentificationSystemDescriptorPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - - /// - /// The unique identifier for the StaffIdentificationSystemDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int StaffIdentificationSystemDescriptorId { get; set; } - - int IDescriptor.DescriptorId - { - get { return StaffIdentificationSystemDescriptorId; } - set { StaffIdentificationSystemDescriptorId = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IStaffIdentificationSystemDescriptor; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - - // Derived Property - if (!(this as Entities.Common.EdFi.IStaffIdentificationSystemDescriptor).StaffIdentificationSystemDescriptorId.Equals(compareTo.StaffIdentificationSystemDescriptorId)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - - //Derived Property - hash.Add((this as Entities.Common.EdFi.IStaffIdentificationSystemDescriptor).StaffIdentificationSystemDescriptorId); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.StaffIdentificationSystemDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffIdentificationSystemDescriptor)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.StaffIdentificationSystemDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStaffIdentificationSystemDescriptor)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - } + private static readonly FullName _fullName_edfi_StaffSchoolAssociation = new FullName("edfi", "StaffSchoolAssociation"); - // ================================================================= - // Validators - // ----------------------------------------------------------------- + // Declare collection item validators + private StaffSchoolAssociationAcademicSubjectPutPostRequestValidator _staffSchoolAssociationAcademicSubjectsValidator = new (); + private StaffSchoolAssociationGradeLevelPutPostRequestValidator _staffSchoolAssociationGradeLevelsValidator = new (); - [ExcludeFromCodeCoverage] - public class StaffIdentificationSystemDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -165587,151 +171694,65 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: StaffLeave - -namespace EdFi.Ods.Api.Common.Models.Resources.StaffLeave.EdFi -{ - /// - /// Represents a reference to the StaffLeave resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class StaffLeaveReference : IResourceReference - { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - [DataMember(Name="staffLeaveEventCategoryDescriptor")][DescriptorExists("StaffLeaveEventCategoryDescriptor")] - public string StaffLeaveEventCategoryDescriptor { get; set; } - - [DataMember(Name="staffUniqueId")] - public string StaffUniqueId - { - get => _staffUniqueId; - set - { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } - private string _staffUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return BeginDate != default(DateTime) && StaffLeaveEventCategoryDescriptor != default(string) && StaffUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (BeginDate == default) - { - yield return "BeginDate"; - } - - if (StaffLeaveEventCategoryDescriptor == default) - { - yield return "StaffLeaveEventCategoryDescriptor"; - } - - if (StaffUniqueId == default) - { - yield return "StaffUniqueId"; - } + // Profile-based collection item filter validation + string profileName = null; - } + // Get the current mapping contract + var mappingContract = (StaffSchoolAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StaffSchoolAssociation); - private Link CreateLink() - { - var link = new Link + if (mappingContract != null) { - Rel = "StaffLeave", - Href = $"/ed-fi/staffLeaves/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; + if (mappingContract.IsStaffSchoolAssociationAcademicSubjectIncluded != null) + { + var hasInvalidStaffSchoolAssociationAcademicSubjectsItems = instance.StaffSchoolAssociationAcademicSubjects.Any(x => !mappingContract.IsStaffSchoolAssociationAcademicSubjectIncluded(x)); + + if (hasInvalidStaffSchoolAssociationAcademicSubjectsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffSchoolAssociationAcademicSubjects", $"A supplied 'StaffSchoolAssociationAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } - string[] linkParts = Discriminator.Split('.'); + if (mappingContract.IsStaffSchoolAssociationGradeLevelIncluded != null) + { + var hasInvalidStaffSchoolAssociationGradeLevelsItems = instance.StaffSchoolAssociationGradeLevels.Any(x => !mappingContract.IsStaffSchoolAssociationGradeLevelIncluded(x)); + + if (hasInvalidStaffSchoolAssociationGradeLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StaffSchoolAssociationGradeLevels", $"A supplied 'StaffSchoolAssociationGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } - if (linkParts.Length < 2) - return link; + } - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + return false; + } - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.StaffLeave table of the StaffLeave aggregate in the ODS Database. + /// A class which represents the edfi.StaffSchoolAssociationAcademicSubject table of the StaffSchoolAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffLeave : Entities.Common.EdFi.IStaffLeave, IHasETag, IDateVersionedEntity, IValidatableObject + public class StaffSchoolAssociationAcademicSubject : Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffLeave"); + private static FullName _fullName = new FullName("edfi", "StaffSchoolAssociationAcademicSubject"); // Fluent validator instance (threadsafe) - private static StaffLeavePutPostRequestValidator _validator = new StaffLeavePutPostRequestValidator(); + private static StaffSchoolAssociationAcademicSubjectPutPostRequestValidator _validator = new StaffSchoolAssociationAcademicSubjectPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -165748,100 +171769,43 @@ public class StaffLeave : Entities.Common.EdFi.IStaffLeave, IHasETag, IDateVersi // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StaffLeave resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaffSchoolAssociation _staffSchoolAssociation; - return _staffReference; - } + [IgnoreDataMember] + Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationAcademicSubject.StaffSchoolAssociation + { + get { return _staffSchoolAssociation; } + set { SetStaffSchoolAssociation(value); } } - [DataMember(Name="staffReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference + public Entities.Common.EdFi.IStaffSchoolAssociation StaffSchoolAssociation { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; - - return null; - } - set - { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; - } + set { SetStaffSchoolAssociation(value); } } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - /// - /// The begin date of the staff leave. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + private void SetStaffSchoolAssociation(Entities.Common.EdFi.IStaffSchoolAssociation value) + { + _staffSchoolAssociation = value; + } /// - /// The code describing the type of leave taken. + /// The academic subjects the individual is eligible to teach. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="staffLeaveEventCategoryDescriptor")][DescriptorExists("StaffLeaveEventCategoryDescriptor")] - public string StaffLeaveEventCategoryDescriptor { get; set; } - - /// - /// A unique alphanumeric code assigned to a staff. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffLeave.StaffUniqueId - { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } + [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] + public string AcademicSubjectDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -165856,7 +171820,7 @@ string Entities.Common.EdFi.IStaffLeave.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffLeave; + var compareTo = obj as Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject; if (ReferenceEquals(this, compareTo)) return true; @@ -165864,19 +171828,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.IStaffLeave).BeginDate.Equals(compareTo.BeginDate)) + // Parent Property + if (_staffSchoolAssociation == null || !_staffSchoolAssociation.Equals(compareTo.StaffSchoolAssociation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffLeave).StaffLeaveEventCategoryDescriptor, compareTo.StaffLeaveEventCategoryDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffLeave).StaffUniqueId, compareTo.StaffUniqueId)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) return false; @@ -165892,17 +171850,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_staffSchoolAssociation != null) + hash.Add(_staffSchoolAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffLeave).BeginDate); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffLeave).StaffLeaveEventCategoryDescriptor); - + hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject).AcademicSubjectDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffLeave).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -165915,28 +171869,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The end date of the staff leave. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } - - /// - /// Expanded reason for the staff leave. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(40, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="reason")] - public string Reason { get; set; } - - /// - /// Indicator of whether a substitute was assigned during the period of staff leave. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="substituteAssigned")] - public bool? SubstituteAssigned { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -165957,7 +171889,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffLeave", "StaffLeave")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSchoolAssociation", "StaffSchoolAssociationAcademicSubject")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -165969,13 +171901,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -165988,32 +171913,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffLeaveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLeave)target); + return Entities.Common.EdFi.StaffSchoolAssociationAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffLeaveMapper.MapTo(this, (Entities.Common.EdFi.IStaffLeave)target, null); + Entities.Common.EdFi.StaffSchoolAssociationAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffLeave.StaffResourceId - { - get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffLeave.StaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStaffReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -166031,6 +171942,7 @@ string Entities.Common.EdFi.IStaffLeave.StaffDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -166081,9 +171993,9 @@ string Entities.Common.EdFi.IStaffLeave.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffLeavePutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffSchoolAssociationAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -166111,22 +172023,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffLeaveEventCategoryDescriptor table of the StaffLeaveEventCategoryDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.StaffSchoolAssociationGradeLevel table of the StaffSchoolAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffLeaveEventCategoryDescriptor : Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class StaffSchoolAssociationGradeLevel : Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffLeaveEventCategoryDescriptor"); + private static FullName _fullName = new FullName("edfi", "StaffSchoolAssociationGradeLevel"); // Fluent validator instance (threadsafe) - private static StaffLeaveEventCategoryDescriptorPutPostRequestValidator _validator = new StaffLeaveEventCategoryDescriptorPutPostRequestValidator(); + private static StaffSchoolAssociationGradeLevelPutPostRequestValidator _validator = new StaffSchoolAssociationGradeLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -166143,13 +172050,6 @@ public class StaffLeaveEventCategoryDescriptor : Entities.Common.EdFi.IStaffLeav // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StaffLeaveEventCategoryDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -166160,19 +172060,33 @@ public class StaffLeaveEventCategoryDescriptor : Entities.Common.EdFi.IStaffLeav //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IStaffSchoolAssociation _staffSchoolAssociation; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int StaffLeaveEventCategoryDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationGradeLevel.StaffSchoolAssociation + { + get { return _staffSchoolAssociation; } + set { SetStaffSchoolAssociation(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IStaffSchoolAssociation StaffSchoolAssociation { - get { return StaffLeaveEventCategoryDescriptorId; } - set { StaffLeaveEventCategoryDescriptorId = value; } + set { SetStaffSchoolAssociation(value); } + } + + private void SetStaffSchoolAssociation(Entities.Common.EdFi.IStaffSchoolAssociation value) + { + _staffSchoolAssociation = value; } + + /// + /// The grade levels the individual is eligible to teach. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string GradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -166187,7 +172101,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor; + var compareTo = obj as Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -166195,9 +172109,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_staffSchoolAssociation == null || !_staffSchoolAssociation.Equals(compareTo.StaffSchoolAssociation)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor).StaffLeaveEventCategoryDescriptorId.Equals(compareTo.StaffLeaveEventCategoryDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) return false; @@ -166213,9 +172131,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_staffSchoolAssociation != null) + hash.Add(_staffSchoolAssociation); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor).StaffLeaveEventCategoryDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel).GradeLevelDescriptor); return hash.ToHashCode(); } @@ -166224,55 +172145,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -166298,11 +172170,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSchoolAssociation", "StaffSchoolAssociationGradeLevel")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -166313,13 +172182,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -166332,12 +172194,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffLeaveEventCategoryDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor)target); + return Entities.Common.EdFi.StaffSchoolAssociationGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffLeaveEventCategoryDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor)target, null); + Entities.Common.EdFi.StaffSchoolAssociationGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)target, null); } // ------------------------------------------------------------- @@ -166345,6 +172207,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -166352,9 +172274,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffLeaveEventCategoryDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class StaffSchoolAssociationGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -166383,28 +172305,34 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffProgramAssociation resource. + /// Represents a reference to the StaffSectionAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffProgramAssociationReference : IResourceReference + public class StaffSectionAssociationReference : IResourceReference { [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] public DateTime BeginDate { get; set; } - [DataMember(Name="programEducationOrganizationId")] - public long ProgramEducationOrganizationId { get; set; } + [DataMember(Name="localCourseCode")] + public string LocalCourseCode { get; set; } - [DataMember(Name="programName")] - public string ProgramName { get; set; } + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + + [DataMember(Name="sectionIdentifier")] + public string SectionIdentifier { get; set; } + + [DataMember(Name="sessionName")] + public string SessionName { get; set; } [DataMember(Name="staffUniqueId")] public string StaffUniqueId @@ -166454,7 +172382,7 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BeginDate != default(DateTime) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StaffUniqueId != default(string); + return BeginDate != default(DateTime) && LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string) && StaffUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() @@ -166464,19 +172392,29 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "BeginDate"; } - if (ProgramEducationOrganizationId == default) + if (LocalCourseCode == default) { - yield return "ProgramEducationOrganizationId"; + yield return "LocalCourseCode"; } - if (ProgramName == default) + if (SchoolId == default) { - yield return "ProgramName"; + yield return "SchoolId"; } - if (ProgramTypeDescriptor == default) + if (SchoolYear == default) { - yield return "ProgramTypeDescriptor"; + yield return "SchoolYear"; + } + + if (SectionIdentifier == default) + { + yield return "SectionIdentifier"; + } + + if (SessionName == default) + { + yield return "SessionName"; } if (StaffUniqueId == default) @@ -166490,8 +172428,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StaffProgramAssociation", - Href = $"/ed-fi/staffProgramAssociations/{ResourceId:n}" + Rel = "StaffSectionAssociation", + Href = $"/ed-fi/staffSectionAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -166518,16 +172456,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StaffProgramAssociation table of the StaffProgramAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StaffSectionAssociation table of the StaffSectionAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffProgramAssociation : Entities.Common.EdFi.IStaffProgramAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StaffSectionAssociation : Entities.Common.EdFi.IStaffSectionAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffProgramAssociation"); + private static FullName _fullName = new FullName("edfi", "StaffSectionAssociation"); // Fluent validator instance (threadsafe) - private static StaffProgramAssociationPutPostRequestValidator _validator = new StaffProgramAssociationPutPostRequestValidator(); + private static StaffSectionAssociationPutPostRequestValidator _validator = new StaffSectionAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -166546,7 +172484,7 @@ public class StaffProgramAssociation : Entities.Common.EdFi.IStaffProgramAssocia // ------------------------------------------------------------ /// - /// The unique identifier for the StaffProgramAssociation resource. + /// The unique identifier for the StaffSectionAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -166557,37 +172495,37 @@ public class StaffProgramAssociation : Entities.Common.EdFi.IStaffProgramAssocia // References // ------------------------------------------------------------- - private bool _programReferenceExplicitlyAssigned; - private Program.EdFi.ProgramReference _programReference; - private Program.EdFi.ProgramReference ImplicitProgramReference + private bool _sectionReferenceExplicitlyAssigned; + private Section.EdFi.SectionReference _sectionReference; + private Section.EdFi.SectionReference ImplicitSectionReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programReference == null && !_programReferenceExplicitlyAssigned) - _programReference = new Program.EdFi.ProgramReference(); + if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) + _sectionReference = new Section.EdFi.SectionReference(); - return _programReference; + return _sectionReference; } } - [DataMember(Name="programReference")] + [DataMember(Name="sectionReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Program.EdFi.ProgramReference ProgramReference + public Section.EdFi.SectionReference SectionReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramReference != null - && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference; + if (ImplicitSectionReference != null + && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference; return null; } set { - _programReferenceExplicitlyAssigned = true; - _programReference = value; + _sectionReferenceExplicitlyAssigned = true; + _sectionReference = value; } } private bool _staffReferenceExplicitlyAssigned; @@ -166630,7 +172568,7 @@ public Staff.EdFi.StaffReference StaffReference // ------------------------------------------------------------- /// - /// Start date for the association of staff to this program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Month, day, and year of a teacher's assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] @@ -166638,16 +172576,41 @@ public Staff.EdFi.StaffReference StaffReference public DateTime BeginDate { get; set; } /// - /// The identifier assigned to an education organization. + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffProgramAssociation.ProgramEducationOrganizationId + string Entities.Common.EdFi.IStaffSectionAssociation.LocalCourseCode { get { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.EducationOrganizationId; + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.LocalCourseCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.LocalCourseCode = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStaffSectionAssociation.SchoolId + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SchoolId; return default(long); } @@ -166656,55 +172619,84 @@ long Entities.Common.EdFi.IStaffProgramAssociation.ProgramEducationOrganizationI // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.EducationOrganizationId = value; + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolId = value; } } /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// The identifier for the school year. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffProgramAssociation.ProgramName + short Entities.Common.EdFi.IStaffSectionAssociation.SchoolYear { get { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramName; + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SchoolYear; - return default(string); + return default(short); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.ProgramName = value; + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolYear = value; } } /// - /// The type of program. + /// The local identifier assigned to a section. /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffSectionAssociation.SectionIdentifier + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SectionIdentifier; - // IS in a reference (StaffProgramAssociation.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IStaffProgramAssociation.ProgramTypeDescriptor + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SectionIdentifier = value; + } + } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStaffSectionAssociation.SessionName { get { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramTypeDescriptor; + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SessionName; - return null; + return default(string); } set { - ImplicitProgramReference.ProgramTypeDescriptor = value; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SessionName = value; } } @@ -166712,7 +172704,7 @@ string Entities.Common.EdFi.IStaffProgramAssociation.ProgramTypeDescriptor /// A unique alphanumeric code assigned to a staff. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffProgramAssociation.StaffUniqueId + string Entities.Common.EdFi.IStaffSectionAssociation.StaffUniqueId { get { @@ -166747,7 +172739,7 @@ string Entities.Common.EdFi.IStaffProgramAssociation.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffProgramAssociation; + var compareTo = obj as Entities.Common.EdFi.IStaffSectionAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -166757,27 +172749,37 @@ public override bool Equals(object obj) // Standard Property - if (!(this as Entities.Common.EdFi.IStaffProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) + if (!(this as Entities.Common.EdFi.IStaffSectionAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).LocalCourseCode, compareTo.LocalCourseCode)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramName, compareTo.ProgramName)) + if (!(this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolId.Equals(compareTo.SchoolId)) return false; - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolYear.Equals(compareTo.SchoolYear)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffProgramAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).SectionIdentifier, compareTo.SectionIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).SessionName, compareTo.SessionName)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).StaffUniqueId, compareTo.StaffUniqueId)) return false; @@ -166795,21 +172797,26 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).BeginDate); + hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).BeginDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramEducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).LocalCourseCode); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramName); + hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolId); - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).ProgramTypeDescriptor); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolYear); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SectionIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffProgramAssociation).StaffUniqueId); + hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SessionName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -166824,18 +172831,42 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// End date for the association of staff to this program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The type of position the staff member holds in the specific class/section. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="classroomPositionDescriptor")][DescriptorExists("ClassroomPositionDescriptor")] + public string ClassroomPositionDescriptor { get; set; } + + /// + /// Month, day, and year of the last day of a staff member's assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] public DateTime? EndDate { get; set; } /// - /// Indicator of whether the staff has access to the student records of the program per district interpretation of FERPA and other privacy laws, regulations, and policies. + /// An indication of whether a teacher is classified as highly qualified for his/her assignment according to state definition. This attribute indicates the teacher is highly qualified for this section being taught. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="studentRecordAccess")] - public bool? StudentRecordAccess { get; set; } + [DataMember(Name="highlyQualifiedTeacher")] + public bool? HighlyQualifiedTeacher { get; set; } + + /// + /// Indicates the percentage of the total scheduled course time, academic standards, and/or learning activities delivered in this section by this staff member. A teacher of record designation may be based solely or partially on this contribution percentage. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="percentageContribution")] + public decimal? PercentageContribution { get; set; } + + /// + /// Indicates that the entire section is excluded from calculation of value-added or growth attribution calculations used for a particular teacher evaluation. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="teacherStudentDataLinkExclusion")] + public bool? TeacherStudentDataLinkExclusion { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -166856,7 +172887,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffProgramAssociation", "StaffProgramAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSectionAssociation", "StaffSectionAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -166887,39 +172918,39 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffProgramAssociation)target); + return Entities.Common.EdFi.StaffSectionAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSectionAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffProgramAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffProgramAssociation)target, null); + Entities.Common.EdFi.StaffSectionAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffSectionAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffProgramAssociation.ProgramResourceId + Guid? Entities.Common.EdFi.IStaffSectionAssociation.SectionResourceId { get { return null; } - set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } + set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffProgramAssociation.ProgramDiscriminator + string Entities.Common.EdFi.IStaffSectionAssociation.SectionDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitProgramReference.Discriminator = value; } + set { ImplicitSectionReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IStaffProgramAssociation.StaffResourceId + Guid? Entities.Common.EdFi.IStaffSectionAssociation.StaffResourceId { get { return null; } set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStaffProgramAssociation.StaffDiscriminator + string Entities.Common.EdFi.IStaffSectionAssociation.StaffDiscriminator { // Not supported for Resources get { return null; } @@ -166927,66 +172958,337 @@ string Entities.Common.EdFi.IStaffProgramAssociation.StaffDiscriminator } - // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StaffSectionAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: StateAbbreviationDescriptor + +namespace EdFi.Ods.Api.Common.Models.Resources.StateAbbreviationDescriptor.EdFi +{ + /// + /// A class which represents the edfi.StateAbbreviationDescriptor table of the StateAbbreviationDescriptor aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StateAbbreviationDescriptor : Entities.Common.EdFi.IStateAbbreviationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + { + private static FullName _fullName = new FullName("edfi", "StateAbbreviationDescriptor"); + + // Fluent validator instance (threadsafe) + private static StateAbbreviationDescriptorPutPostRequestValidator _validator = new StateAbbreviationDescriptorPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the StateAbbreviationDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int StateAbbreviationDescriptorId { get; set; } + + int IDescriptor.DescriptorId + { + get { return StateAbbreviationDescriptorId; } + set { StateAbbreviationDescriptorId = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStateAbbreviationDescriptor; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Derived Property + if (!(this as Entities.Common.EdFi.IStateAbbreviationDescriptor).StateAbbreviationDescriptorId.Equals(compareTo.StateAbbreviationDescriptorId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Derived Property + hash.Add((this as Entities.Common.EdFi.IStateAbbreviationDescriptor).StateAbbreviationDescriptorId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } + + /// + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + /// + /// A shortened description for the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - int dotLength = pathBuilder.Length; + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } - // ---------------------- - // Validate collections - // ---------------------- + // ------------------------------------------------------------- - // --------------------------- - // Validate embedded objects - // --------------------------- + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StateAbbreviationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateAbbreviationDescriptor)target); + } - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- + void IMappable.Map(object target) + { + Entities.Common.EdFi.StateAbbreviationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStateAbbreviationDescriptor)target, null); } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- } // ================================================================= @@ -166994,9 +173296,9 @@ string Entities.Common.EdFi.IStaffProgramAssociation.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StateAbbreviationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -167025,46 +173327,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffSchoolAssociation resource. + /// Represents a reference to the StateEducationAgency resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffSchoolAssociationReference : IResourceReference + public class StateEducationAgencyReference : IResourceReference { - [DataMember(Name="programAssignmentDescriptor")][DescriptorExists("ProgramAssignmentDescriptor")] - public string ProgramAssignmentDescriptor { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - [DataMember(Name="staffUniqueId")] - public string StaffUniqueId - { - get => _staffUniqueId; - set - { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } - private string _staffUniqueId; + [DataMember(Name="stateEducationAgencyId")] + public long StateEducationAgencyId { get; set; } /// /// Gets or sets the resource identifier of the referenced resource. /// public Guid ResourceId { get; set; } - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - private Link _link; @@ -167090,24 +173371,14 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return ProgramAssignmentDescriptor != default(string) && SchoolId != default(long) && StaffUniqueId != default(string); + return StateEducationAgencyId != default(long); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (ProgramAssignmentDescriptor == default) - { - yield return "ProgramAssignmentDescriptor"; - } - - if (SchoolId == default) - { - yield return "SchoolId"; - } - - if (StaffUniqueId == default) + if (StateEducationAgencyId == default) { - yield return "StaffUniqueId"; + yield return "StateEducationAgencyId"; } } @@ -167116,44 +173387,25 @@ private Link CreateLink() { var link = new Link { - Rel = "StaffSchoolAssociation", - Href = $"/ed-fi/staffSchoolAssociations/{ResourceId:n}" + Rel = "StateEducationAgency", + Href = $"/ed-fi/stateEducationAgencies/{ResourceId:n}" }; - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return link; } } // Aggregate reference /// - /// A class which represents the edfi.StaffSchoolAssociation table of the StaffSchoolAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StateEducationAgency table of the StateEducationAgency aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffSchoolAssociation : Entities.Common.EdFi.IStaffSchoolAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StateEducationAgency : Entities.Common.EdFi.IStateEducationAgency, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffSchoolAssociation"); + private static FullName _fullName = new FullName("edfi", "StateEducationAgency"); // Fluent validator instance (threadsafe) - private static StaffSchoolAssociationPutPostRequestValidator _validator = new StaffSchoolAssociationPutPostRequestValidator(); + private static StateEducationAgencyPutPostRequestValidator _validator = new StateEducationAgencyPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -167164,10 +173416,18 @@ public class StaffSchoolAssociation : Entities.Common.EdFi.IStaffSchoolAssociati // Constructor // ------------------------------------------------------------- - public StaffSchoolAssociation() + public StateEducationAgency() { - StaffSchoolAssociationAcademicSubjects = new List(); - StaffSchoolAssociationGradeLevels = new List(); + StateEducationAgencyAccountabilities = new List(); + StateEducationAgencyFederalFunds = new List(); + + // Inherited lists + EducationOrganizationAddresses = new List(); + EducationOrganizationCategories = new List(); + EducationOrganizationIdentificationCodes = new List(); + EducationOrganizationIndicators = new List(); + EducationOrganizationInstitutionTelephones = new List(); + EducationOrganizationInternationalAddresses = new List(); } // ------------------------------------------------------------ @@ -167177,7 +173437,7 @@ public StaffSchoolAssociation() // ------------------------------------------------------------ /// - /// The unique identifier for the StaffSchoolAssociation resource. + /// The unique identifier for the StateEducationAgency resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -167187,139 +173447,6 @@ public StaffSchoolAssociation() // ============================================================= // References // ------------------------------------------------------------- - - private bool _calendarReferenceExplicitlyAssigned; - private Calendar.EdFi.CalendarReference _calendarReference; - private Calendar.EdFi.CalendarReference ImplicitCalendarReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_calendarReference == null && !_calendarReferenceExplicitlyAssigned) - _calendarReference = new Calendar.EdFi.CalendarReference(); - - return _calendarReference; - } - } - - [DataMember(Name="calendarReference")] - [FullyDefinedReference] - public Calendar.EdFi.CalendarReference CalendarReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCalendarReference != null - && (_calendarReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) - return ImplicitCalendarReference; - - return null; - } - set - { - _calendarReferenceExplicitlyAssigned = true; - _calendarReference = value; - } - } - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); - - return _schoolReference; - } - } - - [DataMember(Name="schoolReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; - - return null; - } - set - { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; - } - } - private bool _schoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) - _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - - return _schoolYearTypeReference; - } - } - - [DataMember(Name="schoolYearTypeReference")] - [FullyDefinedReference] - public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolYearTypeReference != null - && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference; - - return null; - } - set - { - _schoolYearTypeReferenceExplicitlyAssigned = true; - _schoolYearTypeReference = value; - } - } - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); - - return _staffReference; - } - } - - [DataMember(Name="staffReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; - - return null; - } - set - { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; - } - } // ------------------------------------------------------------- //============================================================== @@ -167327,67 +173454,17 @@ public Staff.EdFi.StaffReference StaffReference // ------------------------------------------------------------- /// - /// The name of the program for which the individual is assigned. + /// The identifier assigned to a state education agency. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="programAssignmentDescriptor")][DescriptorExists("ProgramAssignmentDescriptor")] - public string ProgramAssignmentDescriptor { get; set; } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffSchoolAssociation.SchoolId - { - get - { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Calendar - _calendarReferenceExplicitlyAssigned = false; - ImplicitCalendarReference.SchoolId = value; - - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; - } - } + [DataMember(Name="stateEducationAgencyId")] + public long StateEducationAgencyId { get; set; } - /// - /// A unique alphanumeric code assigned to a staff. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffSchoolAssociation.StaffUniqueId + long IEducationOrganization.EducationOrganizationId { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } + get { return StateEducationAgencyId; } + set { StateEducationAgencyId = value; } } // ------------------------------------------------------------- @@ -167403,7 +173480,7 @@ string Entities.Common.EdFi.IStaffSchoolAssociation.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffSchoolAssociation; + var compareTo = obj as Entities.Common.EdFi.IStateEducationAgency; if (ReferenceEquals(this, compareTo)) return true; @@ -167412,18 +173489,8 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociation).ProgramAssignmentDescriptor, compareTo.ProgramAssignmentDescriptor)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffSchoolAssociation).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + // Derived Property + if (!(this as Entities.Common.EdFi.IStateEducationAgency).StateEducationAgencyId.Equals(compareTo.StateEducationAgencyId)) return false; @@ -167440,15 +173507,9 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociation).ProgramAssignmentDescriptor); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociation).SchoolId); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IStateEducationAgency).StateEducationAgencyId); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -167456,160 +173517,255 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// The full, legally accepted name of the institution. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="nameOfInstitution")] + public string NameOfInstitution { get; set; } + + /// + /// The current operational status of the education organization (e.g., active, inactive). + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] + public string OperationalStatusDescriptor { get; set; } + + /// + /// A short name for the institution. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortNameOfInstitution")] + public string ShortNameOfInstitution { get; set; } + + /// + /// The public web site address (URL) for the education organization. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="webSite")] + public string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The identifier for the calendar. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffSchoolAssociation.CalendarCode + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="addresses")] + public ICollection EducationOrganizationAddresses { - get + get { return _educationOrganizationAddresses; } + set { - if (ImplicitCalendarReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) - { - return ImplicitCalendarReference.CalendarCode; - } - - return default(string); + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + { + get { return _educationOrganizationAddressesCovariant; } + set { EducationOrganizationAddresses = new List(value.Cast()); } + } + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + + [NoDuplicateMembers][RequiredCollection] + [DataMember(Name="categories")] + public ICollection EducationOrganizationCategories + { + get { return _educationOrganizationCategories; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Calendar - _calendarReferenceExplicitlyAssigned = false; - ImplicitCalendarReference.CalendarCode = value; + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); } } - /// - /// Identifier for a school year. - /// - // IS in a reference, NOT a lookup column - short? Entities.Common.EdFi.IStaffSchoolAssociation.SchoolYear + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories { - get + get { return _educationOrganizationCategoriesCovariant; } + set { EducationOrganizationCategories = new List(value.Cast()); } + } + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationCodes")] + public ICollection EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodes; } + set { - if (ImplicitCalendarReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCalendarReference.IsReferenceFullyDefined())) - { - return ImplicitCalendarReference.SchoolYear; - } + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - { - return ImplicitSchoolYearTypeReference.SchoolYear; - } + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + { + get { return _educationOrganizationIdentificationCodesCovariant; } + set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } + } + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; - return default(short?); - } + [NoDuplicateMembers] + [DataMember(Name="indicators")] + public ICollection EducationOrganizationIndicators + { + get { return _educationOrganizationIndicators; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } + } - // Calendar - _calendarReferenceExplicitlyAssigned = false; - ImplicitCalendarReference.SchoolYear = value.GetValueOrDefault(); + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get { return _educationOrganizationIndicatorsCovariant; } + set { EducationOrganizationIndicators = new List(value.Cast()); } + } + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); + [NoDuplicateMembers] + [DataMember(Name="institutionTelephones")] + public ICollection EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephones; } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); } } - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + { + get { return _educationOrganizationInstitutionTelephonesCovariant; } + set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + } + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [NoDuplicateMembers] + [DataMember(Name="internationalAddresses")] + public ICollection EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddresses; } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } + } - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get { return _educationOrganizationInternationalAddressesCovariant; } + set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSchoolAssociation", "StaffSchoolAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StateEducationAgency", "StateEducationAgency")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _staffSchoolAssociationAcademicSubjects; - private ICollection _staffSchoolAssociationAcademicSubjectsCovariant; + private ICollection _stateEducationAgencyAccountabilities; + private ICollection _stateEducationAgencyAccountabilitiesCovariant; [NoDuplicateMembers] - [DataMember(Name="academicSubjects")] - public ICollection StaffSchoolAssociationAcademicSubjects + [DataMember(Name="accountabilities")] + public ICollection StateEducationAgencyAccountabilities { - get { return _staffSchoolAssociationAcademicSubjects; } + get { return _stateEducationAgencyAccountabilities; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)e.Item).StaffSchoolAssociation = this); - _staffSchoolAssociationAcademicSubjects = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyAccountability)e.Item).StateEducationAgency = this); + _stateEducationAgencyAccountabilities = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)e.Item).StaffSchoolAssociation = this; - _staffSchoolAssociationAcademicSubjectsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyAccountability)e.Item).StateEducationAgency = this; + _stateEducationAgencyAccountabilitiesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaffSchoolAssociation.StaffSchoolAssociationAcademicSubjects + ICollection Entities.Common.EdFi.IStateEducationAgency.StateEducationAgencyAccountabilities { - get { return _staffSchoolAssociationAcademicSubjectsCovariant; } - set { StaffSchoolAssociationAcademicSubjects = new List(value.Cast()); } + get { return _stateEducationAgencyAccountabilitiesCovariant; } + set { StateEducationAgencyAccountabilities = new List(value.Cast()); } } - private ICollection _staffSchoolAssociationGradeLevels; - private ICollection _staffSchoolAssociationGradeLevelsCovariant; + private ICollection _stateEducationAgencyFederalFunds; + private ICollection _stateEducationAgencyFederalFundsCovariant; [NoDuplicateMembers] - [DataMember(Name="gradeLevels")] - public ICollection StaffSchoolAssociationGradeLevels + [DataMember(Name="federalFunds")] + public ICollection StateEducationAgencyFederalFunds { - get { return _staffSchoolAssociationGradeLevels; } + get { return _stateEducationAgencyFederalFunds; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)e.Item).StaffSchoolAssociation = this); - _staffSchoolAssociationGradeLevels = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyFederalFunds)e.Item).StateEducationAgency = this); + _stateEducationAgencyFederalFunds = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)e.Item).StaffSchoolAssociation = this; - _staffSchoolAssociationGradeLevelsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyFederalFunds)e.Item).StateEducationAgency = this; + _stateEducationAgencyFederalFundsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStaffSchoolAssociation.StaffSchoolAssociationGradeLevels + ICollection Entities.Common.EdFi.IStateEducationAgency.StateEducationAgencyFederalFunds { - get { return _staffSchoolAssociationGradeLevelsCovariant; } - set { StaffSchoolAssociationGradeLevels = new List(value.Cast()); } + get { return _stateEducationAgencyFederalFundsCovariant; } + set { StateEducationAgencyFederalFunds = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -167634,14 +173790,44 @@ public ICollection StaffSchoolAssociationGrade internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_staffSchoolAssociationAcademicSubjects != null) foreach (var item in _staffSchoolAssociationAcademicSubjects) + if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) { - item.StaffSchoolAssociation = this; + item.EducationOrganization = this; } - if (_staffSchoolAssociationGradeLevels != null) foreach (var item in _staffSchoolAssociationGradeLevels) + if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) { - item.StaffSchoolAssociation = this; + item.EducationOrganization = this; + } + + if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) + { + item.EducationOrganization = this; + } + + if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) + { + item.EducationOrganization = this; + } + + if (_stateEducationAgencyAccountabilities != null) foreach (var item in _stateEducationAgencyAccountabilities) + { + item.StateEducationAgency = this; + } + + if (_stateEducationAgencyFederalFunds != null) foreach (var item in _stateEducationAgencyFederalFunds) + { + item.StateEducationAgency = this; } } @@ -167652,60 +173838,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffSchoolAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSchoolAssociation)target); + return Entities.Common.EdFi.StateEducationAgencyMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateEducationAgency)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffSchoolAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffSchoolAssociation)target, null); + Entities.Common.EdFi.StateEducationAgencyMapper.MapTo(this, (Entities.Common.EdFi.IStateEducationAgency)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffSchoolAssociation.CalendarResourceId - { - get { return null; } - set { ImplicitCalendarReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffSchoolAssociation.CalendarDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitCalendarReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStaffSchoolAssociation.SchoolResourceId - { - get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IStaffSchoolAssociation.SchoolYearTypeResourceId - { - get { return null; } - set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IStaffSchoolAssociation.StaffResourceId - { - get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffSchoolAssociation.StaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStaffReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -167728,119 +173872,120 @@ string Entities.Common.EdFi.IStaffSchoolAssociation.StaffDiscriminator // ---------------------- // Validate collections // ---------------------- - if (StaffSchoolAssociationAcademicSubjects.Any() && mappingContract?.IsMemberSupported("StaffSchoolAssociationAcademicSubjects") != false) + if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StaffSchoolAssociationAcademicSubjects"); + pathBuilder.Append("EducationOrganizationAddresses"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffSchoolAssociationAcademicSubjects, validationContext, validationContext.Items.ForCollection("StaffSchoolAssociationAcademicSubjects")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) { yield return result; } } - if (StaffSchoolAssociationGradeLevels.Any() && mappingContract?.IsMemberSupported("StaffSchoolAssociationGradeLevels") != false) + if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StaffSchoolAssociationGradeLevels"); + pathBuilder.Append("EducationOrganizationCategories"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StaffSchoolAssociationGradeLevels, validationContext, validationContext.Items.ForCollection("StaffSchoolAssociationGradeLevels")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) { yield return result; } } - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) + if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); + pathBuilder.Append("EducationOrganizationIdentificationCodes"); - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) { yield return result; } } - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); - - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationIndicators"); - IEnumerable<(string path, long value)> GetSchoolIdSources() + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) + { + yield return result; + } + } + + if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) { - // Obtain value from other references - var valueFromSchoolReference = this.SchoolReference?.SchoolId; + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInstitutionTelephones"); - if (valueFromSchoolReference != null) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) { - yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); + yield return result; } + } + + if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("EducationOrganizationInternationalAddresses"); - // Obtain value from other references - var valueFromCalendarReference = this.CalendarReference?.SchoolId; - - if (valueFromCalendarReference != null) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) { - yield return ("calendarReference.schoolId", this.CalendarReference.SchoolId); + yield return result; } - } - var sourcesForSchoolYear = GetSchoolYearSources().ToArray(); - if (!sourcesForSchoolYear.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + if (StateEducationAgencyAccountabilities.Any() && mappingContract?.IsMemberSupported("StateEducationAgencyAccountabilities") != false) { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForSchoolYear.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolYear.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolYear' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolYear.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StateEducationAgencyAccountabilities"); - IEnumerable<(string path, short value)> GetSchoolYearSources() + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StateEducationAgencyAccountabilities, validationContext, validationContext.Items.ForCollection("StateEducationAgencyAccountabilities")))) + { + yield return result; + } + } + + if (StateEducationAgencyFederalFunds.Any() && mappingContract?.IsMemberSupported("StateEducationAgencyFederalFunds") != false) { - // Obtain value from other references - var valueFromCalendarReference = this.CalendarReference?.SchoolYear; + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StateEducationAgencyFederalFunds"); - if (valueFromCalendarReference != null) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StateEducationAgencyFederalFunds, validationContext, validationContext.Items.ForCollection("StateEducationAgencyFederalFunds")))) { - yield return ("calendarReference.schoolYear", this.CalendarReference.SchoolYear); + yield return result; } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); - // Obtain value from other references - var valueFromSchoolYearTypeReference = this.SchoolYearTypeReference?.SchoolYear; - - if (valueFromSchoolYearTypeReference != null) + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) { - yield return ("schoolYearTypeReference.schoolYear", this.SchoolYearTypeReference.SchoolYear); + yield return result; } - } // Execute the resource's fluent validator @@ -167868,15 +174013,21 @@ string Entities.Common.EdFi.IStaffSchoolAssociation.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffSchoolAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StateEducationAgencyPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StaffSchoolAssociation = new FullName("edfi", "StaffSchoolAssociation"); + private static readonly FullName _fullName_edfi_StateEducationAgency = new FullName("edfi", "StateEducationAgency"); // Declare collection item validators - private StaffSchoolAssociationAcademicSubjectPutPostRequestValidator _staffSchoolAssociationAcademicSubjectsValidator = new (); - private StaffSchoolAssociationGradeLevelPutPostRequestValidator _staffSchoolAssociationGradeLevelsValidator = new (); + private StateEducationAgencyAccountabilityPutPostRequestValidator _stateEducationAgencyAccountabilitiesValidator = new (); + private StateEducationAgencyFederalFundsPutPostRequestValidator _stateEducationAgencyFederalFundsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); + private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -167893,30 +174044,96 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStaffSchoolAssociationAcademicSubjectIncluded(x)); + var hasInvalidStateEducationAgencyAccountabilitiesItems = instance.StateEducationAgencyAccountabilities.Any(x => !mappingContract.IsStateEducationAgencyAccountabilityIncluded(x)); - if (hasInvalidStaffSchoolAssociationAcademicSubjectsItems) + if (hasInvalidStateEducationAgencyAccountabilitiesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffSchoolAssociationAcademicSubjects", $"A supplied 'StaffSchoolAssociationAcademicSubject' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StateEducationAgencyAccountabilities", $"A supplied 'StateEducationAgencyAccountability' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsStaffSchoolAssociationGradeLevelIncluded != null) + if (mappingContract.IsStateEducationAgencyFederalFundsIncluded != null) { - var hasInvalidStaffSchoolAssociationGradeLevelsItems = instance.StaffSchoolAssociationGradeLevels.Any(x => !mappingContract.IsStaffSchoolAssociationGradeLevelIncluded(x)); + var hasInvalidStateEducationAgencyFederalFundsItems = instance.StateEducationAgencyFederalFunds.Any(x => !mappingContract.IsStateEducationAgencyFederalFundsIncluded(x)); - if (hasInvalidStaffSchoolAssociationGradeLevelsItems) + if (hasInvalidStateEducationAgencyFederalFundsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StaffSchoolAssociationGradeLevels", $"A supplied 'StaffSchoolAssociationGradeLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StateEducationAgencyFederalFunds", $"A supplied 'StateEducationAgencyFederalFunds' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationAddressIncluded != null) + { + var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); + + if (hasInvalidEducationOrganizationAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationCategoryIncluded != null) + { + var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); + + if (hasInvalidEducationOrganizationCategoriesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) + { + var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); + + if (hasInvalidEducationOrganizationIdentificationCodesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) + { + var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); + + if (hasInvalidEducationOrganizationIndicatorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) + { + var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); + + if (hasInvalidEducationOrganizationInstitutionTelephonesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + { + var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); + + if (hasInvalidEducationOrganizationInternationalAddressesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -167938,16 +174155,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffSchoolAssociationAcademicSubject table of the StaffSchoolAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StateEducationAgencyAccountability table of the StateEducationAgency aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffSchoolAssociationAcademicSubject : Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject, IValidatableObject + public class StateEducationAgencyAccountability : Entities.Common.EdFi.IStateEducationAgencyAccountability, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffSchoolAssociationAcademicSubject"); + private static FullName _fullName = new FullName("edfi", "StateEducationAgencyAccountability"); // Fluent validator instance (threadsafe) - private static StaffSchoolAssociationAcademicSubjectPutPostRequestValidator _validator = new StaffSchoolAssociationAcademicSubjectPutPostRequestValidator(); + private static StateEducationAgencyAccountabilityPutPostRequestValidator _validator = new StateEducationAgencyAccountabilityPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -167961,46 +174178,96 @@ public class StaffSchoolAssociationAcademicSubject : Entities.Common.EdFi.IStaff // ------------------------------------------------------------ - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _schoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) + _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + + return _schoolYearTypeReference; + } + } + + [DataMember(Name="schoolYearTypeReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolYearTypeReference != null + && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference; - // ============================================================= - // References - // ------------------------------------------------------------- + return null; + } + set + { + _schoolYearTypeReferenceExplicitlyAssigned = true; + _schoolYearTypeReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffSchoolAssociation _staffSchoolAssociation; + private Entities.Common.EdFi.IStateEducationAgency _stateEducationAgency; [IgnoreDataMember] - Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationAcademicSubject.StaffSchoolAssociation + Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyAccountability.StateEducationAgency { - get { return _staffSchoolAssociation; } - set { SetStaffSchoolAssociation(value); } + get { return _stateEducationAgency; } + set { SetStateEducationAgency(value); } } - public Entities.Common.EdFi.IStaffSchoolAssociation StaffSchoolAssociation + public Entities.Common.EdFi.IStateEducationAgency StateEducationAgency { - set { SetStaffSchoolAssociation(value); } + set { SetStateEducationAgency(value); } } - private void SetStaffSchoolAssociation(Entities.Common.EdFi.IStaffSchoolAssociation value) + private void SetStateEducationAgency(Entities.Common.EdFi.IStateEducationAgency value) { - _staffSchoolAssociation = value; + _stateEducationAgency = value; } /// - /// The academic subjects the individual is eligible to teach. + /// The school year for which the accountability is reported. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicSubjectDescriptor")][DescriptorExists("AcademicSubjectDescriptor")] - public string AcademicSubjectDescriptor { get; set; } + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IStateEducationAgencyAccountability.SchoolYear + { + get + { + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -168015,7 +174282,7 @@ private void SetStaffSchoolAssociation(Entities.Common.EdFi.IStaffSchoolAssociat /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject; + var compareTo = obj as Entities.Common.EdFi.IStateEducationAgencyAccountability; if (ReferenceEquals(this, compareTo)) return true; @@ -168024,12 +174291,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_staffSchoolAssociation == null || !_staffSchoolAssociation.Equals(compareTo.StaffSchoolAssociation)) + if (_stateEducationAgency == null || !_stateEducationAgency.Equals(compareTo.StateEducationAgency)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject).AcademicSubjectDescriptor, compareTo.AcademicSubjectDescriptor)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStateEducationAgencyAccountability).SchoolYear.Equals(compareTo.SchoolYear)) return false; @@ -168046,12 +174313,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_staffSchoolAssociation != null) - hash.Add(_staffSchoolAssociation); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject).AcademicSubjectDescriptor); + if (_stateEducationAgency != null) + hash.Add(_stateEducationAgency); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStateEducationAgencyAccountability).SchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -168064,6 +174330,13 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// An indication of whether CTE concentrators are included in the state's computation of its graduation rate. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="cteGraduationRateInclusion")] + public bool? CTEGraduationRateInclusion { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -168084,7 +174357,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSchoolAssociation", "StaffSchoolAssociationAcademicSubject")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StateEducationAgency", "StateEducationAgencyAccountability")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -168108,18 +174381,25 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffSchoolAssociationAcademicSubjectMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)target); + return Entities.Common.EdFi.StateEducationAgencyAccountabilityMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateEducationAgencyAccountability)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffSchoolAssociationAcademicSubjectMapper.MapTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject)target, null); + Entities.Common.EdFi.StateEducationAgencyAccountabilityMapper.MapTo(this, (Entities.Common.EdFi.IStateEducationAgencyAccountability)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStateEducationAgencyAccountability.SchoolYearTypeResourceId + { + get { return null; } + set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + } + + // ----------------------------------------------------------------- // ================================== @@ -168188,9 +174468,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffSchoolAssociationAcademicSubjectPutPostRequestValidator : FluentValidation.AbstractValidator + public class StateEducationAgencyAccountabilityPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -168219,16 +174499,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StaffSchoolAssociationGradeLevel table of the StaffSchoolAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StateEducationAgencyFederalFunds table of the StateEducationAgency aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffSchoolAssociationGradeLevel : Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel, IValidatableObject + public class StateEducationAgencyFederalFunds : Entities.Common.EdFi.IStateEducationAgencyFederalFunds, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffSchoolAssociationGradeLevel"); + private static FullName _fullName = new FullName("edfi", "StateEducationAgencyFederalFunds"); // Fluent validator instance (threadsafe) - private static StaffSchoolAssociationGradeLevelPutPostRequestValidator _validator = new StaffSchoolAssociationGradeLevelPutPostRequestValidator(); + private static StateEducationAgencyFederalFundsPutPostRequestValidator _validator = new StateEducationAgencyFederalFundsPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -168255,33 +174535,32 @@ public class StaffSchoolAssociationGradeLevel : Entities.Common.EdFi.IStaffSchoo //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStaffSchoolAssociation _staffSchoolAssociation; + private Entities.Common.EdFi.IStateEducationAgency _stateEducationAgency; [IgnoreDataMember] - Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationGradeLevel.StaffSchoolAssociation + Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyFederalFunds.StateEducationAgency { - get { return _staffSchoolAssociation; } - set { SetStaffSchoolAssociation(value); } + get { return _stateEducationAgency; } + set { SetStateEducationAgency(value); } } - public Entities.Common.EdFi.IStaffSchoolAssociation StaffSchoolAssociation + public Entities.Common.EdFi.IStateEducationAgency StateEducationAgency { - set { SetStaffSchoolAssociation(value); } + set { SetStateEducationAgency(value); } } - private void SetStaffSchoolAssociation(Entities.Common.EdFi.IStaffSchoolAssociation value) + private void SetStateEducationAgency(Entities.Common.EdFi.IStateEducationAgency value) { - _staffSchoolAssociation = value; + _stateEducationAgency = value; } /// - /// The grade levels the individual is eligible to teach. + /// The fiscal year for which the federal funds are received. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string GradeLevelDescriptor { get; set; } + [DataMember(Name="fiscalYear")] + public int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -168296,7 +174575,7 @@ private void SetStaffSchoolAssociation(Entities.Common.EdFi.IStaffSchoolAssociat /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel; + var compareTo = obj as Entities.Common.EdFi.IStateEducationAgencyFederalFunds; if (ReferenceEquals(this, compareTo)) return true; @@ -168305,12 +174584,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_staffSchoolAssociation == null || !_staffSchoolAssociation.Equals(compareTo.StaffSchoolAssociation)) + if (_stateEducationAgency == null || !_stateEducationAgency.Equals(compareTo.StateEducationAgency)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel).GradeLevelDescriptor, compareTo.GradeLevelDescriptor)) + if (!(this as Entities.Common.EdFi.IStateEducationAgencyFederalFunds).FiscalYear.Equals(compareTo.FiscalYear)) return false; @@ -168327,11 +174606,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_staffSchoolAssociation != null) - hash.Add(_staffSchoolAssociation); + if (_stateEducationAgency != null) + hash.Add(_stateEducationAgency); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel).GradeLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IStateEducationAgencyFederalFunds).FiscalYear); return hash.ToHashCode(); } @@ -168345,6 +174624,14 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The amount of federal dollars distributed to Local Education Agencies (LEAs), retained by the State Education Agency (SEA) for program administration or other approved state-level activities (including unallocated, transferred to another state agency, or distributed to entities other than LEAs). + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="federalProgramsFundingAllocation")] + public decimal? FederalProgramsFundingAllocation { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -168365,7 +174652,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSchoolAssociation", "StaffSchoolAssociationGradeLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StateEducationAgency", "StateEducationAgencyFederalFunds")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -168389,12 +174676,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffSchoolAssociationGradeLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)target); + return Entities.Common.EdFi.StateEducationAgencyFederalFundsMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateEducationAgencyFederalFunds)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffSchoolAssociationGradeLevelMapper.MapTo(this, (Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel)target, null); + Entities.Common.EdFi.StateEducationAgencyFederalFundsMapper.MapTo(this, (Entities.Common.EdFi.IStateEducationAgencyFederalFunds)target, null); } // ------------------------------------------------------------- @@ -168469,9 +174756,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffSchoolAssociationGradeLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class StateEducationAgencyFederalFundsPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -168500,46 +174787,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StaffSectionAssociation resource. + /// Represents a reference to the Student resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StaffSectionAssociationReference : IResourceReference + public class StudentReference : IResourceReference { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - [DataMember(Name="localCourseCode")] - public string LocalCourseCode { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } - - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } - - [DataMember(Name="sectionIdentifier")] - public string SectionIdentifier { get; set; } - - [DataMember(Name="sessionName")] - public string SessionName { get; set; } - - [DataMember(Name="staffUniqueId")] - public string StaffUniqueId + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId { - get => _staffUniqueId; + get => _studentUniqueId; set { - _staffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } - private string _staffUniqueId; + private string _studentUniqueId; /// /// Gets or sets the resource identifier of the referenced resource. @@ -168577,90 +174846,837 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BeginDate != default(DateTime) && LocalCourseCode != default(string) && SchoolId != default(long) && SchoolYear != default(short) && SectionIdentifier != default(string) && SessionName != default(string) && StaffUniqueId != default(string); + return StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BeginDate == default) + if (StudentUniqueId == default) { - yield return "BeginDate"; + yield return "StudentUniqueId"; } - if (LocalCourseCode == default) + } + + private Link CreateLink() + { + var link = new Link { - yield return "LocalCourseCode"; + Rel = "Student", + Href = $"/ed-fi/students/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.Student table of the Student aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class Student : Entities.Common.EdFi.IStudent, IHasETag, IDateVersionedEntity, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "Student"); + + // Fluent validator instance (threadsafe) + private static StudentPutPostRequestValidator _validator = new StudentPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + public Student() + { + StudentIdentificationDocuments = new List(); + StudentOtherNames = new List(); + StudentPersonalIdentificationDocuments = new List(); + StudentVisas = new List(); + } + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the Student resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _personReferenceExplicitlyAssigned; + private Person.EdFi.PersonReference _personReference; + private Person.EdFi.PersonReference ImplicitPersonReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_personReference == null && !_personReferenceExplicitlyAssigned) + _personReference = new Person.EdFi.PersonReference(); + + return _personReference; } + } - if (SchoolId == default) + [DataMember(Name="personReference")] + [FullyDefinedReference] + public Person.EdFi.PersonReference PersonReference + { + get { - yield return "SchoolId"; + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitPersonReference != null + && (_personReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + return ImplicitPersonReference; + + return null; + } + set + { + _personReferenceExplicitlyAssigned = true; + _personReference = value; } + } + // ------------------------------------------------------------- - if (SchoolYear == default) + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A unique alphanumeric code assigned to a student. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [UniqueId][DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set { - yield return "SchoolYear"; + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } + } + private string _studentUniqueId; + + string IIdentifiablePerson.UniqueId { get { return StudentUniqueId; } } + // ------------------------------------------------------------- - if (SectionIdentifier == default) + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStudent; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Property + if (!((this as Entities.Common.EdFi.IStudent).StudentUniqueId.Equals(compareTo.StudentUniqueId))) + return false; + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + //Property + hash.Add((this as Entities.Common.EdFi.IStudent).StudentUniqueId); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The city the student was born in. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="birthCity")] + public string BirthCity { get; set; } + + /// + /// The country in which an individual is born. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="birthCountryDescriptor")][DescriptorExists("CountryDescriptor")] + public string BirthCountryDescriptor { get; set; } + + /// + /// The month, day, and year on which an individual was born. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="birthDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BirthDate { get; set; } + + /// + /// For students born outside of the U.S., the Province or jurisdiction in which an individual is born. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="birthInternationalProvince")] + public string BirthInternationalProvince { get; set; } + + /// + /// A person's sex at birth. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="birthSexDescriptor")][DescriptorExists("SexDescriptor")] + public string BirthSexDescriptor { get; set; } + + /// + /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which an individual was born. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="birthStateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] + public string BirthStateAbbreviationDescriptor { get; set; } + + /// + /// An indicator of whether or not the person is a U.S. citizen. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="citizenshipStatusDescriptor")][DescriptorExists("CitizenshipStatusDescriptor")] + public string CitizenshipStatusDescriptor { get; set; } + + /// + /// For students born outside of the U.S., the date the student entered the U.S. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="dateEnteredUS")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DateEnteredUS { get; set; } + + /// + /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="firstName")] + public string FirstName { get; set; } + + /// + /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="generationCodeSuffix")] + public string GenerationCodeSuffix { get; set; } + + /// + /// The name borne in common by members of a family. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } + + /// + /// The individual's maiden name. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="maidenName")] + public string MaidenName { get; set; } + + /// + /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="middleName")] + public string MiddleName { get; set; } + + /// + /// Indicator of whether the student was born with other siblings (i.e., twins, triplets, etc.) + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="multipleBirthStatus")] + public bool? MultipleBirthStatus { get; set; } + + /// + /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="personalTitlePrefix")] + public string PersonalTitlePrefix { get; set; } + + /// + /// A unique alphanumeric code assigned to a person. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudent.PersonId + { + get { - yield return "SectionIdentifier"; + if (ImplicitPersonReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + { + return ImplicitPersonReference.PersonId; + } + + return default(string); } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - if (SessionName == default) + // Person + _personReferenceExplicitlyAssigned = false; + ImplicitPersonReference.PersonId = value; + } + } + + /// + /// The first name the individual prefers, if different from their legal first name + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="preferredFirstName")] + public string PreferredFirstName { get; set; } + + /// + /// The last name the individual prefers, if different from their legal last name + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="preferredLastSurname")] + public string PreferredLastSurname { get; set; } + + /// + /// This descriptor defines the originating record source system for the person. + /// + + // IS in a reference (Student.SourceSystemDescriptorId), IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + string Entities.Common.EdFi.IStudent.SourceSystemDescriptor + { + get { - yield return "SessionName"; + if (ImplicitPersonReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) + { + return ImplicitPersonReference.SourceSystemDescriptor; + } + + return null; + } + set + { + ImplicitPersonReference.SourceSystemDescriptor = value; } + } + // ------------------------------------------------------------- - if (StaffUniqueId == default) + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "Student")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _studentIdentificationDocuments; + private ICollection _studentIdentificationDocumentsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="identificationDocuments")] + public ICollection StudentIdentificationDocuments + { + get { return _studentIdentificationDocuments; } + set { - yield return "StaffUniqueId"; + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentIdentificationDocument)e.Item).Student = this); + _studentIdentificationDocuments = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentIdentificationDocument)e.Item).Student = this; + _studentIdentificationDocumentsCovariant = covariantList; } + } + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudent.StudentIdentificationDocuments + { + get { return _studentIdentificationDocumentsCovariant; } + set { StudentIdentificationDocuments = new List(value.Cast()); } } - private Link CreateLink() + private ICollection _studentOtherNames; + private ICollection _studentOtherNamesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="otherNames")] + public ICollection StudentOtherNames { - var link = new Link + get { return _studentOtherNames; } + set { - Rel = "StaffSectionAssociation", - Href = $"/ed-fi/staffSectionAssociations/{ResourceId:n}" - }; + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentOtherName)e.Item).Student = this); + _studentOtherNames = list; - if (string.IsNullOrEmpty(Discriminator)) - return link; + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentOtherName)e.Item).Student = this; + _studentOtherNamesCovariant = covariantList; + } + } - string[] linkParts = Discriminator.Split('.'); + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudent.StudentOtherNames + { + get { return _studentOtherNamesCovariant; } + set { StudentOtherNames = new List(value.Cast()); } + } - if (linkParts.Length < 2) - return link; + private ICollection _studentPersonalIdentificationDocuments; + private ICollection _studentPersonalIdentificationDocumentsCovariant; - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + [NoDuplicateMembers] + [DataMember(Name="personalIdentificationDocuments")] + public ICollection StudentPersonalIdentificationDocuments + { + get { return _studentPersonalIdentificationDocuments; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentPersonalIdentificationDocument)e.Item).Student = this); + _studentPersonalIdentificationDocuments = list; - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentPersonalIdentificationDocument)e.Item).Student = this; + _studentPersonalIdentificationDocumentsCovariant = covariantList; + } + } - return new Link + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudent.StudentPersonalIdentificationDocuments + { + get { return _studentPersonalIdentificationDocumentsCovariant; } + set { StudentPersonalIdentificationDocuments = new List(value.Cast()); } + } + + private ICollection _studentVisas; + private ICollection _studentVisasCovariant; + + [NoDuplicateMembers] + [DataMember(Name="visas")] + public ICollection StudentVisas + { + get { return _studentVisas; } + set { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentVisa)e.Item).Student = this); + _studentVisas = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentVisa)e.Item).Student = this; + _studentVisasCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudent.StudentVisas + { + get { return _studentVisasCovariant; } + set { StudentVisas = new List(value.Cast()); } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_studentIdentificationDocuments != null) foreach (var item in _studentIdentificationDocuments) + { + item.Student = this; + } + + if (_studentOtherNames != null) foreach (var item in _studentOtherNames) + { + item.Student = this; + } + + if (_studentPersonalIdentificationDocuments != null) foreach (var item in _studentPersonalIdentificationDocuments) + { + item.Student = this; + } + + if (_studentVisas != null) foreach (var item in _studentVisas) + { + item.Student = this; + } + + } + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StudentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudent)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StudentMapper.MapTo(this, (Entities.Common.EdFi.IStudent)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStudent.PersonResourceId + { + get { return null; } + set { ImplicitPersonReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudent.PersonDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitPersonReference.Discriminator = value; } + } + + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + if (StudentIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StudentIdentificationDocuments") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentIdentificationDocuments"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StudentIdentificationDocuments")))) + { + yield return result; + } + } + + if (StudentOtherNames.Any() && mappingContract?.IsMemberSupported("StudentOtherNames") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentOtherNames"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentOtherNames, validationContext, validationContext.Items.ForCollection("StudentOtherNames")))) + { + yield return result; + } + } + + if (StudentPersonalIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StudentPersonalIdentificationDocuments") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentPersonalIdentificationDocuments"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentPersonalIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StudentPersonalIdentificationDocuments")))) + { + yield return result; + } + } + + if (StudentVisas.Any() && mappingContract?.IsMemberSupported("StudentVisas") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentVisas"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentVisas, validationContext, validationContext.Items.ForCollection("StudentVisas")))) + { + yield return result; + } + } + + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StudentPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_Student = new FullName("edfi", "Student"); + + // Declare collection item validators + private StudentIdentificationDocumentPutPostRequestValidator _studentIdentificationDocumentsValidator = new (); + private StudentOtherNamePutPostRequestValidator _studentOtherNamesValidator = new (); + private StudentPersonalIdentificationDocumentPutPostRequestValidator _studentPersonalIdentificationDocumentsValidator = new (); + private StudentVisaPutPostRequestValidator _studentVisasValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StudentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_Student); + + if (mappingContract != null) + { + if (mappingContract.IsStudentIdentificationDocumentIncluded != null) + { + var hasInvalidStudentIdentificationDocumentsItems = instance.StudentIdentificationDocuments.Any(x => !mappingContract.IsStudentIdentificationDocumentIncluded(x)); + + if (hasInvalidStudentIdentificationDocumentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentIdentificationDocuments", $"A supplied 'StudentIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentOtherNameIncluded != null) + { + var hasInvalidStudentOtherNamesItems = instance.StudentOtherNames.Any(x => !mappingContract.IsStudentOtherNameIncluded(x)); + + if (hasInvalidStudentOtherNamesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentOtherNames", $"A supplied 'StudentOtherName' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentPersonalIdentificationDocumentIncluded != null) + { + var hasInvalidStudentPersonalIdentificationDocumentsItems = instance.StudentPersonalIdentificationDocuments.Any(x => !mappingContract.IsStudentPersonalIdentificationDocumentIncluded(x)); + + if (hasInvalidStudentPersonalIdentificationDocumentsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentPersonalIdentificationDocuments", $"A supplied 'StudentPersonalIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentVisaIncluded != null) + { + var hasInvalidStudentVisasItems = instance.StudentVisas.Any(x => !mappingContract.IsStudentVisaIncluded(x)); + + if (hasInvalidStudentVisasItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentVisas", $"A supplied 'StudentVisa' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.StaffSectionAssociation table of the StaffSectionAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentIdentificationDocument table of the Student aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StaffSectionAssociation : Entities.Common.EdFi.IStaffSectionAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentIdentificationDocument : Entities.Common.EdFi.IStudentIdentificationDocument, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StaffSectionAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentIdentificationDocument"); // Fluent validator instance (threadsafe) - private static StaffSectionAssociationPutPostRequestValidator _validator = new StaffSectionAssociationPutPostRequestValidator(); + private static StudentIdentificationDocumentPutPostRequestValidator _validator = new StudentIdentificationDocumentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -168677,249 +175693,52 @@ public class StaffSectionAssociation : Entities.Common.EdFi.IStaffSectionAssocia // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StaffSectionAssociation resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _sectionReferenceExplicitlyAssigned; - private Section.EdFi.SectionReference _sectionReference; - private Section.EdFi.SectionReference ImplicitSectionReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) - _sectionReference = new Section.EdFi.SectionReference(); - - return _sectionReference; - } - } - - [DataMember(Name="sectionReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Section.EdFi.SectionReference SectionReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSectionReference != null - && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference; - - return null; - } - set - { - _sectionReferenceExplicitlyAssigned = true; - _sectionReference = value; - } - } - private bool _staffReferenceExplicitlyAssigned; - private Staff.EdFi.StaffReference _staffReference; - private Staff.EdFi.StaffReference ImplicitStaffReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_staffReference == null && !_staffReferenceExplicitlyAssigned) - _staffReference = new Staff.EdFi.StaffReference(); - - return _staffReference; - } - } - - [DataMember(Name="staffReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Staff.EdFi.StaffReference StaffReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStaffReference != null - && (_staffReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference; - - return null; - } - set - { - _staffReferenceExplicitlyAssigned = true; - _staffReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudent _student; - /// - /// Month, day, and year of a teacher's assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffSectionAssociation.LocalCourseCode - { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.LocalCourseCode; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.LocalCourseCode = value; - } - } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStaffSectionAssociation.SchoolId + [IgnoreDataMember] + Entities.Common.EdFi.IStudent IStudentIdentificationDocument.Student { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolId = value; - } + get { return _student; } + set { SetStudent(value); } } - /// - /// The identifier for the school year. - /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStaffSectionAssociation.SchoolYear + public Entities.Common.EdFi.IStudent Student { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolYear = value; - } + set { SetStudent(value); } } - /// - /// The local identifier assigned to a section. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffSectionAssociation.SectionIdentifier + private void SetStudent(Entities.Common.EdFi.IStudent value) { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SectionIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SectionIdentifier = value; - } + _student = value; } /// - /// The identifier for the calendar for the academic session. + /// The primary function of the document used for establishing identity. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffSectionAssociation.SessionName - { - get - { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SessionName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SessionName = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] + public string IdentificationDocumentUseDescriptor { get; set; } /// - /// A unique alphanumeric code assigned to a staff. + /// The category of the document relative to its purpose. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStaffSectionAssociation.StaffUniqueId - { - get - { - if (ImplicitStaffReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStaffReference.IsReferenceFullyDefined())) - return ImplicitStaffReference.StaffUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Staff - _staffReferenceExplicitlyAssigned = false; - ImplicitStaffReference.StaffUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Staff", value); - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] + public string PersonalInformationVerificationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -168934,7 +175753,7 @@ string Entities.Common.EdFi.IStaffSectionAssociation.StaffUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStaffSectionAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentIdentificationDocument; if (ReferenceEquals(this, compareTo)) return true; @@ -168942,39 +175761,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Standard Property - if (!(this as Entities.Common.EdFi.IStaffSectionAssociation).BeginDate.Equals(compareTo.BeginDate)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).LocalCourseCode, compareTo.LocalCourseCode)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolId.Equals(compareTo.SchoolId)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolYear.Equals(compareTo.SchoolYear)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).SectionIdentifier, compareTo.SectionIdentifier)) + // Parent Property + if (_student == null || !_student.Equals(compareTo.Student)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).SessionName, compareTo.SessionName)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStaffSectionAssociation).StaffUniqueId, compareTo.StaffUniqueId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) return false; @@ -168990,28 +175788,17 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_student != null) + hash.Add(_student); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).BeginDate); - - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).LocalCourseCode); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SchoolYear); + hash.Add((this as Entities.Common.EdFi.IStudentIdentificationDocument).IdentificationDocumentUseDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SectionIdentifier); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).SessionName); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentIdentificationDocument).PersonalInformationVerificationDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStaffSectionAssociation).StaffUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -169026,42 +175813,43 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The type of position the staff member holds in the specific class/section. + /// The day when the document expires, if null then never expires. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="classroomPositionDescriptor")][DescriptorExists("ClassroomPositionDescriptor")] - public string ClassroomPositionDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DocumentExpirationDate { get; set; } /// - /// Month, day, and year of the last day of a staff member's assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The title of the document given by the issuer. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="documentTitle")] + public string DocumentTitle { get; set; } /// - /// An indication of whether a teacher is classified as highly qualified for his/her assignment according to state definition. This attribute indicates the teacher is highly qualified for this section being taught. + /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="highlyQualifiedTeacher")] - public bool? HighlyQualifiedTeacher { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] + public string IssuerCountryDescriptor { get; set; } /// - /// Indicates the percentage of the total scheduled course time, academic standards, and/or learning activities delivered in this section by this staff member. A teacher of record designation may be based solely or partially on this contribution percentage. + /// The unique identifier on the issuer's identification system. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9.9999", "9.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="percentageContribution")] - public decimal? PercentageContribution { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerDocumentIdentificationCode")] + public string IssuerDocumentIdentificationCode { get; set; } /// - /// Indicates that the entire section is excluded from calculation of value-added or growth attribution calculations used for a particular teacher evaluation. + /// Name of the entity or institution that issued the document. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="teacherStudentDataLinkExclusion")] - public bool? TeacherStudentDataLinkExclusion { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerName")] + public string IssuerName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -169082,7 +175870,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StaffSectionAssociation", "StaffSectionAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentIdentificationDocument")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -169094,13 +175882,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -169113,46 +175894,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StaffSectionAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStaffSectionAssociation)target); + return Entities.Common.EdFi.StudentIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentIdentificationDocument)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StaffSectionAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStaffSectionAssociation)target, null); + Entities.Common.EdFi.StudentIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStudentIdentificationDocument)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStaffSectionAssociation.SectionResourceId - { - get { return null; } - set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffSectionAssociation.SectionDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitSectionReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStaffSectionAssociation.StaffResourceId - { - get { return null; } - set { ImplicitStaffReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStaffSectionAssociation.StaffDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStaffReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -169170,6 +175923,7 @@ string Entities.Common.EdFi.IStaffSectionAssociation.StaffDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -169220,9 +175974,9 @@ string Entities.Common.EdFi.IStaffSectionAssociation.StaffDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StaffSectionAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -169250,22 +176004,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StateAbbreviationDescriptor table of the StateAbbreviationDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.StudentOtherName table of the Student aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StateAbbreviationDescriptor : Entities.Common.EdFi.IStateAbbreviationDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class StudentOtherName : Entities.Common.EdFi.IStudentOtherName, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StateAbbreviationDescriptor"); + private static FullName _fullName = new FullName("edfi", "StudentOtherName"); // Fluent validator instance (threadsafe) - private static StateAbbreviationDescriptorPutPostRequestValidator _validator = new StateAbbreviationDescriptorPutPostRequestValidator(); + private static StudentOtherNamePutPostRequestValidator _validator = new StudentOtherNamePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -169282,13 +176031,6 @@ public class StateAbbreviationDescriptor : Entities.Common.EdFi.IStateAbbreviati // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StateAbbreviationDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -169299,19 +176041,33 @@ public class StateAbbreviationDescriptor : Entities.Common.EdFi.IStateAbbreviati //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudent _student; - /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. - /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int StateAbbreviationDescriptorId { get; set; } + [IgnoreDataMember] + Entities.Common.EdFi.IStudent IStudentOtherName.Student + { + get { return _student; } + set { SetStudent(value); } + } - int IDescriptor.DescriptorId + public Entities.Common.EdFi.IStudent Student { - get { return StateAbbreviationDescriptorId; } - set { StateAbbreviationDescriptorId = value; } + set { SetStudent(value); } + } + + private void SetStudent(Entities.Common.EdFi.IStudent value) + { + _student = value; } + + /// + /// The types of alternate names for an individual. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="otherNameTypeDescriptor")][DescriptorExists("OtherNameTypeDescriptor")] + public string OtherNameTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -169326,7 +176082,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStateAbbreviationDescriptor; + var compareTo = obj as Entities.Common.EdFi.IStudentOtherName; if (ReferenceEquals(this, compareTo)) return true; @@ -169334,9 +176090,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_student == null || !_student.Equals(compareTo.Student)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IStateAbbreviationDescriptor).StateAbbreviationDescriptorId.Equals(compareTo.StateAbbreviationDescriptorId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentOtherName).OtherNameTypeDescriptor, compareTo.OtherNameTypeDescriptor)) return false; @@ -169352,9 +176112,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_student != null) + hash.Add(_student); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IStateAbbreviationDescriptor).StateAbbreviationDescriptorId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentOtherName).OtherNameTypeDescriptor); return hash.ToHashCode(); } @@ -169363,60 +176126,53 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The description of the descriptor. + /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="firstName")] + public string FirstName { get; set; } /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } + [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="generationCodeSuffix")] + public string GenerationCodeSuffix { get; set; } /// - /// The end date of the period when the descriptor is in effect. + /// The name borne in common by members of a family. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="lastSurname")] + public string LastSurname { get; set; } /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. + /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="middleName")] + public string MiddleName { get; set; } /// - /// A shortened description for the descriptor. + /// A prefix used to denote the title, degree, position, or seniority of the individual. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="personalTitlePrefix")] + public string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -169437,11 +176193,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentOtherName")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -169452,13 +176205,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -169471,12 +176217,12 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StateAbbreviationDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateAbbreviationDescriptor)target); + return Entities.Common.EdFi.StudentOtherNameMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentOtherName)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StateAbbreviationDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStateAbbreviationDescriptor)target, null); + Entities.Common.EdFi.StudentOtherNameMapper.MapTo(this, (Entities.Common.EdFi.IStudentOtherName)target, null); } // ------------------------------------------------------------- @@ -169484,6 +176230,66 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -169491,9 +176297,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StateAbbreviationDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentOtherNamePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -169521,86 +176327,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StateEducationAgency resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class StateEducationAgencyReference : IResourceReference - { - [DataMember(Name="stateEducationAgencyId")] - public long StateEducationAgencyId { get; set; } - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return StateEducationAgencyId != default(long); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (StateEducationAgencyId == default) - { - yield return "StateEducationAgencyId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "StateEducationAgency", - Href = $"/ed-fi/stateEducationAgencies/{ResourceId:n}" - }; - - return link; - } - } // Aggregate reference - /// - /// A class which represents the edfi.StateEducationAgency table of the StateEducationAgency aggregate in the ODS Database. + /// A class which represents the edfi.StudentPersonalIdentificationDocument table of the Student aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StateEducationAgency : Entities.Common.EdFi.IStateEducationAgency, Entities.Common.EdFi.IEducationOrganization, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentPersonalIdentificationDocument : Entities.Common.EdFi.IStudentPersonalIdentificationDocument, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StateEducationAgency"); + private static FullName _fullName = new FullName("edfi", "StudentPersonalIdentificationDocument"); // Fluent validator instance (threadsafe) - private static StateEducationAgencyPutPostRequestValidator _validator = new StateEducationAgencyPutPostRequestValidator(); + private static StudentPersonalIdentificationDocumentPutPostRequestValidator _validator = new StudentPersonalIdentificationDocumentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -169611,32 +176348,12 @@ public class StateEducationAgency : Entities.Common.EdFi.IStateEducationAgency, // Constructor // ------------------------------------------------------------- - public StateEducationAgency() - { - StateEducationAgencyAccountabilities = new List(); - StateEducationAgencyFederalFunds = new List(); - - // Inherited lists - EducationOrganizationAddresses = new List(); - EducationOrganizationCategories = new List(); - EducationOrganizationIdentificationCodes = new List(); - EducationOrganizationIndicators = new List(); - EducationOrganizationInstitutionTelephones = new List(); - EducationOrganizationInternationalAddresses = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StateEducationAgency resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -169647,20 +176364,42 @@ public StateEducationAgency() //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudent _student; + + [IgnoreDataMember] + Entities.Common.EdFi.IStudent IStudentPersonalIdentificationDocument.Student + { + get { return _student; } + set { SetStudent(value); } + } + + public Entities.Common.EdFi.IStudent Student + { + set { SetStudent(value); } + } + + private void SetStudent(Entities.Common.EdFi.IStudent value) + { + _student = value; + } /// - /// The identifier assigned to a state education agency. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The primary function of the document used for establishing identity. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="stateEducationAgencyId")] - public long StateEducationAgencyId { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] + public string IdentificationDocumentUseDescriptor { get; set; } - long IEducationOrganization.EducationOrganizationId - { - get { return StateEducationAgencyId; } - set { StateEducationAgencyId = value; } - } + /// + /// The category of the document relative to its purpose. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] + public string PersonalInformationVerificationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -169675,7 +176414,7 @@ long IEducationOrganization.EducationOrganizationId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStateEducationAgency; + var compareTo = obj as Entities.Common.EdFi.IStudentPersonalIdentificationDocument; if (ReferenceEquals(this, compareTo)) return true; @@ -169683,9 +176422,18 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_student == null || !_student.Equals(compareTo.Student)) + return false; - // Derived Property - if (!(this as Entities.Common.EdFi.IStateEducationAgency).StateEducationAgencyId.Equals(compareTo.StateEducationAgencyId)) + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) return false; @@ -169701,9 +176449,16 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_student != null) + hash.Add(_student); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IStateEducationAgency).StateEducationAgencyId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).IdentificationDocumentUseDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).PersonalInformationVerificationDescriptor); return hash.ToHashCode(); } @@ -169712,320 +176467,368 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The full, legally accepted name of the institution. + /// The day when the document expires, if null then never expires. /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="nameOfInstitution")] - public string NameOfInstitution { get; set; } + [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DocumentExpirationDate { get; set; } /// - /// The current operational status of the education organization (e.g., active, inactive). + /// The title of the document given by the issuer. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="documentTitle")] + public string DocumentTitle { get; set; } + + /// + /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="operationalStatusDescriptor")][DescriptorExists("OperationalStatusDescriptor")] - public string OperationalStatusDescriptor { get; set; } + [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] + public string IssuerCountryDescriptor { get; set; } /// - /// A short name for the institution. + /// The unique identifier on the issuer's identification system. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortNameOfInstitution")] - public string ShortNameOfInstitution { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerDocumentIdentificationCode")] + public string IssuerDocumentIdentificationCode { get; set; } /// - /// The public web site address (URL) for the education organization. + /// Name of the entity or institution that issued the document. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="webSite")] - public string WebSite { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerName")] + public string IssuerName { get; set; } // ------------------------------------------------------------- // ============================================================= - // Properties + // One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Inherited One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Inherited One-to-one relationships + // Inherited Collections // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Inherited Collections + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentPersonalIdentificationDocument")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - [NoDuplicateMembers] - [DataMember(Name="addresses")] - public ICollection EducationOrganizationAddresses + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) { - get { return _educationOrganizationAddresses; } - set - { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); - } + return Entities.Common.EdFi.StudentPersonalIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentPersonalIdentificationDocument)target); } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + void IMappable.Map(object target) { - get { return _educationOrganizationAddressesCovariant; } - set { EducationOrganizationAddresses = new List(value.Cast()); } + Entities.Common.EdFi.StudentPersonalIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStudentPersonalIdentificationDocument)target, null); } - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; + // ------------------------------------------------------------- - [NoDuplicateMembers][RequiredCollection] - [DataMember(Name="categories")] - public ICollection EducationOrganizationCategories + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - get { return _educationOrganizationCategories; } - set + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; } + // ---------------------------------- } + } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories - { - get { return _educationOrganizationCategoriesCovariant; } - set { EducationOrganizationCategories = new List(value.Cast()); } - } - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; + // ================================================================= + // Validators + // ----------------------------------------------------------------- - [NoDuplicateMembers] - [DataMember(Name="identificationCodes")] - public ICollection EducationOrganizationIdentificationCodes + [ExcludeFromCodeCoverage] + public class StudentPersonalIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { - get { return _educationOrganizationIdentificationCodes; } - set + if (context.InstanceToValidate == null) { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes - { - get { return _educationOrganizationIdentificationCodesCovariant; } - set { EducationOrganizationIdentificationCodes = new List(value.Cast()); } - } - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; + var instance = context.InstanceToValidate; - [NoDuplicateMembers] - [DataMember(Name="indicators")] - public ICollection EducationOrganizationIndicators - { - get { return _educationOrganizationIndicators; } - set + var failures = new List(); + + if (failures.Any()) { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators - { - get { return _educationOrganizationIndicatorsCovariant; } - set { EducationOrganizationIndicators = new List(value.Cast()); } + return true; } - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StudentVisa table of the Student aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StudentVisa : Entities.Common.EdFi.IStudentVisa, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StudentVisa"); + + // Fluent validator instance (threadsafe) + private static StudentVisaPutPostRequestValidator _validator = new StudentVisaPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ - [NoDuplicateMembers] - [DataMember(Name="institutionTelephones")] - public ICollection EducationOrganizationInstitutionTelephones - { - get { return _educationOrganizationInstitutionTelephones; } - set - { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); - } - } + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudent _student; + + [IgnoreDataMember] + Entities.Common.EdFi.IStudent IStudentVisa.Student { - get { return _educationOrganizationInstitutionTelephonesCovariant; } - set { EducationOrganizationInstitutionTelephones = new List(value.Cast()); } + get { return _student; } + set { SetStudent(value); } } - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - [NoDuplicateMembers] - [DataMember(Name="internationalAddresses")] - public ICollection EducationOrganizationInternationalAddresses + public Entities.Common.EdFi.IStudent Student { - get { return _educationOrganizationInternationalAddresses; } - set - { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } + set { SetStudent(value); } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + private void SetStudent(Entities.Common.EdFi.IStudent value) { - get { return _educationOrganizationInternationalAddressesCovariant; } - set { EducationOrganizationInternationalAddresses = new List(value.Cast()); } + _student = value; } - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StateEducationAgency", "StateEducationAgency")] - public System.Collections.IDictionary Extensions { get; set; } + /// + /// An indicator of a non-US citizen's Visa type. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="visaDescriptor")][DescriptorExists("VisaDescriptor")] + public string VisaDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= - // Collections + // Equality // ------------------------------------------------------------- - private ICollection _stateEducationAgencyAccountabilities; - private ICollection _stateEducationAgencyAccountabilitiesCovariant; - [NoDuplicateMembers] - [DataMember(Name="accountabilities")] - public ICollection StateEducationAgencyAccountabilities + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) { - get { return _stateEducationAgencyAccountabilities; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyAccountability)e.Item).StateEducationAgency = this); - _stateEducationAgencyAccountabilities = list; + var compareTo = obj as Entities.Common.EdFi.IStudentVisa; - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyAccountability)e.Item).StateEducationAgency = this; - _stateEducationAgencyAccountabilitiesCovariant = covariantList; - } - } + if (ReferenceEquals(this, compareTo)) + return true; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStateEducationAgency.StateEducationAgencyAccountabilities - { - get { return _stateEducationAgencyAccountabilitiesCovariant; } - set { StateEducationAgencyAccountabilities = new List(value.Cast()); } - } + if (compareTo == null) + return false; - private ICollection _stateEducationAgencyFederalFunds; - private ICollection _stateEducationAgencyFederalFundsCovariant; + // Parent Property + if (_student == null || !_student.Equals(compareTo.Student)) + return false; - [NoDuplicateMembers] - [DataMember(Name="federalFunds")] - public ICollection StateEducationAgencyFederalFunds - { - get { return _stateEducationAgencyFederalFunds; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyFederalFunds)e.Item).StateEducationAgency = this); - _stateEducationAgencyFederalFunds = list; - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStateEducationAgencyFederalFunds)e.Item).StateEducationAgency = this; - _stateEducationAgencyFederalFundsCovariant = covariantList; - } + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentVisa).VisaDescriptor, compareTo.VisaDescriptor)) + return false; + + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStateEducationAgency.StateEducationAgencyFederalFunds + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() { - get { return _stateEducationAgencyFederalFundsCovariant; } - set { StateEducationAgencyFederalFunds = new List(value.Cast()); } - } + var hash = new HashCode(); + //Parent Property + if (_student != null) + hash.Add(_student); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentVisa).VisaDescriptor); + return hash.ToHashCode(); + } // ------------------------------------------------------------- // ============================================================= - // Versioning + // Inherited Properties // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- + // ============================================================= + // Properties // ------------------------------------------------------------- - // OnDeserialize // ------------------------------------------------------------- - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_educationOrganizationAddresses != null) foreach (var item in _educationOrganizationAddresses) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationCategories != null) foreach (var item in _educationOrganizationCategories) - { - item.EducationOrganization = this; - } - - if (_educationOrganizationIdentificationCodes != null) foreach (var item in _educationOrganizationIdentificationCodes) - { - item.EducationOrganization = this; - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_educationOrganizationIndicators != null) foreach (var item in _educationOrganizationIndicators) - { - item.EducationOrganization = this; - } + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_educationOrganizationInstitutionTelephones != null) foreach (var item in _educationOrganizationInstitutionTelephones) - { - item.EducationOrganization = this; - } + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_educationOrganizationInternationalAddresses != null) foreach (var item in _educationOrganizationInternationalAddresses) - { - item.EducationOrganization = this; - } + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentVisa")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- - if (_stateEducationAgencyAccountabilities != null) foreach (var item in _stateEducationAgencyAccountabilities) - { - item.StateEducationAgency = this; - } + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - if (_stateEducationAgencyFederalFunds != null) foreach (var item in _stateEducationAgencyFederalFunds) - { - item.StateEducationAgency = this; - } + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- - } + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- // ------------------------------------------------------------ // ============================================================ @@ -170033,12 +176836,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StateEducationAgencyMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateEducationAgency)target); + return Entities.Common.EdFi.StudentVisaMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentVisa)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StateEducationAgencyMapper.MapTo(this, (Entities.Common.EdFi.IStateEducationAgency)target, null); + Entities.Common.EdFi.StudentVisaMapper.MapTo(this, (Entities.Common.EdFi.IStudentVisa)target, null); } // ------------------------------------------------------------- @@ -170062,107 +176865,12 @@ void IMappable.Map(object target) try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (EducationOrganizationAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationAddresses")))) - { - yield return result; - } - } - - if (EducationOrganizationCategories.Any() && mappingContract?.IsMemberSupported("EducationOrganizationCategories") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationCategories"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationCategories, validationContext, validationContext.Items.ForCollection("EducationOrganizationCategories")))) - { - yield return result; - } - } - - if (EducationOrganizationIdentificationCodes.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIdentificationCodes") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIdentificationCodes"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIdentificationCodes, validationContext, validationContext.Items.ForCollection("EducationOrganizationIdentificationCodes")))) - { - yield return result; - } - } - - if (EducationOrganizationIndicators.Any() && mappingContract?.IsMemberSupported("EducationOrganizationIndicators") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationIndicators"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationIndicators, validationContext, validationContext.Items.ForCollection("EducationOrganizationIndicators")))) - { - yield return result; - } - } - - if (EducationOrganizationInstitutionTelephones.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInstitutionTelephones") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInstitutionTelephones"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInstitutionTelephones, validationContext, validationContext.Items.ForCollection("EducationOrganizationInstitutionTelephones")))) - { - yield return result; - } - } - - if (EducationOrganizationInternationalAddresses.Any() && mappingContract?.IsMemberSupported("EducationOrganizationInternationalAddresses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("EducationOrganizationInternationalAddresses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(EducationOrganizationInternationalAddresses, validationContext, validationContext.Items.ForCollection("EducationOrganizationInternationalAddresses")))) - { - yield return result; - } - } - - if (StateEducationAgencyAccountabilities.Any() && mappingContract?.IsMemberSupported("StateEducationAgencyAccountabilities") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StateEducationAgencyAccountabilities"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StateEducationAgencyAccountabilities, validationContext, validationContext.Items.ForCollection("StateEducationAgencyAccountabilities")))) - { - yield return result; - } - } - - if (StateEducationAgencyFederalFunds.Any() && mappingContract?.IsMemberSupported("StateEducationAgencyFederalFunds") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StateEducationAgencyFederalFunds"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StateEducationAgencyFederalFunds, validationContext, validationContext.Items.ForCollection("StateEducationAgencyFederalFunds")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -170208,21 +176916,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StateEducationAgencyPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentVisaPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StateEducationAgency = new FullName("edfi", "StateEducationAgency"); - - // Declare collection item validators - private StateEducationAgencyAccountabilityPutPostRequestValidator _stateEducationAgencyAccountabilitiesValidator = new (); - private StateEducationAgencyFederalFundsPutPostRequestValidator _stateEducationAgencyFederalFundsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationAddressPutPostRequestValidator _educationOrganizationAddressesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationCategoryPutPostRequestValidator _educationOrganizationCategoriesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIdentificationCodePutPostRequestValidator _educationOrganizationIdentificationCodesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationIndicatorPutPostRequestValidator _educationOrganizationIndicatorsValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInstitutionTelephonePutPostRequestValidator _educationOrganizationInstitutionTelephonesValidator = new (); - private EducationOrganization.EdFi.EducationOrganizationInternationalAddressPutPostRequestValidator _educationOrganizationInternationalAddressesValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -170235,131 +176931,159 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StateEducationAgencyMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StateEducationAgency); - - if (mappingContract != null) + if (failures.Any()) { - if (mappingContract.IsStateEducationAgencyAccountabilityIncluded != null) + foreach (var failure in failures) { - var hasInvalidStateEducationAgencyAccountabilitiesItems = instance.StateEducationAgencyAccountabilities.Any(x => !mappingContract.IsStateEducationAgencyAccountabilityIncluded(x)); - - if (hasInvalidStateEducationAgencyAccountabilitiesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StateEducationAgencyAccountabilities", $"A supplied 'StateEducationAgencyAccountability' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } + result.Errors.Add(failure); } - if (mappingContract.IsStateEducationAgencyFederalFundsIncluded != null) - { - var hasInvalidStateEducationAgencyFederalFundsItems = instance.StateEducationAgencyFederalFunds.Any(x => !mappingContract.IsStateEducationAgencyFederalFundsIncluded(x)); - - if (hasInvalidStateEducationAgencyFederalFundsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StateEducationAgencyFederalFunds", $"A supplied 'StateEducationAgencyFederalFunds' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + return false; + } - if (mappingContract.IsEducationOrganizationAddressIncluded != null) - { - var hasInvalidEducationOrganizationAddressesItems = instance.EducationOrganizationAddresses.Any(x => !mappingContract.IsEducationOrganizationAddressIncluded(x)); - - if (hasInvalidEducationOrganizationAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationAddresses", $"A supplied 'EducationOrganizationAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + return true; + } + } + // ----------------------------------------------------------------- - if (mappingContract.IsEducationOrganizationCategoryIncluded != null) - { - var hasInvalidEducationOrganizationCategoriesItems = instance.EducationOrganizationCategories.Any(x => !mappingContract.IsEducationOrganizationCategoryIncluded(x)); - - if (hasInvalidEducationOrganizationCategoriesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationCategories", $"A supplied 'EducationOrganizationCategory' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } +} +// Aggregate: StudentAcademicRecord - if (mappingContract.IsEducationOrganizationIdentificationCodeIncluded != null) - { - var hasInvalidEducationOrganizationIdentificationCodesItems = instance.EducationOrganizationIdentificationCodes.Any(x => !mappingContract.IsEducationOrganizationIdentificationCodeIncluded(x)); - - if (hasInvalidEducationOrganizationIdentificationCodesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIdentificationCodes", $"A supplied 'EducationOrganizationIdentificationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } +namespace EdFi.Ods.Api.Common.Models.Resources.StudentAcademicRecord.EdFi +{ + /// + /// Represents a reference to the StudentAcademicRecord resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StudentAcademicRecordReference : IResourceReference + { + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } - if (mappingContract.IsEducationOrganizationIndicatorIncluded != null) - { - var hasInvalidEducationOrganizationIndicatorsItems = instance.EducationOrganizationIndicators.Any(x => !mappingContract.IsEducationOrganizationIndicatorIncluded(x)); - - if (hasInvalidEducationOrganizationIndicatorsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationIndicators", $"A supplied 'EducationOrganizationIndicator' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } - if (mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded != null) - { - var hasInvalidEducationOrganizationInstitutionTelephonesItems = instance.EducationOrganizationInstitutionTelephones.Any(x => !mappingContract.IsEducationOrganizationInstitutionTelephoneIncluded(x)); - - if (hasInvalidEducationOrganizationInstitutionTelephonesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInstitutionTelephones", $"A supplied 'EducationOrganizationInstitutionTelephone' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; - if (mappingContract.IsEducationOrganizationInternationalAddressIncluded != null) + [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] + public string TermDescriptor { get; set; } + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) { - var hasInvalidEducationOrganizationInternationalAddressesItems = instance.EducationOrganizationInternationalAddresses.Any(x => !mappingContract.IsEducationOrganizationInternationalAddressIncluded(x)); - - if (hasInvalidEducationOrganizationInternationalAddressesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("EducationOrganizationInternationalAddresses", $"A supplied 'EducationOrganizationInternationalAddress' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); } + return _link; } + } - if (failures.Any()) + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return EducationOrganizationId != default(long) && SchoolYear != default(short) && StudentUniqueId != default(string) && TermDescriptor != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (EducationOrganizationId == default) { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + yield return "EducationOrganizationId"; + } - return false; + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + if (TermDescriptor == default) + { + yield return "TermDescriptor"; } - return true; } - } - // ----------------------------------------------------------------- + + private Link CreateLink() + { + var link = new Link + { + Rel = "StudentAcademicRecord", + Href = $"/ed-fi/studentAcademicRecords/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference /// - /// A class which represents the edfi.StateEducationAgencyAccountability table of the StateEducationAgency aggregate in the ODS Database. + /// A class which represents the edfi.StudentAcademicRecord table of the StudentAcademicRecord aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StateEducationAgencyAccountability : Entities.Common.EdFi.IStateEducationAgencyAccountability, IValidatableObject + public class StudentAcademicRecord : Entities.Common.EdFi.IStudentAcademicRecord, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StateEducationAgencyAccountability"); + private static FullName _fullName = new FullName("edfi", "StudentAcademicRecord"); // Fluent validator instance (threadsafe) - private static StateEducationAgencyAccountabilityPutPostRequestValidator _validator = new StateEducationAgencyAccountabilityPutPostRequestValidator(); + private static StudentAcademicRecordPutPostRequestValidator _validator = new StudentAcademicRecordPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -170370,18 +177094,66 @@ public class StateEducationAgencyAccountability : Entities.Common.EdFi.IStateEdu // Constructor // ------------------------------------------------------------- + public StudentAcademicRecord() + { + StudentAcademicRecordAcademicHonors = new List(); + StudentAcademicRecordDiplomas = new List(); + StudentAcademicRecordGradePointAverages = new List(); + StudentAcademicRecordRecognitions = new List(); + StudentAcademicRecordReportCards = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentAcademicRecord resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } private bool _schoolYearTypeReferenceExplicitlyAssigned; private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference @@ -170415,35 +177187,75 @@ public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference _schoolYearTypeReference = value; } } + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); + + return _studentReference; + } + } + + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; + + return null; + } + set + { + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStateEducationAgency _stateEducationAgency; - [IgnoreDataMember] - Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyAccountability.StateEducationAgency + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationId { - get { return _stateEducationAgency; } - set { SetStateEducationAgency(value); } - } + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; - public Entities.Common.EdFi.IStateEducationAgency StateEducationAgency - { - set { SetStateEducationAgency(value); } - } + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced - private void SetStateEducationAgency(Entities.Common.EdFi.IStateEducationAgency value) - { - _stateEducationAgency = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } } /// - /// The school year for which the accountability is reported. + /// The identifier for the school year. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStateEducationAgencyAccountability.SchoolYear + short Entities.Common.EdFi.IStudentAcademicRecord.SchoolYear { get { @@ -170463,6 +177275,41 @@ short Entities.Common.EdFi.IStateEducationAgencyAccountability.SchoolYear ImplicitSchoolYearTypeReference.SchoolYear = value; } } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAcademicRecord.StudentUniqueId + { + get + { + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + + /// + /// The term for the session during the school year. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] + public string TermDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -170477,7 +177324,7 @@ short Entities.Common.EdFi.IStateEducationAgencyAccountability.SchoolYear /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStateEducationAgencyAccountability; + var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecord; if (ReferenceEquals(this, compareTo)) return true; @@ -170485,13 +177332,24 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_stateEducationAgency == null || !_stateEducationAgency.Equals(compareTo.StateEducationAgency)) + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAcademicRecord).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStateEducationAgencyAccountability).SchoolYear.Equals(compareTo.SchoolYear)) + if (!(this as Entities.Common.EdFi.IStudentAcademicRecord).SchoolYear.Equals(compareTo.SchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAcademicRecord).StudentUniqueId, compareTo.StudentUniqueId)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecord).TermDescriptor, compareTo.TermDescriptor)) return false; @@ -170507,12 +177365,19 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_stateEducationAgency != null) - hash.Add(_stateEducationAgency); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStateEducationAgencyAccountability).SchoolYear); + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).SchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).StudentUniqueId); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).TermDescriptor); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -170527,16 +177392,125 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// An indication of whether CTE concentrators are included in the state's computation of its graduation rate. + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="cteGraduationRateInclusion")] - public bool? CTEGraduationRateInclusion { get; set; } + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="cumulativeAttemptedCreditConversion")] + public decimal? CumulativeAttemptedCreditConversion { get; set; } + + /// + /// The value of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="cumulativeAttemptedCredits")] + public decimal? CumulativeAttemptedCredits { get; set; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="cumulativeAttemptedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string CumulativeAttemptedCreditTypeDescriptor { get; set; } + + /// + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="cumulativeEarnedCreditConversion")] + public decimal? CumulativeEarnedCreditConversion { get; set; } + + /// + /// The value of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="cumulativeEarnedCredits")] + public decimal? CumulativeEarnedCredits { get; set; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="cumulativeEarnedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string CumulativeEarnedCreditTypeDescriptor { get; set; } + + /// + /// The month and year the student is projected to graduate. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="projectedGraduationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? ProjectedGraduationDate { get; set; } + + /// + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="sessionAttemptedCreditConversion")] + public decimal? SessionAttemptedCreditConversion { get; set; } + + /// + /// The value of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="sessionAttemptedCredits")] + public decimal? SessionAttemptedCredits { get; set; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="sessionAttemptedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string SessionAttemptedCreditTypeDescriptor { get; set; } + + /// + /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="sessionEarnedCreditConversion")] + public decimal? SessionEarnedCreditConversion { get; set; } + + /// + /// The value of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="sessionEarnedCredits")] + public decimal? SessionEarnedCredits { get; set; } + + /// + /// The type of credits or units of value awarded for the completion of a course. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="sessionEarnedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] + public string SessionEarnedCreditTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + /// + /// classRanking + /// + + [DataMember(Name = "classRanking")] + public StudentAcademicRecordClassRanking StudentAcademicRecordClassRanking { get; set; } + + Entities.Common.EdFi.IStudentAcademicRecordClassRanking Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordClassRanking + { + get { return StudentAcademicRecordClassRanking; } + set { StudentAcademicRecordClassRanking = (StudentAcademicRecordClassRanking) value; } + } + // ------------------------------------------------------------- // ============================================================= @@ -170549,26 +177523,214 @@ public override int GetHashCode() // ------------------------------------------------------------- // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StateEducationAgency", "StateEducationAgencyAccountability")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecord")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + private ICollection _studentAcademicRecordAcademicHonors; + private ICollection _studentAcademicRecordAcademicHonorsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="academicHonors")] + public ICollection StudentAcademicRecordAcademicHonors + { + get { return _studentAcademicRecordAcademicHonors; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)e.Item).StudentAcademicRecord = this); + _studentAcademicRecordAcademicHonors = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)e.Item).StudentAcademicRecord = this; + _studentAcademicRecordAcademicHonorsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordAcademicHonors + { + get { return _studentAcademicRecordAcademicHonorsCovariant; } + set { StudentAcademicRecordAcademicHonors = new List(value.Cast()); } + } + + private ICollection _studentAcademicRecordDiplomas; + private ICollection _studentAcademicRecordDiplomasCovariant; + + [NoDuplicateMembers] + [DataMember(Name="diplomas")] + public ICollection StudentAcademicRecordDiplomas + { + get { return _studentAcademicRecordDiplomas; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordDiploma)e.Item).StudentAcademicRecord = this); + _studentAcademicRecordDiplomas = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordDiploma)e.Item).StudentAcademicRecord = this; + _studentAcademicRecordDiplomasCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordDiplomas + { + get { return _studentAcademicRecordDiplomasCovariant; } + set { StudentAcademicRecordDiplomas = new List(value.Cast()); } + } + + private ICollection _studentAcademicRecordGradePointAverages; + private ICollection _studentAcademicRecordGradePointAveragesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="gradePointAverages")] + public ICollection StudentAcademicRecordGradePointAverages + { + get { return _studentAcademicRecordGradePointAverages; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)e.Item).StudentAcademicRecord = this); + _studentAcademicRecordGradePointAverages = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)e.Item).StudentAcademicRecord = this; + _studentAcademicRecordGradePointAveragesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordGradePointAverages + { + get { return _studentAcademicRecordGradePointAveragesCovariant; } + set { StudentAcademicRecordGradePointAverages = new List(value.Cast()); } + } + + private ICollection _studentAcademicRecordRecognitions; + private ICollection _studentAcademicRecordRecognitionsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="recognitions")] + public ICollection StudentAcademicRecordRecognitions + { + get { return _studentAcademicRecordRecognitions; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordRecognition)e.Item).StudentAcademicRecord = this); + _studentAcademicRecordRecognitions = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordRecognition)e.Item).StudentAcademicRecord = this; + _studentAcademicRecordRecognitionsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordRecognitions + { + get { return _studentAcademicRecordRecognitionsCovariant; } + set { StudentAcademicRecordRecognitions = new List(value.Cast()); } + } + + private ICollection _studentAcademicRecordReportCards; + private ICollection _studentAcademicRecordReportCardsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="reportCards")] + public ICollection StudentAcademicRecordReportCards + { + get { return _studentAcademicRecordReportCards; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordReportCard)e.Item).StudentAcademicRecord = this); + _studentAcademicRecordReportCards = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordReportCard)e.Item).StudentAcademicRecord = this; + _studentAcademicRecordReportCardsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordReportCards + { + get { return _studentAcademicRecordReportCardsCovariant; } + set { StudentAcademicRecordReportCards = new List(value.Cast()); } + } - // ============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_studentAcademicRecordAcademicHonors != null) foreach (var item in _studentAcademicRecordAcademicHonors) + { + item.StudentAcademicRecord = this; + } + + if (_studentAcademicRecordDiplomas != null) foreach (var item in _studentAcademicRecordDiplomas) + { + item.StudentAcademicRecord = this; + } + + if (_studentAcademicRecordGradePointAverages != null) foreach (var item in _studentAcademicRecordGradePointAverages) + { + item.StudentAcademicRecord = this; + } + + if (_studentAcademicRecordRecognitions != null) foreach (var item in _studentAcademicRecordRecognitions) + { + item.StudentAcademicRecord = this; + } + + if (_studentAcademicRecordReportCards != null) foreach (var item in _studentAcademicRecordReportCards) + { + item.StudentAcademicRecord = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -170576,25 +177738,53 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StateEducationAgencyAccountabilityMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateEducationAgencyAccountability)target); + return Entities.Common.EdFi.StudentAcademicRecordMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecord)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StateEducationAgencyAccountabilityMapper.MapTo(this, (Entities.Common.EdFi.IStateEducationAgencyAccountability)target, null); + Entities.Common.EdFi.StudentAcademicRecordMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecord)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStateEducationAgencyAccountability.SchoolYearTypeResourceId + Guid? Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAcademicRecord.SchoolYearTypeResourceId { get { return null; } set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } } + Guid? Entities.Common.EdFi.IStudentAcademicRecord.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -170612,16 +177802,87 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (StudentAcademicRecordAcademicHonors.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordAcademicHonors") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAcademicRecordAcademicHonors"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordAcademicHonors, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordAcademicHonors")))) + { + yield return result; + } + } + + if (StudentAcademicRecordDiplomas.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordDiplomas") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAcademicRecordDiplomas"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordDiplomas, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordDiplomas")))) + { + yield return result; + } + } + + if (StudentAcademicRecordGradePointAverages.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordGradePointAverages") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAcademicRecordGradePointAverages"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordGradePointAverages, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordGradePointAverages")))) + { + yield return result; + } + } + + if (StudentAcademicRecordRecognitions.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordRecognitions") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAcademicRecordRecognitions"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordRecognitions, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordRecognitions")))) + { + yield return result; + } + } + + if (StudentAcademicRecordReportCards.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordReportCards") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAcademicRecordReportCards"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordReportCards, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordReportCards")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects // --------------------------- + if (StudentAcademicRecordClassRanking != null && mappingContract?.IsMemberSupported("StudentAcademicRecordClassRanking") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAcademicRecordClassRanking"); + + foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(StudentAcademicRecordClassRanking, validationContext, validationContext.Items.ForEmbeddedObject("StudentAcademicRecordClassRanking")))) + { + yield return result; + } + } + // --------------------- // Validate Extensions @@ -170663,9 +177924,18 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StateEducationAgencyAccountabilityPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAcademicRecordPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StudentAcademicRecord = new FullName("edfi", "StudentAcademicRecord"); + + // Declare collection item validators + private StudentAcademicRecordAcademicHonorPutPostRequestValidator _studentAcademicRecordAcademicHonorsValidator = new (); + private StudentAcademicRecordDiplomaPutPostRequestValidator _studentAcademicRecordDiplomasValidator = new (); + private StudentAcademicRecordGradePointAveragePutPostRequestValidator _studentAcademicRecordGradePointAveragesValidator = new (); + private StudentAcademicRecordRecognitionPutPostRequestValidator _studentAcademicRecordRecognitionsValidator = new (); + private StudentAcademicRecordReportCardPutPostRequestValidator _studentAcademicRecordReportCardsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -170678,6 +177948,72 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StudentAcademicRecordMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAcademicRecord); + + if (mappingContract != null) + { + if (mappingContract.IsStudentAcademicRecordAcademicHonorIncluded != null) + { + var hasInvalidStudentAcademicRecordAcademicHonorsItems = instance.StudentAcademicRecordAcademicHonors.Any(x => !mappingContract.IsStudentAcademicRecordAcademicHonorIncluded(x)); + + if (hasInvalidStudentAcademicRecordAcademicHonorsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAcademicRecordAcademicHonors", $"A supplied 'StudentAcademicRecordAcademicHonor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentAcademicRecordDiplomaIncluded != null) + { + var hasInvalidStudentAcademicRecordDiplomasItems = instance.StudentAcademicRecordDiplomas.Any(x => !mappingContract.IsStudentAcademicRecordDiplomaIncluded(x)); + + if (hasInvalidStudentAcademicRecordDiplomasItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAcademicRecordDiplomas", $"A supplied 'StudentAcademicRecordDiploma' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentAcademicRecordGradePointAverageIncluded != null) + { + var hasInvalidStudentAcademicRecordGradePointAveragesItems = instance.StudentAcademicRecordGradePointAverages.Any(x => !mappingContract.IsStudentAcademicRecordGradePointAverageIncluded(x)); + + if (hasInvalidStudentAcademicRecordGradePointAveragesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAcademicRecordGradePointAverages", $"A supplied 'StudentAcademicRecordGradePointAverage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentAcademicRecordRecognitionIncluded != null) + { + var hasInvalidStudentAcademicRecordRecognitionsItems = instance.StudentAcademicRecordRecognitions.Any(x => !mappingContract.IsStudentAcademicRecordRecognitionIncluded(x)); + + if (hasInvalidStudentAcademicRecordRecognitionsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAcademicRecordRecognitions", $"A supplied 'StudentAcademicRecordRecognition' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentAcademicRecordReportCardIncluded != null) + { + var hasInvalidStudentAcademicRecordReportCardsItems = instance.StudentAcademicRecordReportCards.Any(x => !mappingContract.IsStudentAcademicRecordReportCardIncluded(x)); + + if (hasInvalidStudentAcademicRecordReportCardsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAcademicRecordReportCards", $"A supplied 'StudentAcademicRecordReportCard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -170694,16 +178030,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StateEducationAgencyFederalFunds table of the StateEducationAgency aggregate in the ODS Database. + /// A class which represents the edfi.StudentAcademicRecordAcademicHonor table of the StudentAcademicRecord aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StateEducationAgencyFederalFunds : Entities.Common.EdFi.IStateEducationAgencyFederalFunds, IValidatableObject + public class StudentAcademicRecordAcademicHonor : Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StateEducationAgencyFederalFunds"); + private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordAcademicHonor"); // Fluent validator instance (threadsafe) - private static StateEducationAgencyFederalFundsPutPostRequestValidator _validator = new StateEducationAgencyFederalFundsPutPostRequestValidator(); + private static StudentAcademicRecordAcademicHonorPutPostRequestValidator _validator = new StudentAcademicRecordAcademicHonorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -170730,32 +178066,42 @@ public class StateEducationAgencyFederalFunds : Entities.Common.EdFi.IStateEduca //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStateEducationAgency _stateEducationAgency; + private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; [IgnoreDataMember] - Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyFederalFunds.StateEducationAgency + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordAcademicHonor.StudentAcademicRecord { - get { return _stateEducationAgency; } - set { SetStateEducationAgency(value); } + get { return _studentAcademicRecord; } + set { SetStudentAcademicRecord(value); } } - public Entities.Common.EdFi.IStateEducationAgency StateEducationAgency + public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord { - set { SetStateEducationAgency(value); } + set { SetStudentAcademicRecord(value); } } - private void SetStateEducationAgency(Entities.Common.EdFi.IStateEducationAgency value) + private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) { - _stateEducationAgency = value; + _studentAcademicRecord = value; } /// - /// The fiscal year for which the federal funds are received. + /// A designation of the type of academic distinctions earned by or awarded to the individual. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="academicHonorCategoryDescriptor")][DescriptorExists("AcademicHonorCategoryDescriptor")] + public string AcademicHonorCategoryDescriptor { get; set; } + + /// + /// A description of the type of academic distinctions earned by or awarded to the individual. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="fiscalYear")] - public int FiscalYear { get; set; } + [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="honorDescription")] + public string HonorDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -170770,7 +178116,7 @@ private void SetStateEducationAgency(Entities.Common.EdFi.IStateEducationAgency /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStateEducationAgencyFederalFunds; + var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor; if (ReferenceEquals(this, compareTo)) return true; @@ -170779,12 +178125,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_stateEducationAgency == null || !_stateEducationAgency.Equals(compareTo.StateEducationAgency)) + if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) return false; // Standard Property - if (!(this as Entities.Common.EdFi.IStateEducationAgencyFederalFunds).FiscalYear.Equals(compareTo.FiscalYear)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).AcademicHonorCategoryDescriptor, compareTo.AcademicHonorCategoryDescriptor)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).HonorDescription, compareTo.HonorDescription)) return false; @@ -170801,11 +178152,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_stateEducationAgency != null) - hash.Add(_stateEducationAgency); + if (_studentAcademicRecord != null) + hash.Add(_studentAcademicRecord); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStateEducationAgencyFederalFunds).FiscalYear); + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).AcademicHonorCategoryDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).HonorDescription); return hash.ToHashCode(); } @@ -170821,12 +178176,90 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The amount of federal dollars distributed to Local Education Agencies (LEAs), retained by the State Education Agency (SEA) for program administration or other approved state-level activities (including unallocated, transferred to another state agency, or distributed to entities other than LEAs). + /// The category of achievement attributed to the individual. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] + public string AchievementCategoryDescriptor { get; set; } + + /// + /// The system that defines the categories by which an achievement is attributed to the individual. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-922337203685477.5808", "922337203685477.5807", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="federalProgramsFundingAllocation")] - public decimal? FederalProgramsFundingAllocation { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategorySystem")] + public string AchievementCategorySystem { get; set; } + + /// + /// The title assigned to the achievement. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementTitle")] + public string AchievementTitle { get; set; } + + /// + /// The criteria for competency-based completion of the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="criteria")] + public string Criteria { get; set; } + + /// + /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="criteriaURL")] + public string CriteriaURL { get; set; } + + /// + /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="evidenceStatement")] + public string EvidenceStatement { get; set; } + + /// + /// The date the honor was awarded. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="honorAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? HonorAwardDate { get; set; } + + /// + /// Date on which the honor expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="honorAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? HonorAwardExpiresDate { get; set; } + + /// + /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="imageURL")] + public string ImageURL { get; set; } + + /// + /// The name of the agent, entity, or institution issuing the element. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="issuerName")] + public string IssuerName { get; set; } + + /// + /// The Uniform Resource Locator (URL) from which the award was issued. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="issuerOriginURL")] + public string IssuerOriginURL { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -170847,7 +178280,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StateEducationAgency", "StateEducationAgencyFederalFunds")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordAcademicHonor")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -170871,12 +178304,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StateEducationAgencyFederalFundsMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStateEducationAgencyFederalFunds)target); + return Entities.Common.EdFi.StudentAcademicRecordAcademicHonorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StateEducationAgencyFederalFundsMapper.MapTo(this, (Entities.Common.EdFi.IStateEducationAgencyFederalFunds)target, null); + Entities.Common.EdFi.StudentAcademicRecordAcademicHonorMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)target, null); } // ------------------------------------------------------------- @@ -170951,9 +178384,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StateEducationAgencyFederalFundsPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAcademicRecordAcademicHonorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -170981,120 +178414,18 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the Student resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class StudentReference : IResourceReference - { - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return StudentUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "Student", - Href = $"/ed-fi/students/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.Student table of the Student aggregate in the ODS Database. + /// A class which represents the edfi.StudentAcademicRecordClassRanking table of the StudentAcademicRecord aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class Student : Entities.Common.EdFi.IStudent, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class StudentAcademicRecordClassRanking : Entities.Common.EdFi.IStudentAcademicRecordClassRanking, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "Student"); + private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordClassRanking"); // Fluent validator instance (threadsafe) - private static StudentPutPostRequestValidator _validator = new StudentPutPostRequestValidator(); + private static StudentAcademicRecordClassRankingPutPostRequestValidator _validator = new StudentAcademicRecordClassRankingPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -171105,90 +178436,40 @@ public class Student : Entities.Common.EdFi.IStudent, IHasETag, IDateVersionedEn // Constructor // ------------------------------------------------------------- - public Student() - { - StudentIdentificationDocuments = new List(); - StudentOtherNames = new List(); - StudentPersonalIdentificationDocuments = new List(); - StudentVisas = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the Student resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + // ------------------------------------------------------------- - private bool _personReferenceExplicitlyAssigned; - private Person.EdFi.PersonReference _personReference; - private Person.EdFi.PersonReference ImplicitPersonReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_personReference == null && !_personReferenceExplicitlyAssigned) - _personReference = new Person.EdFi.PersonReference(); + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; - return _personReference; - } + [IgnoreDataMember] + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordClassRanking.StudentAcademicRecord + { + get { return _studentAcademicRecord; } + set { SetStudentAcademicRecord(value); } } - [DataMember(Name="personReference")] - [FullyDefinedReference] - public Person.EdFi.PersonReference PersonReference + public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitPersonReference != null - && (_personReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - return ImplicitPersonReference; - - return null; - } - set - { - _personReferenceExplicitlyAssigned = true; - _personReference = value; - } + set { SetStudentAcademicRecord(value); } } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - /// - /// A unique alphanumeric code assigned to a student. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(32, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [UniqueId][DataMember(Name="studentUniqueId")] - public string StudentUniqueId + private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } + _studentAcademicRecord = value; } - private string _studentUniqueId; - - string IIdentifiablePerson.UniqueId { get { return StudentUniqueId; } } // ------------------------------------------------------------- // ============================================================= @@ -171203,7 +178484,7 @@ public string StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudent; + var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordClassRanking; if (ReferenceEquals(this, compareTo)) return true; @@ -171211,10 +178492,11 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Property - if (!((this as Entities.Common.EdFi.IStudent).StudentUniqueId.Equals(compareTo.StudentUniqueId))) + // Parent Property + if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) return false; + return true; } @@ -171227,10 +178509,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Property - hash.Add((this as Entities.Common.EdFi.IStudent).StudentUniqueId); - + //Parent Property + if (_studentAcademicRecord != null) + hash.Add(_studentAcademicRecord); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -171243,194 +178524,71 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + private bool _classRankExplicitlyAssigned = false; + private int _classRank; /// - /// The city the student was born in. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, MinimumLength=2, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="birthCity")] - public string BirthCity { get; set; } - - /// - /// The country in which an individual is born. It is strongly recommended that entries use only ISO 3166 2-letter country codes. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="birthCountryDescriptor")][DescriptorExists("CountryDescriptor")] - public string BirthCountryDescriptor { get; set; } - - /// - /// The month, day, and year on which an individual was born. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="birthDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BirthDate { get; set; } - - /// - /// For students born outside of the U.S., the Province or jurisdiction in which an individual is born. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="birthInternationalProvince")] - public string BirthInternationalProvince { get; set; } - - /// - /// A person's sex at birth. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="birthSexDescriptor")][DescriptorExists("SexDescriptor")] - public string BirthSexDescriptor { get; set; } - - /// - /// The abbreviation for the name of the state (within the United States) or extra-state jurisdiction in which an individual was born. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="birthStateAbbreviationDescriptor")][DescriptorExists("StateAbbreviationDescriptor")] - public string BirthStateAbbreviationDescriptor { get; set; } - - /// - /// An indicator of whether or not the person is a U.S. citizen. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="citizenshipStatusDescriptor")][DescriptorExists("CitizenshipStatusDescriptor")] - public string CitizenshipStatusDescriptor { get; set; } - - /// - /// For students born outside of the U.S., the date the student entered the U.S. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="dateEnteredUS")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DateEnteredUS { get; set; } - - /// - /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="firstName")] - public string FirstName { get; set; } - - /// - /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="generationCodeSuffix")] - public string GenerationCodeSuffix { get; set; } - - /// - /// The name borne in common by members of a family. + /// The academic rank of a student in relation to his or her graduating class (e.g., 1st, 2nd, 3rd). /// // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="lastSurname")] - public string LastSurname { get; set; } + [DataMember(Name="classRank")] + public int ClassRank + { + get => _classRank; + set + { + _classRank = value; + _classRankExplicitlyAssigned = true; + } + } - /// - /// The individual's maiden name. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="maidenName")] - public string MaidenName { get; set; } /// - /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// Date class ranking was determined. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="middleName")] - public string MiddleName { get; set; } + [DataMember(Name="classRankingDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? ClassRankingDate { get; set; } /// - /// Indicator of whether the student was born with other siblings (i.e., twins, triplets, etc.) + /// The academic percentage rank of a student in relation to his or her graduating class (e.g., 95%, 80%, 50%). /// // NOT in a reference, NOT a lookup column - [DataMember(Name="multipleBirthStatus")] - public bool? MultipleBirthStatus { get; set; } + [DataMember(Name="percentageRanking")] + public int? PercentageRanking { get; set; } + + private bool _totalNumberInClassExplicitlyAssigned = false; + private int _totalNumberInClass; /// - /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// The total number of students in the student's graduating class. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="personalTitlePrefix")] - public string PersonalTitlePrefix { get; set; } - - /// - /// A unique alphanumeric code assigned to a person. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudent.PersonId - { - get - { - if (ImplicitPersonReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - { - return ImplicitPersonReference.PersonId; - } - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Person - _personReferenceExplicitlyAssigned = false; - ImplicitPersonReference.PersonId = value; + [DataMember(Name="totalNumberInClass")] + public int TotalNumberInClass + { + get => _totalNumberInClass; + set + { + _totalNumberInClass = value; + _totalNumberInClassExplicitlyAssigned = true; } } - /// - /// The first name the individual prefers, if different from their legal first name - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="preferredFirstName")] - public string PreferredFirstName { get; set; } - - /// - /// The last name the individual prefers, if different from their legal last name - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="preferredLastSurname")] - public string PreferredLastSurname { get; set; } - - /// - /// This descriptor defines the originating record source system for the person. - /// + // ------------------------------------------------------------- - // IS in a reference (Student.SourceSystemDescriptorId), IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - string Entities.Common.EdFi.IStudent.SourceSystemDescriptor + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() { - get + if (!_classRankExplicitlyAssigned) { - if (ImplicitPersonReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitPersonReference.IsReferenceFullyDefined())) - { - return ImplicitPersonReference.SourceSystemDescriptor; - } - - return null; + yield return "ClassRank"; } - set + if (!_totalNumberInClassExplicitlyAssigned) { - ImplicitPersonReference.SourceSystemDescriptor = value; + yield return "TotalNumberInClass"; } } - // ------------------------------------------------------------- // ============================================================= // One-to-one relationships @@ -171450,176 +178608,23 @@ string Entities.Common.EdFi.IStudent.SourceSystemDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "Student")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordClassRanking")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentIdentificationDocuments; - private ICollection _studentIdentificationDocumentsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="identificationDocuments")] - public ICollection StudentIdentificationDocuments - { - get { return _studentIdentificationDocuments; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentIdentificationDocument)e.Item).Student = this); - _studentIdentificationDocuments = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentIdentificationDocument)e.Item).Student = this; - _studentIdentificationDocumentsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudent.StudentIdentificationDocuments - { - get { return _studentIdentificationDocumentsCovariant; } - set { StudentIdentificationDocuments = new List(value.Cast()); } - } - - private ICollection _studentOtherNames; - private ICollection _studentOtherNamesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="otherNames")] - public ICollection StudentOtherNames - { - get { return _studentOtherNames; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentOtherName)e.Item).Student = this); - _studentOtherNames = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentOtherName)e.Item).Student = this; - _studentOtherNamesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudent.StudentOtherNames - { - get { return _studentOtherNamesCovariant; } - set { StudentOtherNames = new List(value.Cast()); } - } - - private ICollection _studentPersonalIdentificationDocuments; - private ICollection _studentPersonalIdentificationDocumentsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="personalIdentificationDocuments")] - public ICollection StudentPersonalIdentificationDocuments - { - get { return _studentPersonalIdentificationDocuments; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentPersonalIdentificationDocument)e.Item).Student = this); - _studentPersonalIdentificationDocuments = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentPersonalIdentificationDocument)e.Item).Student = this; - _studentPersonalIdentificationDocumentsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudent.StudentPersonalIdentificationDocuments - { - get { return _studentPersonalIdentificationDocumentsCovariant; } - set { StudentPersonalIdentificationDocuments = new List(value.Cast()); } - } - - private ICollection _studentVisas; - private ICollection _studentVisasCovariant; - - [NoDuplicateMembers] - [DataMember(Name="visas")] - public ICollection StudentVisas - { - get { return _studentVisas; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentVisa)e.Item).Student = this); - _studentVisas = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentVisa)e.Item).Student = this; - _studentVisasCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudent.StudentVisas - { - get { return _studentVisasCovariant; } - set { StudentVisas = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_studentIdentificationDocuments != null) foreach (var item in _studentIdentificationDocuments) - { - item.Student = this; - } - - if (_studentOtherNames != null) foreach (var item in _studentOtherNames) - { - item.Student = this; - } - - if (_studentPersonalIdentificationDocuments != null) foreach (var item in _studentPersonalIdentificationDocuments) - { - item.Student = this; - } - - if (_studentVisas != null) foreach (var item in _studentVisas) - { - item.Student = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -171627,32 +178632,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudent)target); + return Entities.Common.EdFi.StudentAcademicRecordClassRankingMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordClassRanking)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentMapper.MapTo(this, (Entities.Common.EdFi.IStudent)target, null); + Entities.Common.EdFi.StudentAcademicRecordClassRankingMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordClassRanking)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudent.PersonResourceId - { - get { return null; } - set { ImplicitPersonReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudent.PersonDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitPersonReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -171670,59 +178661,12 @@ string Entities.Common.EdFi.IStudent.PersonDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections - // ---------------------- - if (StudentIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StudentIdentificationDocuments") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentIdentificationDocuments"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StudentIdentificationDocuments")))) - { - yield return result; - } - } - - if (StudentOtherNames.Any() && mappingContract?.IsMemberSupported("StudentOtherNames") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentOtherNames"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentOtherNames, validationContext, validationContext.Items.ForCollection("StudentOtherNames")))) - { - yield return result; - } - } - - if (StudentPersonalIdentificationDocuments.Any() && mappingContract?.IsMemberSupported("StudentPersonalIdentificationDocuments") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentPersonalIdentificationDocuments"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentPersonalIdentificationDocuments, validationContext, validationContext.Items.ForCollection("StudentPersonalIdentificationDocuments")))) - { - yield return result; - } - } - - if (StudentVisas.Any() && mappingContract?.IsMemberSupported("StudentVisas") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentVisas"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentVisas, validationContext, validationContext.Items.ForCollection("StudentVisas")))) - { - yield return result; - } - } - + // ---------------------- // --------------------------- // Validate embedded objects @@ -171768,17 +178712,9 @@ string Entities.Common.EdFi.IStudent.PersonDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAcademicRecordClassRankingPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_Student = new FullName("edfi", "Student"); - - // Declare collection item validators - private StudentIdentificationDocumentPutPostRequestValidator _studentIdentificationDocumentsValidator = new (); - private StudentOtherNamePutPostRequestValidator _studentOtherNamesValidator = new (); - private StudentPersonalIdentificationDocumentPutPostRequestValidator _studentPersonalIdentificationDocumentsValidator = new (); - private StudentVisaPutPostRequestValidator _studentVisasValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -171791,61 +178727,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext var failures = new List(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StudentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_Student); - - if (mappingContract != null) - { - if (mappingContract.IsStudentIdentificationDocumentIncluded != null) - { - var hasInvalidStudentIdentificationDocumentsItems = instance.StudentIdentificationDocuments.Any(x => !mappingContract.IsStudentIdentificationDocumentIncluded(x)); - - if (hasInvalidStudentIdentificationDocumentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentIdentificationDocuments", $"A supplied 'StudentIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStudentOtherNameIncluded != null) - { - var hasInvalidStudentOtherNamesItems = instance.StudentOtherNames.Any(x => !mappingContract.IsStudentOtherNameIncluded(x)); - - if (hasInvalidStudentOtherNamesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentOtherNames", $"A supplied 'StudentOtherName' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStudentPersonalIdentificationDocumentIncluded != null) - { - var hasInvalidStudentPersonalIdentificationDocumentsItems = instance.StudentPersonalIdentificationDocuments.Any(x => !mappingContract.IsStudentPersonalIdentificationDocumentIncluded(x)); - - if (hasInvalidStudentPersonalIdentificationDocumentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentPersonalIdentificationDocuments", $"A supplied 'StudentPersonalIdentificationDocument' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStudentVisaIncluded != null) - { - var hasInvalidStudentVisasItems = instance.StudentVisas.Any(x => !mappingContract.IsStudentVisaIncluded(x)); - - if (hasInvalidStudentVisasItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentVisas", $"A supplied 'StudentVisa' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -171862,16 +178743,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext // ----------------------------------------------------------------- /// - /// A class which represents the edfi.StudentIdentificationDocument table of the Student aggregate in the ODS Database. + /// A class which represents the edfi.StudentAcademicRecordDiploma table of the StudentAcademicRecord aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentIdentificationDocument : Entities.Common.EdFi.IStudentIdentificationDocument, IValidatableObject + public class StudentAcademicRecordDiploma : Entities.Common.EdFi.IStudentAcademicRecordDiploma, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentIdentificationDocument"); + private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordDiploma"); // Fluent validator instance (threadsafe) - private static StudentIdentificationDocumentPutPostRequestValidator _validator = new StudentIdentificationDocumentPutPostRequestValidator(); + private static StudentAcademicRecordDiplomaPutPostRequestValidator _validator = new StudentAcademicRecordDiplomaPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -171898,42 +178779,41 @@ public class StudentIdentificationDocument : Entities.Common.EdFi.IStudentIdenti //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudent _student; + private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; [IgnoreDataMember] - Entities.Common.EdFi.IStudent IStudentIdentificationDocument.Student + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordDiploma.StudentAcademicRecord { - get { return _student; } - set { SetStudent(value); } + get { return _studentAcademicRecord; } + set { SetStudentAcademicRecord(value); } } - public Entities.Common.EdFi.IStudent Student + public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord { - set { SetStudent(value); } + set { SetStudentAcademicRecord(value); } } - private void SetStudent(Entities.Common.EdFi.IStudent value) + private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) { - _student = value; + _studentAcademicRecord = value; } /// - /// The primary function of the document used for establishing identity. + /// The month, day, and year on which the student met graduation requirements and was awarded a diploma. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] - public string IdentificationDocumentUseDescriptor { get; set; } + [DataMember(Name="diplomaAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime DiplomaAwardDate { get; set; } /// - /// The category of the document relative to its purpose. + /// The type of diploma/credential that is awarded to a student in recognition of his/her completion of the curricular requirements. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] - public string PersonalInformationVerificationDescriptor { get; set; } + [DataMember(Name="diplomaTypeDescriptor")][DescriptorExists("DiplomaTypeDescriptor")] + public string DiplomaTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -171948,7 +178828,7 @@ private void SetStudent(Entities.Common.EdFi.IStudent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentIdentificationDocument; + var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordDiploma; if (ReferenceEquals(this, compareTo)) return true; @@ -171957,17 +178837,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_student == null || !_student.Equals(compareTo.Student)) + if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) + if (!(this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaAwardDate.Equals(compareTo.DiplomaAwardDate)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaTypeDescriptor, compareTo.DiplomaTypeDescriptor)) return false; @@ -171984,15 +178864,15 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_student != null) - hash.Add(_student); + if (_studentAcademicRecord != null) + hash.Add(_studentAcademicRecord); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentIdentificationDocument).IdentificationDocumentUseDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaAwardDate); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentIdentificationDocument).PersonalInformationVerificationDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaTypeDescriptor); return hash.ToHashCode(); } @@ -172008,43 +178888,106 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The day when the document expires, if null then never expires. + /// The category of achievement attributed to the individual. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] + public string AchievementCategoryDescriptor { get; set; } + + /// + /// The system that defines the categories by which an achievement is attributed to the individual. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DocumentExpirationDate { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategorySystem")] + public string AchievementCategorySystem { get; set; } /// - /// The title of the document given by the issuer. + /// The title assigned to the achievement. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="documentTitle")] - public string DocumentTitle { get; set; } + [DataMember(Name="achievementTitle")] + public string AchievementTitle { get; set; } /// - /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// The criteria for competency-based completion of the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="criteria")] + public string Criteria { get; set; } + + /// + /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="criteriaURL")] + public string CriteriaURL { get; set; } + + /// + /// Indicated a student who reached a state-defined threshold of vocational education and who attained a high school diploma or its recognized state equivalent or GED. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="cteCompleter")] + public bool? CTECompleter { get; set; } + + /// + /// Date on which the diploma expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="diplomaAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? DiplomaAwardExpiresDate { get; set; } + + /// + /// The description of the diploma given to the student for accomplishments. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="diplomaDescription")] + public string DiplomaDescription { get; set; } + + /// + /// The level of diploma/credential that is awarded to a student in recognition of completion of the curricular requirements. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] - public string IssuerCountryDescriptor { get; set; } + [DataMember(Name="diplomaLevelDescriptor")][DescriptorExists("DiplomaLevelDescriptor")] + public string DiplomaLevelDescriptor { get; set; } /// - /// The unique identifier on the issuer's identification system. + /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerDocumentIdentificationCode")] - public string IssuerDocumentIdentificationCode { get; set; } + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="evidenceStatement")] + public string EvidenceStatement { get; set; } /// - /// Name of the entity or institution that issued the document. + /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="imageURL")] + public string ImageURL { get; set; } + + /// + /// The name of the agent, entity, or institution issuing the element. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] [DataMember(Name="issuerName")] public string IssuerName { get; set; } + + /// + /// The Uniform Resource Locator (URL) from which the award was issued. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="issuerOriginURL")] + public string IssuerOriginURL { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -172065,7 +179008,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentIdentificationDocument")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordDiploma")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -172089,12 +179032,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentIdentificationDocument)target); + return Entities.Common.EdFi.StudentAcademicRecordDiplomaMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordDiploma)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStudentIdentificationDocument)target, null); + Entities.Common.EdFi.StudentAcademicRecordDiplomaMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordDiploma)target, null); } // ------------------------------------------------------------- @@ -172169,9 +179112,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAcademicRecordDiplomaPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -172200,16 +179143,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentOtherName table of the Student aggregate in the ODS Database. + /// A class which represents the edfi.StudentAcademicRecordGradePointAverage table of the StudentAcademicRecord aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentOtherName : Entities.Common.EdFi.IStudentOtherName, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class StudentAcademicRecordGradePointAverage : Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentOtherName"); + private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordGradePointAverage"); // Fluent validator instance (threadsafe) - private static StudentOtherNamePutPostRequestValidator _validator = new StudentOtherNamePutPostRequestValidator(); + private static StudentAcademicRecordGradePointAveragePutPostRequestValidator _validator = new StudentAcademicRecordGradePointAveragePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -172236,33 +179180,33 @@ public class StudentOtherName : Entities.Common.EdFi.IStudentOtherName, IValidat //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudent _student; + private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; [IgnoreDataMember] - Entities.Common.EdFi.IStudent IStudentOtherName.Student + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordGradePointAverage.StudentAcademicRecord { - get { return _student; } - set { SetStudent(value); } + get { return _studentAcademicRecord; } + set { SetStudentAcademicRecord(value); } } - public Entities.Common.EdFi.IStudent Student + public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord { - set { SetStudent(value); } + set { SetStudentAcademicRecord(value); } } - private void SetStudent(Entities.Common.EdFi.IStudent value) + private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) { - _student = value; + _studentAcademicRecord = value; } /// - /// The types of alternate names for an individual. + /// The system used for calculating the grade point average for an individual. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="otherNameTypeDescriptor")][DescriptorExists("OtherNameTypeDescriptor")] - public string OtherNameTypeDescriptor { get; set; } + [DataMember(Name="gradePointAverageTypeDescriptor")][DescriptorExists("GradePointAverageTypeDescriptor")] + public string GradePointAverageTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -172277,7 +179221,7 @@ private void SetStudent(Entities.Common.EdFi.IStudent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentOtherName; + var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage; if (ReferenceEquals(this, compareTo)) return true; @@ -172286,12 +179230,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_student == null || !_student.Equals(compareTo.Student)) + if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentOtherName).OtherNameTypeDescriptor, compareTo.OtherNameTypeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage).GradePointAverageTypeDescriptor, compareTo.GradePointAverageTypeDescriptor)) return false; @@ -172308,11 +179252,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_student != null) - hash.Add(_student); + if (_studentAcademicRecord != null) + hash.Add(_studentAcademicRecord); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentOtherName).OtherNameTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage).GradePointAverageTypeDescriptor); return hash.ToHashCode(); } @@ -172326,50 +179270,51 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + private bool _gradePointAverageValueExplicitlyAssigned = false; + private decimal _gradePointAverageValue; /// - /// A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="firstName")] - public string FirstName { get; set; } - - /// - /// An appendage, if any, used to denote an individual's generation in his family (e.g., Jr., Sr., III). + /// The value of the grade points earned divided by the number of credits attempted. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(10, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="generationCodeSuffix")] - public string GenerationCodeSuffix { get; set; } + [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="gradePointAverageValue")] + public decimal GradePointAverageValue + { + get => _gradePointAverageValue; + set + { + _gradePointAverageValue = value; + _gradePointAverageValueExplicitlyAssigned = true; + } + } - /// - /// The name borne in common by members of a family. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="lastSurname")] - public string LastSurname { get; set; } /// - /// A secondary name given to an individual at birth, baptism, or during another naming ceremony. + /// Indicator of whether or not the Grade Point Average value is cumulative. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="middleName")] - public string MiddleName { get; set; } + [DataMember(Name="isCumulative")] + public bool? IsCumulative { get; set; } /// - /// A prefix used to denote the title, degree, position, or seniority of the individual. + /// The maximum value for the grade point average. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="personalTitlePrefix")] - public string PersonalTitlePrefix { get; set; } + [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="maxGradePointAverageValue")] + public decimal? MaxGradePointAverageValue { get; set; } // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_gradePointAverageValueExplicitlyAssigned) + { + yield return "GradePointAverageValue"; + } + } + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -172388,7 +179333,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentOtherName")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordGradePointAverage")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -172412,12 +179357,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentOtherNameMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentOtherName)target); + return Entities.Common.EdFi.StudentAcademicRecordGradePointAverageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentOtherNameMapper.MapTo(this, (Entities.Common.EdFi.IStudentOtherName)target, null); + Entities.Common.EdFi.StudentAcademicRecordGradePointAverageMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)target, null); } // ------------------------------------------------------------- @@ -172492,9 +179437,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentOtherNamePutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAcademicRecordGradePointAveragePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -172523,16 +179468,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentPersonalIdentificationDocument table of the Student aggregate in the ODS Database. + /// A class which represents the edfi.StudentAcademicRecordRecognition table of the StudentAcademicRecord aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentPersonalIdentificationDocument : Entities.Common.EdFi.IStudentPersonalIdentificationDocument, IValidatableObject + public class StudentAcademicRecordRecognition : Entities.Common.EdFi.IStudentAcademicRecordRecognition, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentPersonalIdentificationDocument"); + private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordRecognition"); // Fluent validator instance (threadsafe) - private static StudentPersonalIdentificationDocumentPutPostRequestValidator _validator = new StudentPersonalIdentificationDocumentPutPostRequestValidator(); + private static StudentAcademicRecordRecognitionPutPostRequestValidator _validator = new StudentAcademicRecordRecognitionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -172559,42 +179504,33 @@ public class StudentPersonalIdentificationDocument : Entities.Common.EdFi.IStude //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudent _student; + private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; [IgnoreDataMember] - Entities.Common.EdFi.IStudent IStudentPersonalIdentificationDocument.Student + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordRecognition.StudentAcademicRecord { - get { return _student; } - set { SetStudent(value); } + get { return _studentAcademicRecord; } + set { SetStudentAcademicRecord(value); } } - public Entities.Common.EdFi.IStudent Student + public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord { - set { SetStudent(value); } + set { SetStudentAcademicRecord(value); } } - private void SetStudent(Entities.Common.EdFi.IStudent value) + private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) { - _student = value; + _studentAcademicRecord = value; } /// - /// The primary function of the document used for establishing identity. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="identificationDocumentUseDescriptor")][DescriptorExists("IdentificationDocumentUseDescriptor")] - public string IdentificationDocumentUseDescriptor { get; set; } - - /// - /// The category of the document relative to its purpose. + /// The nature of recognition given to the individual for accomplishments in a co-curricular, or extra-curricular activity. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="personalInformationVerificationDescriptor")][DescriptorExists("PersonalInformationVerificationDescriptor")] - public string PersonalInformationVerificationDescriptor { get; set; } + [DataMember(Name="recognitionTypeDescriptor")][DescriptorExists("RecognitionTypeDescriptor")] + public string RecognitionTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -172609,7 +179545,7 @@ private void SetStudent(Entities.Common.EdFi.IStudent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentPersonalIdentificationDocument; + var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordRecognition; if (ReferenceEquals(this, compareTo)) return true; @@ -172618,17 +179554,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_student == null || !_student.Equals(compareTo.Student)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).IdentificationDocumentUseDescriptor, compareTo.IdentificationDocumentUseDescriptor)) + if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).PersonalInformationVerificationDescriptor, compareTo.PersonalInformationVerificationDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordRecognition).RecognitionTypeDescriptor, compareTo.RecognitionTypeDescriptor)) return false; @@ -172645,15 +179576,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_student != null) - hash.Add(_student); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).IdentificationDocumentUseDescriptor); - + if (_studentAcademicRecord != null) + hash.Add(_studentAcademicRecord); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentPersonalIdentificationDocument).PersonalInformationVerificationDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordRecognition).RecognitionTypeDescriptor); return hash.ToHashCode(); } @@ -172669,43 +179596,98 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The day when the document expires, if null then never expires. + /// The category of achievement attributed to the individual. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] + public string AchievementCategoryDescriptor { get; set; } + + /// + /// The system that defines the categories by which an achievement is attributed to the individual. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="documentExpirationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DocumentExpirationDate { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="achievementCategorySystem")] + public string AchievementCategorySystem { get; set; } /// - /// The title of the document given by the issuer. + /// The title assigned to the achievement. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="documentTitle")] - public string DocumentTitle { get; set; } + [DataMember(Name="achievementTitle")] + public string AchievementTitle { get; set; } /// - /// Country of origin of the document. It is strongly recommended that entries use only ISO 3166 2-letter country codes. + /// The criteria for competency-based completion of the achievement/award. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerCountryDescriptor")][DescriptorExists("CountryDescriptor")] - public string IssuerCountryDescriptor { get; set; } + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="criteria")] + public string Criteria { get; set; } /// - /// The unique identifier on the issuer's identification system. + /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerDocumentIdentificationCode")] - public string IssuerDocumentIdentificationCode { get; set; } + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="criteriaURL")] + public string CriteriaURL { get; set; } /// - /// Name of the entity or institution that issued the document. + /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="evidenceStatement")] + public string EvidenceStatement { get; set; } + + /// + /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="imageURL")] + public string ImageURL { get; set; } + + /// + /// The name of the agent, entity, or institution issuing the element. /// // NOT in a reference, NOT a lookup column [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] [DataMember(Name="issuerName")] public string IssuerName { get; set; } + + /// + /// The Uniform Resource Locator (URL) from which the award was issued. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] + [DataMember(Name="issuerOriginURL")] + public string IssuerOriginURL { get; set; } + + /// + /// The date the recognition was awarded or earned. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="recognitionAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? RecognitionAwardDate { get; set; } + + /// + /// Date on which the recognition expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="recognitionAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? RecognitionAwardExpiresDate { get; set; } + + /// + /// A description of the type of recognition earned by or awarded to the individual. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="recognitionDescription")] + public string RecognitionDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -172726,7 +179708,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentPersonalIdentificationDocument")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordRecognition")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -172750,12 +179732,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentPersonalIdentificationDocumentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentPersonalIdentificationDocument)target); + return Entities.Common.EdFi.StudentAcademicRecordRecognitionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordRecognition)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentPersonalIdentificationDocumentMapper.MapTo(this, (Entities.Common.EdFi.IStudentPersonalIdentificationDocument)target, null); + Entities.Common.EdFi.StudentAcademicRecordRecognitionMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordRecognition)target, null); } // ------------------------------------------------------------- @@ -172830,9 +179812,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentPersonalIdentificationDocumentPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAcademicRecordRecognitionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -172861,16 +179843,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentVisa table of the Student aggregate in the ODS Database. + /// A class which represents the edfi.StudentAcademicRecordReportCard table of the StudentAcademicRecord aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentVisa : Entities.Common.EdFi.IStudentVisa, IValidatableObject + public class StudentAcademicRecordReportCard : Entities.Common.EdFi.IStudentAcademicRecordReportCard, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentVisa"); + private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordReportCard"); // Fluent validator instance (threadsafe) - private static StudentVisaPutPostRequestValidator _validator = new StudentVisaPutPostRequestValidator(); + private static StudentAcademicRecordReportCardPutPostRequestValidator _validator = new StudentAcademicRecordReportCardPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -172892,38 +179874,166 @@ public class StudentVisa : Entities.Common.EdFi.IStudentVisa, IValidatableObject // ============================================================= // References // ------------------------------------------------------------- + + private bool _reportCardReferenceExplicitlyAssigned; + private ReportCard.EdFi.ReportCardReference _reportCardReference; + private ReportCard.EdFi.ReportCardReference ImplicitReportCardReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_reportCardReference == null && !_reportCardReferenceExplicitlyAssigned) + _reportCardReference = new ReportCard.EdFi.ReportCardReference(); + + return _reportCardReference; + } + } + + [DataMember(Name="reportCardReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public ReportCard.EdFi.ReportCardReference ReportCardReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitReportCardReference != null + && (_reportCardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) + return ImplicitReportCardReference; + + return null; + } + set + { + _reportCardReferenceExplicitlyAssigned = true; + _reportCardReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudent _student; + private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; [IgnoreDataMember] - Entities.Common.EdFi.IStudent IStudentVisa.Student + Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordReportCard.StudentAcademicRecord { - get { return _student; } - set { SetStudent(value); } + get { return _studentAcademicRecord; } + set { SetStudentAcademicRecord(value); } } - public Entities.Common.EdFi.IStudent Student + public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord { - set { SetStudent(value); } + set { SetStudentAcademicRecord(value); } } - private void SetStudent(Entities.Common.EdFi.IStudent value) + private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) { - _student = value; + _studentAcademicRecord = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_reportCardReferenceExplicitlyAssigned) + { + ImplicitReportCardReference.EducationOrganizationId = _studentAcademicRecord.EducationOrganizationId; + ImplicitReportCardReference.StudentUniqueId = _studentAcademicRecord.StudentUniqueId; + } } /// - /// An indicator of a non-US citizen's Visa type. + /// The state's name of the period for which grades are reported. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="visaDescriptor")][DescriptorExists("VisaDescriptor")] - public string VisaDescriptor { get; set; } + + // IS in a reference (StudentAcademicRecordReportCard.GradingPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodDescriptor + { + get + { + if (ImplicitReportCardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) + return ImplicitReportCardReference.GradingPeriodDescriptor; + + return null; + } + set + { + ImplicitReportCardReference.GradingPeriodDescriptor = value; + } + } + + /// + /// The school's descriptive name of the grading period. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodName + { + get + { + if (ImplicitReportCardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) + return ImplicitReportCardReference.GradingPeriodName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ReportCard + _reportCardReferenceExplicitlyAssigned = false; + ImplicitReportCardReference.GradingPeriodName = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodSchoolId + { + get + { + if (ImplicitReportCardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) + return ImplicitReportCardReference.GradingPeriodSchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ReportCard + _reportCardReferenceExplicitlyAssigned = false; + ImplicitReportCardReference.GradingPeriodSchoolId = value; + } + } + + /// + /// The identifier for the grading period school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodSchoolYear + { + get + { + if (ImplicitReportCardReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) + return ImplicitReportCardReference.GradingPeriodSchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ReportCard + _reportCardReferenceExplicitlyAssigned = false; + ImplicitReportCardReference.GradingPeriodSchoolYear = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -172938,7 +180048,7 @@ private void SetStudent(Entities.Common.EdFi.IStudent value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentVisa; + var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordReportCard; if (ReferenceEquals(this, compareTo)) return true; @@ -172947,12 +180057,27 @@ public override bool Equals(object obj) return false; // Parent Property - if (_student == null || !_student.Equals(compareTo.Student)) + if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentVisa).VisaDescriptor, compareTo.VisaDescriptor)) + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodName, compareTo.GradingPeriodName)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolId.Equals(compareTo.GradingPeriodSchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) return false; @@ -172969,12 +180094,21 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_student != null) - hash.Add(_student); + if (_studentAcademicRecord != null) + hash.Add(_studentAcademicRecord); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentVisa).VisaDescriptor); + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodDescriptor); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -173007,7 +180141,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "Student", "StudentVisa")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordReportCard")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -173024,6 +180158,12 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -173031,18 +180171,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentVisaMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentVisa)target); + return Entities.Common.EdFi.StudentAcademicRecordReportCardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordReportCard)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentVisaMapper.MapTo(this, (Entities.Common.EdFi.IStudentVisa)target, null); + Entities.Common.EdFi.StudentAcademicRecordReportCardMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordReportCard)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardResourceId + { + get { return null; } + set { ImplicitReportCardReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitReportCardReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -173085,6 +180239,67 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForEducationOrganizationId = GetEducationOrganizationIdSources().ToArray(); + + if (!sourcesForEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'educationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetEducationOrganizationIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).StudentAcademicRecord.EducationOrganizationId); + + // Obtain value from other references + var valueFromReportCardReference = this.ReportCardReference?.EducationOrganizationId; + + if (valueFromReportCardReference != null) + { + yield return ("reportCardReference.educationOrganizationId", this.ReportCardReference.EducationOrganizationId); + } + + } + var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); + + if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetStudentUniqueIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).StudentAcademicRecord.StudentUniqueId); + + // Obtain value from other references + var valueFromReportCardReference = this.ReportCardReference?.StudentUniqueId; + + if (valueFromReportCardReference != null) + { + yield return ("reportCardReference.studentUniqueId", this.ReportCardReference.StudentUniqueId); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -173111,9 +180326,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentVisaPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAcademicRecordReportCardPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -173142,22 +180357,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentAcademicRecord resource. + /// Represents a reference to the StudentAssessment resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordReference : IResourceReference + public class StudentAssessmentReference : IResourceReference { - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + [DataMember(Name="studentAssessmentIdentifier")] + public string StudentAssessmentIdentifier { get; set; } [DataMember(Name="studentUniqueId")] public string StudentUniqueId @@ -173171,9 +180389,6 @@ public string StudentUniqueId } private string _studentUniqueId; - [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] - public string TermDescriptor { get; set; } - /// /// Gets or sets the resource identifier of the referenced resource. /// @@ -173210,29 +180425,29 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return EducationOrganizationId != default(long) && SchoolYear != default(short) && StudentUniqueId != default(string) && TermDescriptor != default(string); + return AssessmentIdentifier != default(string) && Namespace != default(string) && StudentAssessmentIdentifier != default(string) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (EducationOrganizationId == default) + if (AssessmentIdentifier == default) { - yield return "EducationOrganizationId"; + yield return "AssessmentIdentifier"; } - if (SchoolYear == default) + if (Namespace == default) { - yield return "SchoolYear"; + yield return "Namespace"; } - if (StudentUniqueId == default) + if (StudentAssessmentIdentifier == default) { - yield return "StudentUniqueId"; + yield return "StudentAssessmentIdentifier"; } - if (TermDescriptor == default) + if (StudentUniqueId == default) { - yield return "TermDescriptor"; + yield return "StudentUniqueId"; } } @@ -173241,8 +180456,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentAcademicRecord", - Href = $"/ed-fi/studentAcademicRecords/{ResourceId:n}" + Rel = "StudentAssessment", + Href = $"/ed-fi/studentAssessments/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -173269,16 +180484,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StudentAcademicRecord table of the StudentAcademicRecord aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessment table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAcademicRecord : Entities.Common.EdFi.IStudentAcademicRecord, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentAssessment : Entities.Common.EdFi.IStudentAssessment, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAcademicRecord"); + private static FullName _fullName = new FullName("edfi", "StudentAssessment"); // Fluent validator instance (threadsafe) - private static StudentAcademicRecordPutPostRequestValidator _validator = new StudentAcademicRecordPutPostRequestValidator(); + private static StudentAssessmentPutPostRequestValidator _validator = new StudentAssessmentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -173289,13 +180504,13 @@ public class StudentAcademicRecord : Entities.Common.EdFi.IStudentAcademicRecord // Constructor // ------------------------------------------------------------- - public StudentAcademicRecord() + public StudentAssessment() { - StudentAcademicRecordAcademicHonors = new List(); - StudentAcademicRecordDiplomas = new List(); - StudentAcademicRecordGradePointAverages = new List(); - StudentAcademicRecordRecognitions = new List(); - StudentAcademicRecordReportCards = new List(); + StudentAssessmentAccommodations = new List(); + StudentAssessmentItems = new List(); + StudentAssessmentPerformanceLevels = new List(); + StudentAssessmentScoreResults = new List(); + StudentAssessmentStudentObjectiveAssessments = new List(); } // ------------------------------------------------------------ @@ -173305,7 +180520,7 @@ public StudentAcademicRecord() // ------------------------------------------------------------ /// - /// The unique identifier for the StudentAcademicRecord resource. + /// The unique identifier for the StudentAssessment resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -173316,37 +180531,70 @@ public StudentAcademicRecord() // References // ------------------------------------------------------------- - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + private bool _assessmentReferenceExplicitlyAssigned; + private Assessment.EdFi.AssessmentReference _assessmentReference; + private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) + _assessmentReference = new Assessment.EdFi.AssessmentReference(); - return _educationOrganizationReference; + return _assessmentReference; } } - [DataMember(Name="educationOrganizationReference")] + [DataMember(Name="assessmentReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + public Assessment.EdFi.AssessmentReference AssessmentReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; + if (ImplicitAssessmentReference != null + && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference; return null; } set { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; + _assessmentReferenceExplicitlyAssigned = true; + _assessmentReference = value; + } + } + private bool _reportedSchoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _reportedSchoolReference; + private School.EdFi.SchoolReference ImplicitReportedSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_reportedSchoolReference == null && !_reportedSchoolReferenceExplicitlyAssigned) + _reportedSchoolReference = new School.EdFi.SchoolReference(); + + return _reportedSchoolReference; + } + } + + [DataMember(Name="reportedSchoolReference")] + [FullyDefinedReference] + public School.EdFi.SchoolReference ReportedSchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitReportedSchoolReference != null + && (_reportedSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitReportedSchoolReference.IsReferenceFullyDefined())) + return ImplicitReportedSchoolReference; + + return null; + } + set + { + _reportedSchoolReferenceExplicitlyAssigned = true; + _reportedSchoolReference = value; } } private bool _schoolYearTypeReferenceExplicitlyAssigned; @@ -173364,7 +180612,7 @@ private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeRefere } [DataMember(Name="schoolYearTypeReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] + [FullyDefinedReference] public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference { get @@ -173422,60 +180670,69 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. + /// A unique number or alphanumeric code assigned to an assessment. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationId + string Entities.Common.EdFi.IStudentAssessment.AssessmentIdentifier { get { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.AssessmentIdentifier; - return default(long); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.AssessmentIdentifier = value; } } /// - /// The identifier for the school year. + /// Namespace for the assessment. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStudentAcademicRecord.SchoolYear + string Entities.Common.EdFi.IStudentAssessment.Namespace { get { - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference.SchoolYear; + if (ImplicitAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) + return ImplicitAssessmentReference.Namespace; - return default(short); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value; + // Assessment + _assessmentReferenceExplicitlyAssigned = false; + ImplicitAssessmentReference.Namespace = value; } } + /// + /// A unique number or alphanumeric code assigned to an assessment administered to a student. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="studentAssessmentIdentifier")] + public string StudentAssessmentIdentifier { get; set; } + /// /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAcademicRecord.StudentUniqueId + string Entities.Common.EdFi.IStudentAssessment.StudentUniqueId { get { @@ -173496,15 +180753,6 @@ string Entities.Common.EdFi.IStudentAcademicRecord.StudentUniqueId GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } - - /// - /// The term for the session during the school year. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="termDescriptor")][DescriptorExists("TermDescriptor")] - public string TermDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -173519,7 +180767,7 @@ string Entities.Common.EdFi.IStudentAcademicRecord.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecord; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessment; if (ReferenceEquals(this, compareTo)) return true; @@ -173529,22 +180777,22 @@ public override bool Equals(object obj) // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentAcademicRecord).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).AssessmentIdentifier, compareTo.AssessmentIdentifier)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentAcademicRecord).SchoolYear.Equals(compareTo.SchoolYear)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).Namespace, compareTo.Namespace)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAcademicRecord).StudentUniqueId, compareTo.StudentUniqueId)) + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).StudentAssessmentIdentifier, compareTo.StudentAssessmentIdentifier)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecord).TermDescriptor, compareTo.TermDescriptor)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -173562,17 +180810,17 @@ public override int GetHashCode() var hash = new HashCode(); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).EducationOrganizationId); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).SchoolYear); + hash.Add((this as Entities.Common.EdFi.IStudentAssessment).AssessmentIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentAssessment).Namespace); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecord).TermDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAssessment).StudentAssessmentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessment).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -173587,123 +180835,175 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// The date and time an assessment was completed by the student. The use of ISO-8601 formats with a timezone designator (UTC or time offset) is recommended in order to prevent ambiguity due to time zones. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="cumulativeAttemptedCreditConversion")] - public decimal? CumulativeAttemptedCreditConversion { get; set; } + [DataMember(Name="administrationDate")] + public DateTime? AdministrationDate { get; set; } + + /// + /// The date and time an assessment administration ended. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="administrationEndDate")] + public DateTime? AdministrationEndDate { get; set; } + + /// + /// The environment in which the test was administered. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="administrationEnvironmentDescriptor")][DescriptorExists("AdministrationEnvironmentDescriptor")] + public string AdministrationEnvironmentDescriptor { get; set; } + + /// + /// The language in which an assessment is written and/or administered. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="administrationLanguageDescriptor")][DescriptorExists("LanguageDescriptor")] + public string AdministrationLanguageDescriptor { get; set; } /// - /// The value of credits or units of value awarded for the completion of a course. + /// Reported time student was assessed in minutes. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="cumulativeAttemptedCredits")] - public decimal? CumulativeAttemptedCredits { get; set; } + [DataMember(Name="assessedMinutes")] + public int? AssessedMinutes { get; set; } /// - /// The type of credits or units of value awarded for the completion of a course. + /// An unusual event occurred during the administration of the assessment. This could include fire alarm, student became ill, etc. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="cumulativeAttemptedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string CumulativeAttemptedCreditTypeDescriptor { get; set; } + [DataMember(Name="eventCircumstanceDescriptor")][DescriptorExists("EventCircumstanceDescriptor")] + public string EventCircumstanceDescriptor { get; set; } /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// Describes special events that occur before during or after the assessment session that may impact use of results. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="cumulativeEarnedCreditConversion")] - public decimal? CumulativeEarnedCreditConversion { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="eventDescription")] + public string EventDescription { get; set; } /// - /// The value of credits or units of value awarded for the completion of a course. + /// The platform with which the assessment was delivered to the student during the assessment session. /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="cumulativeEarnedCredits")] - public decimal? CumulativeEarnedCredits { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="platformTypeDescriptor")][DescriptorExists("PlatformTypeDescriptor")] + public string PlatformTypeDescriptor { get; set; } /// - /// The type of credits or units of value awarded for the completion of a course. + /// The primary reason student is not tested. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="cumulativeEarnedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string CumulativeEarnedCreditTypeDescriptor { get; set; } + [DataMember(Name="reasonNotTestedDescriptor")][DescriptorExists("ReasonNotTestedDescriptor")] + public string ReasonNotTestedDescriptor { get; set; } /// - /// The month and year the student is projected to graduate. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="projectedGraduationDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? ProjectedGraduationDate { get; set; } + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IStudentAssessment.ReportedSchoolId + { + get + { + if (ImplicitReportedSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitReportedSchoolReference.IsReferenceFullyDefined())) + { + return ImplicitReportedSchoolReference.SchoolId; + } - /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="sessionAttemptedCreditConversion")] - public decimal? SessionAttemptedCreditConversion { get; set; } + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ReportedSchool + _reportedSchoolReferenceExplicitlyAssigned = false; + ImplicitReportedSchoolReference.SchoolId = value.GetValueOrDefault(); + } + } /// - /// The value of credits or units of value awarded for the completion of a course. + /// A reported school identifier for the school the enrollment at the time of the assessment used when the assigned SchoolId is not known by the assessment vendor. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="sessionAttemptedCredits")] - public decimal? SessionAttemptedCredits { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="reportedSchoolIdentifier")] + public string ReportedSchoolIdentifier { get; set; } /// - /// The type of credits or units of value awarded for the completion of a course. + /// Indicator if the test was a retake. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="sessionAttemptedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string SessionAttemptedCreditTypeDescriptor { get; set; } + [DataMember(Name="retestIndicatorDescriptor")][DescriptorExists("RetestIndicatorDescriptor")] + public string RetestIndicatorDescriptor { get; set; } /// - /// Conversion factor that when multiplied by the number of credits is equivalent to Carnegie units. + /// The school year for which the assessment was administered to a student. Among other uses, handles cases in which a student takes a prior-year exam in a subsequent school year during an exam re-test. /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999.99", "9999999.99", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="sessionEarnedCreditConversion")] - public decimal? SessionEarnedCreditConversion { get; set; } + // IS in a reference, NOT a lookup column + short? Entities.Common.EdFi.IStudentAssessment.SchoolYear + { + get + { + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + { + return ImplicitSchoolYearTypeReference.SchoolYear; + } + + return default(short?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); + } + } /// - /// The value of credits or units of value awarded for the completion of a course. + /// The unique number for the assessment form or answer document. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "999999.999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="sessionEarnedCredits")] - public decimal? SessionEarnedCredits { get; set; } + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="serialNumber")] + public string SerialNumber { get; set; } /// - /// The type of credits or units of value awarded for the completion of a course. + /// The grade level of a student when assessed. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="sessionEarnedCreditTypeDescriptor")][DescriptorExists("CreditTypeDescriptor")] - public string SessionEarnedCreditTypeDescriptor { get; set; } + [DataMember(Name="whenAssessedGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string WhenAssessedGradeLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- /// - /// classRanking + /// period /// - [DataMember(Name = "classRanking")] - public StudentAcademicRecordClassRanking StudentAcademicRecordClassRanking { get; set; } + [DataMember(Name = "period")] + public StudentAssessmentPeriod StudentAssessmentPeriod { get; set; } - Entities.Common.EdFi.IStudentAcademicRecordClassRanking Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordClassRanking + Entities.Common.EdFi.IStudentAssessmentPeriod Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPeriod { - get { return StudentAcademicRecordClassRanking; } - set { StudentAcademicRecordClassRanking = (StudentAcademicRecordClassRanking) value; } + get { return StudentAssessmentPeriod; } + set { StudentAssessmentPeriod = (StudentAssessmentPeriod) value; } } // ------------------------------------------------------------- @@ -173721,161 +181021,161 @@ Entities.Common.EdFi.IStudentAcademicRecordClassRanking Entities.Common.EdFi.ISt // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecord")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessment")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentAcademicRecordAcademicHonors; - private ICollection _studentAcademicRecordAcademicHonorsCovariant; + private ICollection _studentAssessmentAccommodations; + private ICollection _studentAssessmentAccommodationsCovariant; [NoDuplicateMembers] - [DataMember(Name="academicHonors")] - public ICollection StudentAcademicRecordAcademicHonors + [DataMember(Name="accommodations")] + public ICollection StudentAssessmentAccommodations { - get { return _studentAcademicRecordAcademicHonors; } + get { return _studentAssessmentAccommodations; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)e.Item).StudentAcademicRecord = this); - _studentAcademicRecordAcademicHonors = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentAccommodation)e.Item).StudentAssessment = this); + _studentAssessmentAccommodations = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)e.Item).StudentAcademicRecord = this; - _studentAcademicRecordAcademicHonorsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentAccommodation)e.Item).StudentAssessment = this; + _studentAssessmentAccommodationsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordAcademicHonors + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentAccommodations { - get { return _studentAcademicRecordAcademicHonorsCovariant; } - set { StudentAcademicRecordAcademicHonors = new List(value.Cast()); } + get { return _studentAssessmentAccommodationsCovariant; } + set { StudentAssessmentAccommodations = new List(value.Cast()); } } - private ICollection _studentAcademicRecordDiplomas; - private ICollection _studentAcademicRecordDiplomasCovariant; + private ICollection _studentAssessmentItems; + private ICollection _studentAssessmentItemsCovariant; [NoDuplicateMembers] - [DataMember(Name="diplomas")] - public ICollection StudentAcademicRecordDiplomas + [DataMember(Name="items")] + public ICollection StudentAssessmentItems { - get { return _studentAcademicRecordDiplomas; } + get { return _studentAssessmentItems; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordDiploma)e.Item).StudentAcademicRecord = this); - _studentAcademicRecordDiplomas = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentItem)e.Item).StudentAssessment = this); + _studentAssessmentItems = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordDiploma)e.Item).StudentAcademicRecord = this; - _studentAcademicRecordDiplomasCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentItem)e.Item).StudentAssessment = this; + _studentAssessmentItemsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordDiplomas + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentItems { - get { return _studentAcademicRecordDiplomasCovariant; } - set { StudentAcademicRecordDiplomas = new List(value.Cast()); } + get { return _studentAssessmentItemsCovariant; } + set { StudentAssessmentItems = new List(value.Cast()); } } - private ICollection _studentAcademicRecordGradePointAverages; - private ICollection _studentAcademicRecordGradePointAveragesCovariant; + private ICollection _studentAssessmentPerformanceLevels; + private ICollection _studentAssessmentPerformanceLevelsCovariant; [NoDuplicateMembers] - [DataMember(Name="gradePointAverages")] - public ICollection StudentAcademicRecordGradePointAverages + [DataMember(Name="performanceLevels")] + public ICollection StudentAssessmentPerformanceLevels { - get { return _studentAcademicRecordGradePointAverages; } + get { return _studentAssessmentPerformanceLevels; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)e.Item).StudentAcademicRecord = this); - _studentAcademicRecordGradePointAverages = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)e.Item).StudentAssessment = this); + _studentAssessmentPerformanceLevels = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)e.Item).StudentAcademicRecord = this; - _studentAcademicRecordGradePointAveragesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)e.Item).StudentAssessment = this; + _studentAssessmentPerformanceLevelsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordGradePointAverages + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPerformanceLevels { - get { return _studentAcademicRecordGradePointAveragesCovariant; } - set { StudentAcademicRecordGradePointAverages = new List(value.Cast()); } + get { return _studentAssessmentPerformanceLevelsCovariant; } + set { StudentAssessmentPerformanceLevels = new List(value.Cast()); } } - private ICollection _studentAcademicRecordRecognitions; - private ICollection _studentAcademicRecordRecognitionsCovariant; + private ICollection _studentAssessmentScoreResults; + private ICollection _studentAssessmentScoreResultsCovariant; [NoDuplicateMembers] - [DataMember(Name="recognitions")] - public ICollection StudentAcademicRecordRecognitions + [DataMember(Name="scoreResults")] + public ICollection StudentAssessmentScoreResults { - get { return _studentAcademicRecordRecognitions; } + get { return _studentAssessmentScoreResults; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordRecognition)e.Item).StudentAcademicRecord = this); - _studentAcademicRecordRecognitions = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentScoreResult)e.Item).StudentAssessment = this); + _studentAssessmentScoreResults = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordRecognition)e.Item).StudentAcademicRecord = this; - _studentAcademicRecordRecognitionsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentScoreResult)e.Item).StudentAssessment = this; + _studentAssessmentScoreResultsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordRecognitions + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentScoreResults { - get { return _studentAcademicRecordRecognitionsCovariant; } - set { StudentAcademicRecordRecognitions = new List(value.Cast()); } + get { return _studentAssessmentScoreResultsCovariant; } + set { StudentAssessmentScoreResults = new List(value.Cast()); } } - private ICollection _studentAcademicRecordReportCards; - private ICollection _studentAcademicRecordReportCardsCovariant; + private ICollection _studentAssessmentStudentObjectiveAssessments; + private ICollection _studentAssessmentStudentObjectiveAssessmentsCovariant; [NoDuplicateMembers] - [DataMember(Name="reportCards")] - public ICollection StudentAcademicRecordReportCards + [DataMember(Name="studentObjectiveAssessments")] + public ICollection StudentAssessmentStudentObjectiveAssessments { - get { return _studentAcademicRecordReportCards; } + get { return _studentAssessmentStudentObjectiveAssessments; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordReportCard)e.Item).StudentAcademicRecord = this); - _studentAcademicRecordReportCards = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)e.Item).StudentAssessment = this); + _studentAssessmentStudentObjectiveAssessments = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAcademicRecordReportCard)e.Item).StudentAcademicRecord = this; - _studentAcademicRecordReportCardsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)e.Item).StudentAssessment = this; + _studentAssessmentStudentObjectiveAssessmentsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAcademicRecord.StudentAcademicRecordReportCards + ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentStudentObjectiveAssessments { - get { return _studentAcademicRecordReportCardsCovariant; } - set { StudentAcademicRecordReportCards = new List(value.Cast()); } + get { return _studentAssessmentStudentObjectiveAssessmentsCovariant; } + set { StudentAssessmentStudentObjectiveAssessments = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -173900,29 +181200,29 @@ public ICollection StudentAcademicRecordReportC internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_studentAcademicRecordAcademicHonors != null) foreach (var item in _studentAcademicRecordAcademicHonors) + if (_studentAssessmentAccommodations != null) foreach (var item in _studentAssessmentAccommodations) { - item.StudentAcademicRecord = this; + item.StudentAssessment = this; } - if (_studentAcademicRecordDiplomas != null) foreach (var item in _studentAcademicRecordDiplomas) + if (_studentAssessmentItems != null) foreach (var item in _studentAssessmentItems) { - item.StudentAcademicRecord = this; + item.StudentAssessment = this; } - if (_studentAcademicRecordGradePointAverages != null) foreach (var item in _studentAcademicRecordGradePointAverages) + if (_studentAssessmentPerformanceLevels != null) foreach (var item in _studentAssessmentPerformanceLevels) { - item.StudentAcademicRecord = this; + item.StudentAssessment = this; } - if (_studentAcademicRecordRecognitions != null) foreach (var item in _studentAcademicRecordRecognitions) + if (_studentAssessmentScoreResults != null) foreach (var item in _studentAssessmentScoreResults) { - item.StudentAcademicRecord = this; + item.StudentAssessment = this; } - if (_studentAcademicRecordReportCards != null) foreach (var item in _studentAcademicRecordReportCards) + if (_studentAssessmentStudentObjectiveAssessments != null) foreach (var item in _studentAssessmentStudentObjectiveAssessments) { - item.StudentAcademicRecord = this; + item.StudentAssessment = this; } } @@ -173933,46 +181233,53 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAcademicRecordMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecord)target); + return Entities.Common.EdFi.StudentAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessment)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAcademicRecordMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecord)target, null); + Entities.Common.EdFi.StudentAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessment)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IStudentAssessment.AssessmentResourceId { get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IStudentAssessment.AssessmentDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } + set { ImplicitAssessmentReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IStudentAcademicRecord.SchoolYearTypeResourceId + Guid? Entities.Common.EdFi.IStudentAssessment.ReportedSchoolResourceId + { + get { return null; } + set { ImplicitReportedSchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IStudentAssessment.SchoolYearTypeResourceId { get { return null; } set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } } - Guid? Entities.Common.EdFi.IStudentAcademicRecord.StudentResourceId + Guid? Entities.Common.EdFi.IStudentAssessment.StudentResourceId { get { return null; } set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator + string Entities.Common.EdFi.IStudentAssessment.StudentDiscriminator { // Not supported for Resources get { return null; } @@ -174002,61 +181309,61 @@ string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator // ---------------------- // Validate collections // ---------------------- - if (StudentAcademicRecordAcademicHonors.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordAcademicHonors") != false) + if (StudentAssessmentAccommodations.Any() && mappingContract?.IsMemberSupported("StudentAssessmentAccommodations") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAcademicRecordAcademicHonors"); + pathBuilder.Append("StudentAssessmentAccommodations"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordAcademicHonors, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordAcademicHonors")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentAccommodations, validationContext, validationContext.Items.ForCollection("StudentAssessmentAccommodations")))) { yield return result; } } - if (StudentAcademicRecordDiplomas.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordDiplomas") != false) + if (StudentAssessmentItems.Any() && mappingContract?.IsMemberSupported("StudentAssessmentItems") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAcademicRecordDiplomas"); + pathBuilder.Append("StudentAssessmentItems"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordDiplomas, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordDiplomas")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentItems, validationContext, validationContext.Items.ForCollection("StudentAssessmentItems")))) { yield return result; } } - if (StudentAcademicRecordGradePointAverages.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordGradePointAverages") != false) + if (StudentAssessmentPerformanceLevels.Any() && mappingContract?.IsMemberSupported("StudentAssessmentPerformanceLevels") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAcademicRecordGradePointAverages"); + pathBuilder.Append("StudentAssessmentPerformanceLevels"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordGradePointAverages, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordGradePointAverages")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentPerformanceLevels, validationContext, validationContext.Items.ForCollection("StudentAssessmentPerformanceLevels")))) { yield return result; } } - if (StudentAcademicRecordRecognitions.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordRecognitions") != false) + if (StudentAssessmentScoreResults.Any() && mappingContract?.IsMemberSupported("StudentAssessmentScoreResults") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAcademicRecordRecognitions"); + pathBuilder.Append("StudentAssessmentScoreResults"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordRecognitions, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordRecognitions")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentScoreResults, validationContext, validationContext.Items.ForCollection("StudentAssessmentScoreResults")))) { yield return result; } } - if (StudentAcademicRecordReportCards.Any() && mappingContract?.IsMemberSupported("StudentAcademicRecordReportCards") != false) + if (StudentAssessmentStudentObjectiveAssessments.Any() && mappingContract?.IsMemberSupported("StudentAssessmentStudentObjectiveAssessments") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAcademicRecordReportCards"); + pathBuilder.Append("StudentAssessmentStudentObjectiveAssessments"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAcademicRecordReportCards, validationContext, validationContext.Items.ForCollection("StudentAcademicRecordReportCards")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentStudentObjectiveAssessments, validationContext, validationContext.Items.ForCollection("StudentAssessmentStudentObjectiveAssessments")))) { yield return result; } @@ -174066,13 +181373,13 @@ string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator // --------------------------- // Validate embedded objects // --------------------------- - if (StudentAcademicRecordClassRanking != null && mappingContract?.IsMemberSupported("StudentAcademicRecordClassRanking") != false) + if (StudentAssessmentPeriod != null && mappingContract?.IsMemberSupported("StudentAssessmentPeriod") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAcademicRecordClassRanking"); + pathBuilder.Append("StudentAssessmentPeriod"); - foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(StudentAcademicRecordClassRanking, validationContext, validationContext.Items.ForEmbeddedObject("StudentAcademicRecordClassRanking")))) + foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(StudentAssessmentPeriod, validationContext, validationContext.Items.ForEmbeddedObject("StudentAssessmentPeriod")))) { yield return result; } @@ -174119,18 +181426,18 @@ string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAcademicRecordPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentAcademicRecord = new FullName("edfi", "StudentAcademicRecord"); + private static readonly FullName _fullName_edfi_StudentAssessment = new FullName("edfi", "StudentAssessment"); // Declare collection item validators - private StudentAcademicRecordAcademicHonorPutPostRequestValidator _studentAcademicRecordAcademicHonorsValidator = new (); - private StudentAcademicRecordDiplomaPutPostRequestValidator _studentAcademicRecordDiplomasValidator = new (); - private StudentAcademicRecordGradePointAveragePutPostRequestValidator _studentAcademicRecordGradePointAveragesValidator = new (); - private StudentAcademicRecordRecognitionPutPostRequestValidator _studentAcademicRecordRecognitionsValidator = new (); - private StudentAcademicRecordReportCardPutPostRequestValidator _studentAcademicRecordReportCardsValidator = new (); + private StudentAssessmentAccommodationPutPostRequestValidator _studentAssessmentAccommodationsValidator = new (); + private StudentAssessmentItemPutPostRequestValidator _studentAssessmentItemsValidator = new (); + private StudentAssessmentPerformanceLevelPutPostRequestValidator _studentAssessmentPerformanceLevelsValidator = new (); + private StudentAssessmentScoreResultPutPostRequestValidator _studentAssessmentScoreResultsValidator = new (); + private StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator _studentAssessmentStudentObjectiveAssessmentsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -174147,63 +181454,63 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStudentAcademicRecordAcademicHonorIncluded(x)); + var hasInvalidStudentAssessmentAccommodationsItems = instance.StudentAssessmentAccommodations.Any(x => !mappingContract.IsStudentAssessmentAccommodationIncluded(x)); - if (hasInvalidStudentAcademicRecordAcademicHonorsItems) + if (hasInvalidStudentAssessmentAccommodationsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAcademicRecordAcademicHonors", $"A supplied 'StudentAcademicRecordAcademicHonor' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentAssessmentAccommodations", $"A supplied 'StudentAssessmentAccommodation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsStudentAcademicRecordDiplomaIncluded != null) + if (mappingContract.IsStudentAssessmentItemIncluded != null) { - var hasInvalidStudentAcademicRecordDiplomasItems = instance.StudentAcademicRecordDiplomas.Any(x => !mappingContract.IsStudentAcademicRecordDiplomaIncluded(x)); + var hasInvalidStudentAssessmentItemsItems = instance.StudentAssessmentItems.Any(x => !mappingContract.IsStudentAssessmentItemIncluded(x)); - if (hasInvalidStudentAcademicRecordDiplomasItems) + if (hasInvalidStudentAssessmentItemsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAcademicRecordDiplomas", $"A supplied 'StudentAcademicRecordDiploma' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentAssessmentItems", $"A supplied 'StudentAssessmentItem' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsStudentAcademicRecordGradePointAverageIncluded != null) + if (mappingContract.IsStudentAssessmentPerformanceLevelIncluded != null) { - var hasInvalidStudentAcademicRecordGradePointAveragesItems = instance.StudentAcademicRecordGradePointAverages.Any(x => !mappingContract.IsStudentAcademicRecordGradePointAverageIncluded(x)); + var hasInvalidStudentAssessmentPerformanceLevelsItems = instance.StudentAssessmentPerformanceLevels.Any(x => !mappingContract.IsStudentAssessmentPerformanceLevelIncluded(x)); - if (hasInvalidStudentAcademicRecordGradePointAveragesItems) + if (hasInvalidStudentAssessmentPerformanceLevelsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAcademicRecordGradePointAverages", $"A supplied 'StudentAcademicRecordGradePointAverage' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentAssessmentPerformanceLevels", $"A supplied 'StudentAssessmentPerformanceLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsStudentAcademicRecordRecognitionIncluded != null) + if (mappingContract.IsStudentAssessmentScoreResultIncluded != null) { - var hasInvalidStudentAcademicRecordRecognitionsItems = instance.StudentAcademicRecordRecognitions.Any(x => !mappingContract.IsStudentAcademicRecordRecognitionIncluded(x)); + var hasInvalidStudentAssessmentScoreResultsItems = instance.StudentAssessmentScoreResults.Any(x => !mappingContract.IsStudentAssessmentScoreResultIncluded(x)); - if (hasInvalidStudentAcademicRecordRecognitionsItems) + if (hasInvalidStudentAssessmentScoreResultsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAcademicRecordRecognitions", $"A supplied 'StudentAcademicRecordRecognition' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentAssessmentScoreResults", $"A supplied 'StudentAssessmentScoreResult' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } - if (mappingContract.IsStudentAcademicRecordReportCardIncluded != null) + if (mappingContract.IsStudentAssessmentStudentObjectiveAssessmentIncluded != null) { - var hasInvalidStudentAcademicRecordReportCardsItems = instance.StudentAcademicRecordReportCards.Any(x => !mappingContract.IsStudentAcademicRecordReportCardIncluded(x)); + var hasInvalidStudentAssessmentStudentObjectiveAssessmentsItems = instance.StudentAssessmentStudentObjectiveAssessments.Any(x => !mappingContract.IsStudentAssessmentStudentObjectiveAssessmentIncluded(x)); - if (hasInvalidStudentAcademicRecordReportCardsItems) + if (hasInvalidStudentAssessmentStudentObjectiveAssessmentsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAcademicRecordReportCards", $"A supplied 'StudentAcademicRecordReportCard' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentAssessmentStudentObjectiveAssessments", $"A supplied 'StudentAssessmentStudentObjectiveAssessment' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -174225,16 +181532,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAcademicRecordAcademicHonor table of the StudentAcademicRecord aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentAccommodation table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordAcademicHonor : Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor, IValidatableObject + public class StudentAssessmentAccommodation : Entities.Common.EdFi.IStudentAssessmentAccommodation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordAcademicHonor"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentAccommodation"); // Fluent validator instance (threadsafe) - private static StudentAcademicRecordAcademicHonorPutPostRequestValidator _validator = new StudentAcademicRecordAcademicHonorPutPostRequestValidator(); + private static StudentAssessmentAccommodationPutPostRequestValidator _validator = new StudentAssessmentAccommodationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -174261,42 +181568,33 @@ public class StudentAcademicRecordAcademicHonor : Entities.Common.EdFi.IStudentA //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; + private Entities.Common.EdFi.IStudentAssessment _studentAssessment; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordAcademicHonor.StudentAcademicRecord + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentAccommodation.StudentAssessment { - get { return _studentAcademicRecord; } - set { SetStudentAcademicRecord(value); } + get { return _studentAssessment; } + set { SetStudentAssessment(value); } } - public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord + public Entities.Common.EdFi.IStudentAssessment StudentAssessment { - set { SetStudentAcademicRecord(value); } + set { SetStudentAssessment(value); } } - private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) + private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) { - _studentAcademicRecord = value; + _studentAssessment = value; } /// - /// A designation of the type of academic distinctions earned by or awarded to the individual. + /// The specific type of special variation used in how an examination is presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="academicHonorCategoryDescriptor")][DescriptorExists("AcademicHonorCategoryDescriptor")] - public string AcademicHonorCategoryDescriptor { get; set; } - - /// - /// A description of the type of academic distinctions earned by or awarded to the individual. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="honorDescription")] - public string HonorDescription { get; set; } + [DataMember(Name="accommodationDescriptor")][DescriptorExists("AccommodationDescriptor")] + public string AccommodationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -174311,7 +181609,7 @@ private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentAccommodation; if (ReferenceEquals(this, compareTo)) return true; @@ -174320,17 +181618,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).AcademicHonorCategoryDescriptor, compareTo.AcademicHonorCategoryDescriptor)) + if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).HonorDescription, compareTo.HonorDescription)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentAccommodation).AccommodationDescriptor, compareTo.AccommodationDescriptor)) return false; @@ -174347,15 +181640,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAcademicRecord != null) - hash.Add(_studentAcademicRecord); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).AcademicHonorCategoryDescriptor); - + if (_studentAssessment != null) + hash.Add(_studentAssessment); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor).HonorDescription); + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentAccommodation).AccommodationDescriptor); return hash.ToHashCode(); } @@ -174369,92 +181658,399 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + // ------------------------------------------------------------- - /// - /// The category of achievement attributed to the individual. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] - public string AchievementCategoryDescriptor { get; set; } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentAccommodation")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StudentAssessmentAccommodationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentAccommodation)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StudentAssessmentAccommodationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentAccommodation)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StudentAssessmentAccommodationPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StudentAssessmentItem table of the StudentAssessment aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StudentAssessmentItem : Entities.Common.EdFi.IStudentAssessmentItem, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StudentAssessmentItem"); + + // Fluent validator instance (threadsafe) + private static StudentAssessmentItemPutPostRequestValidator _validator = new StudentAssessmentItemPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _assessmentItemReferenceExplicitlyAssigned; + private AssessmentItem.EdFi.AssessmentItemReference _assessmentItemReference; + private AssessmentItem.EdFi.AssessmentItemReference ImplicitAssessmentItemReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_assessmentItemReference == null && !_assessmentItemReferenceExplicitlyAssigned) + _assessmentItemReference = new AssessmentItem.EdFi.AssessmentItemReference(); + + return _assessmentItemReference; + } + } + + [DataMember(Name="assessmentItemReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public AssessmentItem.EdFi.AssessmentItemReference AssessmentItemReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitAssessmentItemReference != null + && (_assessmentItemReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) + return ImplicitAssessmentItemReference; + + return null; + } + set + { + _assessmentItemReferenceExplicitlyAssigned = true; + _assessmentItemReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudentAssessment _studentAssessment; + + [IgnoreDataMember] + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment + { + get { return _studentAssessment; } + set { SetStudentAssessment(value); } + } + + public Entities.Common.EdFi.IStudentAssessment StudentAssessment + { + set { SetStudentAssessment(value); } + } + + private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) + { + _studentAssessment = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_assessmentItemReferenceExplicitlyAssigned) + { + ImplicitAssessmentItemReference.AssessmentIdentifier = _studentAssessment.AssessmentIdentifier; + ImplicitAssessmentItemReference.Namespace = _studentAssessment.Namespace; + } + } /// - /// The system that defines the categories by which an achievement is attributed to the individual. + /// A unique number or alphanumeric code assigned to a space, room, site, building, individual, organization, program, or institution by a school, school system, state, or other agency or entity. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategorySystem")] - public string AchievementCategorySystem { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentItem.IdentificationCode + { + get + { + if (ImplicitAssessmentItemReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) + return ImplicitAssessmentItemReference.IdentificationCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentItem + _assessmentItemReferenceExplicitlyAssigned = false; + ImplicitAssessmentItemReference.IdentificationCode = value; + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- /// - /// The title assigned to the achievement. + /// Determines equality based on the natural key properties of the resource. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementTitle")] - public string AchievementTitle { get; set; } + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentItem; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentItem).IdentificationCode, compareTo.IdentificationCode)) + return false; + + + return true; + } /// - /// The criteria for competency-based completion of the achievement/award. + /// Builds the hash code based on the unique identifying values. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="criteria")] - public string Criteria { get; set; } + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_studentAssessment != null) + hash.Add(_studentAssessment); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentItem).IdentificationCode); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. + /// The analyzed result of a student's response to an assessment item. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="criteriaURL")] - public string CriteriaURL { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assessmentItemResultDescriptor")][DescriptorExists("AssessmentItemResultDescriptor")] + public string AssessmentItemResultDescriptor { get; set; } /// - /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. + /// A student's response to a stimulus on a test. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="evidenceStatement")] - public string EvidenceStatement { get; set; } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="assessmentResponse")] + public string AssessmentResponse { get; set; } /// - /// The date the honor was awarded. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The formative descriptive feedback that was given to a student in response to the results from a scored/evaluated assessment item. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="honorAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? HonorAwardDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="descriptiveFeedback")] + public string DescriptiveFeedback { get; set; } /// - /// Date on which the honor expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The test question number for this student's test item. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="honorAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? HonorAwardExpiresDate { get; set; } + [DataMember(Name="itemNumber")] + public int? ItemNumber { get; set; } /// - /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. + /// A meaningful raw score of the performance of a student on an assessment item. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="imageURL")] - public string ImageURL { get; set; } + [Range(typeof(decimal), "-9999999999.99999", "9999999999.99999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="rawScoreResult")] + public decimal? RawScoreResult { get; set; } /// - /// The name of the agent, entity, or institution issuing the element. + /// Indicator of the response. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerName")] - public string IssuerName { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="responseIndicatorDescriptor")][DescriptorExists("ResponseIndicatorDescriptor")] + public string ResponseIndicatorDescriptor { get; set; } /// - /// The Uniform Resource Locator (URL) from which the award was issued. + /// The overall time that a student actually spent on the assessment item expressed in minutes. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="issuerOriginURL")] - public string IssuerOriginURL { get; set; } + [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="timeAssessed")] + public string TimeAssessed { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -174475,7 +182071,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordAcademicHonor")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentItem")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -174492,6 +182088,12 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -174499,18 +182101,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAcademicRecordAcademicHonorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)target); + return Entities.Common.EdFi.StudentAssessmentItemMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentItem)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAcademicRecordAcademicHonorMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor)target, null); + Entities.Common.EdFi.StudentAssessmentItemMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentItem)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemResourceId + { + get { return null; } + set { ImplicitAssessmentItemReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitAssessmentItemReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -174553,6 +182169,67 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); + + if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentItem).StudentAssessment.AssessmentIdentifier); + + // Obtain value from other references + var valueFromAssessmentItemReference = this.AssessmentItemReference?.AssessmentIdentifier; + + if (valueFromAssessmentItemReference != null) + { + yield return ("assessmentItemReference.assessmentIdentifier", this.AssessmentItemReference.AssessmentIdentifier); + } + + } + var sourcesForNamespace = GetNamespaceSources().ToArray(); + + if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetNamespaceSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentItem).StudentAssessment.Namespace); + + // Obtain value from other references + var valueFromAssessmentItemReference = this.AssessmentItemReference?.Namespace; + + if (valueFromAssessmentItemReference != null) + { + yield return ("assessmentItemReference.namespace", this.AssessmentItemReference.Namespace); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -174579,9 +182256,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAcademicRecordAcademicHonorPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentItemPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -174610,17 +182287,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAcademicRecordClassRanking table of the StudentAcademicRecord aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class StudentAcademicRecordClassRanking : Entities.Common.EdFi.IStudentAcademicRecordClassRanking, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class StudentAssessmentPerformanceLevel : Entities.Common.EdFi.IStudentAssessmentPerformanceLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordClassRanking"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentPerformanceLevel"); // Fluent validator instance (threadsafe) - private static StudentAcademicRecordClassRankingPutPostRequestValidator _validator = new StudentAcademicRecordClassRankingPutPostRequestValidator(); + private static StudentAssessmentPerformanceLevelPutPostRequestValidator _validator = new StudentAssessmentPerformanceLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -174647,24 +182323,42 @@ public class StudentAcademicRecordClassRanking : Entities.Common.EdFi.IStudentAc //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; + private Entities.Common.EdFi.IStudentAssessment _studentAssessment; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordClassRanking.StudentAcademicRecord + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPerformanceLevel.StudentAssessment { - get { return _studentAcademicRecord; } - set { SetStudentAcademicRecord(value); } + get { return _studentAssessment; } + set { SetStudentAssessment(value); } } - public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord + public Entities.Common.EdFi.IStudentAssessment StudentAssessment { - set { SetStudentAcademicRecord(value); } + set { SetStudentAssessment(value); } } - private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) + private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) { - _studentAcademicRecord = value; + _studentAssessment = value; } + + /// + /// The method that the instructor of the class uses to report the performance and achievement. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } + + /// + /// A specification of which performance level value describes the student proficiency. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] + public string PerformanceLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -174679,7 +182373,7 @@ private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordClassRanking; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -174688,7 +182382,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) + if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).PerformanceLevelDescriptor, compareTo.PerformanceLevelDescriptor)) return false; @@ -174705,8 +182409,16 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAcademicRecord != null) - hash.Add(_studentAcademicRecord); + if (_studentAssessment != null) + hash.Add(_studentAssessment); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).PerformanceLevelDescriptor); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -174719,72 +182431,16 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - private bool _classRankExplicitlyAssigned = false; - private int _classRank; - - /// - /// The academic rank of a student in relation to his or her graduating class (e.g., 1st, 2nd, 3rd). - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="classRank")] - public int ClassRank - { - get => _classRank; - set - { - _classRank = value; - _classRankExplicitlyAssigned = true; - } - } - - - /// - /// Date class ranking was determined. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="classRankingDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? ClassRankingDate { get; set; } - - /// - /// The academic percentage rank of a student in relation to his or her graduating class (e.g., 95%, 80%, 50%). - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="percentageRanking")] - public int? PercentageRanking { get; set; } - - private bool _totalNumberInClassExplicitlyAssigned = false; - private int _totalNumberInClass; /// - /// The total number of students in the student's graduating class. + /// The name of the indicator being measured for a collection of performance level values. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="totalNumberInClass")] - public int TotalNumberInClass - { - get => _totalNumberInClass; - set - { - _totalNumberInClass = value; - _totalNumberInClassExplicitlyAssigned = true; - } - } - + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="performanceLevelIndicatorName")] + public string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_classRankExplicitlyAssigned) - { - yield return "ClassRank"; - } - if (!_totalNumberInClassExplicitlyAssigned) - { - yield return "TotalNumberInClass"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -174803,7 +182459,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordClassRanking")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentPerformanceLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -174827,12 +182483,12 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAcademicRecordClassRankingMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordClassRanking)target); + return Entities.Common.EdFi.StudentAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAcademicRecordClassRankingMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordClassRanking)target, null); + Entities.Common.EdFi.StudentAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)target, null); } // ------------------------------------------------------------- @@ -174907,9 +182563,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAcademicRecordClassRankingPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -174938,16 +182594,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAcademicRecordDiploma table of the StudentAcademicRecord aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentPeriod table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordDiploma : Entities.Common.EdFi.IStudentAcademicRecordDiploma, IValidatableObject + public class StudentAssessmentPeriod : Entities.Common.EdFi.IStudentAssessmentPeriod, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordDiploma"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentPeriod"); // Fluent validator instance (threadsafe) - private static StudentAcademicRecordDiplomaPutPostRequestValidator _validator = new StudentAcademicRecordDiplomaPutPostRequestValidator(); + private static StudentAssessmentPeriodPutPostRequestValidator _validator = new StudentAssessmentPeriodPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -174974,41 +182630,24 @@ public class StudentAcademicRecordDiploma : Entities.Common.EdFi.IStudentAcademi //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; + private Entities.Common.EdFi.IStudentAssessment _studentAssessment; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordDiploma.StudentAcademicRecord + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPeriod.StudentAssessment { - get { return _studentAcademicRecord; } - set { SetStudentAcademicRecord(value); } + get { return _studentAssessment; } + set { SetStudentAssessment(value); } } - public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord + public Entities.Common.EdFi.IStudentAssessment StudentAssessment { - set { SetStudentAcademicRecord(value); } + set { SetStudentAssessment(value); } } - private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) + private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) { - _studentAcademicRecord = value; + _studentAssessment = value; } - - /// - /// The month, day, and year on which the student met graduation requirements and was awarded a diploma. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="diplomaAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime DiplomaAwardDate { get; set; } - - /// - /// The type of diploma/credential that is awarded to a student in recognition of his/her completion of the curricular requirements. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="diplomaTypeDescriptor")][DescriptorExists("DiplomaTypeDescriptor")] - public string DiplomaTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -175023,7 +182662,7 @@ private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordDiploma; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentPeriod; if (ReferenceEquals(this, compareTo)) return true; @@ -175032,17 +182671,7 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) - return false; - - - // Standard Property - if (!(this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaAwardDate.Equals(compareTo.DiplomaAwardDate)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaTypeDescriptor, compareTo.DiplomaTypeDescriptor)) + if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) return false; @@ -175059,16 +182688,8 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAcademicRecord != null) - hash.Add(_studentAcademicRecord); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaAwardDate); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordDiploma).DiplomaTypeDescriptor); - + if (_studentAssessment != null) + hash.Add(_studentAssessment); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -175083,106 +182704,27 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The category of achievement attributed to the individual. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] - public string AchievementCategoryDescriptor { get; set; } - - /// - /// The system that defines the categories by which an achievement is attributed to the individual. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategorySystem")] - public string AchievementCategorySystem { get; set; } - - /// - /// The title assigned to the achievement. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementTitle")] - public string AchievementTitle { get; set; } - - /// - /// The criteria for competency-based completion of the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="criteria")] - public string Criteria { get; set; } - - /// - /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="criteriaURL")] - public string CriteriaURL { get; set; } - - /// - /// Indicated a student who reached a state-defined threshold of vocational education and who attained a high school diploma or its recognized state equivalent or GED. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="cteCompleter")] - public bool? CTECompleter { get; set; } - - /// - /// Date on which the diploma expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="diplomaAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? DiplomaAwardExpiresDate { get; set; } - - /// - /// The description of the diploma given to the student for accomplishments. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="diplomaDescription")] - public string DiplomaDescription { get; set; } - - /// - /// The level of diploma/credential that is awarded to a student in recognition of completion of the curricular requirements. + /// The period of time in which an assessment is supposed to be administered (e.g., Beginning of Year, Middle of Year, End of Year). /// // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="diplomaLevelDescriptor")][DescriptorExists("DiplomaLevelDescriptor")] - public string DiplomaLevelDescriptor { get; set; } - - /// - /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="evidenceStatement")] - public string EvidenceStatement { get; set; } - - /// - /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="imageURL")] - public string ImageURL { get; set; } + [DataMember(Name="assessmentPeriodDescriptor")][DescriptorExists("AssessmentPeriodDescriptor")] + public string AssessmentPeriodDescriptor { get; set; } /// - /// The name of the agent, entity, or institution issuing the element. + /// The first date the assessment is to be administered. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerName")] - public string IssuerName { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? BeginDate { get; set; } /// - /// The Uniform Resource Locator (URL) from which the award was issued. + /// The last date the assessment is to be administered. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="issuerOriginURL")] - public string IssuerOriginURL { get; set; } + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -175203,7 +182745,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordDiploma")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentPeriod")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -175227,12 +182769,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAcademicRecordDiplomaMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordDiploma)target); + return Entities.Common.EdFi.StudentAssessmentPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentPeriod)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAcademicRecordDiplomaMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordDiploma)target, null); + Entities.Common.EdFi.StudentAssessmentPeriodMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentPeriod)target, null); } // ------------------------------------------------------------- @@ -175307,9 +182849,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAcademicRecordDiplomaPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentPeriodPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -175338,17 +182880,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAcademicRecordGradePointAverage table of the StudentAcademicRecord aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentScoreResult table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] - public class StudentAcademicRecordGradePointAverage : Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject + public class StudentAssessmentScoreResult : Entities.Common.EdFi.IStudentAssessmentScoreResult, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordGradePointAverage"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentScoreResult"); // Fluent validator instance (threadsafe) - private static StudentAcademicRecordGradePointAveragePutPostRequestValidator _validator = new StudentAcademicRecordGradePointAveragePutPostRequestValidator(); + private static StudentAssessmentScoreResultPutPostRequestValidator _validator = new StudentAssessmentScoreResultPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -175375,33 +182916,33 @@ public class StudentAcademicRecordGradePointAverage : Entities.Common.EdFi.IStud //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; + private Entities.Common.EdFi.IStudentAssessment _studentAssessment; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordGradePointAverage.StudentAcademicRecord + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentScoreResult.StudentAssessment { - get { return _studentAcademicRecord; } - set { SetStudentAcademicRecord(value); } + get { return _studentAssessment; } + set { SetStudentAssessment(value); } } - public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord + public Entities.Common.EdFi.IStudentAssessment StudentAssessment { - set { SetStudentAcademicRecord(value); } + set { SetStudentAssessment(value); } } - private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) + private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) { - _studentAcademicRecord = value; + _studentAssessment = value; } /// - /// The system used for calculating the grade point average for an individual. + /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="gradePointAverageTypeDescriptor")][DescriptorExists("GradePointAverageTypeDescriptor")] - public string GradePointAverageTypeDescriptor { get; set; } + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -175416,7 +182957,7 @@ private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentScoreResult; if (ReferenceEquals(this, compareTo)) return true; @@ -175425,12 +182966,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) + if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage).GradePointAverageTypeDescriptor, compareTo.GradePointAverageTypeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentScoreResult).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) return false; @@ -175447,11 +182988,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAcademicRecord != null) - hash.Add(_studentAcademicRecord); + if (_studentAssessment != null) + hash.Add(_studentAssessment); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage).GradePointAverageTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentScoreResult).AssessmentReportingMethodDescriptor); return hash.ToHashCode(); } @@ -175465,51 +183006,26 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - private bool _gradePointAverageValueExplicitlyAssigned = false; - private decimal _gradePointAverageValue; - - /// - /// The value of the grade points earned divided by the number of credits attempted. - /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="gradePointAverageValue")] - public decimal GradePointAverageValue - { - get => _gradePointAverageValue; - set - { - _gradePointAverageValue = value; - _gradePointAverageValueExplicitlyAssigned = true; - } - } - /// - /// Indicator of whether or not the Grade Point Average value is cumulative. + /// The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="isCumulative")] - public bool? IsCumulative { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="result")] + public string Result { get; set; } /// - /// The maximum value for the grade point average. + /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "99999999999999.9999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="maxGradePointAverageValue")] - public decimal? MaxGradePointAverageValue { get; set; } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] + public string ResultDatatypeTypeDescriptor { get; set; } // ------------------------------------------------------------- - IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() - { - if (!_gradePointAverageValueExplicitlyAssigned) - { - yield return "GradePointAverageValue"; - } - } - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -175528,7 +183044,7 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordGradePointAverage")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentScoreResult")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -175552,12 +183068,12 @@ IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassigned // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAcademicRecordGradePointAverageMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)target); + return Entities.Common.EdFi.StudentAssessmentScoreResultMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentScoreResult)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAcademicRecordGradePointAverageMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage)target, null); + Entities.Common.EdFi.StudentAssessmentScoreResultMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentScoreResult)target, null); } // ------------------------------------------------------------- @@ -175632,9 +183148,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAcademicRecordGradePointAveragePutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentScoreResultPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -175663,16 +183179,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAcademicRecordRecognition table of the StudentAcademicRecord aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessment table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordRecognition : Entities.Common.EdFi.IStudentAcademicRecordRecognition, IValidatableObject + public class StudentAssessmentStudentObjectiveAssessment : Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordRecognition"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessment"); // Fluent validator instance (threadsafe) - private static StudentAcademicRecordRecognitionPutPostRequestValidator _validator = new StudentAcademicRecordRecognitionPutPostRequestValidator(); + private static StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator _validator = new StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -175683,6 +183199,11 @@ public class StudentAcademicRecordRecognition : Entities.Common.EdFi.IStudentAca // Constructor // ------------------------------------------------------------- + public StudentAssessmentStudentObjectiveAssessment() + { + StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new List(); + StudentAssessmentStudentObjectiveAssessmentScoreResults = new List(); + } // ------------------------------------------------------------ @@ -175694,38 +183215,95 @@ public class StudentAcademicRecordRecognition : Entities.Common.EdFi.IStudentAca // ============================================================= // References // ------------------------------------------------------------- + + private bool _objectiveAssessmentReferenceExplicitlyAssigned; + private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference _objectiveAssessmentReference; + private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ImplicitObjectiveAssessmentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_objectiveAssessmentReference == null && !_objectiveAssessmentReferenceExplicitlyAssigned) + _objectiveAssessmentReference = new ObjectiveAssessment.EdFi.ObjectiveAssessmentReference(); + + return _objectiveAssessmentReference; + } + } + + [DataMember(Name="objectiveAssessmentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ObjectiveAssessmentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitObjectiveAssessmentReference != null + && (_objectiveAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) + return ImplicitObjectiveAssessmentReference; + + return null; + } + set + { + _objectiveAssessmentReferenceExplicitlyAssigned = true; + _objectiveAssessmentReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; + private Entities.Common.EdFi.IStudentAssessment _studentAssessment; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordRecognition.StudentAcademicRecord + Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssessment.StudentAssessment { - get { return _studentAcademicRecord; } - set { SetStudentAcademicRecord(value); } + get { return _studentAssessment; } + set { SetStudentAssessment(value); } } - public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord + public Entities.Common.EdFi.IStudentAssessment StudentAssessment { - set { SetStudentAcademicRecord(value); } + set { SetStudentAssessment(value); } } - private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) + private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) { - _studentAcademicRecord = value; + _studentAssessment = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_objectiveAssessmentReferenceExplicitlyAssigned) + { + ImplicitObjectiveAssessmentReference.AssessmentIdentifier = _studentAssessment.AssessmentIdentifier; + ImplicitObjectiveAssessmentReference.Namespace = _studentAssessment.Namespace; + } } /// - /// The nature of recognition given to the individual for accomplishments in a co-curricular, or extra-curricular activity. + /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="recognitionTypeDescriptor")][DescriptorExists("RecognitionTypeDescriptor")] - public string RecognitionTypeDescriptor { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.IdentificationCode + { + get + { + if (ImplicitObjectiveAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) + return ImplicitObjectiveAssessmentReference.IdentificationCode; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ObjectiveAssessment + _objectiveAssessmentReferenceExplicitlyAssigned = false; + ImplicitObjectiveAssessmentReference.IdentificationCode = value; + } + } // ------------------------------------------------------------- // ============================================================= @@ -175740,7 +183318,7 @@ private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecor /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordRecognition; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment; if (ReferenceEquals(this, compareTo)) return true; @@ -175749,12 +183327,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) + if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordRecognition).RecognitionTypeDescriptor, compareTo.RecognitionTypeDescriptor)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).IdentificationCode, compareTo.IdentificationCode)) return false; @@ -175771,12 +183349,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAcademicRecord != null) - hash.Add(_studentAcademicRecord); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordRecognition).RecognitionTypeDescriptor); + if (_studentAssessment != null) + hash.Add(_studentAssessment); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).IdentificationCode); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -175791,98 +183368,25 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The category of achievement attributed to the individual. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategoryDescriptor")][DescriptorExists("AchievementCategoryDescriptor")] - public string AchievementCategoryDescriptor { get; set; } - - /// - /// The system that defines the categories by which an achievement is attributed to the individual. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementCategorySystem")] - public string AchievementCategorySystem { get; set; } - - /// - /// The title assigned to the achievement. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="achievementTitle")] - public string AchievementTitle { get; set; } - - /// - /// The criteria for competency-based completion of the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="criteria")] - public string Criteria { get; set; } - - /// - /// The Uniform Resource Locator (URL) for the unique address of a web page describing the competency-based completion criteria for the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="criteriaURL")] - public string CriteriaURL { get; set; } - - /// - /// A statement or reference describing the evidence that the individual met the criteria for attainment of the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="evidenceStatement")] - public string EvidenceStatement { get; set; } - - /// - /// The Uniform Resource Locator (URL) for the unique address of an image representing an award or badge associated with the achievement/award. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="imageURL")] - public string ImageURL { get; set; } - - /// - /// The name of the agent, entity, or institution issuing the element. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(150, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="issuerName")] - public string IssuerName { get; set; } - - /// - /// The Uniform Resource Locator (URL) from which the award was issued. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, MinimumLength=5, ErrorMessage=ValidationHelpers.StringLengthWithMinimumMessageFormat), NoDangerousText] - [DataMember(Name="issuerOriginURL")] - public string IssuerOriginURL { get; set; } - - /// - /// The date the recognition was awarded or earned. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The date and time an assessment was completed by the student. The use of ISO-8601 formats with a timezone designator (UTC or time offset) is recommended in order to prevent ambiguity due to time zones. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="recognitionAwardDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? RecognitionAwardDate { get; set; } + [DataMember(Name="administrationDate")] + public DateTime? AdministrationDate { get; set; } /// - /// Date on which the recognition expires. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The date and time an assessment administration ended. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="recognitionAwardExpiresDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? RecognitionAwardExpiresDate { get; set; } + [DataMember(Name="administrationEndDate")] + public DateTime? AdministrationEndDate { get; set; } /// - /// A description of the type of recognition earned by or awarded to the individual. + /// Reported time student was assessed in minutes. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(80, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="recognitionDescription")] - public string RecognitionDescription { get; set; } + [DataMember(Name="assessedMinutes")] + public int? AssessedMinutes { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -175903,13 +183407,73 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordRecognition")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessment")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; + private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="performanceLevels")] + public ICollection StudentAssessmentStudentObjectiveAssessmentPerformanceLevels + { + get { return _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)e.Item).StudentAssessmentStudentObjectiveAssessment = this); + _studentAssessmentStudentObjectiveAssessmentPerformanceLevels = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)e.Item).StudentAssessmentStudentObjectiveAssessment = this; + _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels + { + get { return _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; } + set { StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new List(value.Cast()); } + } + + private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResults; + private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="scoreResults")] + public ICollection StudentAssessmentStudentObjectiveAssessmentScoreResults + { + get { return _studentAssessmentStudentObjectiveAssessmentScoreResults; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)e.Item).StudentAssessmentStudentObjectiveAssessment = this); + _studentAssessmentStudentObjectiveAssessmentScoreResults = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)e.Item).StudentAssessmentStudentObjectiveAssessment = this; + _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentScoreResults + { + get { return _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; } + set { StudentAssessmentStudentObjectiveAssessmentScoreResults = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -175920,6 +183484,22 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_studentAssessmentStudentObjectiveAssessmentPerformanceLevels != null) foreach (var item in _studentAssessmentStudentObjectiveAssessmentPerformanceLevels) + { + item.StudentAssessmentStudentObjectiveAssessment = this; + } + + if (_studentAssessmentStudentObjectiveAssessmentScoreResults != null) foreach (var item in _studentAssessmentStudentObjectiveAssessmentScoreResults) + { + item.StudentAssessmentStudentObjectiveAssessment = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -175927,18 +183507,32 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAcademicRecordRecognitionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordRecognition)target); + return Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAcademicRecordRecognitionMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordRecognition)target, null); + Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentResourceId + { + get { return null; } + set { ImplicitObjectiveAssessmentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitObjectiveAssessmentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -175962,6 +183556,30 @@ void IMappable.Map(object target) // ---------------------- // Validate collections // ---------------------- + if (StudentAssessmentStudentObjectiveAssessmentPerformanceLevels.Any() && mappingContract?.IsMemberSupported("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentStudentObjectiveAssessmentPerformanceLevels, validationContext, validationContext.Items.ForCollection("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels")))) + { + yield return result; + } + } + + if (StudentAssessmentStudentObjectiveAssessmentScoreResults.Any() && mappingContract?.IsMemberSupported("StudentAssessmentStudentObjectiveAssessmentScoreResults") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAssessmentStudentObjectiveAssessmentScoreResults"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentStudentObjectiveAssessmentScoreResults, validationContext, validationContext.Items.ForCollection("StudentAssessmentStudentObjectiveAssessmentScoreResults")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -175981,6 +183599,67 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); + + if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).StudentAssessment.AssessmentIdentifier); + + // Obtain value from other references + var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.AssessmentIdentifier; + + if (valueFromObjectiveAssessmentReference != null) + { + yield return ("objectiveAssessmentReference.assessmentIdentifier", this.ObjectiveAssessmentReference.AssessmentIdentifier); + } + + } + var sourcesForNamespace = GetNamespaceSources().ToArray(); + + if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetNamespaceSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).StudentAssessment.Namespace); + + // Obtain value from other references + var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.Namespace; + + if (valueFromObjectiveAssessmentReference != null) + { + yield return ("objectiveAssessmentReference.namespace", this.ObjectiveAssessmentReference.Namespace); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -176007,9 +183686,15 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAcademicRecordRecognitionPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessment = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessment"); + + // Declare collection item validators + private StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsValidator = new (); + private StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator _studentAssessmentStudentObjectiveAssessmentScoreResultsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -176022,6 +183707,39 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StudentAssessmentStudentObjectiveAssessmentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentStudentObjectiveAssessment); + + if (mappingContract != null) + { + if (mappingContract.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelIncluded != null) + { + var hasInvalidStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsItems = instance.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels.Any(x => !mappingContract.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelIncluded(x)); + + if (hasInvalidStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels", $"A supplied 'StudentAssessmentStudentObjectiveAssessmentPerformanceLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded != null) + { + var hasInvalidStudentAssessmentStudentObjectiveAssessmentScoreResultsItems = instance.StudentAssessmentStudentObjectiveAssessmentScoreResults.Any(x => !mappingContract.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded(x)); + + if (hasInvalidStudentAssessmentStudentObjectiveAssessmentScoreResultsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAssessmentStudentObjectiveAssessmentScoreResults", $"A supplied 'StudentAssessmentStudentObjectiveAssessmentScoreResult' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -176038,16 +183756,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAcademicRecordReportCard table of the StudentAcademicRecord aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAcademicRecordReportCard : Entities.Common.EdFi.IStudentAcademicRecordReportCard, IValidatableObject + public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevel : Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAcademicRecordReportCard"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel"); // Fluent validator instance (threadsafe) - private static StudentAcademicRecordReportCardPutPostRequestValidator _validator = new StudentAcademicRecordReportCardPutPostRequestValidator(); + private static StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator _validator = new StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -176069,166 +183787,47 @@ public class StudentAcademicRecordReportCard : Entities.Common.EdFi.IStudentAcad // ============================================================= // References // ------------------------------------------------------------- - - private bool _reportCardReferenceExplicitlyAssigned; - private ReportCard.EdFi.ReportCardReference _reportCardReference; - private ReportCard.EdFi.ReportCardReference ImplicitReportCardReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_reportCardReference == null && !_reportCardReferenceExplicitlyAssigned) - _reportCardReference = new ReportCard.EdFi.ReportCardReference(); - - return _reportCardReference; - } - } - - [DataMember(Name="reportCardReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public ReportCard.EdFi.ReportCardReference ReportCardReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitReportCardReference != null - && (_reportCardReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) - return ImplicitReportCardReference; - - return null; - } - set - { - _reportCardReferenceExplicitlyAssigned = true; - _reportCardReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAcademicRecord _studentAcademicRecord; + private Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment _studentAssessmentStudentObjectiveAssessment; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordReportCard.StudentAcademicRecord - { - get { return _studentAcademicRecord; } - set { SetStudentAcademicRecord(value); } - } - - public Entities.Common.EdFi.IStudentAcademicRecord StudentAcademicRecord - { - set { SetStudentAcademicRecord(value); } - } - - private void SetStudentAcademicRecord(Entities.Common.EdFi.IStudentAcademicRecord value) + Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel.StudentAssessmentStudentObjectiveAssessment { - _studentAcademicRecord = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_reportCardReferenceExplicitlyAssigned) - { - ImplicitReportCardReference.EducationOrganizationId = _studentAcademicRecord.EducationOrganizationId; - ImplicitReportCardReference.StudentUniqueId = _studentAcademicRecord.StudentUniqueId; - } + get { return _studentAssessmentStudentObjectiveAssessment; } + set { SetStudentAssessmentStudentObjectiveAssessment(value); } } - /// - /// The state's name of the period for which grades are reported. - /// - - // IS in a reference (StudentAcademicRecordReportCard.GradingPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodDescriptor + public Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { - get - { - if (ImplicitReportCardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) - return ImplicitReportCardReference.GradingPeriodDescriptor; - - return null; - } - set - { - ImplicitReportCardReference.GradingPeriodDescriptor = value; - } + set { SetStudentAssessmentStudentObjectiveAssessment(value); } } - /// - /// The school's descriptive name of the grading period. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodName + private void SetStudentAssessmentStudentObjectiveAssessment(Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment value) { - get - { - if (ImplicitReportCardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) - return ImplicitReportCardReference.GradingPeriodName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ReportCard - _reportCardReferenceExplicitlyAssigned = false; - ImplicitReportCardReference.GradingPeriodName = value; - } + _studentAssessmentStudentObjectiveAssessment = value; } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The method that the instructor of the class uses to report the performance and achievement. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodSchoolId - { - get - { - if (ImplicitReportCardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) - return ImplicitReportCardReference.GradingPeriodSchoolId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ReportCard - _reportCardReferenceExplicitlyAssigned = false; - ImplicitReportCardReference.GradingPeriodSchoolId = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } /// - /// The identifier for the grading period school year. + /// A specification of which performance level value describes the student proficiency. /// - // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodSchoolYear - { - get - { - if (ImplicitReportCardReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitReportCardReference.IsReferenceFullyDefined())) - return ImplicitReportCardReference.GradingPeriodSchoolYear; - - return default(short); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ReportCard - _reportCardReferenceExplicitlyAssigned = false; - ImplicitReportCardReference.GradingPeriodSchoolYear = value; - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] + public string PerformanceLevelDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -176243,7 +183842,7 @@ short Entities.Common.EdFi.IStudentAcademicRecordReportCard.GradingPeriodSchoolY /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAcademicRecordReportCard; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel; if (ReferenceEquals(this, compareTo)) return true; @@ -176252,27 +183851,17 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAcademicRecord == null || !_studentAcademicRecord.Equals(compareTo.StudentAcademicRecord)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodName, compareTo.GradingPeriodName)) + if (_studentAssessmentStudentObjectiveAssessment == null || !_studentAssessmentStudentObjectiveAssessment.Equals(compareTo.StudentAssessmentStudentObjectiveAssessment)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolId.Equals(compareTo.GradingPeriodSchoolId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor, compareTo.PerformanceLevelDescriptor)) return false; @@ -176289,21 +183878,16 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAcademicRecord != null) - hash.Add(_studentAcademicRecord); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodDescriptor); + if (_studentAssessmentStudentObjectiveAssessment != null) + hash.Add(_studentAssessmentStudentObjectiveAssessment); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodName); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).GradingPeriodSchoolYear); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -176316,6 +183900,14 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The name of the indicator being measured for a collection of performance level values. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="performanceLevelIndicatorName")] + public string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -176336,7 +183928,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAcademicRecord", "StudentAcademicRecordReportCard")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -176353,12 +183945,6 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -176366,32 +183952,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAcademicRecordReportCardMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAcademicRecordReportCard)target); + return Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAcademicRecordReportCardMapper.MapTo(this, (Entities.Common.EdFi.IStudentAcademicRecordReportCard)target, null); + Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardResourceId - { - get { return null; } - set { ImplicitReportCardReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitReportCardReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -176434,67 +184006,6 @@ string Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardDiscrimin yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForEducationOrganizationId = GetEducationOrganizationIdSources().ToArray(); - - if (!sourcesForEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'educationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetEducationOrganizationIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).StudentAcademicRecord.EducationOrganizationId); - - // Obtain value from other references - var valueFromReportCardReference = this.ReportCardReference?.EducationOrganizationId; - - if (valueFromReportCardReference != null) - { - yield return ("reportCardReference.educationOrganizationId", this.ReportCardReference.EducationOrganizationId); - } - - } - var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); - - if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetStudentUniqueIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentAcademicRecordReportCard).StudentAcademicRecord.StudentUniqueId); - - // Obtain value from other references - var valueFromReportCardReference = this.ReportCardReference?.StudentUniqueId; - - if (valueFromReportCardReference != null) - { - yield return ("reportCardReference.studentUniqueId", this.ReportCardReference.StudentUniqueId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -176521,9 +184032,9 @@ string Entities.Common.EdFi.IStudentAcademicRecordReportCard.ReportCardDiscrimin // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAcademicRecordReportCardPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -176551,144 +184062,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentAssessment resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class StudentAssessmentReference : IResourceReference - { - [DataMember(Name="assessmentIdentifier")] - public string AssessmentIdentifier { get; set; } - - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - [DataMember(Name="studentAssessmentIdentifier")] - public string StudentAssessmentIdentifier { get; set; } - - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return AssessmentIdentifier != default(string) && Namespace != default(string) && StudentAssessmentIdentifier != default(string) && StudentUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (AssessmentIdentifier == default) - { - yield return "AssessmentIdentifier"; - } - - if (Namespace == default) - { - yield return "Namespace"; - } - - if (StudentAssessmentIdentifier == default) - { - yield return "StudentAssessmentIdentifier"; - } - - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "StudentAssessment", - Href = $"/ed-fi/studentAssessments/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.StudentAssessment table of the StudentAssessment aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentScoreResult table of the StudentAssessment aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessment : Entities.Common.EdFi.IStudentAssessment, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentAssessmentStudentObjectiveAssessmentScoreResult : Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessment"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentScoreResult"); // Fluent validator instance (threadsafe) - private static StudentAssessmentPutPostRequestValidator _validator = new StudentAssessmentPutPostRequestValidator(); + private static StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator _validator = new StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -176699,255 +184083,49 @@ public class StudentAssessment : Entities.Common.EdFi.IStudentAssessment, IHasET // Constructor // ------------------------------------------------------------- - public StudentAssessment() - { - StudentAssessmentAccommodations = new List(); - StudentAssessmentItems = new List(); - StudentAssessmentPerformanceLevels = new List(); - StudentAssessmentScoreResults = new List(); - StudentAssessmentStudentObjectiveAssessments = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StudentAssessment resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _assessmentReferenceExplicitlyAssigned; - private Assessment.EdFi.AssessmentReference _assessmentReference; - private Assessment.EdFi.AssessmentReference ImplicitAssessmentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_assessmentReference == null && !_assessmentReferenceExplicitlyAssigned) - _assessmentReference = new Assessment.EdFi.AssessmentReference(); - - return _assessmentReference; - } - } - - [DataMember(Name="assessmentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Assessment.EdFi.AssessmentReference AssessmentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitAssessmentReference != null - && (_assessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference; - - return null; - } - set - { - _assessmentReferenceExplicitlyAssigned = true; - _assessmentReference = value; - } - } - private bool _reportedSchoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _reportedSchoolReference; - private School.EdFi.SchoolReference ImplicitReportedSchoolReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_reportedSchoolReference == null && !_reportedSchoolReferenceExplicitlyAssigned) - _reportedSchoolReference = new School.EdFi.SchoolReference(); - - return _reportedSchoolReference; - } - } - - [DataMember(Name="reportedSchoolReference")] - [FullyDefinedReference] - public School.EdFi.SchoolReference ReportedSchoolReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitReportedSchoolReference != null - && (_reportedSchoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitReportedSchoolReference.IsReferenceFullyDefined())) - return ImplicitReportedSchoolReference; - - return null; - } - set - { - _reportedSchoolReferenceExplicitlyAssigned = true; - _reportedSchoolReference = value; - } - } - private bool _schoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) - _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); - - return _schoolYearTypeReference; - } - } - - [DataMember(Name="schoolYearTypeReference")] - [FullyDefinedReference] - public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolYearTypeReference != null - && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference; - - return null; - } - set - { - _schoolYearTypeReferenceExplicitlyAssigned = true; - _schoolYearTypeReference = value; - } - } - private bool _studentReferenceExplicitlyAssigned; - private Student.EdFi.StudentReference _studentReference; - private Student.EdFi.StudentReference ImplicitStudentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentReference == null && !_studentReferenceExplicitlyAssigned) - _studentReference = new Student.EdFi.StudentReference(); - - return _studentReference; - } - } - - [DataMember(Name="studentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Student.EdFi.StudentReference StudentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentReference != null - && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference; - - return null; - } - set - { - _studentReferenceExplicitlyAssigned = true; - _studentReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment _studentAssessmentStudentObjectiveAssessment; - /// - /// A unique number or alphanumeric code assigned to an assessment. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessment.AssessmentIdentifier + [IgnoreDataMember] + Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentScoreResult.StudentAssessmentStudentObjectiveAssessment { - get - { - if (ImplicitAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference.AssessmentIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Assessment - _assessmentReferenceExplicitlyAssigned = false; - ImplicitAssessmentReference.AssessmentIdentifier = value; - } + get { return _studentAssessmentStudentObjectiveAssessment; } + set { SetStudentAssessmentStudentObjectiveAssessment(value); } } - /// - /// Namespace for the assessment. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessment.Namespace + public Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { - get - { - if (ImplicitAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentReference.IsReferenceFullyDefined())) - return ImplicitAssessmentReference.Namespace; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + set { SetStudentAssessmentStudentObjectiveAssessment(value); } + } - // Assessment - _assessmentReferenceExplicitlyAssigned = false; - ImplicitAssessmentReference.Namespace = value; - } + private void SetStudentAssessmentStudentObjectiveAssessment(Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment value) + { + _studentAssessmentStudentObjectiveAssessment = value; } /// - /// A unique number or alphanumeric code assigned to an assessment administered to a student. + /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="studentAssessmentIdentifier")] - public string StudentAssessmentIdentifier { get; set; } - - /// - /// A unique alphanumeric code assigned to a student. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessment.StudentUniqueId - { - get - { - if (ImplicitStudentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Student - _studentReferenceExplicitlyAssigned = false; - ImplicitStudentReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] + public string AssessmentReportingMethodDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -176962,7 +184140,7 @@ string Entities.Common.EdFi.IStudentAssessment.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessment; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult; if (ReferenceEquals(this, compareTo)) return true; @@ -176970,24 +184148,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).AssessmentIdentifier, compareTo.AssessmentIdentifier)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).Namespace, compareTo.Namespace)) + // Parent Property + if (_studentAssessmentStudentObjectiveAssessment == null || !_studentAssessmentStudentObjectiveAssessment.Equals(compareTo.StudentAssessmentStudentObjectiveAssessment)) return false; // Standard Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).StudentAssessmentIdentifier, compareTo.StudentAssessmentIdentifier)) - return false; - - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessment).StudentUniqueId, compareTo.StudentUniqueId)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) return false; @@ -177003,19 +184170,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessment).AssessmentIdentifier); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessment).Namespace); + //Parent Property + if (_studentAssessmentStudentObjectiveAssessment != null) + hash.Add(_studentAssessmentStudentObjectiveAssessment); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessment).StudentAssessmentIdentifier); - + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult).AssessmentReportingMethodDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessment).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -177030,177 +184191,27 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The date and time an assessment was completed by the student. The use of ISO-8601 formats with a timezone designator (UTC or time offset) is recommended in order to prevent ambiguity due to time zones. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="administrationDate")] - public DateTime? AdministrationDate { get; set; } - - /// - /// The date and time an assessment administration ended. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="administrationEndDate")] - public DateTime? AdministrationEndDate { get; set; } - - /// - /// The environment in which the test was administered. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="administrationEnvironmentDescriptor")][DescriptorExists("AdministrationEnvironmentDescriptor")] - public string AdministrationEnvironmentDescriptor { get; set; } - - /// - /// The language in which an assessment is written and/or administered. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="administrationLanguageDescriptor")][DescriptorExists("LanguageDescriptor")] - public string AdministrationLanguageDescriptor { get; set; } - - /// - /// Reported time student was assessed in minutes. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="assessedMinutes")] - public int? AssessedMinutes { get; set; } - - /// - /// An unusual event occurred during the administration of the assessment. This could include fire alarm, student became ill, etc. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="eventCircumstanceDescriptor")][DescriptorExists("EventCircumstanceDescriptor")] - public string EventCircumstanceDescriptor { get; set; } - - /// - /// Describes special events that occur before during or after the assessment session that may impact use of results. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="eventDescription")] - public string EventDescription { get; set; } - - /// - /// The platform with which the assessment was delivered to the student during the assessment session. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="platformTypeDescriptor")][DescriptorExists("PlatformTypeDescriptor")] - public string PlatformTypeDescriptor { get; set; } - - /// - /// The primary reason student is not tested. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="reasonNotTestedDescriptor")][DescriptorExists("ReasonNotTestedDescriptor")] - public string ReasonNotTestedDescriptor { get; set; } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. - /// - // IS in a reference, NOT a lookup column - long? Entities.Common.EdFi.IStudentAssessment.ReportedSchoolId - { - get - { - if (ImplicitReportedSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitReportedSchoolReference.IsReferenceFullyDefined())) - { - return ImplicitReportedSchoolReference.SchoolId; - } - - return default(long?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // ReportedSchool - _reportedSchoolReferenceExplicitlyAssigned = false; - ImplicitReportedSchoolReference.SchoolId = value.GetValueOrDefault(); - } - } - - /// - /// A reported school identifier for the school the enrollment at the time of the assessment used when the assigned SchoolId is not known by the assessment vendor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="reportedSchoolIdentifier")] - public string ReportedSchoolIdentifier { get; set; } - - /// - /// Indicator if the test was a retake. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="retestIndicatorDescriptor")][DescriptorExists("RetestIndicatorDescriptor")] - public string RetestIndicatorDescriptor { get; set; } - - /// - /// The school year for which the assessment was administered to a student. Among other uses, handles cases in which a student takes a prior-year exam in a subsequent school year during an exam re-test. - /// - // IS in a reference, NOT a lookup column - short? Entities.Common.EdFi.IStudentAssessment.SchoolYear - { - get - { - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - { - return ImplicitSchoolYearTypeReference.SchoolYear; - } - - return default(short?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); - } - } - - /// - /// The unique number for the assessment form or answer document. + /// The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc. /// // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="serialNumber")] - public string SerialNumber { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="result")] + public string Result { get; set; } /// - /// The grade level of a student when assessed. + /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. /// // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="whenAssessedGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string WhenAssessedGradeLevelDescriptor { get; set; } + [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] + public string ResultDatatypeTypeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- - /// - /// period - /// - - [DataMember(Name = "period")] - public StudentAssessmentPeriod StudentAssessmentPeriod { get; set; } - - Entities.Common.EdFi.IStudentAssessmentPeriod Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPeriod - { - get { return StudentAssessmentPeriod; } - set { StudentAssessmentPeriod = (StudentAssessmentPeriod) value; } - } - // ------------------------------------------------------------- // ============================================================= @@ -177216,211 +184227,23 @@ Entities.Common.EdFi.IStudentAssessmentPeriod Entities.Common.EdFi.IStudentAsses // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessment")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentScoreResult")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentAssessmentAccommodations; - private ICollection _studentAssessmentAccommodationsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="accommodations")] - public ICollection StudentAssessmentAccommodations - { - get { return _studentAssessmentAccommodations; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAssessmentAccommodation)e.Item).StudentAssessment = this); - _studentAssessmentAccommodations = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentAccommodation)e.Item).StudentAssessment = this; - _studentAssessmentAccommodationsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentAccommodations - { - get { return _studentAssessmentAccommodationsCovariant; } - set { StudentAssessmentAccommodations = new List(value.Cast()); } - } - - private ICollection _studentAssessmentItems; - private ICollection _studentAssessmentItemsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="items")] - public ICollection StudentAssessmentItems - { - get { return _studentAssessmentItems; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAssessmentItem)e.Item).StudentAssessment = this); - _studentAssessmentItems = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentItem)e.Item).StudentAssessment = this; - _studentAssessmentItemsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentItems - { - get { return _studentAssessmentItemsCovariant; } - set { StudentAssessmentItems = new List(value.Cast()); } - } - - private ICollection _studentAssessmentPerformanceLevels; - private ICollection _studentAssessmentPerformanceLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="performanceLevels")] - public ICollection StudentAssessmentPerformanceLevels - { - get { return _studentAssessmentPerformanceLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)e.Item).StudentAssessment = this); - _studentAssessmentPerformanceLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)e.Item).StudentAssessment = this; - _studentAssessmentPerformanceLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentPerformanceLevels - { - get { return _studentAssessmentPerformanceLevelsCovariant; } - set { StudentAssessmentPerformanceLevels = new List(value.Cast()); } - } - - private ICollection _studentAssessmentScoreResults; - private ICollection _studentAssessmentScoreResultsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="scoreResults")] - public ICollection StudentAssessmentScoreResults - { - get { return _studentAssessmentScoreResults; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAssessmentScoreResult)e.Item).StudentAssessment = this); - _studentAssessmentScoreResults = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentScoreResult)e.Item).StudentAssessment = this; - _studentAssessmentScoreResultsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentScoreResults - { - get { return _studentAssessmentScoreResultsCovariant; } - set { StudentAssessmentScoreResults = new List(value.Cast()); } - } - - private ICollection _studentAssessmentStudentObjectiveAssessments; - private ICollection _studentAssessmentStudentObjectiveAssessmentsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="studentObjectiveAssessments")] - public ICollection StudentAssessmentStudentObjectiveAssessments - { - get { return _studentAssessmentStudentObjectiveAssessments; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)e.Item).StudentAssessment = this); - _studentAssessmentStudentObjectiveAssessments = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)e.Item).StudentAssessment = this; - _studentAssessmentStudentObjectiveAssessmentsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessment.StudentAssessmentStudentObjectiveAssessments - { - get { return _studentAssessmentStudentObjectiveAssessmentsCovariant; } - set { StudentAssessmentStudentObjectiveAssessments = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - if (_studentAssessmentAccommodations != null) foreach (var item in _studentAssessmentAccommodations) - { - item.StudentAssessment = this; - } - - if (_studentAssessmentItems != null) foreach (var item in _studentAssessmentItems) - { - item.StudentAssessment = this; - } - - if (_studentAssessmentPerformanceLevels != null) foreach (var item in _studentAssessmentPerformanceLevels) - { - item.StudentAssessment = this; - } - - if (_studentAssessmentScoreResults != null) foreach (var item in _studentAssessmentScoreResults) - { - item.StudentAssessment = this; - } - - if (_studentAssessmentStudentObjectiveAssessments != null) foreach (var item in _studentAssessmentStudentObjectiveAssessments) - { - item.StudentAssessment = this; - } - - } // ------------------------------------------------------------ // ============================================================ @@ -177428,60 +184251,18 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessment)target); + return Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentScoreResultMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessment)target, null); + Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentScoreResultMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentAssessment.AssessmentResourceId - { - get { return null; } - set { ImplicitAssessmentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudentAssessment.AssessmentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitAssessmentReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStudentAssessment.ReportedSchoolResourceId - { - get { return null; } - set { ImplicitReportedSchoolReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IStudentAssessment.SchoolYearTypeResourceId - { - get { return null; } - set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } - } - - - Guid? Entities.Common.EdFi.IStudentAssessment.StudentResourceId - { - get { return null; } - set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudentAssessment.StudentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -177499,87 +184280,16 @@ string Entities.Common.EdFi.IStudentAssessment.StudentDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (StudentAssessmentAccommodations.Any() && mappingContract?.IsMemberSupported("StudentAssessmentAccommodations") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentAccommodations"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentAccommodations, validationContext, validationContext.Items.ForCollection("StudentAssessmentAccommodations")))) - { - yield return result; - } - } - - if (StudentAssessmentItems.Any() && mappingContract?.IsMemberSupported("StudentAssessmentItems") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentItems"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentItems, validationContext, validationContext.Items.ForCollection("StudentAssessmentItems")))) - { - yield return result; - } - } - - if (StudentAssessmentPerformanceLevels.Any() && mappingContract?.IsMemberSupported("StudentAssessmentPerformanceLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentPerformanceLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentPerformanceLevels, validationContext, validationContext.Items.ForCollection("StudentAssessmentPerformanceLevels")))) - { - yield return result; - } - } - - if (StudentAssessmentScoreResults.Any() && mappingContract?.IsMemberSupported("StudentAssessmentScoreResults") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentScoreResults"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentScoreResults, validationContext, validationContext.Items.ForCollection("StudentAssessmentScoreResults")))) - { - yield return result; - } - } - - if (StudentAssessmentStudentObjectiveAssessments.Any() && mappingContract?.IsMemberSupported("StudentAssessmentStudentObjectiveAssessments") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentStudentObjectiveAssessments"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentStudentObjectiveAssessments, validationContext, validationContext.Items.ForCollection("StudentAssessmentStudentObjectiveAssessments")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects // --------------------------- - if (StudentAssessmentPeriod != null && mappingContract?.IsMemberSupported("StudentAssessmentPeriod") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentPeriod"); - - foreach (var result in ValidationHelpers.ValidateEmbeddedObject(new ValidationContext(StudentAssessmentPeriod, validationContext, validationContext.Items.ForEmbeddedObject("StudentAssessmentPeriod")))) - { - yield return result; - } - } - // --------------------- // Validate Extensions @@ -177621,122 +184331,190 @@ string Entities.Common.EdFi.IStudentAssessment.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentAssessment = new FullName("edfi", "StudentAssessment"); + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: StudentAssessmentEducationOrganizationAssociation + +namespace EdFi.Ods.Api.Common.Models.Resources.StudentAssessmentEducationOrganizationAssociation.EdFi +{ + /// + /// Represents a reference to the StudentAssessmentEducationOrganizationAssociation resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StudentAssessmentEducationOrganizationAssociationReference : IResourceReference + { + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } + + [DataMember(Name="educationOrganizationAssociationTypeDescriptor")][DescriptorExists("EducationOrganizationAssociationTypeDescriptor")] + public string EducationOrganizationAssociationTypeDescriptor { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } - // Declare collection item validators - private StudentAssessmentAccommodationPutPostRequestValidator _studentAssessmentAccommodationsValidator = new (); - private StudentAssessmentItemPutPostRequestValidator _studentAssessmentItemsValidator = new (); - private StudentAssessmentPerformanceLevelPutPostRequestValidator _studentAssessmentPerformanceLevelsValidator = new (); - private StudentAssessmentScoreResultPutPostRequestValidator _studentAssessmentScoreResultsValidator = new (); - private StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator _studentAssessmentStudentObjectiveAssessmentsValidator = new (); + [DataMember(Name="namespace")] + public string Namespace { get; set; } - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + [DataMember(Name="studentAssessmentIdentifier")] + public string StudentAssessmentIdentifier { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId { - if (context.InstanceToValidate == null) + get => _studentUniqueId; + set { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } + } + private string _studentUniqueId; - var instance = context.InstanceToValidate; + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } - var failures = new List(); + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } - // Profile-based collection item filter validation - string profileName = null; - // Get the current mapping contract - var mappingContract = (StudentAssessmentMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentAssessment); + private Link _link; - if (mappingContract != null) + [DataMember(Name="link")] + public Link Link + { + get { - if (mappingContract.IsStudentAssessmentAccommodationIncluded != null) + if (_link == null) { - var hasInvalidStudentAssessmentAccommodationsItems = instance.StudentAssessmentAccommodations.Any(x => !mappingContract.IsStudentAssessmentAccommodationIncluded(x)); - - if (hasInvalidStudentAssessmentAccommodationsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAssessmentAccommodations", $"A supplied 'StudentAssessmentAccommodation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); } - if (mappingContract.IsStudentAssessmentItemIncluded != null) - { - var hasInvalidStudentAssessmentItemsItems = instance.StudentAssessmentItems.Any(x => !mappingContract.IsStudentAssessmentItemIncluded(x)); - - if (hasInvalidStudentAssessmentItemsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAssessmentItems", $"A supplied 'StudentAssessmentItem' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + return _link; + } + } - if (mappingContract.IsStudentAssessmentPerformanceLevelIncluded != null) - { - var hasInvalidStudentAssessmentPerformanceLevelsItems = instance.StudentAssessmentPerformanceLevels.Any(x => !mappingContract.IsStudentAssessmentPerformanceLevelIncluded(x)); - - if (hasInvalidStudentAssessmentPerformanceLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAssessmentPerformanceLevels", $"A supplied 'StudentAssessmentPerformanceLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AssessmentIdentifier != default(string) && EducationOrganizationAssociationTypeDescriptor != default(string) && EducationOrganizationId != default(long) && Namespace != default(string) && StudentAssessmentIdentifier != default(string) && StudentUniqueId != default(string); + } - if (mappingContract.IsStudentAssessmentScoreResultIncluded != null) - { - var hasInvalidStudentAssessmentScoreResultsItems = instance.StudentAssessmentScoreResults.Any(x => !mappingContract.IsStudentAssessmentScoreResultIncluded(x)); - - if (hasInvalidStudentAssessmentScoreResultsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAssessmentScoreResults", $"A supplied 'StudentAssessmentScoreResult' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AssessmentIdentifier == default) + { + yield return "AssessmentIdentifier"; + } - if (mappingContract.IsStudentAssessmentStudentObjectiveAssessmentIncluded != null) - { - var hasInvalidStudentAssessmentStudentObjectiveAssessmentsItems = instance.StudentAssessmentStudentObjectiveAssessments.Any(x => !mappingContract.IsStudentAssessmentStudentObjectiveAssessmentIncluded(x)); - - if (hasInvalidStudentAssessmentStudentObjectiveAssessmentsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAssessmentStudentObjectiveAssessments", $"A supplied 'StudentAssessmentStudentObjectiveAssessment' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } + if (EducationOrganizationAssociationTypeDescriptor == default) + { + yield return "EducationOrganizationAssociationTypeDescriptor"; + } + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; } - if (failures.Any()) + if (Namespace == default) { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + yield return "Namespace"; + } - return false; + if (StudentAssessmentIdentifier == default) + { + yield return "StudentAssessmentIdentifier"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; } - return true; } - } - // ----------------------------------------------------------------- + + private Link CreateLink() + { + var link = new Link + { + Rel = "StudentAssessmentEducationOrganizationAssociation", + Href = $"/ed-fi/studentAssessmentEducationOrganizationAssociations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference /// - /// A class which represents the edfi.StudentAssessmentAccommodation table of the StudentAssessment aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentEducationOrganizationAssociation table of the StudentAssessmentEducationOrganizationAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentAccommodation : Entities.Common.EdFi.IStudentAssessmentAccommodation, IValidatableObject + public class StudentAssessmentEducationOrganizationAssociation : Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentAccommodation"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentEducationOrganizationAssociation"); // Fluent validator instance (threadsafe) - private static StudentAssessmentAccommodationPutPostRequestValidator _validator = new StudentAssessmentAccommodationPutPostRequestValidator(); + private static StudentAssessmentEducationOrganizationAssociationPutPostRequestValidator _validator = new StudentAssessmentEducationOrganizationAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -177753,43 +184531,258 @@ public class StudentAssessmentAccommodation : Entities.Common.EdFi.IStudentAsses // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentAssessmentEducationOrganizationAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _educationOrganizationReference; + } + } + + [DataMember(Name="educationOrganizationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; + + return null; + } + set + { + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; + } + } + private bool _schoolYearTypeReferenceExplicitlyAssigned; + private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; + private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) + _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + + return _schoolYearTypeReference; + } + } + + [DataMember(Name="schoolYearTypeReference")] + [FullyDefinedReference] + public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolYearTypeReference != null + && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + return ImplicitSchoolYearTypeReference; + + return null; + } + set + { + _schoolYearTypeReferenceExplicitlyAssigned = true; + _schoolYearTypeReference = value; + } + } + private bool _studentAssessmentReferenceExplicitlyAssigned; + private StudentAssessment.EdFi.StudentAssessmentReference _studentAssessmentReference; + private StudentAssessment.EdFi.StudentAssessmentReference ImplicitStudentAssessmentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentAssessmentReference == null && !_studentAssessmentReferenceExplicitlyAssigned) + _studentAssessmentReference = new StudentAssessment.EdFi.StudentAssessmentReference(); + + return _studentAssessmentReference; + } + } + + [DataMember(Name="studentAssessmentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentAssessment.EdFi.StudentAssessmentReference StudentAssessmentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentAssessmentReference != null + && (_studentAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentReference; + + return null; + } + set + { + _studentAssessmentReferenceExplicitlyAssigned = true; + _studentAssessmentReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessment _studentAssessment; - [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentAccommodation.StudentAssessment + /// + /// A unique number or alphanumeric code assigned to an assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.AssessmentIdentifier { - get { return _studentAssessment; } - set { SetStudentAssessment(value); } + get + { + if (ImplicitStudentAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentReference.AssessmentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessment + _studentAssessmentReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentReference.AssessmentIdentifier = value; + } } - public Entities.Common.EdFi.IStudentAssessment StudentAssessment + /// + /// The type of association being represented. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="educationOrganizationAssociationTypeDescriptor")][DescriptorExists("EducationOrganizationAssociationTypeDescriptor")] + public string EducationOrganizationAssociationTypeDescriptor { get; set; } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationId { - set { SetStudentAssessment(value); } + get + { + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } } - private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) + /// + /// Namespace for the assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.Namespace { - _studentAssessment = value; + get + { + if (ImplicitStudentAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentReference.Namespace; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessment + _studentAssessmentReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentReference.Namespace = value; + } } /// - /// The specific type of special variation used in how an examination is presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria. + /// A unique number or alphanumeric code assigned to an assessment administered to a student. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="accommodationDescriptor")][DescriptorExists("AccommodationDescriptor")] - public string AccommodationDescriptor { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentIdentifier + { + get + { + if (ImplicitStudentAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentReference.StudentAssessmentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessment + _studentAssessmentReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentReference.StudentAssessmentIdentifier = value; + } + } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentUniqueId + { + get + { + if (ImplicitStudentAssessmentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessment + _studentAssessmentReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } // ------------------------------------------------------------- // ============================================================= @@ -177804,7 +184797,7 @@ private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentAccommodation; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -177812,13 +184805,34 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).AssessmentIdentifier, compareTo.AssessmentIdentifier)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentAccommodation).AccommodationDescriptor, compareTo.AccommodationDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationAssociationTypeDescriptor, compareTo.EducationOrganizationAssociationTypeDescriptor)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).Namespace, compareTo.Namespace)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentAssessmentIdentifier, compareTo.StudentAssessmentIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -177834,13 +184848,25 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_studentAssessment != null) - hash.Add(_studentAssessment); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).AssessmentIdentifier); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentAccommodation).AccommodationDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationAssociationTypeDescriptor); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).Namespace); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentAssessmentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -177853,6 +184879,33 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The school year associated with the association.. + /// + // IS in a reference, NOT a lookup column + short? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.SchoolYear + { + get + { + if (ImplicitSchoolYearTypeReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) + { + return ImplicitSchoolYearTypeReference.SchoolYear; + } + + return default(short?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // SchoolYearType + _schoolYearTypeReferenceExplicitlyAssigned = false; + ImplicitSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); + } + } // ------------------------------------------------------------- // ============================================================= @@ -177873,7 +184926,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentAccommodation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessmentEducationOrganizationAssociation", "StudentAssessmentEducationOrganizationAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -177885,6 +184938,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -177897,18 +184957,53 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentAccommodationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentAccommodation)target); + return Entities.Common.EdFi.StudentAssessmentEducationOrganizationAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentAccommodationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentAccommodation)target, null); + Entities.Common.EdFi.StudentAssessmentEducationOrganizationAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationResourceId + { + get { return null; } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.SchoolYearTypeResourceId + { + get { return null; } + set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentResourceId + { + get { return null; } + set { ImplicitStudentAssessmentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentAssessmentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -177926,7 +185021,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -177977,9 +185071,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentAccommodationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentEducationOrganizationAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -178007,17 +185101,160 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAssessmentItem table of the StudentAssessment aggregate in the ODS Database. + /// Represents a reference to the StudentAssessmentRegistration resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationReference : IResourceReference + { + [DataMember(Name="administrationIdentifier")] + public string AdministrationIdentifier { get; set; } + + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } + + [DataMember(Name="assigningEducationOrganizationId")] + public long AssigningEducationOrganizationId { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="namespace")] + public string Namespace { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AdministrationIdentifier != default(string) && AssessmentIdentifier != default(string) && AssigningEducationOrganizationId != default(long) && EducationOrganizationId != default(long) && Namespace != default(string) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AdministrationIdentifier == default) + { + yield return "AdministrationIdentifier"; + } + + if (AssessmentIdentifier == default) + { + yield return "AssessmentIdentifier"; + } + + if (AssigningEducationOrganizationId == default) + { + yield return "AssigningEducationOrganizationId"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (Namespace == default) + { + yield return "Namespace"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "StudentAssessmentRegistration", + Href = $"/ed-fi/studentAssessmentRegistrations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.StudentAssessmentRegistration table of the StudentAssessmentRegistration aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentItem : Entities.Common.EdFi.IStudentAssessmentItem, IValidatableObject + public class StudentAssessmentRegistration : Entities.Common.EdFi.IStudentAssessmentRegistration, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentItem"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentRegistration"); // Fluent validator instance (threadsafe) - private static StudentAssessmentItemPutPostRequestValidator _validator = new StudentAssessmentItemPutPostRequestValidator(); + private static StudentAssessmentRegistrationPutPostRequestValidator _validator = new StudentAssessmentRegistrationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -178028,49 +185265,226 @@ public class StudentAssessmentItem : Entities.Common.EdFi.IStudentAssessmentItem // Constructor // ------------------------------------------------------------- + public StudentAssessmentRegistration() + { + StudentAssessmentRegistrationAssessmentAccommodations = new List(); + StudentAssessmentRegistrationAssessmentCustomizations = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentAssessmentRegistration resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _assessmentItemReferenceExplicitlyAssigned; - private AssessmentItem.EdFi.AssessmentItemReference _assessmentItemReference; - private AssessmentItem.EdFi.AssessmentItemReference ImplicitAssessmentItemReference + private bool _assessmentAdministrationReferenceExplicitlyAssigned; + private AssessmentAdministration.EdFi.AssessmentAdministrationReference _assessmentAdministrationReference; + private AssessmentAdministration.EdFi.AssessmentAdministrationReference ImplicitAssessmentAdministrationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_assessmentItemReference == null && !_assessmentItemReferenceExplicitlyAssigned) - _assessmentItemReference = new AssessmentItem.EdFi.AssessmentItemReference(); + if (_assessmentAdministrationReference == null && !_assessmentAdministrationReferenceExplicitlyAssigned) + _assessmentAdministrationReference = new AssessmentAdministration.EdFi.AssessmentAdministrationReference(); - return _assessmentItemReference; + return _assessmentAdministrationReference; } } - [DataMember(Name="assessmentItemReference")] + [DataMember(Name="assessmentAdministrationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public AssessmentItem.EdFi.AssessmentItemReference AssessmentItemReference + public AssessmentAdministration.EdFi.AssessmentAdministrationReference AssessmentAdministrationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitAssessmentItemReference != null - && (_assessmentItemReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) - return ImplicitAssessmentItemReference; + if (ImplicitAssessmentAdministrationReference != null + && (_assessmentAdministrationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference; return null; } set { - _assessmentItemReferenceExplicitlyAssigned = true; - _assessmentItemReference = value; + _assessmentAdministrationReferenceExplicitlyAssigned = true; + _assessmentAdministrationReference = value; + } + } + private bool _reportingEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _reportingEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitReportingEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_reportingEducationOrganizationReference == null && !_reportingEducationOrganizationReferenceExplicitlyAssigned) + _reportingEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _reportingEducationOrganizationReference; + } + } + + [DataMember(Name="reportingEducationOrganizationReference")] + [FullyDefinedReference] + public EducationOrganization.EdFi.EducationOrganizationReference ReportingEducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitReportingEducationOrganizationReference != null + && (_reportingEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitReportingEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitReportingEducationOrganizationReference; + + return null; + } + set + { + _reportingEducationOrganizationReferenceExplicitlyAssigned = true; + _reportingEducationOrganizationReference = value; + } + } + private bool _studentEducationOrganizationAssessmentAccommodationReferenceExplicitlyAssigned; + private StudentEducationOrganizationAssessmentAccommodation.EdFi.StudentEducationOrganizationAssessmentAccommodationReference _studentEducationOrganizationAssessmentAccommodationReference; + private StudentEducationOrganizationAssessmentAccommodation.EdFi.StudentEducationOrganizationAssessmentAccommodationReference ImplicitStudentEducationOrganizationAssessmentAccommodationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentEducationOrganizationAssessmentAccommodationReference == null && !_studentEducationOrganizationAssessmentAccommodationReferenceExplicitlyAssigned) + _studentEducationOrganizationAssessmentAccommodationReference = new StudentEducationOrganizationAssessmentAccommodation.EdFi.StudentEducationOrganizationAssessmentAccommodationReference(); + + return _studentEducationOrganizationAssessmentAccommodationReference; + } + } + + [DataMember(Name="studentEducationOrganizationAssessmentAccommodationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentEducationOrganizationAssessmentAccommodation.EdFi.StudentEducationOrganizationAssessmentAccommodationReference StudentEducationOrganizationAssessmentAccommodationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentEducationOrganizationAssessmentAccommodationReference != null + && (_studentEducationOrganizationAssessmentAccommodationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentEducationOrganizationAssessmentAccommodationReference.IsReferenceFullyDefined())) + return ImplicitStudentEducationOrganizationAssessmentAccommodationReference; + + return null; + } + set + { + _studentEducationOrganizationAssessmentAccommodationReferenceExplicitlyAssigned = true; + _studentEducationOrganizationAssessmentAccommodationReference = value; + } + } + private bool _studentEducationOrganizationAssociationReferenceExplicitlyAssigned; + private StudentEducationOrganizationAssociation.EdFi.StudentEducationOrganizationAssociationReference _studentEducationOrganizationAssociationReference; + private StudentEducationOrganizationAssociation.EdFi.StudentEducationOrganizationAssociationReference ImplicitStudentEducationOrganizationAssociationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentEducationOrganizationAssociationReference == null && !_studentEducationOrganizationAssociationReferenceExplicitlyAssigned) + _studentEducationOrganizationAssociationReference = new StudentEducationOrganizationAssociation.EdFi.StudentEducationOrganizationAssociationReference(); + + return _studentEducationOrganizationAssociationReference; + } + } + + [DataMember(Name="studentEducationOrganizationAssociationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentEducationOrganizationAssociation.EdFi.StudentEducationOrganizationAssociationReference StudentEducationOrganizationAssociationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentEducationOrganizationAssociationReference != null + && (_studentEducationOrganizationAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentEducationOrganizationAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentEducationOrganizationAssociationReference; + + return null; + } + set + { + _studentEducationOrganizationAssociationReferenceExplicitlyAssigned = true; + _studentEducationOrganizationAssociationReference = value; + } + } + private bool _studentSchoolAssociationReferenceExplicitlyAssigned; + private StudentSchoolAssociation.EdFi.StudentSchoolAssociationReference _studentSchoolAssociationReference; + private StudentSchoolAssociation.EdFi.StudentSchoolAssociationReference ImplicitStudentSchoolAssociationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentSchoolAssociationReference == null && !_studentSchoolAssociationReferenceExplicitlyAssigned) + _studentSchoolAssociationReference = new StudentSchoolAssociation.EdFi.StudentSchoolAssociationReference(); + + return _studentSchoolAssociationReference; + } + } + + [DataMember(Name="studentSchoolAssociationReference")] + [FullyDefinedReference][RequiredReference("edfi", "StudentAssessmentRegistration")] + public StudentSchoolAssociation.EdFi.StudentSchoolAssociationReference StudentSchoolAssociationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentSchoolAssociationReference != null + && (_studentSchoolAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentSchoolAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSchoolAssociationReference; + + return null; + } + set + { + _studentSchoolAssociationReferenceExplicitlyAssigned = true; + _studentSchoolAssociationReference = value; + } + } + private bool _testingEducationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _testingEducationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitTestingEducationOrganizationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_testingEducationOrganizationReference == null && !_testingEducationOrganizationReferenceExplicitlyAssigned) + _testingEducationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); + + return _testingEducationOrganizationReference; + } + } + + [DataMember(Name="testingEducationOrganizationReference")] + [FullyDefinedReference] + public EducationOrganization.EdFi.EducationOrganizationReference TestingEducationOrganizationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitTestingEducationOrganizationReference != null + && (_testingEducationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitTestingEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitTestingEducationOrganizationReference; + + return null; + } + set + { + _testingEducationOrganizationReferenceExplicitlyAssigned = true; + _testingEducationOrganizationReference = value; } } // ------------------------------------------------------------- @@ -178078,43 +185492,122 @@ public AssessmentItem.EdFi.AssessmentItemReference AssessmentItemReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessment _studentAssessment; - [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment + /// + /// The title or name of the assessment in the context of its administration. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistration.AdministrationIdentifier { - get { return _studentAssessment; } - set { SetStudentAssessment(value); } + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.AdministrationIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.AdministrationIdentifier = value; + } } - public Entities.Common.EdFi.IStudentAssessment StudentAssessment + /// + /// A unique number or alphanumeric code assigned to an assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistration.AssessmentIdentifier { - set { SetStudentAssessment(value); } + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.AssessmentIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.AssessmentIdentifier = value; + } } - private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentAssessmentRegistration.AssigningEducationOrganizationId { - _studentAssessment = value; + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.AssigningEducationOrganizationId; - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_assessmentItemReferenceExplicitlyAssigned) + return default(long); + } + set { - ImplicitAssessmentItemReference.AssessmentIdentifier = _studentAssessment.AssessmentIdentifier; - ImplicitAssessmentItemReference.Namespace = _studentAssessment.Namespace; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.AssigningEducationOrganizationId = value; } } /// - /// A unique number or alphanumeric code assigned to a space, room, site, building, individual, organization, program, or institution by a school, school system, state, or other agency or entity. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessmentItem.IdentificationCode + long Entities.Common.EdFi.IStudentAssessmentRegistration.EducationOrganizationId { get { - if (ImplicitAssessmentItemReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentItemReference.IsReferenceFullyDefined())) - return ImplicitAssessmentItemReference.IdentificationCode; + if (ImplicitStudentEducationOrganizationAssessmentAccommodationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentEducationOrganizationAssessmentAccommodationReference.IsReferenceFullyDefined())) + return ImplicitStudentEducationOrganizationAssessmentAccommodationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentEducationOrganizationAssessmentAccommodation + _studentEducationOrganizationAssessmentAccommodationReferenceExplicitlyAssigned = false; + ImplicitStudentEducationOrganizationAssessmentAccommodationReference.EducationOrganizationId = value; + + // StudentEducationOrganizationAssociation + _studentEducationOrganizationAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentEducationOrganizationAssociationReference.EducationOrganizationId = value; + } + } + + /// + /// Namespace for the assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistration.Namespace + { + get + { + if (ImplicitAssessmentAdministrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentAdministrationReference.IsReferenceFullyDefined())) + return ImplicitAssessmentAdministrationReference.Namespace; return default(string); } @@ -178123,9 +185616,43 @@ string Entities.Common.EdFi.IStudentAssessmentItem.IdentificationCode // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // AssessmentItem - _assessmentItemReferenceExplicitlyAssigned = false; - ImplicitAssessmentItemReference.IdentificationCode = value; + // AssessmentAdministration + _assessmentAdministrationReferenceExplicitlyAssigned = false; + ImplicitAssessmentAdministrationReference.Namespace = value; + } + } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentUniqueId + { + get + { + if (ImplicitStudentEducationOrganizationAssessmentAccommodationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentEducationOrganizationAssessmentAccommodationReference.IsReferenceFullyDefined())) + return ImplicitStudentEducationOrganizationAssessmentAccommodationReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentEducationOrganizationAssessmentAccommodation + _studentEducationOrganizationAssessmentAccommodationReferenceExplicitlyAssigned = false; + ImplicitStudentEducationOrganizationAssessmentAccommodationReference.StudentUniqueId = value; + + // StudentEducationOrganizationAssociation + _studentEducationOrganizationAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentEducationOrganizationAssociationReference.StudentUniqueId = value; + + // StudentSchoolAssociation + _studentSchoolAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSchoolAssociationReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } // ------------------------------------------------------------- @@ -178142,7 +185669,7 @@ string Entities.Common.EdFi.IStudentAssessmentItem.IdentificationCode /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentItem; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentRegistration; if (ReferenceEquals(this, compareTo)) return true; @@ -178150,13 +185677,34 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistration).AdministrationIdentifier, compareTo.AdministrationIdentifier)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentItem).IdentificationCode, compareTo.IdentificationCode)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistration).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAssessmentRegistration).AssigningEducationOrganizationId.Equals(compareTo.AssigningEducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAssessmentRegistration).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistration).Namespace, compareTo.Namespace)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistration).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -178172,12 +185720,24 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_studentAssessment != null) - hash.Add(_studentAssessment); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentItem).IdentificationCode); + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistration).AdministrationIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistration).AssessmentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistration).AssigningEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistration).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistration).Namespace); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistration).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -178192,60 +185752,128 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The analyzed result of a student's response to an assessment item. + /// The grade level or primary instructional level at which the student is to be assessed. /// // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assessmentItemResultDescriptor")][DescriptorExists("AssessmentItemResultDescriptor")] - public string AssessmentItemResultDescriptor { get; set; } + [DataMember(Name="assessmentGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string AssessmentGradeLevelDescriptor { get; set; } /// - /// A student's response to a stimulus on a test. + /// The month, day, and year on which an individual enters and begins to receive instructional services in a school for each school year. The EntryDate value should be the date the student enrolled, or when the student's enrollment materially changed, such as with a grade promotion. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assessmentResponse")] - public string AssessmentResponse { get; set; } + // IS in a reference, NOT a lookup column + DateTime Entities.Common.EdFi.IStudentAssessmentRegistration.EntryDate + { + get + { + if (ImplicitStudentSchoolAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSchoolAssociationReference.IsReferenceFullyDefined())) + { + return ImplicitStudentSchoolAssociationReference.EntryDate; + } + + return default(DateTime); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentSchoolAssociation + _studentSchoolAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSchoolAssociationReference.EntryDate = value; + } + } /// - /// The formative descriptive feedback that was given to a student in response to the results from a scored/evaluated assessment item. + /// The environment or format in which the assessment is expected to be administered. /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="descriptiveFeedback")] - public string DescriptiveFeedback { get; set; } + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="platformTypeDescriptor")][DescriptorExists("PlatformTypeDescriptor")] + public string PlatformTypeDescriptor { get; set; } /// - /// The test question number for this student's test item. + /// The identifier assigned to an education organization. /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="itemNumber")] - public int? ItemNumber { get; set; } + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IStudentAssessmentRegistration.ReportingEducationOrganizationId + { + get + { + if (ImplicitReportingEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitReportingEducationOrganizationReference.IsReferenceFullyDefined())) + { + return ImplicitReportingEducationOrganizationReference.EducationOrganizationId; + } + + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ReportingEducationOrganization + _reportingEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitReportingEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); + } + } /// - /// A meaningful raw score of the performance of a student on an assessment item. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// - // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "-9999999999.99999", "9999999999.99999", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="rawScoreResult")] - public decimal? RawScoreResult { get; set; } + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentAssessmentRegistration.SchoolId + { + get + { + if (ImplicitStudentSchoolAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSchoolAssociationReference.IsReferenceFullyDefined())) + { + return ImplicitStudentSchoolAssociationReference.SchoolId; + } + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentSchoolAssociation + _studentSchoolAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSchoolAssociationReference.SchoolId = value; + } + } /// - /// Indicator of the response. + /// The identifier assigned to an education organization. /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="responseIndicatorDescriptor")][DescriptorExists("ResponseIndicatorDescriptor")] - public string ResponseIndicatorDescriptor { get; set; } + // IS in a reference, NOT a lookup column + long? Entities.Common.EdFi.IStudentAssessmentRegistration.TestingEducationOrganizationId + { + get + { + if (ImplicitTestingEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitTestingEducationOrganizationReference.IsReferenceFullyDefined())) + { + return ImplicitTestingEducationOrganizationReference.EducationOrganizationId; + } - /// - /// The overall time that a student actually spent on the assessment item expressed in minutes. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(30, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="timeAssessed")] - public string TimeAssessed { get; set; } + return default(long?); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // TestingEducationOrganization + _testingEducationOrganizationReferenceExplicitlyAssigned = false; + ImplicitTestingEducationOrganizationReference.EducationOrganizationId = value.GetValueOrDefault(); + } + } // ------------------------------------------------------------- // ============================================================= @@ -178266,18 +185894,85 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentItem")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessmentRegistration", "StudentAssessmentRegistration")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _studentAssessmentRegistrationAssessmentAccommodations; + private ICollection _studentAssessmentRegistrationAssessmentAccommodationsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="assessmentAccommodations")] + public ICollection StudentAssessmentRegistrationAssessmentAccommodations + { + get { return _studentAssessmentRegistrationAssessmentAccommodations; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation)e.Item).StudentAssessmentRegistration = this); + _studentAssessmentRegistrationAssessmentAccommodations = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation)e.Item).StudentAssessmentRegistration = this; + _studentAssessmentRegistrationAssessmentAccommodationsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessmentRegistration.StudentAssessmentRegistrationAssessmentAccommodations + { + get { return _studentAssessmentRegistrationAssessmentAccommodationsCovariant; } + set { StudentAssessmentRegistrationAssessmentAccommodations = new List(value.Cast()); } + } + + private ICollection _studentAssessmentRegistrationAssessmentCustomizations; + private ICollection _studentAssessmentRegistrationAssessmentCustomizationsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="assessmentCustomizations")] + public ICollection StudentAssessmentRegistrationAssessmentCustomizations + { + get { return _studentAssessmentRegistrationAssessmentCustomizations; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization)e.Item).StudentAssessmentRegistration = this); + _studentAssessmentRegistrationAssessmentCustomizations = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization)e.Item).StudentAssessmentRegistration = this; + _studentAssessmentRegistrationAssessmentCustomizationsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentAssessmentRegistration.StudentAssessmentRegistrationAssessmentCustomizations + { + get { return _studentAssessmentRegistrationAssessmentCustomizationsCovariant; } + set { StudentAssessmentRegistrationAssessmentCustomizations = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -178288,6 +185983,16 @@ public override int GetHashCode() internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization + if (_studentAssessmentRegistrationAssessmentAccommodations != null) foreach (var item in _studentAssessmentRegistrationAssessmentAccommodations) + { + item.StudentAssessmentRegistration = this; + } + + if (_studentAssessmentRegistrationAssessmentCustomizations != null) foreach (var item in _studentAssessmentRegistrationAssessmentCustomizations) + { + item.StudentAssessmentRegistration = this; + } + } // ------------------------------------------------------------ @@ -178296,29 +186001,99 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentItemMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentItem)target); + return Entities.Common.EdFi.StudentAssessmentRegistrationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistration)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentItemMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentItem)target, null); + Entities.Common.EdFi.StudentAssessmentRegistrationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistration)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemResourceId + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.AssessmentAdministrationResourceId { get { return null; } - set { ImplicitAssessmentItemReference.ResourceId = value ?? default(Guid); } + set { ImplicitAssessmentAdministrationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator + string Entities.Common.EdFi.IStudentAssessmentRegistration.AssessmentAdministrationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitAssessmentItemReference.Discriminator = value; } + set { ImplicitAssessmentAdministrationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.ReportingEducationOrganizationResourceId + { + get { return null; } + set { ImplicitReportingEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentRegistration.ReportingEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitReportingEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssessmentAccommodationResourceId + { + get { return null; } + set { ImplicitStudentEducationOrganizationAssessmentAccommodationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssessmentAccommodationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentEducationOrganizationAssessmentAccommodationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssociationResourceId + { + get { return null; } + set { ImplicitStudentEducationOrganizationAssociationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrganizationAssociationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentEducationOrganizationAssociationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.StudentSchoolAssociationResourceId + { + get { return null; } + set { ImplicitStudentSchoolAssociationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentSchoolAssociationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentSchoolAssociationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentRegistration.TestingEducationOrganizationResourceId + { + get { return null; } + set { ImplicitTestingEducationOrganizationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentRegistration.TestingEducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitTestingEducationOrganizationReference.Discriminator = value; } } @@ -178339,12 +186114,35 @@ string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (StudentAssessmentRegistrationAssessmentAccommodations.Any() && mappingContract?.IsMemberSupported("StudentAssessmentRegistrationAssessmentAccommodations") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAssessmentRegistrationAssessmentAccommodations"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentRegistrationAssessmentAccommodations, validationContext, validationContext.Items.ForCollection("StudentAssessmentRegistrationAssessmentAccommodations")))) + { + yield return result; + } + } + + if (StudentAssessmentRegistrationAssessmentCustomizations.Any() && mappingContract?.IsMemberSupported("StudentAssessmentRegistrationAssessmentCustomizations") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentAssessmentRegistrationAssessmentCustomizations"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentRegistrationAssessmentCustomizations, validationContext, validationContext.Items.ForCollection("StudentAssessmentRegistrationAssessmentCustomizations")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -178371,57 +186169,75 @@ string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator pathBuilder.Length = dotLength; string pathPrefix = null; - var sourcesForAssessmentIdentifier = GetAssessmentIdentifierSources().ToArray(); + var sourcesForEducationOrganizationId = GetEducationOrganizationIdSources().ToArray(); - if (!sourcesForAssessmentIdentifier.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + if (!sourcesForEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) { pathPrefix ??= pathBuilder.ToString(); - string values = string.Join("', '", sourcesForAssessmentIdentifier.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForAssessmentIdentifier.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + string values = string.Join("', '", sourcesForEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'assessmentIdentifier' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForAssessmentIdentifier.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'educationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); } - IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() + IEnumerable<(string path, long value)> GetEducationOrganizationIdSources() { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentItem).StudentAssessment.AssessmentIdentifier); + // Obtain value from other references + var valueFromStudentEducationOrganizationAssessmentAccommodationReference = this.StudentEducationOrganizationAssessmentAccommodationReference?.EducationOrganizationId; + + if (valueFromStudentEducationOrganizationAssessmentAccommodationReference != null) + { + yield return ("studentEducationOrganizationAssessmentAccommodationReference.educationOrganizationId", this.StudentEducationOrganizationAssessmentAccommodationReference.EducationOrganizationId); + } // Obtain value from other references - var valueFromAssessmentItemReference = this.AssessmentItemReference?.AssessmentIdentifier; + var valueFromStudentEducationOrganizationAssociationReference = this.StudentEducationOrganizationAssociationReference?.EducationOrganizationId; - if (valueFromAssessmentItemReference != null) + if (valueFromStudentEducationOrganizationAssociationReference != null) { - yield return ("assessmentItemReference.assessmentIdentifier", this.AssessmentItemReference.AssessmentIdentifier); + yield return ("studentEducationOrganizationAssociationReference.educationOrganizationId", this.StudentEducationOrganizationAssociationReference.EducationOrganizationId); } } - var sourcesForNamespace = GetNamespaceSources().ToArray(); + var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); - if (!sourcesForNamespace.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) { pathPrefix ??= pathBuilder.ToString(); - string values = string.Join("', '", sourcesForNamespace.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForNamespace.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'namespace' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForNamespace.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); } - IEnumerable<(string path, string value)> GetNamespaceSources() + IEnumerable<(string path, string value)> GetStudentUniqueIdSources() { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentItem).StudentAssessment.Namespace); + // Obtain value from other references + var valueFromStudentEducationOrganizationAssessmentAccommodationReference = this.StudentEducationOrganizationAssessmentAccommodationReference?.StudentUniqueId; + + if (valueFromStudentEducationOrganizationAssessmentAccommodationReference != null) + { + yield return ("studentEducationOrganizationAssessmentAccommodationReference.studentUniqueId", this.StudentEducationOrganizationAssessmentAccommodationReference.StudentUniqueId); + } // Obtain value from other references - var valueFromAssessmentItemReference = this.AssessmentItemReference?.Namespace; + var valueFromStudentEducationOrganizationAssociationReference = this.StudentEducationOrganizationAssociationReference?.StudentUniqueId; - if (valueFromAssessmentItemReference != null) + if (valueFromStudentEducationOrganizationAssociationReference != null) { - yield return ("assessmentItemReference.namespace", this.AssessmentItemReference.Namespace); + yield return ("studentEducationOrganizationAssociationReference.studentUniqueId", this.StudentEducationOrganizationAssociationReference.StudentUniqueId); + } + + // Obtain value from other references + var valueFromStudentSchoolAssociationReference = this.StudentSchoolAssociationReference?.StudentUniqueId; + + if (valueFromStudentSchoolAssociationReference != null) + { + yield return ("studentSchoolAssociationReference.studentUniqueId", this.StudentSchoolAssociationReference.StudentUniqueId); } } @@ -178451,9 +186267,15 @@ string Entities.Common.EdFi.IStudentAssessmentItem.AssessmentItemDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentItemPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentRegistrationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StudentAssessmentRegistration = new FullName("edfi", "StudentAssessmentRegistration"); + + // Declare collection item validators + private StudentAssessmentRegistrationAssessmentAccommodationPutPostRequestValidator _studentAssessmentRegistrationAssessmentAccommodationsValidator = new (); + private StudentAssessmentRegistrationAssessmentCustomizationPutPostRequestValidator _studentAssessmentRegistrationAssessmentCustomizationsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -178466,6 +186288,39 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StudentAssessmentRegistrationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentAssessmentRegistration); + + if (mappingContract != null) + { + if (mappingContract.IsStudentAssessmentRegistrationAssessmentAccommodationIncluded != null) + { + var hasInvalidStudentAssessmentRegistrationAssessmentAccommodationsItems = instance.StudentAssessmentRegistrationAssessmentAccommodations.Any(x => !mappingContract.IsStudentAssessmentRegistrationAssessmentAccommodationIncluded(x)); + + if (hasInvalidStudentAssessmentRegistrationAssessmentAccommodationsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAssessmentRegistrationAssessmentAccommodations", $"A supplied 'StudentAssessmentRegistrationAssessmentAccommodation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentAssessmentRegistrationAssessmentCustomizationIncluded != null) + { + var hasInvalidStudentAssessmentRegistrationAssessmentCustomizationsItems = instance.StudentAssessmentRegistrationAssessmentCustomizations.Any(x => !mappingContract.IsStudentAssessmentRegistrationAssessmentCustomizationIncluded(x)); + + if (hasInvalidStudentAssessmentRegistrationAssessmentCustomizationsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentAssessmentRegistrationAssessmentCustomizations", $"A supplied 'StudentAssessmentRegistrationAssessmentCustomization' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -178482,16 +186337,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentRegistrationAssessmentAccommodation table of the StudentAssessmentRegistration aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentPerformanceLevel : Entities.Common.EdFi.IStudentAssessmentPerformanceLevel, IValidatableObject + public class StudentAssessmentRegistrationAssessmentAccommodation : Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentPerformanceLevel"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentRegistrationAssessmentAccommodation"); // Fluent validator instance (threadsafe) - private static StudentAssessmentPerformanceLevelPutPostRequestValidator _validator = new StudentAssessmentPerformanceLevelPutPostRequestValidator(); + private static StudentAssessmentRegistrationAssessmentAccommodationPutPostRequestValidator _validator = new StudentAssessmentRegistrationAssessmentAccommodationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -178518,42 +186373,33 @@ public class StudentAssessmentPerformanceLevel : Entities.Common.EdFi.IStudentAs //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessment _studentAssessment; + private Entities.Common.EdFi.IStudentAssessmentRegistration _studentAssessmentRegistration; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPerformanceLevel.StudentAssessment + Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrationAssessmentAccommodation.StudentAssessmentRegistration { - get { return _studentAssessment; } - set { SetStudentAssessment(value); } + get { return _studentAssessmentRegistration; } + set { SetStudentAssessmentRegistration(value); } } - public Entities.Common.EdFi.IStudentAssessment StudentAssessment + public Entities.Common.EdFi.IStudentAssessmentRegistration StudentAssessmentRegistration { - set { SetStudentAssessment(value); } + set { SetStudentAssessmentRegistration(value); } } - private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) + private void SetStudentAssessmentRegistration(Entities.Common.EdFi.IStudentAssessmentRegistration value) { - _studentAssessment = value; + _studentAssessmentRegistration = value; } /// - /// The method that the instructor of the class uses to report the performance and achievement. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } - - /// - /// A specification of which performance level value describes the student proficiency. + /// The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] - public string PerformanceLevelDescriptor { get; set; } + [DataMember(Name="accommodationDescriptor")][DescriptorExists("AccommodationDescriptor")] + public string AccommodationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -178568,7 +186414,7 @@ private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation; if (ReferenceEquals(this, compareTo)) return true; @@ -178577,17 +186423,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) + if (_studentAssessmentRegistration == null || !_studentAssessmentRegistration.Equals(compareTo.StudentAssessmentRegistration)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).PerformanceLevelDescriptor, compareTo.PerformanceLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation).AccommodationDescriptor, compareTo.AccommodationDescriptor)) return false; @@ -178604,15 +186445,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAssessment != null) - hash.Add(_studentAssessment); + if (_studentAssessmentRegistration != null) + hash.Add(_studentAssessmentRegistration); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentPerformanceLevel).PerformanceLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation).AccommodationDescriptor); return hash.ToHashCode(); } @@ -178626,14 +186463,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The name of the indicator being measured for a collection of performance level values. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="performanceLevelIndicatorName")] - public string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -178654,7 +186483,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentPerformanceLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessmentRegistration", "StudentAssessmentRegistrationAssessmentAccommodation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -178678,12 +186507,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)target); + return Entities.Common.EdFi.StudentAssessmentRegistrationAssessmentAccommodationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentPerformanceLevel)target, null); + Entities.Common.EdFi.StudentAssessmentRegistrationAssessmentAccommodationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation)target, null); } // ------------------------------------------------------------- @@ -178758,9 +186587,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentRegistrationAssessmentAccommodationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -178789,16 +186618,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAssessmentPeriod table of the StudentAssessment aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentRegistrationAssessmentCustomization table of the StudentAssessmentRegistration aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentPeriod : Entities.Common.EdFi.IStudentAssessmentPeriod, IValidatableObject + public class StudentAssessmentRegistrationAssessmentCustomization : Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentPeriod"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentRegistrationAssessmentCustomization"); // Fluent validator instance (threadsafe) - private static StudentAssessmentPeriodPutPostRequestValidator _validator = new StudentAssessmentPeriodPutPostRequestValidator(); + private static StudentAssessmentRegistrationAssessmentCustomizationPutPostRequestValidator _validator = new StudentAssessmentRegistrationAssessmentCustomizationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -178825,24 +186654,33 @@ public class StudentAssessmentPeriod : Entities.Common.EdFi.IStudentAssessmentPe //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessment _studentAssessment; + private Entities.Common.EdFi.IStudentAssessmentRegistration _studentAssessmentRegistration; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPeriod.StudentAssessment + Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrationAssessmentCustomization.StudentAssessmentRegistration { - get { return _studentAssessment; } - set { SetStudentAssessment(value); } + get { return _studentAssessmentRegistration; } + set { SetStudentAssessmentRegistration(value); } } - public Entities.Common.EdFi.IStudentAssessment StudentAssessment + public Entities.Common.EdFi.IStudentAssessmentRegistration StudentAssessmentRegistration { - set { SetStudentAssessment(value); } + set { SetStudentAssessmentRegistration(value); } } - private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) + private void SetStudentAssessmentRegistration(Entities.Common.EdFi.IStudentAssessmentRegistration value) { - _studentAssessment = value; + _studentAssessmentRegistration = value; } + + /// + /// An agreed upon identifier for the custom information. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="customizationKey")] + public string CustomizationKey { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -178857,7 +186695,7 @@ private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentPeriod; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization; if (ReferenceEquals(this, compareTo)) return true; @@ -178866,7 +186704,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) + if (_studentAssessmentRegistration == null || !_studentAssessmentRegistration.Equals(compareTo.StudentAssessmentRegistration)) + return false; + + + // Standard Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization).CustomizationKey, compareTo.CustomizationKey)) return false; @@ -178883,8 +186726,12 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAssessment != null) - hash.Add(_studentAssessment); + if (_studentAssessmentRegistration != null) + hash.Add(_studentAssessmentRegistration); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization).CustomizationKey); + return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -178899,27 +186746,13 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The period of time in which an assessment is supposed to be administered (e.g., Beginning of Year, Middle of Year, End of Year). - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="assessmentPeriodDescriptor")][DescriptorExists("AssessmentPeriodDescriptor")] - public string AssessmentPeriodDescriptor { get; set; } - - /// - /// The first date the assessment is to be administered. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? BeginDate { get; set; } - - /// - /// The last date the assessment is to be administered. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Custom value for the indicated CustomizationKey. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [RequiredWithNonDefault] + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="customizationValue")] + public string CustomizationValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -178940,7 +186773,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentPeriod")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessmentRegistration", "StudentAssessmentRegistrationAssessmentCustomization")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -178964,12 +186797,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentPeriodMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentPeriod)target); + return Entities.Common.EdFi.StudentAssessmentRegistrationAssessmentCustomizationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentPeriodMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentPeriod)target, null); + Entities.Common.EdFi.StudentAssessmentRegistrationAssessmentCustomizationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization)target, null); } // ------------------------------------------------------------- @@ -179044,9 +186877,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentPeriodPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentRegistrationAssessmentCustomizationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -179074,316 +186907,168 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAssessmentScoreResult table of the StudentAssessment aggregate in the ODS Database. + /// Represents a reference to the StudentAssessmentRegistrationBatteryPartAssociation resource. /// - [Serializable, DataContract] + [DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentScoreResult : Entities.Common.EdFi.IStudentAssessmentScoreResult, IValidatableObject + public class StudentAssessmentRegistrationBatteryPartAssociationReference : IResourceReference { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentScoreResult"); - - // Fluent validator instance (threadsafe) - private static StudentAssessmentScoreResultPutPostRequestValidator _validator = new StudentAssessmentScoreResultPutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ + [DataMember(Name="administrationIdentifier")] + public string AdministrationIdentifier { get; set; } - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ + [DataMember(Name="assessmentBatteryPartName")] + public string AssessmentBatteryPartName { get; set; } - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [DataMember(Name="assessmentIdentifier")] + public string AssessmentIdentifier { get; set; } - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessment _studentAssessment; + [DataMember(Name="assigningEducationOrganizationId")] + public long AssigningEducationOrganizationId { get; set; } - [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentScoreResult.StudentAssessment - { - get { return _studentAssessment; } - set { SetStudentAssessment(value); } - } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } - public Entities.Common.EdFi.IStudentAssessment StudentAssessment - { - set { SetStudentAssessment(value); } - } + [DataMember(Name="namespace")] + public string Namespace { get; set; } - private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId { - _studentAssessment = value; + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } } + private string _studentUniqueId; /// - /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. + /// Gets or sets the resource identifier of the referenced resource. /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- + public Guid ResourceId { get; set; } /// - /// Determines equality based on the natural key properties of the resource. + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentScoreResult; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentScoreResult).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) - return false; + public string Discriminator { get; set; } - return true; - } + private Link _link; - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() + [DataMember(Name="link")] + public Link Link { - var hash = new HashCode(); - //Parent Property - if (_studentAssessment != null) - hash.Add(_studentAssessment); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentScoreResult).AssessmentReportingMethodDescriptor); + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } - return hash.ToHashCode(); + return _link; + } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="result")] - public string Result { get; set; } /// - /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] - public string ResultDatatypeTypeDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentScoreResult")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.StudentAssessmentScoreResultMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentScoreResult)target); - } - - void IMappable.Map(object target) + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() { - Entities.Common.EdFi.StudentAssessmentScoreResultMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentScoreResult)target, null); + return AdministrationIdentifier != default(string) && AssessmentBatteryPartName != default(string) && AssessmentIdentifier != default(string) && AssigningEducationOrganizationId != default(long) && EducationOrganizationId != default(long) && Namespace != default(string) && StudentUniqueId != default(string); } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IResourceReference.GetUndefinedProperties() { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; + if (AdministrationIdentifier == default) + { + yield return "AdministrationIdentifier"; + } - try + if (AssessmentBatteryPartName == default) { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; + yield return "AssessmentBatteryPartName"; + } - // ---------------------- - // Validate collections - // ---------------------- + if (AssessmentIdentifier == default) + { + yield return "AssessmentIdentifier"; + } - // --------------------------- - // Validate embedded objects - // --------------------------- + if (AssigningEducationOrganizationId == default) + { + yield return "AssigningEducationOrganizationId"; + } - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } + if (Namespace == default) + { + yield return "Namespace"; } - finally + + if (StudentUniqueId == default) { - // Restore original length - pathBuilder.Length = originalLength; + yield return "StudentUniqueId"; } - // ---------------------------------- - } - } - // ================================================================= - // Validators - // ----------------------------------------------------------------- + } - [ExcludeFromCodeCoverage] - public class StudentAssessmentScoreResultPutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private Link CreateLink() { - if (context.InstanceToValidate == null) + var link = new Link { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + Rel = "StudentAssessmentRegistrationBatteryPartAssociation", + Href = $"/ed-fi/studentAssessmentRegistrationBatteryPartAssociations/{ResourceId:n}" + }; - return false; - } + if (string.IsNullOrEmpty(Discriminator)) + return link; - var instance = context.InstanceToValidate; + string[] linkParts = Discriminator.Split('.'); - var failures = new List(); + if (linkParts.Length < 2) + return link; - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - return false; - } + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; - return true; + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } - } - // ----------------------------------------------------------------- + } // Aggregate reference /// - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessment table of the StudentAssessment aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentRegistrationBatteryPartAssociation table of the StudentAssessmentRegistrationBatteryPartAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessment : Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment, IValidatableObject + public class StudentAssessmentRegistrationBatteryPartAssociation : Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessment"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentRegistrationBatteryPartAssociation"); // Fluent validator instance (threadsafe) - private static StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator _validator = new StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator(); + private static StudentAssessmentRegistrationBatteryPartAssociationPutPostRequestValidator _validator = new StudentAssessmentRegistrationBatteryPartAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -179394,10 +187079,9 @@ public class StudentAssessmentStudentObjectiveAssessment : Entities.Common.EdFi. // Constructor // ------------------------------------------------------------- - public StudentAssessmentStudentObjectiveAssessment() + public StudentAssessmentRegistrationBatteryPartAssociation() { - StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new List(); - StudentAssessmentStudentObjectiveAssessmentScoreResults = new List(); + StudentAssessmentRegistrationBatteryPartAssociationAccommodations = new List(); } // ------------------------------------------------------------ @@ -179405,43 +187089,83 @@ public StudentAssessmentStudentObjectiveAssessment() // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentAssessmentRegistrationBatteryPartAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _objectiveAssessmentReferenceExplicitlyAssigned; - private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference _objectiveAssessmentReference; - private ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ImplicitObjectiveAssessmentReference + private bool _assessmentBatteryPartReferenceExplicitlyAssigned; + private AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference _assessmentBatteryPartReference; + private AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference ImplicitAssessmentBatteryPartReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_objectiveAssessmentReference == null && !_objectiveAssessmentReferenceExplicitlyAssigned) - _objectiveAssessmentReference = new ObjectiveAssessment.EdFi.ObjectiveAssessmentReference(); + if (_assessmentBatteryPartReference == null && !_assessmentBatteryPartReferenceExplicitlyAssigned) + _assessmentBatteryPartReference = new AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference(); - return _objectiveAssessmentReference; + return _assessmentBatteryPartReference; } } - [DataMember(Name="objectiveAssessmentReference")] + [DataMember(Name="assessmentBatteryPartReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ObjectiveAssessmentReference + public AssessmentBatteryPart.EdFi.AssessmentBatteryPartReference AssessmentBatteryPartReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitObjectiveAssessmentReference != null - && (_objectiveAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) - return ImplicitObjectiveAssessmentReference; + if (ImplicitAssessmentBatteryPartReference != null + && (_assessmentBatteryPartReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitAssessmentBatteryPartReference.IsReferenceFullyDefined())) + return ImplicitAssessmentBatteryPartReference; return null; } set { - _objectiveAssessmentReferenceExplicitlyAssigned = true; - _objectiveAssessmentReference = value; + _assessmentBatteryPartReferenceExplicitlyAssigned = true; + _assessmentBatteryPartReference = value; + } + } + private bool _studentAssessmentRegistrationReferenceExplicitlyAssigned; + private StudentAssessmentRegistration.EdFi.StudentAssessmentRegistrationReference _studentAssessmentRegistrationReference; + private StudentAssessmentRegistration.EdFi.StudentAssessmentRegistrationReference ImplicitStudentAssessmentRegistrationReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentAssessmentRegistrationReference == null && !_studentAssessmentRegistrationReferenceExplicitlyAssigned) + _studentAssessmentRegistrationReference = new StudentAssessmentRegistration.EdFi.StudentAssessmentRegistrationReference(); + + return _studentAssessmentRegistrationReference; + } + } + + [DataMember(Name="studentAssessmentRegistrationReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public StudentAssessmentRegistration.EdFi.StudentAssessmentRegistrationReference StudentAssessmentRegistrationReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentAssessmentRegistrationReference != null + && (_studentAssessmentRegistrationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentRegistrationReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentRegistrationReference; + + return null; + } + set + { + _studentAssessmentRegistrationReferenceExplicitlyAssigned = true; + _studentAssessmentRegistrationReference = value; } } // ------------------------------------------------------------- @@ -179449,43 +187173,147 @@ public ObjectiveAssessment.EdFi.ObjectiveAssessmentReference ObjectiveAssessment //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessment _studentAssessment; - [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssessment.StudentAssessment + /// + /// The title or name of the assessment in the context of its administration. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AdministrationIdentifier { - get { return _studentAssessment; } - set { SetStudentAssessment(value); } + get + { + if (ImplicitStudentAssessmentRegistrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentRegistrationReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentRegistrationReference.AdministrationIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessmentRegistration + _studentAssessmentRegistrationReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentRegistrationReference.AdministrationIdentifier = value; + } } - public Entities.Common.EdFi.IStudentAssessment StudentAssessment + /// + /// The name of the part of an assessment battery. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AssessmentBatteryPartName { - set { SetStudentAssessment(value); } + get + { + if (ImplicitAssessmentBatteryPartReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentBatteryPartReference.IsReferenceFullyDefined())) + return ImplicitAssessmentBatteryPartReference.AssessmentBatteryPartName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentBatteryPart + _assessmentBatteryPartReferenceExplicitlyAssigned = false; + ImplicitAssessmentBatteryPartReference.AssessmentBatteryPartName = value; + } } - private void SetStudentAssessment(Entities.Common.EdFi.IStudentAssessment value) + /// + /// A unique number or alphanumeric code assigned to an assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AssessmentIdentifier { - _studentAssessment = value; + get + { + if (ImplicitAssessmentBatteryPartReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentBatteryPartReference.IsReferenceFullyDefined())) + return ImplicitAssessmentBatteryPartReference.AssessmentIdentifier; - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_objectiveAssessmentReferenceExplicitlyAssigned) + return default(string); + } + set { - ImplicitObjectiveAssessmentReference.AssessmentIdentifier = _studentAssessment.AssessmentIdentifier; - ImplicitObjectiveAssessmentReference.Namespace = _studentAssessment.Namespace; + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // AssessmentBatteryPart + _assessmentBatteryPartReferenceExplicitlyAssigned = false; + ImplicitAssessmentBatteryPartReference.AssessmentIdentifier = value; + + // StudentAssessmentRegistration + _studentAssessmentRegistrationReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentRegistrationReference.AssessmentIdentifier = value; } } /// - /// A unique number or alphanumeric code assigned to an objective assessment by a school, school system, a state, or other agency or entity. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.IdentificationCode + long Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AssigningEducationOrganizationId { get { - if (ImplicitObjectiveAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveAssessmentReference.IsReferenceFullyDefined())) - return ImplicitObjectiveAssessmentReference.IdentificationCode; + if (ImplicitStudentAssessmentRegistrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentRegistrationReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentRegistrationReference.AssigningEducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessmentRegistration + _studentAssessmentRegistrationReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentRegistrationReference.AssigningEducationOrganizationId = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.EducationOrganizationId + { + get + { + if (ImplicitStudentAssessmentRegistrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentRegistrationReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentRegistrationReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessmentRegistration + _studentAssessmentRegistrationReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentRegistrationReference.EducationOrganizationId = value; + } + } + + /// + /// Namespace for the assessment. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.Namespace + { + get + { + if (ImplicitAssessmentBatteryPartReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitAssessmentBatteryPartReference.IsReferenceFullyDefined())) + return ImplicitAssessmentBatteryPartReference.Namespace; return default(string); } @@ -179494,9 +187322,39 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Identif // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ObjectiveAssessment - _objectiveAssessmentReferenceExplicitlyAssigned = false; - ImplicitObjectiveAssessmentReference.IdentificationCode = value; + // AssessmentBatteryPart + _assessmentBatteryPartReferenceExplicitlyAssigned = false; + ImplicitAssessmentBatteryPartReference.Namespace = value; + + // StudentAssessmentRegistration + _studentAssessmentRegistrationReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentRegistrationReference.Namespace = value; + } + } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.StudentUniqueId + { + get + { + if (ImplicitStudentAssessmentRegistrationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentRegistrationReference.IsReferenceFullyDefined())) + return ImplicitStudentAssessmentRegistrationReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // StudentAssessmentRegistration + _studentAssessmentRegistrationReferenceExplicitlyAssigned = false; + ImplicitStudentAssessmentRegistrationReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } // ------------------------------------------------------------- @@ -179513,7 +187371,7 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Identif /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -179521,13 +187379,39 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_studentAssessment == null || !_studentAssessment.Equals(compareTo.StudentAssessment)) + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AdministrationIdentifier, compareTo.AdministrationIdentifier)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).IdentificationCode, compareTo.IdentificationCode)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AssessmentBatteryPartName, compareTo.AssessmentBatteryPartName)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AssessmentIdentifier, compareTo.AssessmentIdentifier)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AssigningEducationOrganizationId.Equals(compareTo.AssigningEducationOrganizationId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).Namespace, compareTo.Namespace)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -179543,12 +187427,27 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_studentAssessment != null) - hash.Add(_studentAssessment); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).IdentificationCode); + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AdministrationIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AssessmentBatteryPartName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AssessmentIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).AssigningEducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).EducationOrganizationId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).Namespace); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -179561,27 +187460,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The date and time an assessment was completed by the student. The use of ISO-8601 formats with a timezone designator (UTC or time offset) is recommended in order to prevent ambiguity due to time zones. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="administrationDate")] - public DateTime? AdministrationDate { get; set; } - - /// - /// The date and time an assessment administration ended. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="administrationEndDate")] - public DateTime? AdministrationEndDate { get; set; } - - /// - /// Reported time student was assessed in minutes. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="assessedMinutes")] - public int? AssessedMinutes { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -179602,71 +187480,41 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessment")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessmentRegistrationBatteryPartAssociation", "StudentAssessmentRegistrationBatteryPartAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; - private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="performanceLevels")] - public ICollection StudentAssessmentStudentObjectiveAssessmentPerformanceLevels - { - get { return _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)e.Item).StudentAssessmentStudentObjectiveAssessment = this); - _studentAssessmentStudentObjectiveAssessmentPerformanceLevels = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)e.Item).StudentAssessmentStudentObjectiveAssessment = this; - _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentPerformanceLevels - { - get { return _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; } - set { StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new List(value.Cast()); } - } - - private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResults; - private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; + private ICollection _studentAssessmentRegistrationBatteryPartAssociationAccommodations; + private ICollection _studentAssessmentRegistrationBatteryPartAssociationAccommodationsCovariant; [NoDuplicateMembers] - [DataMember(Name="scoreResults")] - public ICollection StudentAssessmentStudentObjectiveAssessmentScoreResults + [DataMember(Name="accommodations")] + public ICollection StudentAssessmentRegistrationBatteryPartAssociationAccommodations { - get { return _studentAssessmentStudentObjectiveAssessmentScoreResults; } + get { return _studentAssessmentRegistrationBatteryPartAssociationAccommodations; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)e.Item).StudentAssessmentStudentObjectiveAssessment = this); - _studentAssessmentStudentObjectiveAssessmentScoreResults = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation)e.Item).StudentAssessmentRegistrationBatteryPartAssociation = this); + _studentAssessmentRegistrationBatteryPartAssociationAccommodations = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)e.Item).StudentAssessmentStudentObjectiveAssessment = this; - _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation)e.Item).StudentAssessmentRegistrationBatteryPartAssociation = this; + _studentAssessmentRegistrationBatteryPartAssociationAccommodationsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.StudentAssessmentStudentObjectiveAssessmentScoreResults + ICollection Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.StudentAssessmentRegistrationBatteryPartAssociationAccommodations { - get { return _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; } - set { StudentAssessmentStudentObjectiveAssessmentScoreResults = new List(value.Cast()); } + get { return _studentAssessmentRegistrationBatteryPartAssociationAccommodationsCovariant; } + set { StudentAssessmentRegistrationBatteryPartAssociationAccommodations = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -179674,6 +187522,13 @@ public ICollection Stude // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -179684,14 +187539,9 @@ public ICollection Stude internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_studentAssessmentStudentObjectiveAssessmentPerformanceLevels != null) foreach (var item in _studentAssessmentStudentObjectiveAssessmentPerformanceLevels) - { - item.StudentAssessmentStudentObjectiveAssessment = this; - } - - if (_studentAssessmentStudentObjectiveAssessmentScoreResults != null) foreach (var item in _studentAssessmentStudentObjectiveAssessmentScoreResults) + if (_studentAssessmentRegistrationBatteryPartAssociationAccommodations != null) foreach (var item in _studentAssessmentRegistrationBatteryPartAssociationAccommodations) { - item.StudentAssessmentStudentObjectiveAssessment = this; + item.StudentAssessmentRegistrationBatteryPartAssociation = this; } } @@ -179702,29 +187552,43 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)target); + return Entities.Common.EdFi.StudentAssessmentRegistrationBatteryPartAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment)target, null); + Entities.Common.EdFi.StudentAssessmentRegistrationBatteryPartAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentResourceId + Guid? Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AssessmentBatteryPartResourceId { get { return null; } - set { ImplicitObjectiveAssessmentReference.ResourceId = value ?? default(Guid); } + set { ImplicitAssessmentBatteryPartReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.ObjectiveAssessmentDiscriminator + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.AssessmentBatteryPartDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitObjectiveAssessmentReference.Discriminator = value; } + set { ImplicitAssessmentBatteryPartReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.StudentAssessmentRegistrationResourceId + { + get { return null; } + set { ImplicitStudentAssessmentRegistrationReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation.StudentAssessmentRegistrationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentAssessmentRegistrationReference.Discriminator = value; } } @@ -179745,31 +187609,18 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Objecti try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (StudentAssessmentStudentObjectiveAssessmentPerformanceLevels.Any() && mappingContract?.IsMemberSupported("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentStudentObjectiveAssessmentPerformanceLevels, validationContext, validationContext.Items.ForCollection("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels")))) - { - yield return result; - } - } - - if (StudentAssessmentStudentObjectiveAssessmentScoreResults.Any() && mappingContract?.IsMemberSupported("StudentAssessmentStudentObjectiveAssessmentScoreResults") != false) + if (StudentAssessmentRegistrationBatteryPartAssociationAccommodations.Any() && mappingContract?.IsMemberSupported("StudentAssessmentRegistrationBatteryPartAssociationAccommodations") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentAssessmentStudentObjectiveAssessmentScoreResults"); + pathBuilder.Append("StudentAssessmentRegistrationBatteryPartAssociationAccommodations"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentStudentObjectiveAssessmentScoreResults, validationContext, validationContext.Items.ForCollection("StudentAssessmentStudentObjectiveAssessmentScoreResults")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentAssessmentRegistrationBatteryPartAssociationAccommodations, validationContext, validationContext.Items.ForCollection("StudentAssessmentRegistrationBatteryPartAssociationAccommodations")))) { yield return result; } @@ -179816,15 +187667,20 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Objecti IEnumerable<(string path, string value)> GetAssessmentIdentifierSources() { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).StudentAssessment.AssessmentIdentifier); + // Obtain value from other references + var valueFromAssessmentBatteryPartReference = this.AssessmentBatteryPartReference?.AssessmentIdentifier; + + if (valueFromAssessmentBatteryPartReference != null) + { + yield return ("assessmentBatteryPartReference.assessmentIdentifier", this.AssessmentBatteryPartReference.AssessmentIdentifier); + } // Obtain value from other references - var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.AssessmentIdentifier; + var valueFromStudentAssessmentRegistrationReference = this.StudentAssessmentRegistrationReference?.AssessmentIdentifier; - if (valueFromObjectiveAssessmentReference != null) + if (valueFromStudentAssessmentRegistrationReference != null) { - yield return ("objectiveAssessmentReference.assessmentIdentifier", this.ObjectiveAssessmentReference.AssessmentIdentifier); + yield return ("studentAssessmentRegistrationReference.assessmentIdentifier", this.StudentAssessmentRegistrationReference.AssessmentIdentifier); } } @@ -179843,15 +187699,20 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Objecti IEnumerable<(string path, string value)> GetNamespaceSources() { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment).StudentAssessment.Namespace); + // Obtain value from other references + var valueFromAssessmentBatteryPartReference = this.AssessmentBatteryPartReference?.Namespace; + + if (valueFromAssessmentBatteryPartReference != null) + { + yield return ("assessmentBatteryPartReference.namespace", this.AssessmentBatteryPartReference.Namespace); + } // Obtain value from other references - var valueFromObjectiveAssessmentReference = this.ObjectiveAssessmentReference?.Namespace; + var valueFromStudentAssessmentRegistrationReference = this.StudentAssessmentRegistrationReference?.Namespace; - if (valueFromObjectiveAssessmentReference != null) + if (valueFromStudentAssessmentRegistrationReference != null) { - yield return ("objectiveAssessmentReference.namespace", this.ObjectiveAssessmentReference.Namespace); + yield return ("studentAssessmentRegistrationReference.namespace", this.StudentAssessmentRegistrationReference.Namespace); } } @@ -179881,15 +187742,14 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Objecti // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentRegistrationBatteryPartAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentAssessmentStudentObjectiveAssessment = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessment"); + private static readonly FullName _fullName_edfi_StudentAssessmentRegistrationBatteryPartAssociation = new FullName("edfi", "StudentAssessmentRegistrationBatteryPartAssociation"); // Declare collection item validators - private StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsValidator = new (); - private StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator _studentAssessmentStudentObjectiveAssessmentScoreResultsValidator = new (); + private StudentAssessmentRegistrationBatteryPartAssociationAccommodationPutPostRequestValidator _studentAssessmentRegistrationBatteryPartAssociationAccommodationsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -179906,30 +187766,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStudentAssessmentStudentObjectiveAssessmentPerformanceLevelIncluded(x)); - - if (hasInvalidStudentAssessmentStudentObjectiveAssessmentPerformanceLevelsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAssessmentStudentObjectiveAssessmentPerformanceLevels", $"A supplied 'StudentAssessmentStudentObjectiveAssessmentPerformanceLevel' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded != null) + if (mappingContract.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded != null) { - var hasInvalidStudentAssessmentStudentObjectiveAssessmentScoreResultsItems = instance.StudentAssessmentStudentObjectiveAssessmentScoreResults.Any(x => !mappingContract.IsStudentAssessmentStudentObjectiveAssessmentScoreResultIncluded(x)); + var hasInvalidStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItems = instance.StudentAssessmentRegistrationBatteryPartAssociationAccommodations.Any(x => !mappingContract.IsStudentAssessmentRegistrationBatteryPartAssociationAccommodationIncluded(x)); - if (hasInvalidStudentAssessmentStudentObjectiveAssessmentScoreResultsItems) + if (hasInvalidStudentAssessmentRegistrationBatteryPartAssociationAccommodationsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentAssessmentStudentObjectiveAssessmentScoreResults", $"A supplied 'StudentAssessmentStudentObjectiveAssessmentScoreResult' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentAssessmentRegistrationBatteryPartAssociationAccommodations", $"A supplied 'StudentAssessmentRegistrationBatteryPartAssociationAccommodation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -179951,16 +187800,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevel table of the StudentAssessment aggregate in the ODS Database. + /// A class which represents the edfi.StudentAssessmentRegistrationBatteryPartAssociationAccommodation table of the StudentAssessmentRegistrationBatteryPartAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevel : Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel, IValidatableObject + public class StudentAssessmentRegistrationBatteryPartAssociationAccommodation : Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel"); + private static FullName _fullName = new FullName("edfi", "StudentAssessmentRegistrationBatteryPartAssociationAccommodation"); // Fluent validator instance (threadsafe) - private static StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator _validator = new StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator(); + private static StudentAssessmentRegistrationBatteryPartAssociationAccommodationPutPostRequestValidator _validator = new StudentAssessmentRegistrationBatteryPartAssociationAccommodationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -179987,42 +187836,33 @@ public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevel : Entit //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment _studentAssessmentStudentObjectiveAssessment; + private Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation _studentAssessmentRegistrationBatteryPartAssociation; [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel.StudentAssessmentStudentObjectiveAssessment + Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation IStudentAssessmentRegistrationBatteryPartAssociationAccommodation.StudentAssessmentRegistrationBatteryPartAssociation { - get { return _studentAssessmentStudentObjectiveAssessment; } - set { SetStudentAssessmentStudentObjectiveAssessment(value); } + get { return _studentAssessmentRegistrationBatteryPartAssociation; } + set { SetStudentAssessmentRegistrationBatteryPartAssociation(value); } } - public Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment + public Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation StudentAssessmentRegistrationBatteryPartAssociation { - set { SetStudentAssessmentStudentObjectiveAssessment(value); } + set { SetStudentAssessmentRegistrationBatteryPartAssociation(value); } } - private void SetStudentAssessmentStudentObjectiveAssessment(Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment value) + private void SetStudentAssessmentRegistrationBatteryPartAssociation(Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation value) { - _studentAssessmentStudentObjectiveAssessment = value; + _studentAssessmentRegistrationBatteryPartAssociation = value; } /// - /// The method that the instructor of the class uses to report the performance and achievement. It may be a qualitative method such as individualized teacher comments or a quantitative method such as a letter or numerical grade. In some cases, more than one type of reporting method may be used. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } - - /// - /// A specification of which performance level value describes the student proficiency. + /// The special variation(s) to be used for the specific part of the assessment battery on how is presented, how it is administered, or how the test taker is allowed to respond. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="performanceLevelDescriptor")][DescriptorExists("PerformanceLevelDescriptor")] - public string PerformanceLevelDescriptor { get; set; } + [DataMember(Name="accommodationDescriptor")][DescriptorExists("AccommodationDescriptor")] + public string AccommodationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -180037,7 +187877,7 @@ private void SetStudentAssessmentStudentObjectiveAssessment(Entities.Common.EdFi /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel; + var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation; if (ReferenceEquals(this, compareTo)) return true; @@ -180046,17 +187886,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentAssessmentStudentObjectiveAssessment == null || !_studentAssessmentStudentObjectiveAssessment.Equals(compareTo.StudentAssessmentStudentObjectiveAssessment)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) + if (_studentAssessmentRegistrationBatteryPartAssociation == null || !_studentAssessmentRegistrationBatteryPartAssociation.Equals(compareTo.StudentAssessmentRegistrationBatteryPartAssociation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor, compareTo.PerformanceLevelDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation).AccommodationDescriptor, compareTo.AccommodationDescriptor)) return false; @@ -180073,15 +187908,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentAssessmentStudentObjectiveAssessment != null) - hash.Add(_studentAssessmentStudentObjectiveAssessment); + if (_studentAssessmentRegistrationBatteryPartAssociation != null) + hash.Add(_studentAssessmentRegistrationBatteryPartAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).AssessmentReportingMethodDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel).PerformanceLevelDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation).AccommodationDescriptor); return hash.ToHashCode(); } @@ -180095,14 +187926,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The name of the indicator being measured for a collection of performance level values. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(60, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="performanceLevelIndicatorName")] - public string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -180123,7 +187946,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessmentRegistrationBatteryPartAssociation", "StudentAssessmentRegistrationBatteryPartAssociationAccommodation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -180147,12 +187970,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)target); + return Entities.Common.EdFi.StudentAssessmentRegistrationBatteryPartAssociationAccommodationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentPerformanceLevelMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel)target, null); + Entities.Common.EdFi.StudentAssessmentRegistrationBatteryPartAssociationAccommodationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation)target, null); } // ------------------------------------------------------------- @@ -180227,9 +188050,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevelPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentAssessmentRegistrationBatteryPartAssociationAccommodationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -180257,17 +188080,22 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentAssessmentStudentObjectiveAssessmentScoreResult table of the StudentAssessment aggregate in the ODS Database. + /// A class which represents the edfi.StudentCharacteristicDescriptor table of the StudentCharacteristicDescriptor aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentScoreResult : Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult, IValidatableObject + public class StudentCharacteristicDescriptor : Entities.Common.EdFi.IStudentCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentStudentObjectiveAssessmentScoreResult"); + private static FullName _fullName = new FullName("edfi", "StudentCharacteristicDescriptor"); // Fluent validator instance (threadsafe) - private static StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator _validator = new StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator(); + private static StudentCharacteristicDescriptorPutPostRequestValidator _validator = new StudentCharacteristicDescriptorPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -180284,6 +188112,13 @@ public class StudentAssessmentStudentObjectiveAssessmentScoreResult : Entities.C // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentCharacteristicDescriptor resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= @@ -180294,33 +188129,19 @@ public class StudentAssessmentStudentObjectiveAssessmentScoreResult : Entities.C //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment _studentAssessmentStudentObjectiveAssessment; - - [IgnoreDataMember] - Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentScoreResult.StudentAssessmentStudentObjectiveAssessment - { - get { return _studentAssessmentStudentObjectiveAssessment; } - set { SetStudentAssessmentStudentObjectiveAssessment(value); } - } - public Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment - { - set { SetStudentAssessmentStudentObjectiveAssessment(value); } - } + /// + /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// + // NOT in a reference, NOT a lookup column + [JsonIgnore] + public int StudentCharacteristicDescriptorId { get; set; } - private void SetStudentAssessmentStudentObjectiveAssessment(Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment value) + int IDescriptor.DescriptorId { - _studentAssessmentStudentObjectiveAssessment = value; + get { return StudentCharacteristicDescriptorId; } + set { StudentCharacteristicDescriptorId = value; } } - - /// - /// The method that the administrator of the assessment uses to report the performance and achievement of all students. It may be a qualitative method such as performance level descriptors or a quantitative method such as a numerical grade or cut score. More than one type of reporting method may be used. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="assessmentReportingMethodDescriptor")][DescriptorExists("AssessmentReportingMethodDescriptor")] - public string AssessmentReportingMethodDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -180335,7 +188156,7 @@ private void SetStudentAssessmentStudentObjectiveAssessment(Entities.Common.EdFi /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult; + var compareTo = obj as Entities.Common.EdFi.IStudentCharacteristicDescriptor; if (ReferenceEquals(this, compareTo)) return true; @@ -180343,13 +188164,9 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_studentAssessmentStudentObjectiveAssessment == null || !_studentAssessmentStudentObjectiveAssessment.Equals(compareTo.StudentAssessmentStudentObjectiveAssessment)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult).AssessmentReportingMethodDescriptor, compareTo.AssessmentReportingMethodDescriptor)) + // Derived Property + if (!(this as Entities.Common.EdFi.IStudentCharacteristicDescriptor).StudentCharacteristicDescriptorId.Equals(compareTo.StudentCharacteristicDescriptorId)) return false; @@ -180365,12 +188182,9 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_studentAssessmentStudentObjectiveAssessment != null) - hash.Add(_studentAssessmentStudentObjectiveAssessment); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult).AssessmentReportingMethodDescriptor); + //Derived Property + hash.Add((this as Entities.Common.EdFi.IStudentCharacteristicDescriptor).StudentCharacteristicDescriptorId); return hash.ToHashCode(); } @@ -180379,29 +188193,60 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + /// + /// A code or abbreviation that is used to refer to the descriptor. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="codeValue")] + public string CodeValue { get; set; } /// - /// The value of a meaningful raw score or statistical expression of the performance of an individual. The results can be expressed as a number, percentile, range, level, etc. + /// The description of the descriptor. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveBeginDate { get; set; } + + /// + /// The end date of the period when the descriptor is in effect. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EffectiveEndDate { get; set; } + + /// + /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(35, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="result")] - public string Result { get; set; } + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="namespace")] + public string Namespace { get; set; } /// - /// The datatype of the result. The results can be expressed as a number, percentile, range, level, etc. + /// A shortened description for the descriptor. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="resultDatatypeTypeDescriptor")][DescriptorExists("ResultDatatypeTypeDescriptor")] - public string ResultDatatypeTypeDescriptor { get; set; } + [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="shortDescription")] + public string ShortDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -180422,8 +188267,11 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentScoreResult")] - public System.Collections.IDictionary Extensions { get; set; } + // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation + public System.Collections.IDictionary Extensions { + get { return null; } + set { } + } // ------------------------------------------------------------- // ============================================================= @@ -180434,6 +188282,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -180446,12 +188301,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentScoreResultMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)target); + return Entities.Common.EdFi.StudentCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCharacteristicDescriptor)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentStudentObjectiveAssessmentScoreResultMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult)target, null); + Entities.Common.EdFi.StudentCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStudentCharacteristicDescriptor)target, null); } // ------------------------------------------------------------- @@ -180459,66 +188314,6 @@ void IMappable.Map(object target) // Resource Reference Data // ----------------------------------------------------------------- // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } } // ================================================================= @@ -180526,9 +188321,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentStudentObjectiveAssessmentScoreResultPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -180557,32 +188352,26 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentAssessmentEducationOrganizationAssociation resource. + /// Represents a reference to the StudentCohortAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentEducationOrganizationAssociationReference : IResourceReference + public class StudentCohortAssociationReference : IResourceReference { - [DataMember(Name="assessmentIdentifier")] - public string AssessmentIdentifier { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - [DataMember(Name="educationOrganizationAssociationTypeDescriptor")][DescriptorExists("EducationOrganizationAssociationTypeDescriptor")] - public string EducationOrganizationAssociationTypeDescriptor { get; set; } + [DataMember(Name="cohortIdentifier")] + public string CohortIdentifier { get; set; } [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - [DataMember(Name="studentAssessmentIdentifier")] - public string StudentAssessmentIdentifier { get; set; } - [DataMember(Name="studentUniqueId")] public string StudentUniqueId { @@ -180631,19 +188420,19 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AssessmentIdentifier != default(string) && EducationOrganizationAssociationTypeDescriptor != default(string) && EducationOrganizationId != default(long) && Namespace != default(string) && StudentAssessmentIdentifier != default(string) && StudentUniqueId != default(string); + return BeginDate != default(DateTime) && CohortIdentifier != default(string) && EducationOrganizationId != default(long) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (AssessmentIdentifier == default) + if (BeginDate == default) { - yield return "AssessmentIdentifier"; + yield return "BeginDate"; } - if (EducationOrganizationAssociationTypeDescriptor == default) + if (CohortIdentifier == default) { - yield return "EducationOrganizationAssociationTypeDescriptor"; + yield return "CohortIdentifier"; } if (EducationOrganizationId == default) @@ -180651,16 +188440,6 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "EducationOrganizationId"; } - if (Namespace == default) - { - yield return "Namespace"; - } - - if (StudentAssessmentIdentifier == default) - { - yield return "StudentAssessmentIdentifier"; - } - if (StudentUniqueId == default) { yield return "StudentUniqueId"; @@ -180672,8 +188451,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentAssessmentEducationOrganizationAssociation", - Href = $"/ed-fi/studentAssessmentEducationOrganizationAssociations/{ResourceId:n}" + Rel = "StudentCohortAssociation", + Href = $"/ed-fi/studentCohortAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -180700,16 +188479,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StudentAssessmentEducationOrganizationAssociation table of the StudentAssessmentEducationOrganizationAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentCohortAssociation table of the StudentCohortAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentAssessmentEducationOrganizationAssociation : Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentCohortAssociation : Entities.Common.EdFi.IStudentCohortAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentAssessmentEducationOrganizationAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentCohortAssociation"); // Fluent validator instance (threadsafe) - private static StudentAssessmentEducationOrganizationAssociationPutPostRequestValidator _validator = new StudentAssessmentEducationOrganizationAssociationPutPostRequestValidator(); + private static StudentCohortAssociationPutPostRequestValidator _validator = new StudentCohortAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -180720,6 +188499,10 @@ public class StudentAssessmentEducationOrganizationAssociation : Entities.Common // Constructor // ------------------------------------------------------------- + public StudentCohortAssociation() + { + StudentCohortAssociationSections = new List(); + } // ------------------------------------------------------------ @@ -180728,7 +188511,7 @@ public class StudentAssessmentEducationOrganizationAssociation : Entities.Common // ------------------------------------------------------------ /// - /// The unique identifier for the StudentAssessmentEducationOrganizationAssociation resource. + /// The unique identifier for the StudentCohortAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -180736,106 +188519,73 @@ public class StudentAssessmentEducationOrganizationAssociation : Entities.Common // ------------------------------------------------------------ // ============================================================= - // References - // ------------------------------------------------------------- - - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; + // References + // ------------------------------------------------------------- - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } - private bool _schoolYearTypeReferenceExplicitlyAssigned; - private SchoolYearType.EdFi.SchoolYearTypeReference _schoolYearTypeReference; - private SchoolYearType.EdFi.SchoolYearTypeReference ImplicitSchoolYearTypeReference + private bool _cohortReferenceExplicitlyAssigned; + private Cohort.EdFi.CohortReference _cohortReference; + private Cohort.EdFi.CohortReference ImplicitCohortReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolYearTypeReference == null && !_schoolYearTypeReferenceExplicitlyAssigned) - _schoolYearTypeReference = new SchoolYearType.EdFi.SchoolYearTypeReference(); + if (_cohortReference == null && !_cohortReferenceExplicitlyAssigned) + _cohortReference = new Cohort.EdFi.CohortReference(); - return _schoolYearTypeReference; + return _cohortReference; } } - [DataMember(Name="schoolYearTypeReference")] - [FullyDefinedReference] - public SchoolYearType.EdFi.SchoolYearTypeReference SchoolYearTypeReference + [DataMember(Name="cohortReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Cohort.EdFi.CohortReference CohortReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolYearTypeReference != null - && (_schoolYearTypeReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - return ImplicitSchoolYearTypeReference; + if (ImplicitCohortReference != null + && (_cohortReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) + return ImplicitCohortReference; return null; } set { - _schoolYearTypeReferenceExplicitlyAssigned = true; - _schoolYearTypeReference = value; + _cohortReferenceExplicitlyAssigned = true; + _cohortReference = value; } } - private bool _studentAssessmentReferenceExplicitlyAssigned; - private StudentAssessment.EdFi.StudentAssessmentReference _studentAssessmentReference; - private StudentAssessment.EdFi.StudentAssessmentReference ImplicitStudentAssessmentReference + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentAssessmentReference == null && !_studentAssessmentReferenceExplicitlyAssigned) - _studentAssessmentReference = new StudentAssessment.EdFi.StudentAssessmentReference(); + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); - return _studentAssessmentReference; + return _studentReference; } } - [DataMember(Name="studentAssessmentReference")] + [DataMember(Name="studentReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public StudentAssessment.EdFi.StudentAssessmentReference StudentAssessmentReference + public Student.EdFi.StudentReference StudentReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentAssessmentReference != null - && (_studentAssessmentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) - return ImplicitStudentAssessmentReference; + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; return null; } set { - _studentAssessmentReferenceExplicitlyAssigned = true; - _studentAssessmentReference = value; + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; } } // ------------------------------------------------------------- @@ -180845,75 +188595,24 @@ public StudentAssessment.EdFi.StudentAssessmentReference StudentAssessmentRefere // ------------------------------------------------------------- /// - /// A unique number or alphanumeric code assigned to an assessment. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.AssessmentIdentifier - { - get - { - if (ImplicitStudentAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) - return ImplicitStudentAssessmentReference.AssessmentIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentAssessment - _studentAssessmentReferenceExplicitlyAssigned = false; - ImplicitStudentAssessmentReference.AssessmentIdentifier = value; - } - } - - /// - /// The type of association being represented. + /// The month, day, and year on which the student was first identified as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // NOT in a reference, IS a lookup column + // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="educationOrganizationAssociationTypeDescriptor")][DescriptorExists("EducationOrganizationAssociationTypeDescriptor")] - public string EducationOrganizationAssociationTypeDescriptor { get; set; } - - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationId - { - get - { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; - - return default(long); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; - } - } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } /// - /// Namespace for the assessment. + /// The name or ID for the cohort. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.Namespace + string Entities.Common.EdFi.IStudentCohortAssociation.CohortIdentifier { get { - if (ImplicitStudentAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) - return ImplicitStudentAssessmentReference.Namespace; + if (ImplicitCohortReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) + return ImplicitCohortReference.CohortIdentifier; return default(string); } @@ -180922,34 +188621,34 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.N // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // StudentAssessment - _studentAssessmentReferenceExplicitlyAssigned = false; - ImplicitStudentAssessmentReference.Namespace = value; + // Cohort + _cohortReferenceExplicitlyAssigned = false; + ImplicitCohortReference.CohortIdentifier = value; } } /// - /// A unique number or alphanumeric code assigned to an assessment administered to a student. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentIdentifier + long Entities.Common.EdFi.IStudentCohortAssociation.EducationOrganizationId { get { - if (ImplicitStudentAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) - return ImplicitStudentAssessmentReference.StudentAssessmentIdentifier; + if (ImplicitCohortReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) + return ImplicitCohortReference.EducationOrganizationId; - return default(string); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // StudentAssessment - _studentAssessmentReferenceExplicitlyAssigned = false; - ImplicitStudentAssessmentReference.StudentAssessmentIdentifier = value; + // Cohort + _cohortReferenceExplicitlyAssigned = false; + ImplicitCohortReference.EducationOrganizationId = value; } } @@ -180957,13 +188656,13 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.S /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentUniqueId + string Entities.Common.EdFi.IStudentCohortAssociation.StudentUniqueId { get { - if (ImplicitStudentAssessmentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentAssessmentReference.IsReferenceFullyDefined())) - return ImplicitStudentAssessmentReference.StudentUniqueId; + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; return default(string); } @@ -180972,9 +188671,9 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.S // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // StudentAssessment - _studentAssessmentReferenceExplicitlyAssigned = false; - ImplicitStudentAssessmentReference.StudentUniqueId = value; + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } @@ -180992,7 +188691,7 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.S /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentCohortAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -181001,33 +188700,23 @@ public override bool Equals(object obj) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).AssessmentIdentifier, compareTo.AssessmentIdentifier)) - return false; - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationAssociationTypeDescriptor, compareTo.EducationOrganizationAssociationTypeDescriptor)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!(this as Entities.Common.EdFi.IStudentCohortAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).Namespace, compareTo.Namespace)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociation).CohortIdentifier, compareTo.CohortIdentifier)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentAssessmentIdentifier, compareTo.StudentAssessmentIdentifier)) + if (!(this as Entities.Common.EdFi.IStudentCohortAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -181044,24 +188733,18 @@ public override int GetHashCode() { var hash = new HashCode(); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).AssessmentIdentifier); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationAssociationTypeDescriptor); - + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).BeginDate); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).Namespace); + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).CohortIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentAssessmentIdentifier); + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -181076,31 +188759,11 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The school year associated with the association.. + /// The month, day, and year on which the student was removed as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// - // IS in a reference, NOT a lookup column - short? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.SchoolYear - { - get - { - if (ImplicitSchoolYearTypeReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolYearTypeReference.IsReferenceFullyDefined())) - { - return ImplicitSchoolYearTypeReference.SchoolYear; - } - - return default(short?); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // SchoolYearType - _schoolYearTypeReferenceExplicitlyAssigned = false; - ImplicitSchoolYearTypeReference.SchoolYear = value.GetValueOrDefault(); - } - } + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -181121,13 +188784,43 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentAssessmentEducationOrganizationAssociation", "StudentAssessmentEducationOrganizationAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCohortAssociation", "StudentCohortAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _studentCohortAssociationSections; + private ICollection _studentCohortAssociationSectionsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="sections")] + public ICollection StudentCohortAssociationSections + { + get { return _studentCohortAssociationSections; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentCohortAssociationSection)e.Item).StudentCohortAssociation = this); + _studentCohortAssociationSections = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCohortAssociationSection)e.Item).StudentCohortAssociation = this; + _studentCohortAssociationSectionsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentCohortAssociation.StudentCohortAssociationSections + { + get { return _studentCohortAssociationSectionsCovariant; } + set { StudentCohortAssociationSections = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -181145,6 +188838,17 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_studentCohortAssociationSections != null) foreach (var item in _studentCohortAssociationSections) + { + item.StudentCohortAssociation = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -181152,50 +188856,43 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentAssessmentEducationOrganizationAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation)target); + return Entities.Common.EdFi.StudentCohortAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCohortAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentAssessmentEducationOrganizationAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation)target, null); + Entities.Common.EdFi.StudentCohortAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentCohortAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IStudentCohortAssociation.CohortResourceId { get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } + set { ImplicitCohortReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IStudentCohortAssociation.CohortDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.SchoolYearTypeResourceId - { - get { return null; } - set { ImplicitSchoolYearTypeReference.ResourceId = value ?? default(Guid); } + set { ImplicitCohortReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentResourceId + Guid? Entities.Common.EdFi.IStudentCohortAssociation.StudentResourceId { get { return null; } - set { ImplicitStudentAssessmentReference.ResourceId = value ?? default(Guid); } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.StudentAssessmentDiscriminator + string Entities.Common.EdFi.IStudentCohortAssociation.StudentDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitStudentAssessmentReference.Discriminator = value; } + set { ImplicitStudentReference.Discriminator = value; } } @@ -181221,6 +188918,18 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.S // ---------------------- // Validate collections // ---------------------- + if (StudentCohortAssociationSections.Any() && mappingContract?.IsMemberSupported("StudentCohortAssociationSections") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentCohortAssociationSections"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCohortAssociationSections, validationContext, validationContext.Items.ForCollection("StudentCohortAssociationSections")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -181266,9 +188975,14 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.S // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentAssessmentEducationOrganizationAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCohortAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StudentCohortAssociation = new FullName("edfi", "StudentCohortAssociation"); + + // Declare collection item validators + private StudentCohortAssociationSectionPutPostRequestValidator _studentCohortAssociationSectionsValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -181281,6 +188995,28 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StudentCohortAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentCohortAssociation); + + if (mappingContract != null) + { + if (mappingContract.IsStudentCohortAssociationSectionIncluded != null) + { + var hasInvalidStudentCohortAssociationSectionsItems = instance.StudentCohortAssociationSections.Any(x => !mappingContract.IsStudentCohortAssociationSectionIncluded(x)); + + if (hasInvalidStudentCohortAssociationSectionsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentCohortAssociationSections", $"A supplied 'StudentCohortAssociationSection' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + } + if (failures.Any()) { foreach (var failure in failures) @@ -181296,22 +189032,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentCharacteristicDescriptor table of the StudentCharacteristicDescriptor aggregate in the ODS Database. + /// A class which represents the edfi.StudentCohortAssociationSection table of the StudentCohortAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCharacteristicDescriptor : Entities.Common.EdFi.IStudentCharacteristicDescriptor, Entities.Common.EdFi.IDescriptor, IHasETag, IDateVersionedEntity + public class StudentCohortAssociationSection : Entities.Common.EdFi.IStudentCohortAssociationSection, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCharacteristicDescriptor"); + private static FullName _fullName = new FullName("edfi", "StudentCohortAssociationSection"); // Fluent validator instance (threadsafe) - private static StudentCharacteristicDescriptorPutPostRequestValidator _validator = new StudentCharacteristicDescriptorPutPostRequestValidator(); + private static StudentCohortAssociationSectionPutPostRequestValidator _validator = new StudentCohortAssociationSectionPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -181328,35 +189059,192 @@ public class StudentCharacteristicDescriptor : Entities.Common.EdFi.IStudentChar // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StudentCharacteristicDescriptor resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- + + private bool _sectionReferenceExplicitlyAssigned; + private Section.EdFi.SectionReference _sectionReference; + private Section.EdFi.SectionReference ImplicitSectionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) + _sectionReference = new Section.EdFi.SectionReference(); + + return _sectionReference; + } + } + + [DataMember(Name="sectionReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Section.EdFi.SectionReference SectionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSectionReference != null + && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference; + + return null; + } + set + { + _sectionReferenceExplicitlyAssigned = true; + _sectionReference = value; + } + } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudentCohortAssociation _studentCohortAssociation; + + [IgnoreDataMember] + Entities.Common.EdFi.IStudentCohortAssociation IStudentCohortAssociationSection.StudentCohortAssociation + { + get { return _studentCohortAssociation; } + set { SetStudentCohortAssociation(value); } + } + + public Entities.Common.EdFi.IStudentCohortAssociation StudentCohortAssociation + { + set { SetStudentCohortAssociation(value); } + } + + private void SetStudentCohortAssociation(Entities.Common.EdFi.IStudentCohortAssociation value) + { + _studentCohortAssociation = value; + } /// - /// A unique identifier used as Primary Key, not derived from business logic, when acting as Foreign Key, references the parent table. + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. /// - // NOT in a reference, NOT a lookup column - [JsonIgnore] - public int StudentCharacteristicDescriptorId { get; set; } + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentCohortAssociationSection.LocalCourseCode + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.LocalCourseCode; - int IDescriptor.DescriptorId + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.LocalCourseCode = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentCohortAssociationSection.SchoolId { - get { return StudentCharacteristicDescriptorId; } - set { StudentCharacteristicDescriptorId = value; } + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolId = value; + } + } + + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IStudentCohortAssociationSection.SchoolYear + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SchoolYear = value; + } + } + + /// + /// The local identifier assigned to a section. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentCohortAssociationSection.SectionIdentifier + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SectionIdentifier; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SectionIdentifier = value; + } + } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentCohortAssociationSection.SessionName + { + get + { + if (ImplicitSectionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) + return ImplicitSectionReference.SessionName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Section + _sectionReferenceExplicitlyAssigned = false; + ImplicitSectionReference.SessionName = value; + } } // ------------------------------------------------------------- @@ -181372,7 +189260,7 @@ int IDescriptor.DescriptorId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCharacteristicDescriptor; + var compareTo = obj as Entities.Common.EdFi.IStudentCohortAssociationSection; if (ReferenceEquals(this, compareTo)) return true; @@ -181380,9 +189268,33 @@ public override bool Equals(object obj) if (compareTo == null) return false; + // Parent Property + if (_studentCohortAssociation == null || !_studentCohortAssociation.Equals(compareTo.StudentCohortAssociation)) + return false; + - // Derived Property - if (!(this as Entities.Common.EdFi.IStudentCharacteristicDescriptor).StudentCharacteristicDescriptorId.Equals(compareTo.StudentCharacteristicDescriptorId)) + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociationSection).LocalCourseCode, compareTo.LocalCourseCode)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolYear.Equals(compareTo.SchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SectionIdentifier, compareTo.SectionIdentifier)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SessionName, compareTo.SessionName)) return false; @@ -181398,10 +189310,24 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_studentCohortAssociation != null) + hash.Add(_studentCohortAssociation); - //Derived Property - hash.Add((this as Entities.Common.EdFi.IStudentCharacteristicDescriptor).StudentCharacteristicDescriptorId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).LocalCourseCode); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SectionIdentifier); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SessionName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -181409,55 +189335,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// A code or abbreviation that is used to refer to the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(50, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="codeValue")] - public string CodeValue { get; set; } - - /// - /// The description of the descriptor. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="description")] - public string Description { get; set; } - - /// - /// The beginning date of the period when the descriptor is in effect. If omitted, the default is immediate effectiveness. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveBeginDate { get; set; } - - /// - /// The end date of the period when the descriptor is in effect. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="effectiveEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EffectiveEndDate { get; set; } - - /// - /// A globally unique namespace that identifies this descriptor set. Author is strongly encouraged to use the Universal Resource Identifier (http, ftp, file, etc.) for the source of the descriptor definition. Best practice is for this source to be the descriptor file itself, so that it can be machine-readable and be fetched in real-time, if necessary. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="namespace")] - public string Namespace { get; set; } - - /// - /// A shortened description for the descriptor. - /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(75, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="shortDescription")] - public string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -181483,11 +189360,8 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - public System.Collections.IDictionary Extensions { - get { return null; } - set { } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCohortAssociation", "StudentCohortAssociationSection")] + public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -181498,13 +189372,6 @@ public System.Collections.IDictionary Extensions { // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -181517,19 +189384,93 @@ public System.Collections.IDictionary Extensions { // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCharacteristicDescriptorMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCharacteristicDescriptor)target); + return Entities.Common.EdFi.StudentCohortAssociationSectionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCohortAssociationSection)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCharacteristicDescriptorMapper.MapTo(this, (Entities.Common.EdFi.IStudentCharacteristicDescriptor)target, null); + Entities.Common.EdFi.StudentCohortAssociationSectionMapper.MapTo(this, (Entities.Common.EdFi.IStudentCohortAssociationSection)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStudentCohortAssociationSection.SectionResourceId + { + get { return null; } + set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentCohortAssociationSection.SectionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitSectionReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } } // ================================================================= @@ -181537,9 +189478,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCharacteristicDescriptorPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCohortAssociationSectionPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -181568,25 +189509,37 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentCohortAssociation resource. + /// Represents a reference to the StudentCompetencyObjective resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentCohortAssociationReference : IResourceReference + public class StudentCompetencyObjectiveReference : IResourceReference { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] + public string GradingPeriodDescriptor { get; set; } - [DataMember(Name="cohortIdentifier")] - public string CohortIdentifier { get; set; } + [DataMember(Name="gradingPeriodName")] + public string GradingPeriodName { get; set; } - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } + [DataMember(Name="gradingPeriodSchoolId")] + public long GradingPeriodSchoolId { get; set; } + + [DataMember(Name="gradingPeriodSchoolYear")] + public short GradingPeriodSchoolYear { get; set; } + + [DataMember(Name="objective")] + public string Objective { get; set; } + + [DataMember(Name="objectiveEducationOrganizationId")] + public long ObjectiveEducationOrganizationId { get; set; } + + [DataMember(Name="objectiveGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] + public string ObjectiveGradeLevelDescriptor { get; set; } [DataMember(Name="studentUniqueId")] public string StudentUniqueId @@ -181636,24 +189589,44 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BeginDate != default(DateTime) && CohortIdentifier != default(string) && EducationOrganizationId != default(long) && StudentUniqueId != default(string); + return GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && GradingPeriodSchoolId != default(long) && GradingPeriodSchoolYear != default(short) && Objective != default(string) && ObjectiveEducationOrganizationId != default(long) && ObjectiveGradeLevelDescriptor != default(string) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BeginDate == default) + if (GradingPeriodDescriptor == default) { - yield return "BeginDate"; + yield return "GradingPeriodDescriptor"; } - if (CohortIdentifier == default) + if (GradingPeriodName == default) { - yield return "CohortIdentifier"; + yield return "GradingPeriodName"; } - if (EducationOrganizationId == default) + if (GradingPeriodSchoolId == default) { - yield return "EducationOrganizationId"; + yield return "GradingPeriodSchoolId"; + } + + if (GradingPeriodSchoolYear == default) + { + yield return "GradingPeriodSchoolYear"; + } + + if (Objective == default) + { + yield return "Objective"; + } + + if (ObjectiveEducationOrganizationId == default) + { + yield return "ObjectiveEducationOrganizationId"; + } + + if (ObjectiveGradeLevelDescriptor == default) + { + yield return "ObjectiveGradeLevelDescriptor"; } if (StudentUniqueId == default) @@ -181667,8 +189640,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentCohortAssociation", - Href = $"/ed-fi/studentCohortAssociations/{ResourceId:n}" + Rel = "StudentCompetencyObjective", + Href = $"/ed-fi/studentCompetencyObjectives/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -181695,16 +189668,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StudentCohortAssociation table of the StudentCohortAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentCompetencyObjective table of the StudentCompetencyObjective aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCohortAssociation : Entities.Common.EdFi.IStudentCohortAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentCompetencyObjective : Entities.Common.EdFi.IStudentCompetencyObjective, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCohortAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentCompetencyObjective"); // Fluent validator instance (threadsafe) - private static StudentCohortAssociationPutPostRequestValidator _validator = new StudentCohortAssociationPutPostRequestValidator(); + private static StudentCompetencyObjectivePutPostRequestValidator _validator = new StudentCompetencyObjectivePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -181715,9 +189688,10 @@ public class StudentCohortAssociation : Entities.Common.EdFi.IStudentCohortAssoc // Constructor // ------------------------------------------------------------- - public StudentCohortAssociation() + public StudentCompetencyObjective() { - StudentCohortAssociationSections = new List(); + StudentCompetencyObjectiveGeneralStudentProgramAssociations = new List(); + StudentCompetencyObjectiveStudentSectionAssociations = new List(); } // ------------------------------------------------------------ @@ -181727,7 +189701,7 @@ public StudentCohortAssociation() // ------------------------------------------------------------ /// - /// The unique identifier for the StudentCohortAssociation resource. + /// The unique identifier for the StudentCompetencyObjective resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -181738,37 +189712,70 @@ public StudentCohortAssociation() // References // ------------------------------------------------------------- - private bool _cohortReferenceExplicitlyAssigned; - private Cohort.EdFi.CohortReference _cohortReference; - private Cohort.EdFi.CohortReference ImplicitCohortReference + private bool _gradingPeriodReferenceExplicitlyAssigned; + private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; + private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_cohortReference == null && !_cohortReferenceExplicitlyAssigned) - _cohortReference = new Cohort.EdFi.CohortReference(); + if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) + _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); - return _cohortReference; + return _gradingPeriodReference; } } - [DataMember(Name="cohortReference")] + [DataMember(Name="gradingPeriodReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Cohort.EdFi.CohortReference CohortReference + public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitCohortReference != null - && (_cohortReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) - return ImplicitCohortReference; + if (ImplicitGradingPeriodReference != null + && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference; return null; } set { - _cohortReferenceExplicitlyAssigned = true; - _cohortReference = value; + _gradingPeriodReferenceExplicitlyAssigned = true; + _gradingPeriodReference = value; + } + } + private bool _objectiveCompetencyObjectiveReferenceExplicitlyAssigned; + private CompetencyObjective.EdFi.CompetencyObjectiveReference _objectiveCompetencyObjectiveReference; + private CompetencyObjective.EdFi.CompetencyObjectiveReference ImplicitObjectiveCompetencyObjectiveReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_objectiveCompetencyObjectiveReference == null && !_objectiveCompetencyObjectiveReferenceExplicitlyAssigned) + _objectiveCompetencyObjectiveReference = new CompetencyObjective.EdFi.CompetencyObjectiveReference(); + + return _objectiveCompetencyObjectiveReference; + } + } + + [DataMember(Name="objectiveCompetencyObjectiveReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public CompetencyObjective.EdFi.CompetencyObjectiveReference ObjectiveCompetencyObjectiveReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitObjectiveCompetencyObjectiveReference != null + && (_objectiveCompetencyObjectiveReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitObjectiveCompetencyObjectiveReference; + + return null; + } + set + { + _objectiveCompetencyObjectiveReferenceExplicitlyAssigned = true; + _objectiveCompetencyObjectiveReference = value; } } private bool _studentReferenceExplicitlyAssigned; @@ -181811,24 +189818,37 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// The month, day, and year on which the student was first identified as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The state's name of the period for which grades are reported. /// - // NOT in a reference, NOT a lookup column - [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + + // IS in a reference (StudentCompetencyObjective.GradingPeriodDescriptorId), IS a lookup column + string Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodDescriptor + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodDescriptor; + + return null; + } + set + { + ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + } + } /// - /// The name or ID for the cohort. + /// The school's descriptive name of the grading period. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCohortAssociation.CohortIdentifier + string Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodName { get { - if (ImplicitCohortReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) - return ImplicitCohortReference.CohortIdentifier; + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.GradingPeriodName; return default(string); } @@ -181837,9 +189857,84 @@ string Entities.Common.EdFi.IStudentCohortAssociation.CohortIdentifier // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Cohort - _cohortReferenceExplicitlyAssigned = false; - ImplicitCohortReference.CohortIdentifier = value; + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.GradingPeriodName = value; + } + } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodSchoolId + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolId = value; + } + } + + /// + /// The identifier for the grading period school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodSchoolYear + { + get + { + if (ImplicitGradingPeriodReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) + return ImplicitGradingPeriodReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // GradingPeriod + _gradingPeriodReferenceExplicitlyAssigned = false; + ImplicitGradingPeriodReference.SchoolYear = value; + } + } + + /// + /// The designated title of the competency objective. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentCompetencyObjective.Objective + { + get + { + if (ImplicitObjectiveCompetencyObjectiveReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitObjectiveCompetencyObjectiveReference.Objective; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // ObjectiveCompetencyObjective + _objectiveCompetencyObjectiveReferenceExplicitlyAssigned = false; + ImplicitObjectiveCompetencyObjectiveReference.Objective = value; } } @@ -181847,13 +189942,13 @@ string Entities.Common.EdFi.IStudentCohortAssociation.CohortIdentifier /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentCohortAssociation.EducationOrganizationId + long Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveEducationOrganizationId { get { - if (ImplicitCohortReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitCohortReference.IsReferenceFullyDefined())) - return ImplicitCohortReference.EducationOrganizationId; + if (ImplicitObjectiveCompetencyObjectiveReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitObjectiveCompetencyObjectiveReference.EducationOrganizationId; return default(long); } @@ -181862,9 +189957,30 @@ long Entities.Common.EdFi.IStudentCohortAssociation.EducationOrganizationId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Cohort - _cohortReferenceExplicitlyAssigned = false; - ImplicitCohortReference.EducationOrganizationId = value; + // ObjectiveCompetencyObjective + _objectiveCompetencyObjectiveReferenceExplicitlyAssigned = false; + ImplicitObjectiveCompetencyObjectiveReference.EducationOrganizationId = value; + } + } + + /// + /// The grade level for which the competency objective is targeted. + /// + + // IS in a reference (StudentCompetencyObjective.ObjectiveGradeLevelDescriptorId), IS a lookup column + string Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveGradeLevelDescriptor + { + get + { + if (ImplicitObjectiveCompetencyObjectiveReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) + return ImplicitObjectiveCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor; + + return null; + } + set + { + ImplicitObjectiveCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor = value; } } @@ -181872,7 +189988,7 @@ long Entities.Common.EdFi.IStudentCohortAssociation.EducationOrganizationId /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCohortAssociation.StudentUniqueId + string Entities.Common.EdFi.IStudentCompetencyObjective.StudentUniqueId { get { @@ -181907,7 +190023,7 @@ string Entities.Common.EdFi.IStudentCohortAssociation.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCohortAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentCompetencyObjective; if (ReferenceEquals(this, compareTo)) return true; @@ -181916,23 +190032,43 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IStudentCohortAssociation).BeginDate.Equals(compareTo.BeginDate)) + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociation).CohortIdentifier, compareTo.CohortIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodName, compareTo.GradingPeriodName)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCohortAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolId.Equals(compareTo.GradingPeriodSchoolId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociation).StudentUniqueId, compareTo.StudentUniqueId)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).Objective, compareTo.Objective)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveEducationOrganizationId.Equals(compareTo.ObjectiveEducationOrganizationId)) + return false; + + + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveGradeLevelDescriptor, compareTo.ObjectiveGradeLevelDescriptor)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -181949,18 +190085,31 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).BeginDate); + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodDescriptor); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).CohortIdentifier); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodName); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).EducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociation).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).Objective); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveEducationOrganizationId); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveGradeLevelDescriptor); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -181975,11 +190124,21 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The month, day, and year on which the student was removed as part of the cohort. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// The competency level assessed for the student for the referenced competency objective. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="competencyLevelDescriptor")][DescriptorExists("CompetencyLevelDescriptor")] + public string CompetencyLevelDescriptor { get; set; } + + /// + /// A statement provided by the teacher that provides information in addition to the grade or assessment score. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="diagnosticStatement")] + public string DiagnosticStatement { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -182000,41 +190159,71 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCohortAssociation", "StudentCohortAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCompetencyObjective", "StudentCompetencyObjective")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentCohortAssociationSections; - private ICollection _studentCohortAssociationSectionsCovariant; + private ICollection _studentCompetencyObjectiveGeneralStudentProgramAssociations; + private ICollection _studentCompetencyObjectiveGeneralStudentProgramAssociationsCovariant; [NoDuplicateMembers] - [DataMember(Name="sections")] - public ICollection StudentCohortAssociationSections + [DataMember(Name="generalStudentProgramAssociations")] + public ICollection StudentCompetencyObjectiveGeneralStudentProgramAssociations { - get { return _studentCohortAssociationSections; } + get { return _studentCompetencyObjectiveGeneralStudentProgramAssociations; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentCohortAssociationSection)e.Item).StudentCohortAssociation = this); - _studentCohortAssociationSections = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)e.Item).StudentCompetencyObjective = this); + _studentCompetencyObjectiveGeneralStudentProgramAssociations = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCohortAssociationSection)e.Item).StudentCohortAssociation = this; - _studentCohortAssociationSectionsCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)e.Item).StudentCompetencyObjective = this; + _studentCompetencyObjectiveGeneralStudentProgramAssociationsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentCohortAssociation.StudentCohortAssociationSections + ICollection Entities.Common.EdFi.IStudentCompetencyObjective.StudentCompetencyObjectiveGeneralStudentProgramAssociations { - get { return _studentCohortAssociationSectionsCovariant; } - set { StudentCohortAssociationSections = new List(value.Cast()); } + get { return _studentCompetencyObjectiveGeneralStudentProgramAssociationsCovariant; } + set { StudentCompetencyObjectiveGeneralStudentProgramAssociations = new List(value.Cast()); } + } + + private ICollection _studentCompetencyObjectiveStudentSectionAssociations; + private ICollection _studentCompetencyObjectiveStudentSectionAssociationsCovariant; + + [NoDuplicateMembers] + [DataMember(Name="studentSectionAssociations")] + public ICollection StudentCompetencyObjectiveStudentSectionAssociations + { + get { return _studentCompetencyObjectiveStudentSectionAssociations; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)e.Item).StudentCompetencyObjective = this); + _studentCompetencyObjectiveStudentSectionAssociations = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)e.Item).StudentCompetencyObjective = this; + _studentCompetencyObjectiveStudentSectionAssociationsCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentCompetencyObjective.StudentCompetencyObjectiveStudentSectionAssociations + { + get { return _studentCompetencyObjectiveStudentSectionAssociationsCovariant; } + set { StudentCompetencyObjectiveStudentSectionAssociations = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -182059,9 +190248,14 @@ public ICollection StudentCohortAssociationSect internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_studentCohortAssociationSections != null) foreach (var item in _studentCohortAssociationSections) + if (_studentCompetencyObjectiveGeneralStudentProgramAssociations != null) foreach (var item in _studentCompetencyObjectiveGeneralStudentProgramAssociations) { - item.StudentCohortAssociation = this; + item.StudentCompetencyObjective = this; + } + + if (_studentCompetencyObjectiveStudentSectionAssociations != null) foreach (var item in _studentCompetencyObjectiveStudentSectionAssociations) + { + item.StudentCompetencyObjective = this; } } @@ -182072,39 +190266,53 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCohortAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCohortAssociation)target); + return Entities.Common.EdFi.StudentCompetencyObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCompetencyObjective)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCohortAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentCohortAssociation)target, null); + Entities.Common.EdFi.StudentCompetencyObjectiveMapper.MapTo(this, (Entities.Common.EdFi.IStudentCompetencyObjective)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentCohortAssociation.CohortResourceId + Guid? Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodResourceId { get { return null; } - set { ImplicitCohortReference.ResourceId = value ?? default(Guid); } + set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentCohortAssociation.CohortDiscriminator + string Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitCohortReference.Discriminator = value; } + set { ImplicitGradingPeriodReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IStudentCohortAssociation.StudentResourceId + Guid? Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveCompetencyObjectiveResourceId + { + get { return null; } + set { ImplicitObjectiveCompetencyObjectiveReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveCompetencyObjectiveDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitObjectiveCompetencyObjectiveReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentCompetencyObjective.StudentResourceId { get { return null; } set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentCohortAssociation.StudentDiscriminator + string Entities.Common.EdFi.IStudentCompetencyObjective.StudentDiscriminator { // Not supported for Resources get { return null; } @@ -182134,13 +190342,25 @@ string Entities.Common.EdFi.IStudentCohortAssociation.StudentDiscriminator // ---------------------- // Validate collections // ---------------------- - if (StudentCohortAssociationSections.Any() && mappingContract?.IsMemberSupported("StudentCohortAssociationSections") != false) + if (StudentCompetencyObjectiveGeneralStudentProgramAssociations.Any() && mappingContract?.IsMemberSupported("StudentCompetencyObjectiveGeneralStudentProgramAssociations") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentCohortAssociationSections"); + pathBuilder.Append("StudentCompetencyObjectiveGeneralStudentProgramAssociations"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCohortAssociationSections, validationContext, validationContext.Items.ForCollection("StudentCohortAssociationSections")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCompetencyObjectiveGeneralStudentProgramAssociations, validationContext, validationContext.Items.ForCollection("StudentCompetencyObjectiveGeneralStudentProgramAssociations")))) + { + yield return result; + } + } + + if (StudentCompetencyObjectiveStudentSectionAssociations.Any() && mappingContract?.IsMemberSupported("StudentCompetencyObjectiveStudentSectionAssociations") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentCompetencyObjectiveStudentSectionAssociations"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCompetencyObjectiveStudentSectionAssociations, validationContext, validationContext.Items.ForCollection("StudentCompetencyObjectiveStudentSectionAssociations")))) { yield return result; } @@ -182191,14 +190411,15 @@ string Entities.Common.EdFi.IStudentCohortAssociation.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCohortAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCompetencyObjectivePutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentCohortAssociation = new FullName("edfi", "StudentCohortAssociation"); + private static readonly FullName _fullName_edfi_StudentCompetencyObjective = new FullName("edfi", "StudentCompetencyObjective"); // Declare collection item validators - private StudentCohortAssociationSectionPutPostRequestValidator _studentCohortAssociationSectionsValidator = new (); + private StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator _studentCompetencyObjectiveGeneralStudentProgramAssociationsValidator = new (); + private StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator _studentCompetencyObjectiveStudentSectionAssociationsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -182215,19 +190436,30 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStudentCohortAssociationSectionIncluded(x)); + var hasInvalidStudentCompetencyObjectiveGeneralStudentProgramAssociationsItems = instance.StudentCompetencyObjectiveGeneralStudentProgramAssociations.Any(x => !mappingContract.IsStudentCompetencyObjectiveGeneralStudentProgramAssociationIncluded(x)); - if (hasInvalidStudentCohortAssociationSectionsItems) + if (hasInvalidStudentCompetencyObjectiveGeneralStudentProgramAssociationsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentCohortAssociationSections", $"A supplied 'StudentCohortAssociationSection' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentCompetencyObjectiveGeneralStudentProgramAssociations", $"A supplied 'StudentCompetencyObjectiveGeneralStudentProgramAssociation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } + + if (mappingContract.IsStudentCompetencyObjectiveStudentSectionAssociationIncluded != null) + { + var hasInvalidStudentCompetencyObjectiveStudentSectionAssociationsItems = instance.StudentCompetencyObjectiveStudentSectionAssociations.Any(x => !mappingContract.IsStudentCompetencyObjectiveStudentSectionAssociationIncluded(x)); + + if (hasInvalidStudentCompetencyObjectiveStudentSectionAssociationsItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentCompetencyObjectiveStudentSectionAssociations", $"A supplied 'StudentCompetencyObjectiveStudentSectionAssociation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -182249,16 +190481,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentCohortAssociationSection table of the StudentCohortAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentCompetencyObjectiveGeneralStudentProgramAssociation table of the StudentCompetencyObjective aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCohortAssociationSection : Entities.Common.EdFi.IStudentCohortAssociationSection, IValidatableObject + public class StudentCompetencyObjectiveGeneralStudentProgramAssociation : Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCohortAssociationSection"); + private static FullName _fullName = new FullName("edfi", "StudentCompetencyObjectiveGeneralStudentProgramAssociation"); // Fluent validator instance (threadsafe) - private static StudentCohortAssociationSectionPutPostRequestValidator _validator = new StudentCohortAssociationSectionPutPostRequestValidator(); + private static StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator _validator = new StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -182281,37 +190513,37 @@ public class StudentCohortAssociationSection : Entities.Common.EdFi.IStudentCoho // References // ------------------------------------------------------------- - private bool _sectionReferenceExplicitlyAssigned; - private Section.EdFi.SectionReference _sectionReference; - private Section.EdFi.SectionReference ImplicitSectionReference + private bool _generalStudentProgramAssociationReferenceExplicitlyAssigned; + private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference _generalStudentProgramAssociationReference; + private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference ImplicitGeneralStudentProgramAssociationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sectionReference == null && !_sectionReferenceExplicitlyAssigned) - _sectionReference = new Section.EdFi.SectionReference(); + if (_generalStudentProgramAssociationReference == null && !_generalStudentProgramAssociationReferenceExplicitlyAssigned) + _generalStudentProgramAssociationReference = new GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference(); - return _sectionReference; + return _generalStudentProgramAssociationReference; } } - [DataMember(Name="sectionReference")] + [DataMember(Name="generalStudentProgramAssociationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Section.EdFi.SectionReference SectionReference + public GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference GeneralStudentProgramAssociationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSectionReference != null - && (_sectionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference; + if (ImplicitGeneralStudentProgramAssociationReference != null + && (_generalStudentProgramAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) + return ImplicitGeneralStudentProgramAssociationReference; return null; } set { - _sectionReferenceExplicitlyAssigned = true; - _sectionReference = value; + _generalStudentProgramAssociationReferenceExplicitlyAssigned = true; + _generalStudentProgramAssociationReference = value; } } // ------------------------------------------------------------- @@ -182319,61 +190551,67 @@ public Section.EdFi.SectionReference SectionReference //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentCohortAssociation _studentCohortAssociation; + private Entities.Common.EdFi.IStudentCompetencyObjective _studentCompetencyObjective; [IgnoreDataMember] - Entities.Common.EdFi.IStudentCohortAssociation IStudentCohortAssociationSection.StudentCohortAssociation + Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveGeneralStudentProgramAssociation.StudentCompetencyObjective { - get { return _studentCohortAssociation; } - set { SetStudentCohortAssociation(value); } + get { return _studentCompetencyObjective; } + set { SetStudentCompetencyObjective(value); } } - public Entities.Common.EdFi.IStudentCohortAssociation StudentCohortAssociation + public Entities.Common.EdFi.IStudentCompetencyObjective StudentCompetencyObjective { - set { SetStudentCohortAssociation(value); } + set { SetStudentCompetencyObjective(value); } } - private void SetStudentCohortAssociation(Entities.Common.EdFi.IStudentCohortAssociation value) + private void SetStudentCompetencyObjective(Entities.Common.EdFi.IStudentCompetencyObjective value) { - _studentCohortAssociation = value; + _studentCompetencyObjective = value; + + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_generalStudentProgramAssociationReferenceExplicitlyAssigned) + { + ImplicitGeneralStudentProgramAssociationReference.StudentUniqueId = _studentCompetencyObjective.StudentUniqueId; + } } /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCohortAssociationSection.LocalCourseCode + DateTime Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.BeginDate { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.LocalCourseCode; + if (ImplicitGeneralStudentProgramAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) + return ImplicitGeneralStudentProgramAssociationReference.BeginDate; - return default(string); + return default(DateTime); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.LocalCourseCode = value; + // GeneralStudentProgramAssociation + _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; + ImplicitGeneralStudentProgramAssociationReference.BeginDate = value; } } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentCohortAssociationSection.SchoolId + long Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.EducationOrganizationId { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SchoolId; + if (ImplicitGeneralStudentProgramAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) + return ImplicitGeneralStudentProgramAssociationReference.EducationOrganizationId; return default(long); } @@ -182382,48 +190620,48 @@ long Entities.Common.EdFi.IStudentCohortAssociationSection.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolId = value; + // GeneralStudentProgramAssociation + _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; + ImplicitGeneralStudentProgramAssociationReference.EducationOrganizationId = value; } } /// - /// The identifier for the school year. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStudentCohortAssociationSection.SchoolYear + long Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramEducationOrganizationId { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SchoolYear; + if (ImplicitGeneralStudentProgramAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) + return ImplicitGeneralStudentProgramAssociationReference.ProgramEducationOrganizationId; - return default(short); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SchoolYear = value; + // GeneralStudentProgramAssociation + _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; + ImplicitGeneralStudentProgramAssociationReference.ProgramEducationOrganizationId = value; } } /// - /// The local identifier assigned to a section. + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCohortAssociationSection.SectionIdentifier + string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramName { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SectionIdentifier; + if (ImplicitGeneralStudentProgramAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) + return ImplicitGeneralStudentProgramAssociationReference.ProgramName; return default(string); } @@ -182432,34 +190670,30 @@ string Entities.Common.EdFi.IStudentCohortAssociationSection.SectionIdentifier // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SectionIdentifier = value; + // GeneralStudentProgramAssociation + _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; + ImplicitGeneralStudentProgramAssociationReference.ProgramName = value; } } /// - /// The identifier for the calendar for the academic session. + /// The type of program. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCohortAssociationSection.SessionName + + // IS in a reference (StudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramTypeDescriptor { get { - if (ImplicitSectionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSectionReference.IsReferenceFullyDefined())) - return ImplicitSectionReference.SessionName; + if (ImplicitGeneralStudentProgramAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) + return ImplicitGeneralStudentProgramAssociationReference.ProgramTypeDescriptor; - return default(string); + return null; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Section - _sectionReferenceExplicitlyAssigned = false; - ImplicitSectionReference.SessionName = value; + ImplicitGeneralStudentProgramAssociationReference.ProgramTypeDescriptor = value; } } // ------------------------------------------------------------- @@ -182476,7 +190710,7 @@ string Entities.Common.EdFi.IStudentCohortAssociationSection.SessionName /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCohortAssociationSection; + var compareTo = obj as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -182485,32 +190719,32 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentCohortAssociation == null || !_studentCohortAssociation.Equals(compareTo.StudentCohortAssociation)) + if (_studentCompetencyObjective == null || !_studentCompetencyObjective.Equals(compareTo.StudentCompetencyObjective)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociationSection).LocalCourseCode, compareTo.LocalCourseCode)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolYear.Equals(compareTo.SchoolYear)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SectionIdentifier, compareTo.SectionIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramName, compareTo.ProgramName)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SessionName, compareTo.SessionName)) + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; @@ -182527,23 +190761,24 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentCohortAssociation != null) - hash.Add(_studentCohortAssociation); + if (_studentCompetencyObjective != null) + hash.Add(_studentCompetencyObjective); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).LocalCourseCode); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).BeginDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolId); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SchoolYear); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramEducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SectionIdentifier); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramTypeDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCohortAssociationSection).SessionName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -182576,7 +190811,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCohortAssociation", "StudentCohortAssociationSection")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCompetencyObjective", "StudentCompetencyObjectiveGeneralStudentProgramAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -182593,6 +190828,12 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + } // ------------------------------------------------------------ // ============================================================ @@ -182600,29 +190841,29 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCohortAssociationSectionMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCohortAssociationSection)target); + return Entities.Common.EdFi.StudentCompetencyObjectiveGeneralStudentProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCohortAssociationSectionMapper.MapTo(this, (Entities.Common.EdFi.IStudentCohortAssociationSection)target, null); + Entities.Common.EdFi.StudentCompetencyObjectiveGeneralStudentProgramAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentCohortAssociationSection.SectionResourceId + Guid? Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.GeneralStudentProgramAssociationResourceId { get { return null; } - set { ImplicitSectionReference.ResourceId = value ?? default(Guid); } + set { ImplicitGeneralStudentProgramAssociationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentCohortAssociationSection.SectionDiscriminator + string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.GeneralStudentProgramAssociationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitSectionReference.Discriminator = value; } + set { ImplicitGeneralStudentProgramAssociationReference.Discriminator = value; } } @@ -182668,6 +190909,40 @@ string Entities.Common.EdFi.IStudentCohortAssociationSection.SectionDiscriminato yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); + + if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetStudentUniqueIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).StudentCompetencyObjective.StudentUniqueId); + + // Obtain value from other references + var valueFromGeneralStudentProgramAssociationReference = this.GeneralStudentProgramAssociationReference?.StudentUniqueId; + + if (valueFromGeneralStudentProgramAssociationReference != null) + { + yield return ("generalStudentProgramAssociationReference.studentUniqueId", this.GeneralStudentProgramAssociationReference.StudentUniqueId); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -182694,9 +190969,9 @@ string Entities.Common.EdFi.IStudentCohortAssociationSection.SectionDiscriminato // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCohortAssociationSectionPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -182724,176 +190999,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentCompetencyObjective resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class StudentCompetencyObjectiveReference : IResourceReference - { - [DataMember(Name="gradingPeriodDescriptor")][DescriptorExists("GradingPeriodDescriptor")] - public string GradingPeriodDescriptor { get; set; } - - [DataMember(Name="gradingPeriodName")] - public string GradingPeriodName { get; set; } - - [DataMember(Name="gradingPeriodSchoolId")] - public long GradingPeriodSchoolId { get; set; } - - [DataMember(Name="gradingPeriodSchoolYear")] - public short GradingPeriodSchoolYear { get; set; } - - [DataMember(Name="objective")] - public string Objective { get; set; } - - [DataMember(Name="objectiveEducationOrganizationId")] - public long ObjectiveEducationOrganizationId { get; set; } - - [DataMember(Name="objectiveGradeLevelDescriptor")][DescriptorExists("GradeLevelDescriptor")] - public string ObjectiveGradeLevelDescriptor { get; set; } - - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set - { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; - - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) - { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); - } - - return _link; - } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return GradingPeriodDescriptor != default(string) && GradingPeriodName != default(string) && GradingPeriodSchoolId != default(long) && GradingPeriodSchoolYear != default(short) && Objective != default(string) && ObjectiveEducationOrganizationId != default(long) && ObjectiveGradeLevelDescriptor != default(string) && StudentUniqueId != default(string); - } - - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (GradingPeriodDescriptor == default) - { - yield return "GradingPeriodDescriptor"; - } - - if (GradingPeriodName == default) - { - yield return "GradingPeriodName"; - } - - if (GradingPeriodSchoolId == default) - { - yield return "GradingPeriodSchoolId"; - } - - if (GradingPeriodSchoolYear == default) - { - yield return "GradingPeriodSchoolYear"; - } - - if (Objective == default) - { - yield return "Objective"; - } - - if (ObjectiveEducationOrganizationId == default) - { - yield return "ObjectiveEducationOrganizationId"; - } - - if (ObjectiveGradeLevelDescriptor == default) - { - yield return "ObjectiveGradeLevelDescriptor"; - } - - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; - } - - } - - private Link CreateLink() - { - var link = new Link - { - Rel = "StudentCompetencyObjective", - Href = $"/ed-fi/studentCompetencyObjectives/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference - /// - /// A class which represents the edfi.StudentCompetencyObjective table of the StudentCompetencyObjective aggregate in the ODS Database. + /// A class which represents the edfi.StudentCompetencyObjectiveStudentSectionAssociation table of the StudentCompetencyObjective aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCompetencyObjective : Entities.Common.EdFi.IStudentCompetencyObjective, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentCompetencyObjectiveStudentSectionAssociation : Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCompetencyObjective"); + private static FullName _fullName = new FullName("edfi", "StudentCompetencyObjectiveStudentSectionAssociation"); // Fluent validator instance (threadsafe) - private static StudentCompetencyObjectivePutPostRequestValidator _validator = new StudentCompetencyObjectivePutPostRequestValidator(); + private static StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator _validator = new StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -182904,313 +191020,217 @@ public class StudentCompetencyObjective : Entities.Common.EdFi.IStudentCompetenc // Constructor // ------------------------------------------------------------- - public StudentCompetencyObjective() - { - StudentCompetencyObjectiveGeneralStudentProgramAssociations = new List(); - StudentCompetencyObjectiveStudentSectionAssociations = new List(); - } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StudentCompetencyObjective resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _gradingPeriodReferenceExplicitlyAssigned; - private GradingPeriod.EdFi.GradingPeriodReference _gradingPeriodReference; - private GradingPeriod.EdFi.GradingPeriodReference ImplicitGradingPeriodReference + private bool _studentSectionAssociationReferenceExplicitlyAssigned; + private StudentSectionAssociation.EdFi.StudentSectionAssociationReference _studentSectionAssociationReference; + private StudentSectionAssociation.EdFi.StudentSectionAssociationReference ImplicitStudentSectionAssociationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_gradingPeriodReference == null && !_gradingPeriodReferenceExplicitlyAssigned) - _gradingPeriodReference = new GradingPeriod.EdFi.GradingPeriodReference(); + if (_studentSectionAssociationReference == null && !_studentSectionAssociationReferenceExplicitlyAssigned) + _studentSectionAssociationReference = new StudentSectionAssociation.EdFi.StudentSectionAssociationReference(); - return _gradingPeriodReference; + return _studentSectionAssociationReference; } } - [DataMember(Name="gradingPeriodReference")] + [DataMember(Name="studentSectionAssociationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public GradingPeriod.EdFi.GradingPeriodReference GradingPeriodReference + public StudentSectionAssociation.EdFi.StudentSectionAssociationReference StudentSectionAssociationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGradingPeriodReference != null - && (_gradingPeriodReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference; + if (ImplicitStudentSectionAssociationReference != null + && (_studentSectionAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference; return null; } set { - _gradingPeriodReferenceExplicitlyAssigned = true; - _gradingPeriodReference = value; - } - } - private bool _objectiveCompetencyObjectiveReferenceExplicitlyAssigned; - private CompetencyObjective.EdFi.CompetencyObjectiveReference _objectiveCompetencyObjectiveReference; - private CompetencyObjective.EdFi.CompetencyObjectiveReference ImplicitObjectiveCompetencyObjectiveReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_objectiveCompetencyObjectiveReference == null && !_objectiveCompetencyObjectiveReferenceExplicitlyAssigned) - _objectiveCompetencyObjectiveReference = new CompetencyObjective.EdFi.CompetencyObjectiveReference(); - - return _objectiveCompetencyObjectiveReference; + _studentSectionAssociationReferenceExplicitlyAssigned = true; + _studentSectionAssociationReference = value; } } + // ------------------------------------------------------------- - [DataMember(Name="objectiveCompetencyObjectiveReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public CompetencyObjective.EdFi.CompetencyObjectiveReference ObjectiveCompetencyObjectiveReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitObjectiveCompetencyObjectiveReference != null - && (_objectiveCompetencyObjectiveReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitObjectiveCompetencyObjectiveReference; + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudentCompetencyObjective _studentCompetencyObjective; - return null; - } - set - { - _objectiveCompetencyObjectiveReferenceExplicitlyAssigned = true; - _objectiveCompetencyObjectiveReference = value; - } - } - private bool _studentReferenceExplicitlyAssigned; - private Student.EdFi.StudentReference _studentReference; - private Student.EdFi.StudentReference ImplicitStudentReference + [IgnoreDataMember] + Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveStudentSectionAssociation.StudentCompetencyObjective { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentReference == null && !_studentReferenceExplicitlyAssigned) - _studentReference = new Student.EdFi.StudentReference(); - - return _studentReference; - } + get { return _studentCompetencyObjective; } + set { SetStudentCompetencyObjective(value); } } - [DataMember(Name="studentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Student.EdFi.StudentReference StudentReference + public Entities.Common.EdFi.IStudentCompetencyObjective StudentCompetencyObjective { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentReference != null - && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference; - - return null; - } - set - { - _studentReferenceExplicitlyAssigned = true; - _studentReference = value; - } + set { SetStudentCompetencyObjective(value); } } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - - /// - /// The state's name of the period for which grades are reported. - /// - // IS in a reference (StudentCompetencyObjective.GradingPeriodDescriptorId), IS a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodDescriptor + private void SetStudentCompetencyObjective(Entities.Common.EdFi.IStudentCompetencyObjective value) { - get - { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodDescriptor; + _studentCompetencyObjective = value; - return null; - } - set + // Initialize unified key values from parent context when reference is being formed by outbound mapper + if (!_studentSectionAssociationReferenceExplicitlyAssigned) { - ImplicitGradingPeriodReference.GradingPeriodDescriptor = value; + ImplicitStudentSectionAssociationReference.StudentUniqueId = _studentCompetencyObjective.StudentUniqueId; } } /// - /// The school's descriptive name of the grading period. + /// Month, day, and year of the student's entry or assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodName + DateTime Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.BeginDate { get { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.GradingPeriodName; + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.BeginDate; - return default(string); + return default(DateTime); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.GradingPeriodName = value; + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.BeginDate = value; } } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The local code assigned by the School that identifies the course offering provided for the instruction of students. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodSchoolId + string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.LocalCourseCode { get { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.SchoolId; + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.LocalCourseCode; - return default(long); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolId = value; + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.LocalCourseCode = value; } } /// - /// The identifier for the grading period school year. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodSchoolYear + long Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SchoolId { get { - if (ImplicitGradingPeriodReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGradingPeriodReference.IsReferenceFullyDefined())) - return ImplicitGradingPeriodReference.SchoolYear; + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.SchoolId; - return default(short); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GradingPeriod - _gradingPeriodReferenceExplicitlyAssigned = false; - ImplicitGradingPeriodReference.SchoolYear = value; + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SchoolId = value; } } /// - /// The designated title of the competency objective. + /// The identifier for the school year. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjective.Objective + short Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SchoolYear { get { - if (ImplicitObjectiveCompetencyObjectiveReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitObjectiveCompetencyObjectiveReference.Objective; + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.SchoolYear; - return default(string); + return default(short); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ObjectiveCompetencyObjective - _objectiveCompetencyObjectiveReferenceExplicitlyAssigned = false; - ImplicitObjectiveCompetencyObjectiveReference.Objective = value; + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SchoolYear = value; } } /// - /// The identifier assigned to an education organization. + /// The local identifier assigned to a section. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveEducationOrganizationId + string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SectionIdentifier { get { - if (ImplicitObjectiveCompetencyObjectiveReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitObjectiveCompetencyObjectiveReference.EducationOrganizationId; + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.SectionIdentifier; - return default(long); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // ObjectiveCompetencyObjective - _objectiveCompetencyObjectiveReferenceExplicitlyAssigned = false; - ImplicitObjectiveCompetencyObjectiveReference.EducationOrganizationId = value; - } - } - - /// - /// The grade level for which the competency objective is targeted. - /// - - // IS in a reference (StudentCompetencyObjective.ObjectiveGradeLevelDescriptorId), IS a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveGradeLevelDescriptor - { - get - { - if (ImplicitObjectiveCompetencyObjectiveReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitObjectiveCompetencyObjectiveReference.IsReferenceFullyDefined())) - return ImplicitObjectiveCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor; - - return null; - } - set - { - ImplicitObjectiveCompetencyObjectiveReference.ObjectiveGradeLevelDescriptor = value; + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SectionIdentifier = value; } } /// - /// A unique alphanumeric code assigned to a student. + /// The identifier for the calendar for the academic session. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjective.StudentUniqueId + string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SessionName { get { - if (ImplicitStudentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference.StudentUniqueId; + if (ImplicitStudentSectionAssociationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) + return ImplicitStudentSectionAssociationReference.SessionName; return default(string); } @@ -183219,10 +191239,9 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.StudentUniqueId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Student - _studentReferenceExplicitlyAssigned = false; - ImplicitStudentReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + // StudentSectionAssociation + _studentSectionAssociationReferenceExplicitlyAssigned = false; + ImplicitStudentSectionAssociationReference.SessionName = value; } } // ------------------------------------------------------------- @@ -183239,7 +191258,7 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCompetencyObjective; + var compareTo = obj as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -183247,44 +191266,38 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodDescriptor, compareTo.GradingPeriodDescriptor)) + // Parent Property + if (_studentCompetencyObjective == null || !_studentCompetencyObjective.Equals(compareTo.StudentCompetencyObjective)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodName, compareTo.GradingPeriodName)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolId.Equals(compareTo.GradingPeriodSchoolId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).LocalCourseCode, compareTo.LocalCourseCode)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolYear.Equals(compareTo.GradingPeriodSchoolYear)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolId.Equals(compareTo.SchoolId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).Objective, compareTo.Objective)) + if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolYear.Equals(compareTo.SchoolYear)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveEducationOrganizationId.Equals(compareTo.ObjectiveEducationOrganizationId)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveGradeLevelDescriptor, compareTo.ObjectiveGradeLevelDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SectionIdentifier, compareTo.SectionIdentifier)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjective).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SessionName, compareTo.SessionName)) return false; @@ -183300,32 +191313,27 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodDescriptor); - + //Parent Property + if (_studentCompetencyObjective != null) + hash.Add(_studentCompetencyObjective); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodName); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).BeginDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolId); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).LocalCourseCode); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).GradingPeriodSchoolYear); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).Objective); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolYear); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveEducationOrganizationId); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).ObjectiveGradeLevelDescriptor); - + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SectionIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjective).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SessionName); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -183338,23 +191346,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// The competency level assessed for the student for the referenced competency objective. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="competencyLevelDescriptor")][DescriptorExists("CompetencyLevelDescriptor")] - public string CompetencyLevelDescriptor { get; set; } - - /// - /// A statement provided by the teacher that provides information in addition to the grade or assessment score. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="diagnosticStatement")] - public string DiagnosticStatement { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -183375,85 +191366,18 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCompetencyObjective", "StudentCompetencyObjective")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _studentCompetencyObjectiveGeneralStudentProgramAssociations; - private ICollection _studentCompetencyObjectiveGeneralStudentProgramAssociationsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="generalStudentProgramAssociations")] - public ICollection StudentCompetencyObjectiveGeneralStudentProgramAssociations - { - get { return _studentCompetencyObjectiveGeneralStudentProgramAssociations; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)e.Item).StudentCompetencyObjective = this); - _studentCompetencyObjectiveGeneralStudentProgramAssociations = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)e.Item).StudentCompetencyObjective = this; - _studentCompetencyObjectiveGeneralStudentProgramAssociationsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentCompetencyObjective.StudentCompetencyObjectiveGeneralStudentProgramAssociations - { - get { return _studentCompetencyObjectiveGeneralStudentProgramAssociationsCovariant; } - set { StudentCompetencyObjectiveGeneralStudentProgramAssociations = new List(value.Cast()); } - } - - private ICollection _studentCompetencyObjectiveStudentSectionAssociations; - private ICollection _studentCompetencyObjectiveStudentSectionAssociationsCovariant; - - [NoDuplicateMembers] - [DataMember(Name="studentSectionAssociations")] - public ICollection StudentCompetencyObjectiveStudentSectionAssociations - { - get { return _studentCompetencyObjectiveStudentSectionAssociations; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)e.Item).StudentCompetencyObjective = this); - _studentCompetencyObjectiveStudentSectionAssociations = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)e.Item).StudentCompetencyObjective = this; - _studentCompetencyObjectiveStudentSectionAssociationsCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentCompetencyObjective.StudentCompetencyObjectiveStudentSectionAssociations - { - get { return _studentCompetencyObjectiveStudentSectionAssociationsCovariant; } - set { StudentCompetencyObjectiveStudentSectionAssociations = new List(value.Cast()); } - } + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCompetencyObjective", "StudentCompetencyObjectiveStudentSectionAssociation")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + // ============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -183464,16 +191388,6 @@ public ICollection StudentC internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_studentCompetencyObjectiveGeneralStudentProgramAssociations != null) foreach (var item in _studentCompetencyObjectiveGeneralStudentProgramAssociations) - { - item.StudentCompetencyObjective = this; - } - - if (_studentCompetencyObjectiveStudentSectionAssociations != null) foreach (var item in _studentCompetencyObjectiveStudentSectionAssociations) - { - item.StudentCompetencyObjective = this; - } - } // ------------------------------------------------------------ @@ -183482,57 +191396,29 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCompetencyObjectiveMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCompetencyObjective)target); + return Entities.Common.EdFi.StudentCompetencyObjectiveStudentSectionAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCompetencyObjectiveMapper.MapTo(this, (Entities.Common.EdFi.IStudentCompetencyObjective)target, null); + Entities.Common.EdFi.StudentCompetencyObjectiveStudentSectionAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodResourceId - { - get { return null; } - set { ImplicitGradingPeriodReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitGradingPeriodReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveCompetencyObjectiveResourceId - { - get { return null; } - set { ImplicitObjectiveCompetencyObjectiveReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveCompetencyObjectiveDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitObjectiveCompetencyObjectiveReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStudentCompetencyObjective.StudentResourceId + Guid? Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.StudentSectionAssociationResourceId { get { return null; } - set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + set { ImplicitStudentSectionAssociationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentCompetencyObjective.StudentDiscriminator + string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.StudentSectionAssociationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitStudentReference.Discriminator = value; } + set { ImplicitStudentSectionAssociationReference.Discriminator = value; } } @@ -183553,35 +191439,12 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.StudentDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- - if (StudentCompetencyObjectiveGeneralStudentProgramAssociations.Any() && mappingContract?.IsMemberSupported("StudentCompetencyObjectiveGeneralStudentProgramAssociations") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentCompetencyObjectiveGeneralStudentProgramAssociations"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCompetencyObjectiveGeneralStudentProgramAssociations, validationContext, validationContext.Items.ForCollection("StudentCompetencyObjectiveGeneralStudentProgramAssociations")))) - { - yield return result; - } - } - - if (StudentCompetencyObjectiveStudentSectionAssociations.Any() && mappingContract?.IsMemberSupported("StudentCompetencyObjectiveStudentSectionAssociations") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentCompetencyObjectiveStudentSectionAssociations"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCompetencyObjectiveStudentSectionAssociations, validationContext, validationContext.Items.ForCollection("StudentCompetencyObjectiveStudentSectionAssociations")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -183601,6 +191464,40 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.StudentDiscriminator yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); + + if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, string value)> GetStudentUniqueIdSources() + { + // Obtain value from the parent + yield return (null, (this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).StudentCompetencyObjective.StudentUniqueId); + + // Obtain value from other references + var valueFromStudentSectionAssociationReference = this.StudentSectionAssociationReference?.StudentUniqueId; + + if (valueFromStudentSectionAssociationReference != null) + { + yield return ("studentSectionAssociationReference.studentUniqueId", this.StudentSectionAssociationReference.StudentUniqueId); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -183627,15 +191524,9 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCompetencyObjectivePutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentCompetencyObjective = new FullName("edfi", "StudentCompetencyObjective"); - - // Declare collection item validators - private StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator _studentCompetencyObjectiveGeneralStudentProgramAssociationsValidator = new (); - private StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator _studentCompetencyObjectiveStudentSectionAssociationsValidator = new (); - - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -183648,39 +191539,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - // Profile-based collection item filter validation - string profileName = null; - - // Get the current mapping contract - var mappingContract = (StudentCompetencyObjectiveMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider - .GetMappingContract(_fullName_edfi_StudentCompetencyObjective); - - if (mappingContract != null) - { - if (mappingContract.IsStudentCompetencyObjectiveGeneralStudentProgramAssociationIncluded != null) - { - var hasInvalidStudentCompetencyObjectiveGeneralStudentProgramAssociationsItems = instance.StudentCompetencyObjectiveGeneralStudentProgramAssociations.Any(x => !mappingContract.IsStudentCompetencyObjectiveGeneralStudentProgramAssociationIncluded(x)); - - if (hasInvalidStudentCompetencyObjectiveGeneralStudentProgramAssociationsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentCompetencyObjectiveGeneralStudentProgramAssociations", $"A supplied 'StudentCompetencyObjectiveGeneralStudentProgramAssociation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsStudentCompetencyObjectiveStudentSectionAssociationIncluded != null) - { - var hasInvalidStudentCompetencyObjectiveStudentSectionAssociationsItems = instance.StudentCompetencyObjectiveStudentSectionAssociations.Any(x => !mappingContract.IsStudentCompetencyObjectiveStudentSectionAssociationIncluded(x)); - - if (hasInvalidStudentCompetencyObjectiveStudentSectionAssociationsItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentCompetencyObjectiveStudentSectionAssociations", $"A supplied 'StudentCompetencyObjectiveStudentSectionAssociation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - } - if (failures.Any()) { foreach (var failure in failures) @@ -183696,17 +191554,137 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentCompetencyObjectiveGeneralStudentProgramAssociation table of the StudentCompetencyObjective aggregate in the ODS Database. + /// Represents a reference to the StudentContactAssociation resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StudentContactAssociationReference : IResourceReference + { + [DataMember(Name="contactUniqueId")] + public string ContactUniqueId + { + get => _contactUniqueId; + set + { + _contactUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); + } + } + private string _contactUniqueId; + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return ContactUniqueId != default(string) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (ContactUniqueId == default) + { + yield return "ContactUniqueId"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "StudentContactAssociation", + Href = $"/ed-fi/studentContactAssociations/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.StudentContactAssociation table of the StudentContactAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCompetencyObjectiveGeneralStudentProgramAssociation : Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation, IValidatableObject + public class StudentContactAssociation : Entities.Common.EdFi.IStudentContactAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCompetencyObjectiveGeneralStudentProgramAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentContactAssociation"); // Fluent validator instance (threadsafe) - private static StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator _validator = new StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator(); + private static StudentContactAssociationPutPostRequestValidator _validator = new StudentContactAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -183723,161 +191701,128 @@ public class StudentCompetencyObjectiveGeneralStudentProgramAssociation : Entiti // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentContactAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _generalStudentProgramAssociationReferenceExplicitlyAssigned; - private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference _generalStudentProgramAssociationReference; - private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference ImplicitGeneralStudentProgramAssociationReference + private bool _contactReferenceExplicitlyAssigned; + private Contact.EdFi.ContactReference _contactReference; + private Contact.EdFi.ContactReference ImplicitContactReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_generalStudentProgramAssociationReference == null && !_generalStudentProgramAssociationReferenceExplicitlyAssigned) - _generalStudentProgramAssociationReference = new GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference(); + if (_contactReference == null && !_contactReferenceExplicitlyAssigned) + _contactReference = new Contact.EdFi.ContactReference(); - return _generalStudentProgramAssociationReference; + return _contactReference; } } - [DataMember(Name="generalStudentProgramAssociationReference")] + [DataMember(Name="contactReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationReference GeneralStudentProgramAssociationReference + public Contact.EdFi.ContactReference ContactReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitGeneralStudentProgramAssociationReference != null - && (_generalStudentProgramAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) - return ImplicitGeneralStudentProgramAssociationReference; + if (ImplicitContactReference != null + && (_contactReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitContactReference.IsReferenceFullyDefined())) + return ImplicitContactReference; return null; } set { - _generalStudentProgramAssociationReferenceExplicitlyAssigned = true; - _generalStudentProgramAssociationReference = value; - } - } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentCompetencyObjective _studentCompetencyObjective; - - [IgnoreDataMember] - Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveGeneralStudentProgramAssociation.StudentCompetencyObjective - { - get { return _studentCompetencyObjective; } - set { SetStudentCompetencyObjective(value); } - } - - public Entities.Common.EdFi.IStudentCompetencyObjective StudentCompetencyObjective - { - set { SetStudentCompetencyObjective(value); } - } - - private void SetStudentCompetencyObjective(Entities.Common.EdFi.IStudentCompetencyObjective value) - { - _studentCompetencyObjective = value; - - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_generalStudentProgramAssociationReferenceExplicitlyAssigned) - { - ImplicitGeneralStudentProgramAssociationReference.StudentUniqueId = _studentCompetencyObjective.StudentUniqueId; + _contactReferenceExplicitlyAssigned = true; + _contactReference = value; } } - - /// - /// The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // IS in a reference, NOT a lookup column - DateTime Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.BeginDate + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference { get { - if (ImplicitGeneralStudentProgramAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) - return ImplicitGeneralStudentProgramAssociationReference.BeginDate; - - return default(DateTime); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); - // GeneralStudentProgramAssociation - _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; - ImplicitGeneralStudentProgramAssociationReference.BeginDate = value; + return _studentReference; } } - /// - /// The identifier assigned to an education organization. - /// - // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.EducationOrganizationId + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference { get { - if (ImplicitGeneralStudentProgramAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) - return ImplicitGeneralStudentProgramAssociationReference.EducationOrganizationId; + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; - return default(long); + return null; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // GeneralStudentProgramAssociation - _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; - ImplicitGeneralStudentProgramAssociationReference.EducationOrganizationId = value; + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The identifier assigned to an education organization. + /// A unique alphanumeric code assigned to a contact. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramEducationOrganizationId + string Entities.Common.EdFi.IStudentContactAssociation.ContactUniqueId { get { - if (ImplicitGeneralStudentProgramAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) - return ImplicitGeneralStudentProgramAssociationReference.ProgramEducationOrganizationId; + if (ImplicitContactReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitContactReference.IsReferenceFullyDefined())) + return ImplicitContactReference.ContactUniqueId; - return default(long); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GeneralStudentProgramAssociation - _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; - ImplicitGeneralStudentProgramAssociationReference.ProgramEducationOrganizationId = value; + // Contact + _contactReferenceExplicitlyAssigned = false; + ImplicitContactReference.ContactUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); } } /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. + /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramName + string Entities.Common.EdFi.IStudentContactAssociation.StudentUniqueId { get { - if (ImplicitGeneralStudentProgramAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) - return ImplicitGeneralStudentProgramAssociationReference.ProgramName; + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; return default(string); } @@ -183886,30 +191831,10 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAsso // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // GeneralStudentProgramAssociation - _generalStudentProgramAssociationReferenceExplicitlyAssigned = false; - ImplicitGeneralStudentProgramAssociationReference.ProgramName = value; - } - } - - /// - /// The type of program. - /// - - // IS in a reference (StudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.ProgramTypeDescriptor - { - get - { - if (ImplicitGeneralStudentProgramAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitGeneralStudentProgramAssociationReference.IsReferenceFullyDefined())) - return ImplicitGeneralStudentProgramAssociationReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitGeneralStudentProgramAssociationReference.ProgramTypeDescriptor = value; + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } // ------------------------------------------------------------- @@ -183926,7 +191851,7 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAsso /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentContactAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -183934,33 +191859,14 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_studentCompetencyObjective == null || !_studentCompetencyObjective.Equals(compareTo.StudentCompetencyObjective)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) - return false; - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentContactAssociation).ContactUniqueId, compareTo.ContactUniqueId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramName, compareTo.ProgramName)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentContactAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -183976,25 +191882,12 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_studentCompetencyObjective != null) - hash.Add(_studentCompetencyObjective); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).BeginDate); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramEducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IStudentContactAssociation).ContactUniqueId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramName); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).ProgramTypeDescriptor); - + hash.Add((this as Entities.Common.EdFi.IStudentContactAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -184007,6 +191900,57 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// The numeric order of the preferred sequence or priority of contact. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="contactPriority")] + public int? ContactPriority { get; set; } + + /// + /// Restrictions for student and/or teacher contact with the individual (e.g., the student may not be picked up by the individual). + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(250, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="contactRestrictions")] + public string ContactRestrictions { get; set; } + + /// + /// Indicator of whether the person is a designated emergency contact for the student. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="emergencyContactStatus")] + public bool? EmergencyContactStatus { get; set; } + + /// + /// Indicator of whether the person is a legal guardian for the student. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="legalGuardian")] + public bool? LegalGuardian { get; set; } + + /// + /// Indicator of whether the student lives with the associated contact. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="livesWith")] + public bool? LivesWith { get; set; } + + /// + /// Indicator of whether the person is a primary contact for the student. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="primaryContactStatus")] + public bool? PrimaryContactStatus { get; set; } + + /// + /// The nature of an individual's relationship to a student, primarily used to capture family relationships. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="relationDescriptor")][DescriptorExists("RelationDescriptor")] + public string RelationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -184027,7 +191971,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCompetencyObjective", "StudentCompetencyObjectiveGeneralStudentProgramAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentContactAssociation", "StudentContactAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -184039,17 +191983,18 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- - - [OnDeserialized] - internal void OnDeserialized(StreamingContext context) - { - // Reconnect collection item parent references on deserialization - } // ------------------------------------------------------------ // ============================================================ @@ -184057,29 +192002,43 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCompetencyObjectiveGeneralStudentProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)target); + return Entities.Common.EdFi.StudentContactAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentContactAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCompetencyObjectiveGeneralStudentProgramAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation)target, null); + Entities.Common.EdFi.StudentContactAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentContactAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.GeneralStudentProgramAssociationResourceId + Guid? Entities.Common.EdFi.IStudentContactAssociation.ContactResourceId { get { return null; } - set { ImplicitGeneralStudentProgramAssociationReference.ResourceId = value ?? default(Guid); } + set { ImplicitContactReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation.GeneralStudentProgramAssociationDiscriminator + string Entities.Common.EdFi.IStudentContactAssociation.ContactDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitGeneralStudentProgramAssociationReference.Discriminator = value; } + set { ImplicitContactReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentContactAssociation.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentContactAssociation.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } } @@ -184100,7 +192059,6 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAsso try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -184125,40 +192083,6 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAsso yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); - - if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetStudentUniqueIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation).StudentCompetencyObjective.StudentUniqueId); - - // Obtain value from other references - var valueFromGeneralStudentProgramAssociationReference = this.GeneralStudentProgramAssociationReference?.StudentUniqueId; - - if (valueFromGeneralStudentProgramAssociationReference != null) - { - yield return ("generalStudentProgramAssociationReference.studentUniqueId", this.GeneralStudentProgramAssociationReference.StudentUniqueId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -184185,9 +192109,9 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAsso // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCompetencyObjectiveGeneralStudentProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentContactAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -184215,17 +192139,135 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentCompetencyObjectiveStudentSectionAssociation table of the StudentCompetencyObjective aggregate in the ODS Database. + /// Represents a reference to the StudentCTEProgramAssociation resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StudentCTEProgramAssociationReference : IResourceReference + { + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } + + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } + + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } + + [DataMember(Name="programName")] + public string ProgramName { get; set; } + + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return BeginDate != default(DateTime) && EducationOrganizationId != default(long) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (BeginDate == default) + { + yield return "BeginDate"; + } + + if (EducationOrganizationId == default) + { + yield return "EducationOrganizationId"; + } + + if (ProgramEducationOrganizationId == default) + { + yield return "ProgramEducationOrganizationId"; + } + + if (ProgramName == default) + { + yield return "ProgramName"; + } + + if (ProgramTypeDescriptor == default) + { + yield return "ProgramTypeDescriptor"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "StudentCTEProgramAssociation", + Href = $"/ed-fi/studentCTEProgramAssociations/{ResourceId:n}" + }; + + return link; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.StudentCTEProgramAssociation table of the StudentCTEProgramAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCompetencyObjectiveStudentSectionAssociation : Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation, IValidatableObject + public class StudentCTEProgramAssociation : Entities.Common.EdFi.IStudentCTEProgramAssociation, Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCompetencyObjectiveStudentSectionAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentCTEProgramAssociation"); // Fluent validator instance (threadsafe) - private static StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator _validator = new StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator(); + private static StudentCTEProgramAssociationPutPostRequestValidator _validator = new StudentCTEProgramAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -184236,142 +192278,181 @@ public class StudentCompetencyObjectiveStudentSectionAssociation : Entities.Comm // Constructor // ------------------------------------------------------------- + public StudentCTEProgramAssociation() + { + StudentCTEProgramAssociationCTEProgramServices = new List(); + + // Inherited lists + GeneralStudentProgramAssociationProgramParticipationStatuses = new List(); + } // ------------------------------------------------------------ // ============================================================ // Unique Identifier // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentCTEProgramAssociation resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - private bool _studentSectionAssociationReferenceExplicitlyAssigned; - private StudentSectionAssociation.EdFi.StudentSectionAssociationReference _studentSectionAssociationReference; - private StudentSectionAssociation.EdFi.StudentSectionAssociationReference ImplicitStudentSectionAssociationReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentSectionAssociationReference == null && !_studentSectionAssociationReferenceExplicitlyAssigned) - _studentSectionAssociationReference = new StudentSectionAssociation.EdFi.StudentSectionAssociationReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _studentSectionAssociationReference; + return _educationOrganizationReference; } } - [DataMember(Name="studentSectionAssociationReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public StudentSectionAssociation.EdFi.StudentSectionAssociationReference StudentSectionAssociationReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentSectionAssociationReference != null - && (_studentSectionAssociationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _studentSectionAssociationReferenceExplicitlyAssigned = true; - _studentSectionAssociationReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentCompetencyObjective _studentCompetencyObjective; - - [IgnoreDataMember] - Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveStudentSectionAssociation.StudentCompetencyObjective + private bool _programReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _programReference; + private Program.EdFi.ProgramReference ImplicitProgramReference { - get { return _studentCompetencyObjective; } - set { SetStudentCompetencyObjective(value); } - } + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_programReference == null && !_programReferenceExplicitlyAssigned) + _programReference = new Program.EdFi.ProgramReference(); - public Entities.Common.EdFi.IStudentCompetencyObjective StudentCompetencyObjective - { - set { SetStudentCompetencyObjective(value); } + return _programReference; + } } - private void SetStudentCompetencyObjective(Entities.Common.EdFi.IStudentCompetencyObjective value) + [DataMember(Name="programReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Program.EdFi.ProgramReference ProgramReference { - _studentCompetencyObjective = value; + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitProgramReference != null + && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference; - // Initialize unified key values from parent context when reference is being formed by outbound mapper - if (!_studentSectionAssociationReferenceExplicitlyAssigned) + return null; + } + set { - ImplicitStudentSectionAssociationReference.StudentUniqueId = _studentCompetencyObjective.StudentUniqueId; + _programReferenceExplicitlyAssigned = true; + _programReference = value; } } + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); - /// - /// Month, day, and year of the student's entry or assignment to the section. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // IS in a reference, NOT a lookup column - DateTime Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.BeginDate + return _studentReference; + } + } + + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference { get { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.BeginDate; + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; - return default(DateTime); + return null; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.BeginDate = value; + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; } } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- /// - /// The local code assigned by the School that identifies the course offering provided for the instruction of students. + /// The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } + + /// + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.LocalCourseCode + long Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationId { get { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.LocalCourseCode; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; - return default(string); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.LocalCourseCode = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SchoolId + long Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramEducationOrganizationId { get { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.SchoolId; + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; return default(long); } @@ -184380,73 +192461,69 @@ long Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.S // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SchoolId = value; + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.EducationOrganizationId = value; } } /// - /// The identifier for the school year. + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SchoolYear + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramName { get { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.SchoolYear; + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramName; - return default(short); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SchoolYear = value; + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.ProgramName = value; } } /// - /// The local identifier assigned to a section. + /// The type of program. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SectionIdentifier + + // IS in a reference (StudentCTEProgramAssociation.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramTypeDescriptor { get { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.SectionIdentifier; + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramTypeDescriptor; - return default(string); + return null; } set { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SectionIdentifier = value; + ImplicitProgramReference.ProgramTypeDescriptor = value; } } /// - /// The identifier for the calendar for the academic session. + /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.SessionName + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentUniqueId { get { - if (ImplicitStudentSectionAssociationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentSectionAssociationReference.IsReferenceFullyDefined())) - return ImplicitStudentSectionAssociationReference.SessionName; + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; return default(string); } @@ -184455,9 +192532,10 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // StudentSectionAssociation - _studentSectionAssociationReferenceExplicitlyAssigned = false; - ImplicitStudentSectionAssociationReference.SessionName = value; + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); } } // ------------------------------------------------------------- @@ -184474,7 +192552,7 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentCTEProgramAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -184482,38 +192560,34 @@ public override bool Equals(object obj) if (compareTo == null) return false; - // Parent Property - if (_studentCompetencyObjective == null || !_studentCompetencyObjective.Equals(compareTo.StudentCompetencyObjective)) - return false; - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).BeginDate.Equals(compareTo.BeginDate)) + // Standard Property + if (!(this as Entities.Common.EdFi.IStudentCTEProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).LocalCourseCode, compareTo.LocalCourseCode)) + if (!(this as Entities.Common.EdFi.IStudentCTEProgramAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolYear.Equals(compareTo.SchoolYear)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramName, compareTo.ProgramName)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SectionIdentifier, compareTo.SectionIdentifier)) + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SessionName, compareTo.SessionName)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -184529,27 +192603,26 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); - //Parent Property - if (_studentCompetencyObjective != null) - hash.Add(_studentCompetencyObjective); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).BeginDate); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).BeginDate); + //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).LocalCourseCode); + hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolId); + hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramEducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SchoolYear); + hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramTypeDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SectionIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).SessionName); + hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -184557,11 +192630,55 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- + + /// + /// The month, day, and year on which the student exited the program or stopped receiving services. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } + + /// + /// The reason the student left the program within a school or district. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="reasonExitedDescriptor")][DescriptorExists("ReasonExitedDescriptor")] + public string ReasonExitedDescriptor { get; set; } + + /// + /// Indicates whether the student received services during the summer session or between sessions. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="servedOutsideOfRegularSession")] + public bool? ServedOutsideOfRegularSession { get; set; } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + + /// + /// Indicator that student is from a gender group that comprises less than 25% of the individuals employed in an occupation or field of work. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="nonTraditionalGenderStatus")] + public bool? NonTraditionalGenderStatus { get; set; } + + /// + /// Indicator that student participated in career and technical education at private agencies or institutions that are reported by the state for purposes of the Elementary and Secondary Education Act (ESEA). Students in private institutions which do not receive Perkins funding are reported only in the state file. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="privateCTEProgram")] + public bool? PrivateCTEProgram { get; set; } + + /// + /// Results of technical skills assessment aligned with industry recognized standards. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="technicalSkillsAssessmentDescriptor")][DescriptorExists("TechnicalSkillsAssessmentDescriptor")] + public string TechnicalSkillsAssessmentDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -184577,23 +192694,81 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- + private ICollection _generalStudentProgramAssociationProgramParticipationStatuses; + private ICollection _generalStudentProgramAssociationProgramParticipationStatusesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="programParticipationStatuses")] + public ICollection GeneralStudentProgramAssociationProgramParticipationStatuses + { + get { return _generalStudentProgramAssociationProgramParticipationStatuses; } + set + { + _generalStudentProgramAssociationProgramParticipationStatuses = value; + _generalStudentProgramAssociationProgramParticipationStatusesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGeneralStudentProgramAssociation.GeneralStudentProgramAssociationProgramParticipationStatuses + { + get { return _generalStudentProgramAssociationProgramParticipationStatusesCovariant; } + set { GeneralStudentProgramAssociationProgramParticipationStatuses = new List(value.Cast()); } + } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCompetencyObjective", "StudentCompetencyObjectiveStudentSectionAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _studentCTEProgramAssociationCTEProgramServices; + private ICollection _studentCTEProgramAssociationCTEProgramServicesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="cteProgramServices")] + public ICollection StudentCTEProgramAssociationCTEProgramServices + { + get { return _studentCTEProgramAssociationCTEProgramServices; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)e.Item).StudentCTEProgramAssociation = this); + _studentCTEProgramAssociationCTEProgramServices = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)e.Item).StudentCTEProgramAssociation = this; + _studentCTEProgramAssociationCTEProgramServicesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentCTEProgramAssociation.StudentCTEProgramAssociationCTEProgramServices + { + get { return _studentCTEProgramAssociationCTEProgramServicesCovariant; } + set { StudentCTEProgramAssociationCTEProgramServices = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -184604,6 +192779,16 @@ public override int GetHashCode() internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization + if (_generalStudentProgramAssociationProgramParticipationStatuses != null) foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) + { + item.GeneralStudentProgramAssociation = this; + } + + if (_studentCTEProgramAssociationCTEProgramServices != null) foreach (var item in _studentCTEProgramAssociationCTEProgramServices) + { + item.StudentCTEProgramAssociation = this; + } + } // ------------------------------------------------------------ @@ -184612,29 +192797,57 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCompetencyObjectiveStudentSectionAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)target); + return Entities.Common.EdFi.StudentCTEProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCompetencyObjectiveStudentSectionAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation)target, null); + Entities.Common.EdFi.StudentCTEProgramAssociationMapper.MapDerivedTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.StudentSectionAssociationResourceId + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationResourceId { get { return null; } - set { ImplicitStudentSectionAssociationReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation.StudentSectionAssociationDiscriminator + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitStudentSectionAssociationReference.Discriminator = value; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramResourceId + { + get { return null; } + set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitProgramReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } } @@ -184655,12 +192868,35 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- // Validate collections // ---------------------- + if (GeneralStudentProgramAssociationProgramParticipationStatuses.Any() && mappingContract?.IsMemberSupported("GeneralStudentProgramAssociationProgramParticipationStatuses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GeneralStudentProgramAssociationProgramParticipationStatuses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GeneralStudentProgramAssociationProgramParticipationStatuses, validationContext, validationContext.Items.ForCollection("GeneralStudentProgramAssociationProgramParticipationStatuses")))) + { + yield return result; + } + } + + if (StudentCTEProgramAssociationCTEProgramServices.Any() && mappingContract?.IsMemberSupported("StudentCTEProgramAssociationCTEProgramServices") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentCTEProgramAssociationCTEProgramServices"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCTEProgramAssociationCTEProgramServices, validationContext, validationContext.Items.ForCollection("StudentCTEProgramAssociationCTEProgramServices")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -184680,40 +192916,6 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForStudentUniqueId = GetStudentUniqueIdSources().ToArray(); - - if (!sourcesForStudentUniqueId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual(GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer)) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForStudentUniqueId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForStudentUniqueId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'studentUniqueId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForStudentUniqueId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, string value)> GetStudentUniqueIdSources() - { - // Obtain value from the parent - yield return (null, (this as Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation).StudentCompetencyObjective.StudentUniqueId); - - // Obtain value from other references - var valueFromStudentSectionAssociationReference = this.StudentSectionAssociationReference?.StudentUniqueId; - - if (valueFromStudentSectionAssociationReference != null) - { - yield return ("studentSectionAssociationReference.studentUniqueId", this.StudentSectionAssociationReference.StudentUniqueId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -184740,9 +192942,15 @@ string Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCompetencyObjectiveStudentSectionAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCTEProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + private static readonly FullName _fullName_edfi_StudentCTEProgramAssociation = new FullName("edfi", "StudentCTEProgramAssociation"); + + // Declare collection item validators + private StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator _studentCTEProgramAssociationCTEProgramServicesValidator = new (); + private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator _generalStudentProgramAssociationProgramParticipationStatusesValidator = new (); + + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -184755,152 +192963,65 @@ protected override bool PreValidate(FluentValidation.ValidationContext(); - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - -} -// Aggregate: StudentContactAssociation + // Profile-based collection item filter validation + string profileName = null; -namespace EdFi.Ods.Api.Common.Models.Resources.StudentContactAssociation.EdFi -{ - /// - /// Represents a reference to the StudentContactAssociation resource. - /// - [DataContract] - [ExcludeFromCodeCoverage] - public class StudentContactAssociationReference : IResourceReference - { - [DataMember(Name="contactUniqueId")] - public string ContactUniqueId - { - get => _contactUniqueId; - set - { - _contactUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); - } - } - private string _contactUniqueId; + // Get the current mapping contract + var mappingContract = (StudentCTEProgramAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentCTEProgramAssociation); - [DataMember(Name="studentUniqueId")] - public string StudentUniqueId - { - get => _studentUniqueId; - set + if (mappingContract != null) { - _studentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } - private string _studentUniqueId; - - /// - /// Gets or sets the resource identifier of the referenced resource. - /// - public Guid ResourceId { get; set; } - - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - - - private Link _link; + if (mappingContract.IsStudentCTEProgramAssociationCTEProgramServiceIncluded != null) + { + var hasInvalidStudentCTEProgramAssociationCTEProgramServicesItems = instance.StudentCTEProgramAssociationCTEProgramServices.Any(x => !mappingContract.IsStudentCTEProgramAssociationCTEProgramServiceIncluded(x)); + + if (hasInvalidStudentCTEProgramAssociationCTEProgramServicesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentCTEProgramAssociationCTEProgramServices", $"A supplied 'StudentCTEProgramAssociationCTEProgramService' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } + } - [DataMember(Name="link")] - public Link Link - { - get - { - if (_link == null) + if (mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded != null) { - // Only generate links when all values are present - if (IsReferenceFullyDefined()) - _link = CreateLink(); + var hasInvalidGeneralStudentProgramAssociationProgramParticipationStatusesItems = instance.GeneralStudentProgramAssociationProgramParticipationStatuses.Any(x => !mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded(x)); + + if (hasInvalidGeneralStudentProgramAssociationProgramParticipationStatusesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GeneralStudentProgramAssociationProgramParticipationStatuses", $"A supplied 'GeneralStudentProgramAssociationProgramParticipationStatus' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } } - return _link; } - } - - /// - /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). - /// - /// true if the reference's properties are all set to non-default values; otherwise false. - public bool IsReferenceFullyDefined() - { - return ContactUniqueId != default(string) && StudentUniqueId != default(string); - } - IEnumerable IResourceReference.GetUndefinedProperties() - { - if (ContactUniqueId == default) + if (failures.Any()) { - yield return "ContactUniqueId"; - } + foreach (var failure in failures) + { + result.Errors.Add(failure); + } - if (StudentUniqueId == default) - { - yield return "StudentUniqueId"; + return false; } + return true; } - - private Link CreateLink() - { - var link = new Link - { - Rel = "StudentContactAssociation", - Href = $"/ed-fi/studentContactAssociations/{ResourceId:n}" - }; - - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; - } - } // Aggregate reference + } + // ----------------------------------------------------------------- /// - /// A class which represents the edfi.StudentContactAssociation table of the StudentContactAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentCTEProgramAssociationCTEProgramService table of the StudentCTEProgramAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentContactAssociation : Entities.Common.EdFi.IStudentContactAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentCTEProgramAssociationCTEProgramService : Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentContactAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentCTEProgramAssociationCTEProgramService"); // Fluent validator instance (threadsafe) - private static StudentContactAssociationPutPostRequestValidator _validator = new StudentContactAssociationPutPostRequestValidator(); + private static StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator _validator = new StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -184917,142 +193038,43 @@ public class StudentContactAssociation : Entities.Common.EdFi.IStudentContactAss // ============================================================ // Unique Identifier // ------------------------------------------------------------ - - /// - /// The unique identifier for the StudentContactAssociation resource. - /// - [DataMember(Name="id")] - [JsonConverter(typeof(GuidConverter))] - public Guid Id { get; set; } // ------------------------------------------------------------ // ============================================================= // References // ------------------------------------------------------------- - - private bool _contactReferenceExplicitlyAssigned; - private Contact.EdFi.ContactReference _contactReference; - private Contact.EdFi.ContactReference ImplicitContactReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_contactReference == null && !_contactReferenceExplicitlyAssigned) - _contactReference = new Contact.EdFi.ContactReference(); - - return _contactReference; - } - } - - [DataMember(Name="contactReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Contact.EdFi.ContactReference ContactReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitContactReference != null - && (_contactReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitContactReference.IsReferenceFullyDefined())) - return ImplicitContactReference; - - return null; - } - set - { - _contactReferenceExplicitlyAssigned = true; - _contactReference = value; - } - } - private bool _studentReferenceExplicitlyAssigned; - private Student.EdFi.StudentReference _studentReference; - private Student.EdFi.StudentReference ImplicitStudentReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_studentReference == null && !_studentReferenceExplicitlyAssigned) - _studentReference = new Student.EdFi.StudentReference(); - - return _studentReference; - } - } - - [DataMember(Name="studentReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Student.EdFi.StudentReference StudentReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitStudentReference != null - && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference; - - return null; - } - set - { - _studentReferenceExplicitlyAssigned = true; - _studentReference = value; - } - } // ------------------------------------------------------------- //============================================================== // Primary Key // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudentCTEProgramAssociation _studentCTEProgramAssociation; - /// - /// A unique alphanumeric code assigned to a contact. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentContactAssociation.ContactUniqueId + [IgnoreDataMember] + Entities.Common.EdFi.IStudentCTEProgramAssociation IStudentCTEProgramAssociationCTEProgramService.StudentCTEProgramAssociation { - get - { - if (ImplicitContactReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitContactReference.IsReferenceFullyDefined())) - return ImplicitContactReference.ContactUniqueId; + get { return _studentCTEProgramAssociation; } + set { SetStudentCTEProgramAssociation(value); } + } - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced + public Entities.Common.EdFi.IStudentCTEProgramAssociation StudentCTEProgramAssociation + { + set { SetStudentCTEProgramAssociation(value); } + } - // Contact - _contactReferenceExplicitlyAssigned = false; - ImplicitContactReference.ContactUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Contact", value); - } + private void SetStudentCTEProgramAssociation(Entities.Common.EdFi.IStudentCTEProgramAssociation value) + { + _studentCTEProgramAssociation = value; } /// - /// A unique alphanumeric code assigned to a student. + /// Indicates the service being provided to the student by the CTE program. /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentContactAssociation.StudentUniqueId - { - get - { - if (ImplicitStudentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) - return ImplicitStudentReference.StudentUniqueId; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Student - _studentReferenceExplicitlyAssigned = false; - ImplicitStudentReference.StudentUniqueId = value; - GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); - } - } + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="cteProgramServiceDescriptor")][DescriptorExists("CTEProgramServiceDescriptor")] + public string CTEProgramServiceDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -185067,7 +193089,7 @@ string Entities.Common.EdFi.IStudentContactAssociation.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentContactAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService; if (ReferenceEquals(this, compareTo)) return true; @@ -185075,14 +193097,13 @@ public override bool Equals(object obj) if (compareTo == null) return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentContactAssociation).ContactUniqueId, compareTo.ContactUniqueId)) + // Parent Property + if (_studentCTEProgramAssociation == null || !_studentCTEProgramAssociation.Equals(compareTo.StudentCTEProgramAssociation)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentContactAssociation).StudentUniqueId, compareTo.StudentUniqueId)) + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService).CTEProgramServiceDescriptor, compareTo.CTEProgramServiceDescriptor)) return false; @@ -185098,12 +193119,13 @@ public override bool Equals(object obj) public override int GetHashCode() { var hash = new HashCode(); + //Parent Property + if (_studentCTEProgramAssociation != null) + hash.Add(_studentCTEProgramAssociation); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentContactAssociation).ContactUniqueId); + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService).CTEProgramServiceDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentContactAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -185118,55 +193140,33 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// The numeric order of the preferred sequence or priority of contact. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="contactPriority")] - public int? ContactPriority { get; set; } - - /// - /// Restrictions for student and/or teacher contact with the individual (e.g., the student may not be picked up by the individual). - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(250, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="contactRestrictions")] - public string ContactRestrictions { get; set; } - - /// - /// Indicator of whether the person is a designated emergency contact for the student. + /// Number and description of the CIP code associated with the student's CTE program. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="emergencyContactStatus")] - public bool? EmergencyContactStatus { get; set; } + [NonDefaultStringLength(120, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="cipCode")] + public string CIPCode { get; set; } /// - /// Indicator of whether the person is a legal guardian for the student. + /// True if service is a primary service. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="legalGuardian")] - public bool? LegalGuardian { get; set; } + [DataMember(Name="primaryIndicator")] + public bool? PrimaryIndicator { get; set; } /// - /// Indicator of whether the student lives with the associated contact. + /// First date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="livesWith")] - public bool? LivesWith { get; set; } + [DataMember(Name="serviceBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? ServiceBeginDate { get; set; } /// - /// Indicator of whether the person is a primary contact for the student. + /// Last date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="primaryContactStatus")] - public bool? PrimaryContactStatus { get; set; } - - /// - /// The nature of an individual's relationship to a student, primarily used to capture family relationships. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="relationDescriptor")][DescriptorExists("RelationDescriptor")] - public string RelationDescriptor { get; set; } + [DataMember(Name="serviceEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? ServiceEndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -185187,7 +193187,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentContactAssociation", "StudentContactAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociationCTEProgramService")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -185199,13 +193199,6 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- - - [DataMember(Name="_etag")] - public virtual string ETag { get; set; } - - [DataMember(Name="_lastModifiedDate")] - public virtual DateTime LastModifiedDate { get; set; } - // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -185218,46 +193211,18 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentContactAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentContactAssociation)target); + return Entities.Common.EdFi.StudentCTEProgramAssociationCTEProgramServiceMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentContactAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentContactAssociation)target, null); + Entities.Common.EdFi.StudentCTEProgramAssociationCTEProgramServiceMapper.MapTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentContactAssociation.ContactResourceId - { - get { return null; } - set { ImplicitContactReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudentContactAssociation.ContactDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitContactReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IStudentContactAssociation.StudentResourceId - { - get { return null; } - set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IStudentContactAssociation.StudentDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitStudentReference.Discriminator = value; } - } - - // ----------------------------------------------------------------- // ================================== @@ -185275,6 +193240,7 @@ string Entities.Common.EdFi.IStudentContactAssociation.StudentDiscriminator try { // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -185325,9 +193291,9 @@ string Entities.Common.EdFi.IStudentContactAssociation.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentContactAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -185356,31 +193322,25 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentCTEProgramAssociation resource. + /// Represents a reference to the StudentDisciplineIncidentBehaviorAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentCTEProgramAssociationReference : IResourceReference + public class StudentDisciplineIncidentBehaviorAssociationReference : IResourceReference { - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } - - [DataMember(Name="educationOrganizationId")] - public long EducationOrganizationId { get; set; } - - [DataMember(Name="programEducationOrganizationId")] - public long ProgramEducationOrganizationId { get; set; } + [DataMember(Name="behaviorDescriptor")][DescriptorExists("BehaviorDescriptor")] + public string BehaviorDescriptor { get; set; } - [DataMember(Name="programName")] - public string ProgramName { get; set; } + [DataMember(Name="incidentIdentifier")] + public string IncidentIdentifier { get; set; } - [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] - public string ProgramTypeDescriptor { get; set; } + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } [DataMember(Name="studentUniqueId")] public string StudentUniqueId @@ -185399,6 +193359,12 @@ public string StudentUniqueId /// public Guid ResourceId { get; set; } + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + private Link _link; @@ -185424,34 +193390,24 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BeginDate != default(DateTime) && EducationOrganizationId != default(long) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StudentUniqueId != default(string); + return BehaviorDescriptor != default(string) && IncidentIdentifier != default(string) && SchoolId != default(long) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BeginDate == default) - { - yield return "BeginDate"; - } - - if (EducationOrganizationId == default) - { - yield return "EducationOrganizationId"; - } - - if (ProgramEducationOrganizationId == default) + if (BehaviorDescriptor == default) { - yield return "ProgramEducationOrganizationId"; + yield return "BehaviorDescriptor"; } - if (ProgramName == default) + if (IncidentIdentifier == default) { - yield return "ProgramName"; + yield return "IncidentIdentifier"; } - if (ProgramTypeDescriptor == default) + if (SchoolId == default) { - yield return "ProgramTypeDescriptor"; + yield return "SchoolId"; } if (StudentUniqueId == default) @@ -185465,25 +193421,44 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentCTEProgramAssociation", - Href = $"/ed-fi/studentCTEProgramAssociations/{ResourceId:n}" + Rel = "StudentDisciplineIncidentBehaviorAssociation", + Href = $"/ed-fi/studentDisciplineIncidentBehaviorAssociations/{ResourceId:n}" }; - return link; + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; } } // Aggregate reference /// - /// A class which represents the edfi.StudentCTEProgramAssociation table of the StudentCTEProgramAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociation table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCTEProgramAssociation : Entities.Common.EdFi.IStudentCTEProgramAssociation, Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentDisciplineIncidentBehaviorAssociation : Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCTEProgramAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentBehaviorAssociation"); // Fluent validator instance (threadsafe) - private static StudentCTEProgramAssociationPutPostRequestValidator _validator = new StudentCTEProgramAssociationPutPostRequestValidator(); + private static StudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator _validator = new StudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -185494,12 +193469,9 @@ public class StudentCTEProgramAssociation : Entities.Common.EdFi.IStudentCTEProg // Constructor // ------------------------------------------------------------- - public StudentCTEProgramAssociation() + public StudentDisciplineIncidentBehaviorAssociation() { - StudentCTEProgramAssociationCTEProgramServices = new List(); - - // Inherited lists - GeneralStudentProgramAssociationProgramParticipationStatuses = new List(); + StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new List(); } // ------------------------------------------------------------ @@ -185509,7 +193481,7 @@ public StudentCTEProgramAssociation() // ------------------------------------------------------------ /// - /// The unique identifier for the StudentCTEProgramAssociation resource. + /// The unique identifier for the StudentDisciplineIncidentBehaviorAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -185520,70 +193492,37 @@ public StudentCTEProgramAssociation() // References // ------------------------------------------------------------- - private bool _educationOrganizationReferenceExplicitlyAssigned; - private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; - private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference - { - get - { - // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) - _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - - return _educationOrganizationReference; - } - } - - [DataMember(Name="educationOrganizationReference")] - [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference - { - get - { - // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitEducationOrganizationReference != null - && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference; - - return null; - } - set - { - _educationOrganizationReferenceExplicitlyAssigned = true; - _educationOrganizationReference = value; - } - } - private bool _programReferenceExplicitlyAssigned; - private Program.EdFi.ProgramReference _programReference; - private Program.EdFi.ProgramReference ImplicitProgramReference + private bool _disciplineIncidentReferenceExplicitlyAssigned; + private DisciplineIncident.EdFi.DisciplineIncidentReference _disciplineIncidentReference; + private DisciplineIncident.EdFi.DisciplineIncidentReference ImplicitDisciplineIncidentReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_programReference == null && !_programReferenceExplicitlyAssigned) - _programReference = new Program.EdFi.ProgramReference(); + if (_disciplineIncidentReference == null && !_disciplineIncidentReferenceExplicitlyAssigned) + _disciplineIncidentReference = new DisciplineIncident.EdFi.DisciplineIncidentReference(); - return _programReference; + return _disciplineIncidentReference; } } - [DataMember(Name="programReference")] + [DataMember(Name="disciplineIncidentReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Program.EdFi.ProgramReference ProgramReference + public DisciplineIncident.EdFi.DisciplineIncidentReference DisciplineIncidentReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitProgramReference != null - && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference; + if (ImplicitDisciplineIncidentReference != null + && (_disciplineIncidentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + return ImplicitDisciplineIncidentReference; return null; } set { - _programReferenceExplicitlyAssigned = true; - _programReference = value; + _disciplineIncidentReferenceExplicitlyAssigned = true; + _disciplineIncidentReference = value; } } private bool _studentReferenceExplicitlyAssigned; @@ -185626,49 +193565,50 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// Describes behavior by category. /// - // NOT in a reference, NOT a lookup column + // NOT in a reference, IS a lookup column [RequiredWithNonDefault] - [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime BeginDate { get; set; } + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="behaviorDescriptor")][DescriptorExists("BehaviorDescriptor")] + public string BehaviorDescriptor { get; set; } /// - /// The identifier assigned to an education organization. + /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationId + string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.IncidentIdentifier { get { - if (ImplicitEducationOrganizationReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) - return ImplicitEducationOrganizationReference.EducationOrganizationId; + if (ImplicitDisciplineIncidentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + return ImplicitDisciplineIncidentReference.IncidentIdentifier; - return default(long); + return default(string); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // EducationOrganization - _educationOrganizationReferenceExplicitlyAssigned = false; - ImplicitEducationOrganizationReference.EducationOrganizationId = value; + // DisciplineIncident + _disciplineIncidentReferenceExplicitlyAssigned = false; + ImplicitDisciplineIncidentReference.IncidentIdentifier = value; } } /// - /// The identifier assigned to an education organization. + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramEducationOrganizationId + long Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.SchoolId { get { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.EducationOrganizationId; + if (ImplicitDisciplineIncidentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) + return ImplicitDisciplineIncidentReference.SchoolId; return default(long); } @@ -185677,55 +193617,9 @@ long Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramEducationOrga // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.EducationOrganizationId = value; - } - } - - /// - /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramName - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramName; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // Program - _programReferenceExplicitlyAssigned = false; - ImplicitProgramReference.ProgramName = value; - } - } - - /// - /// The type of program. - /// - - // IS in a reference (StudentCTEProgramAssociation.ProgramTypeDescriptorId), IS a lookup column - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramTypeDescriptor - { - get - { - if (ImplicitProgramReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) - return ImplicitProgramReference.ProgramTypeDescriptor; - - return null; - } - set - { - ImplicitProgramReference.ProgramTypeDescriptor = value; + // DisciplineIncident + _disciplineIncidentReferenceExplicitlyAssigned = false; + ImplicitDisciplineIncidentReference.SchoolId = value; } } @@ -185733,7 +193627,7 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramTypeDescrip /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentUniqueId + string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentUniqueId { get { @@ -185768,7 +193662,7 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCTEProgramAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -185778,32 +193672,22 @@ public override bool Equals(object obj) // Standard Property - if (!(this as Entities.Common.EdFi.IStudentCTEProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCTEProgramAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor, compareTo.BehaviorDescriptor)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramName, compareTo.ProgramName)) - return false; - - - // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + if (!(this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).SchoolId.Equals(compareTo.SchoolId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -185821,24 +193705,17 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).BeginDate); - + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor); - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramEducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramName); - - //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).ProgramTypeDescriptor); - + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).SchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociation).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -185846,28 +193723,6 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - - /// - /// The month, day, and year on which the student exited the program or stopped receiving services. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? EndDate { get; set; } - - /// - /// The reason the student left the program within a school or district. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="reasonExitedDescriptor")][DescriptorExists("ReasonExitedDescriptor")] - public string ReasonExitedDescriptor { get; set; } - - /// - /// Indicates whether the student received services during the summer session or between sessions. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="servedOutsideOfRegularSession")] - public bool? ServedOutsideOfRegularSession { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -185875,26 +193730,12 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Indicator that student is from a gender group that comprises less than 25% of the individuals employed in an occupation or field of work. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="nonTraditionalGenderStatus")] - public bool? NonTraditionalGenderStatus { get; set; } - - /// - /// Indicator that student participated in career and technical education at private agencies or institutions that are reported by the state for purposes of the Elementary and Secondary Education Act (ESEA). Students in private institutions which do not receive Perkins funding are reported only in the state file. + /// Specifies a more granular level of detail of a behavior involved in the incident. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="privateCTEProgram")] - public bool? PrivateCTEProgram { get; set; } - - /// - /// Results of technical skills assessment aligned with industry recognized standards. - /// - // NOT in a reference, IS a lookup column - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="technicalSkillsAssessmentDescriptor")][DescriptorExists("TechnicalSkillsAssessmentDescriptor")] - public string TechnicalSkillsAssessmentDescriptor { get; set; } + [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="behaviorDetailedDescription")] + public string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -185910,67 +193751,46 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- - private ICollection _generalStudentProgramAssociationProgramParticipationStatuses; - private ICollection _generalStudentProgramAssociationProgramParticipationStatusesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="programParticipationStatuses")] - public ICollection GeneralStudentProgramAssociationProgramParticipationStatuses - { - get { return _generalStudentProgramAssociationProgramParticipationStatuses; } - set - { - _generalStudentProgramAssociationProgramParticipationStatuses = value; - _generalStudentProgramAssociationProgramParticipationStatusesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGeneralStudentProgramAssociation.GeneralStudentProgramAssociationProgramParticipationStatuses - { - get { return _generalStudentProgramAssociationProgramParticipationStatusesCovariant; } - set { GeneralStudentProgramAssociationProgramParticipationStatuses = new List(value.Cast()); } - } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentCTEProgramAssociationCTEProgramServices; - private ICollection _studentCTEProgramAssociationCTEProgramServicesCovariant; + private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; + private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; [NoDuplicateMembers] - [DataMember(Name="cteProgramServices")] - public ICollection StudentCTEProgramAssociationCTEProgramServices + [DataMember(Name="disciplineIncidentParticipationCodes")] + public ICollection StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes { - get { return _studentCTEProgramAssociationCTEProgramServices; } + get { return _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)e.Item).StudentCTEProgramAssociation = this); - _studentCTEProgramAssociationCTEProgramServices = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentBehaviorAssociation = this); + _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)e.Item).StudentCTEProgramAssociation = this; - _studentCTEProgramAssociationCTEProgramServicesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentBehaviorAssociation = this; + _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentCTEProgramAssociation.StudentCTEProgramAssociationCTEProgramServices + ICollection Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes { - get { return _studentCTEProgramAssociationCTEProgramServicesCovariant; } - set { StudentCTEProgramAssociationCTEProgramServices = new List(value.Cast()); } + get { return _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; } + set { StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -185995,14 +193815,9 @@ public ICollection StudentCTEProg internal void OnDeserialized(StreamingContext context) { // Reconnect collection item parent references on deserialization - if (_generalStudentProgramAssociationProgramParticipationStatuses != null) foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) - { - item.GeneralStudentProgramAssociation = this; - } - - if (_studentCTEProgramAssociationCTEProgramServices != null) foreach (var item in _studentCTEProgramAssociationCTEProgramServices) + if (_studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes != null) foreach (var item in _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes) { - item.StudentCTEProgramAssociation = this; + item.StudentDisciplineIncidentBehaviorAssociation = this; } } @@ -186013,53 +193828,39 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCTEProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociation)target); + return Entities.Common.EdFi.StudentDisciplineIncidentBehaviorAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCTEProgramAssociationMapper.MapDerivedTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociation)target, null); + Entities.Common.EdFi.StudentDisciplineIncidentBehaviorAssociationMapper.MapTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationResourceId - { - get { return null; } - set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } - } - - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationDiscriminator - { - // Not supported for Resources - get { return null; } - set { ImplicitEducationOrganizationReference.Discriminator = value; } - } - - - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramResourceId + Guid? Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.DisciplineIncidentResourceId { get { return null; } - set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } + set { ImplicitDisciplineIncidentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramDiscriminator + string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.DisciplineIncidentDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitProgramReference.Discriminator = value; } + set { ImplicitDisciplineIncidentReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentResourceId + Guid? Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentResourceId { get { return null; } set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminator + string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentDiscriminator { // Not supported for Resources get { return null; } @@ -186089,25 +193890,13 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminat // ---------------------- // Validate collections // ---------------------- - if (GeneralStudentProgramAssociationProgramParticipationStatuses.Any() && mappingContract?.IsMemberSupported("GeneralStudentProgramAssociationProgramParticipationStatuses") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("GeneralStudentProgramAssociationProgramParticipationStatuses"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GeneralStudentProgramAssociationProgramParticipationStatuses, validationContext, validationContext.Items.ForCollection("GeneralStudentProgramAssociationProgramParticipationStatuses")))) - { - yield return result; - } - } - - if (StudentCTEProgramAssociationCTEProgramServices.Any() && mappingContract?.IsMemberSupported("StudentCTEProgramAssociationCTEProgramServices") != false) + if (StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes.Any() && mappingContract?.IsMemberSupported("StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes") != false) { // Reset path builder pathBuilder.Length = dotLength; - pathBuilder.Append("StudentCTEProgramAssociationCTEProgramServices"); + pathBuilder.Append("StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes"); - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentCTEProgramAssociationCTEProgramServices, validationContext, validationContext.Items.ForCollection("StudentCTEProgramAssociationCTEProgramServices")))) + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes, validationContext, validationContext.Items.ForCollection("StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes")))) { yield return result; } @@ -186158,15 +193947,14 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminat // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCTEProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentCTEProgramAssociation = new FullName("edfi", "StudentCTEProgramAssociation"); + private static readonly FullName _fullName_edfi_StudentDisciplineIncidentBehaviorAssociation = new FullName("edfi", "StudentDisciplineIncidentBehaviorAssociation"); // Declare collection item validators - private StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator _studentCTEProgramAssociationCTEProgramServicesValidator = new (); - private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator _generalStudentProgramAssociationProgramParticipationStatusesValidator = new (); + private StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -186183,30 +193971,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStudentCTEProgramAssociationCTEProgramServiceIncluded(x)); - - if (hasInvalidStudentCTEProgramAssociationCTEProgramServicesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentCTEProgramAssociationCTEProgramServices", $"A supplied 'StudentCTEProgramAssociationCTEProgramService' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - - if (mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded != null) + if (mappingContract.IsStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodeIncluded != null) { - var hasInvalidGeneralStudentProgramAssociationProgramParticipationStatusesItems = instance.GeneralStudentProgramAssociationProgramParticipationStatuses.Any(x => !mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded(x)); + var hasInvalidStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesItems = instance.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes.Any(x => !mappingContract.IsStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodeIncluded(x)); - if (hasInvalidGeneralStudentProgramAssociationProgramParticipationStatusesItems) + if (hasInvalidStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("GeneralStudentProgramAssociationProgramParticipationStatuses", $"A supplied 'GeneralStudentProgramAssociationProgramParticipationStatus' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes", $"A supplied 'StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -186228,16 +194005,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentCTEProgramAssociationCTEProgramService table of the StudentCTEProgramAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentCTEProgramAssociationCTEProgramService : Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService, IValidatableObject + public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode : Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentCTEProgramAssociationCTEProgramService"); + private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode"); // Fluent validator instance (threadsafe) - private static StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator _validator = new StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator(); + private static StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _validator = new StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -186264,33 +194041,33 @@ public class StudentCTEProgramAssociationCTEProgramService : Entities.Common.EdF //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentCTEProgramAssociation _studentCTEProgramAssociation; + private Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation _studentDisciplineIncidentBehaviorAssociation; [IgnoreDataMember] - Entities.Common.EdFi.IStudentCTEProgramAssociation IStudentCTEProgramAssociationCTEProgramService.StudentCTEProgramAssociation + Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentBehaviorAssociation { - get { return _studentCTEProgramAssociation; } - set { SetStudentCTEProgramAssociation(value); } + get { return _studentDisciplineIncidentBehaviorAssociation; } + set { SetStudentDisciplineIncidentBehaviorAssociation(value); } } - public Entities.Common.EdFi.IStudentCTEProgramAssociation StudentCTEProgramAssociation + public Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation StudentDisciplineIncidentBehaviorAssociation { - set { SetStudentCTEProgramAssociation(value); } + set { SetStudentDisciplineIncidentBehaviorAssociation(value); } } - private void SetStudentCTEProgramAssociation(Entities.Common.EdFi.IStudentCTEProgramAssociation value) + private void SetStudentDisciplineIncidentBehaviorAssociation(Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation value) { - _studentCTEProgramAssociation = value; + _studentDisciplineIncidentBehaviorAssociation = value; } /// - /// Indicates the service being provided to the student by the CTE program. + /// The role or type of participation of a student in a discipline incident. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="cteProgramServiceDescriptor")][DescriptorExists("CTEProgramServiceDescriptor")] - public string CTEProgramServiceDescriptor { get; set; } + [DataMember(Name="disciplineIncidentParticipationCodeDescriptor")][DescriptorExists("DisciplineIncidentParticipationCodeDescriptor")] + public string DisciplineIncidentParticipationCodeDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -186305,7 +194082,7 @@ private void SetStudentCTEProgramAssociation(Entities.Common.EdFi.IStudentCTEPro /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService; + var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode; if (ReferenceEquals(this, compareTo)) return true; @@ -186314,12 +194091,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentCTEProgramAssociation == null || !_studentCTEProgramAssociation.Equals(compareTo.StudentCTEProgramAssociation)) + if (_studentDisciplineIncidentBehaviorAssociation == null || !_studentDisciplineIncidentBehaviorAssociation.Equals(compareTo.StudentDisciplineIncidentBehaviorAssociation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService).CTEProgramServiceDescriptor, compareTo.CTEProgramServiceDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) return false; @@ -186336,11 +194113,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentCTEProgramAssociation != null) - hash.Add(_studentCTEProgramAssociation); + if (_studentDisciplineIncidentBehaviorAssociation != null) + hash.Add(_studentDisciplineIncidentBehaviorAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService).CTEProgramServiceDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor); return hash.ToHashCode(); } @@ -186354,35 +194131,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Number and description of the CIP code associated with the student's CTE program. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(120, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="cipCode")] - public string CIPCode { get; set; } - - /// - /// True if service is a primary service. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="primaryIndicator")] - public bool? PrimaryIndicator { get; set; } - - /// - /// First date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="serviceBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? ServiceBeginDate { get; set; } - - /// - /// Last date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="serviceEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? ServiceEndDate { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -186403,7 +194151,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociationCTEProgramService")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -186427,12 +194175,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentCTEProgramAssociationCTEProgramServiceMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)target); + return Entities.Common.EdFi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentCTEProgramAssociationCTEProgramServiceMapper.MapTo(this, (Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService)target, null); + Entities.Common.EdFi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)target, null); } // ------------------------------------------------------------- @@ -186507,9 +194255,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentCTEProgramAssociationCTEProgramServicePutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -186538,20 +194286,17 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentDisciplineIncidentBehaviorAssociation resource. + /// Represents a reference to the StudentDisciplineIncidentNonOffenderAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentBehaviorAssociationReference : IResourceReference + public class StudentDisciplineIncidentNonOffenderAssociationReference : IResourceReference { - [DataMember(Name="behaviorDescriptor")][DescriptorExists("BehaviorDescriptor")] - public string BehaviorDescriptor { get; set; } - [DataMember(Name="incidentIdentifier")] public string IncidentIdentifier { get; set; } @@ -186606,16 +194351,11 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return BehaviorDescriptor != default(string) && IncidentIdentifier != default(string) && SchoolId != default(long) && StudentUniqueId != default(string); + return IncidentIdentifier != default(string) && SchoolId != default(long) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (BehaviorDescriptor == default) - { - yield return "BehaviorDescriptor"; - } - if (IncidentIdentifier == default) { yield return "IncidentIdentifier"; @@ -186637,8 +194377,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentDisciplineIncidentBehaviorAssociation", - Href = $"/ed-fi/studentDisciplineIncidentBehaviorAssociations/{ResourceId:n}" + Rel = "StudentDisciplineIncidentNonOffenderAssociation", + Href = $"/ed-fi/studentDisciplineIncidentNonOffenderAssociations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -186665,16 +194405,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociation table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociation table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentBehaviorAssociation : Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentDisciplineIncidentNonOffenderAssociation : Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentBehaviorAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentNonOffenderAssociation"); // Fluent validator instance (threadsafe) - private static StudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator _validator = new StudentDisciplineIncidentBehaviorAssociationPutPostRequestValidator(); + private static StudentDisciplineIncidentNonOffenderAssociationPutPostRequestValidator _validator = new StudentDisciplineIncidentNonOffenderAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -186685,9 +194425,9 @@ public class StudentDisciplineIncidentBehaviorAssociation : Entities.Common.EdFi // Constructor // ------------------------------------------------------------- - public StudentDisciplineIncidentBehaviorAssociation() + public StudentDisciplineIncidentNonOffenderAssociation() { - StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new List(); + StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new List(); } // ------------------------------------------------------------ @@ -186697,7 +194437,7 @@ public StudentDisciplineIncidentBehaviorAssociation() // ------------------------------------------------------------ /// - /// The unique identifier for the StudentDisciplineIncidentBehaviorAssociation resource. + /// The unique identifier for the StudentDisciplineIncidentNonOffenderAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -186780,20 +194520,11 @@ public Student.EdFi.StudentReference StudentReference // Primary Key // ------------------------------------------------------------- - /// - /// Describes behavior by category. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="behaviorDescriptor")][DescriptorExists("BehaviorDescriptor")] - public string BehaviorDescriptor { get; set; } - /// /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.IncidentIdentifier + string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.IncidentIdentifier { get { @@ -186818,7 +194549,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Incide /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.SchoolId + long Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.SchoolId { get { @@ -186843,7 +194574,7 @@ long Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.SchoolId /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentUniqueId + string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentUniqueId { get { @@ -186878,7 +194609,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Studen /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -186887,23 +194618,18 @@ public override bool Equals(object obj) return false; - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor, compareTo.BehaviorDescriptor)) - return false; - - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).SchoolId.Equals(compareTo.SchoolId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -186920,18 +194646,14 @@ public override int GetHashCode() { var hash = new HashCode(); - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).BehaviorDescriptor); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).IncidentIdentifier); + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).IncidentIdentifier); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).SchoolId); + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).SchoolId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -186944,14 +194666,6 @@ public override int GetHashCode() // ============================================================= // Properties // ------------------------------------------------------------- - - /// - /// Specifies a more granular level of detail of a behavior involved in the incident. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(1024, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="behaviorDetailedDescription")] - public string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -186972,41 +194686,41 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; - private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; + private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes; + private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; [NoDuplicateMembers] [DataMember(Name="disciplineIncidentParticipationCodes")] - public ICollection StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes + public ICollection StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes { - get { return _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; } + get { return _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentBehaviorAssociation = this); - _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentNonOffenderAssociation = this); + _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentBehaviorAssociation = this; - _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentNonOffenderAssociation = this; + _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes + ICollection Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes { - get { return _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; } - set { StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new List(value.Cast()); } + get { return _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; } + set { StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -187031,9 +194745,9 @@ public ICollection + public class StudentDisciplineIncidentNonOffenderAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentDisciplineIncidentBehaviorAssociation = new FullName("edfi", "StudentDisciplineIncidentBehaviorAssociation"); + private static readonly FullName _fullName_edfi_StudentDisciplineIncidentNonOffenderAssociation = new FullName("edfi", "StudentDisciplineIncidentNonOffenderAssociation"); // Declare collection item validators - private StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesValidator = new (); + private StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -187187,19 +194901,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodeIncluded(x)); + var hasInvalidStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesItems = instance.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes.Any(x => !mappingContract.IsStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodeIncluded(x)); - if (hasInvalidStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesItems) + if (hasInvalidStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes", $"A supplied 'StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes", $"A supplied 'StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -187221,16 +194935,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentBehaviorAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode : Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode, IValidatableObject + public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode : Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode"); + private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode"); // Fluent validator instance (threadsafe) - private static StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _validator = new StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator(); + private static StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _validator = new StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -187257,23 +194971,23 @@ public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParti //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation _studentDisciplineIncidentBehaviorAssociation; + private Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation _studentDisciplineIncidentNonOffenderAssociation; [IgnoreDataMember] - Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentBehaviorAssociation + Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentNonOffenderAssociation { - get { return _studentDisciplineIncidentBehaviorAssociation; } - set { SetStudentDisciplineIncidentBehaviorAssociation(value); } + get { return _studentDisciplineIncidentNonOffenderAssociation; } + set { SetStudentDisciplineIncidentNonOffenderAssociation(value); } } - public Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation StudentDisciplineIncidentBehaviorAssociation + public Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation StudentDisciplineIncidentNonOffenderAssociation { - set { SetStudentDisciplineIncidentBehaviorAssociation(value); } + set { SetStudentDisciplineIncidentNonOffenderAssociation(value); } } - private void SetStudentDisciplineIncidentBehaviorAssociation(Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation value) + private void SetStudentDisciplineIncidentNonOffenderAssociation(Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation value) { - _studentDisciplineIncidentBehaviorAssociation = value; + _studentDisciplineIncidentNonOffenderAssociation = value; } /// @@ -187298,7 +195012,7 @@ private void SetStudentDisciplineIncidentBehaviorAssociation(Entities.Common.EdF /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode; + var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode; if (ReferenceEquals(this, compareTo)) return true; @@ -187307,12 +195021,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentDisciplineIncidentBehaviorAssociation == null || !_studentDisciplineIncidentBehaviorAssociation.Equals(compareTo.StudentDisciplineIncidentBehaviorAssociation)) + if (_studentDisciplineIncidentNonOffenderAssociation == null || !_studentDisciplineIncidentNonOffenderAssociation.Equals(compareTo.StudentDisciplineIncidentNonOffenderAssociation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) return false; @@ -187329,11 +195043,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentDisciplineIncidentBehaviorAssociation != null) - hash.Add(_studentDisciplineIncidentBehaviorAssociation); + if (_studentDisciplineIncidentNonOffenderAssociation != null) + hash.Add(_studentDisciplineIncidentNonOffenderAssociation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor); return hash.ToHashCode(); } @@ -187367,7 +195081,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -187391,12 +195105,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)target); + return Entities.Common.EdFi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode)target, null); + Entities.Common.EdFi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)target, null); } // ------------------------------------------------------------- @@ -187471,9 +195185,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -187502,22 +195216,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentDisciplineIncidentNonOffenderAssociation resource. + /// Represents a reference to the StudentEducationOrganizationAssessmentAccommodation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentNonOffenderAssociationReference : IResourceReference + public class StudentEducationOrganizationAssessmentAccommodationReference : IResourceReference { - [DataMember(Name="incidentIdentifier")] - public string IncidentIdentifier { get; set; } - - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } [DataMember(Name="studentUniqueId")] public string StudentUniqueId @@ -187567,19 +195278,14 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return IncidentIdentifier != default(string) && SchoolId != default(long) && StudentUniqueId != default(string); + return EducationOrganizationId != default(long) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (IncidentIdentifier == default) - { - yield return "IncidentIdentifier"; - } - - if (SchoolId == default) + if (EducationOrganizationId == default) { - yield return "SchoolId"; + yield return "EducationOrganizationId"; } if (StudentUniqueId == default) @@ -187593,8 +195299,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentDisciplineIncidentNonOffenderAssociation", - Href = $"/ed-fi/studentDisciplineIncidentNonOffenderAssociations/{ResourceId:n}" + Rel = "StudentEducationOrganizationAssessmentAccommodation", + Href = $"/ed-fi/studentEducationOrganizationAssessmentAccommodations/{ResourceId:n}" }; if (string.IsNullOrEmpty(Discriminator)) @@ -187621,16 +195327,16 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociation table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentEducationOrganizationAssessmentAccommodation table of the StudentEducationOrganizationAssessmentAccommodation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentNonOffenderAssociation : Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentEducationOrganizationAssessmentAccommodation : Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentNonOffenderAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentEducationOrganizationAssessmentAccommodation"); // Fluent validator instance (threadsafe) - private static StudentDisciplineIncidentNonOffenderAssociationPutPostRequestValidator _validator = new StudentDisciplineIncidentNonOffenderAssociationPutPostRequestValidator(); + private static StudentEducationOrganizationAssessmentAccommodationPutPostRequestValidator _validator = new StudentEducationOrganizationAssessmentAccommodationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -187641,9 +195347,9 @@ public class StudentDisciplineIncidentNonOffenderAssociation : Entities.Common.E // Constructor // ------------------------------------------------------------- - public StudentDisciplineIncidentNonOffenderAssociation() + public StudentEducationOrganizationAssessmentAccommodation() { - StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new List(); + StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations = new List(); } // ------------------------------------------------------------ @@ -187653,7 +195359,7 @@ public StudentDisciplineIncidentNonOffenderAssociation() // ------------------------------------------------------------ /// - /// The unique identifier for the StudentDisciplineIncidentNonOffenderAssociation resource. + /// The unique identifier for the StudentEducationOrganizationAssessmentAccommodation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -187664,37 +195370,37 @@ public StudentDisciplineIncidentNonOffenderAssociation() // References // ------------------------------------------------------------- - private bool _disciplineIncidentReferenceExplicitlyAssigned; - private DisciplineIncident.EdFi.DisciplineIncidentReference _disciplineIncidentReference; - private DisciplineIncident.EdFi.DisciplineIncidentReference ImplicitDisciplineIncidentReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_disciplineIncidentReference == null && !_disciplineIncidentReferenceExplicitlyAssigned) - _disciplineIncidentReference = new DisciplineIncident.EdFi.DisciplineIncidentReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _disciplineIncidentReference; + return _educationOrganizationReference; } } - [DataMember(Name="disciplineIncidentReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public DisciplineIncident.EdFi.DisciplineIncidentReference DisciplineIncidentReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitDisciplineIncidentReference != null - && (_disciplineIncidentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - return ImplicitDisciplineIncidentReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _disciplineIncidentReferenceExplicitlyAssigned = true; - _disciplineIncidentReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } private bool _studentReferenceExplicitlyAssigned; @@ -187737,41 +195443,16 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// A locally assigned unique identifier (within the school or school district) to identify each specific DisciplineIncident or occurrence. The same identifier should be used to document the entire discipline incident even if it included multiple offenses and multiple offenders. - /// - // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.IncidentIdentifier - { - get - { - if (ImplicitDisciplineIncidentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - return ImplicitDisciplineIncidentReference.IncidentIdentifier; - - return default(string); - } - set - { - // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. - // All ExplicitlyAssigned are reset to false in advanced - - // DisciplineIncident - _disciplineIncidentReferenceExplicitlyAssigned = false; - ImplicitDisciplineIncidentReference.IncidentIdentifier = value; - } - } - - /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.SchoolId + long Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.EducationOrganizationId { get { - if (ImplicitDisciplineIncidentReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitDisciplineIncidentReference.IsReferenceFullyDefined())) - return ImplicitDisciplineIncidentReference.SchoolId; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -187780,9 +195461,9 @@ long Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Schoo // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // DisciplineIncident - _disciplineIncidentReferenceExplicitlyAssigned = false; - ImplicitDisciplineIncidentReference.SchoolId = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } @@ -187790,7 +195471,7 @@ long Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Schoo /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentUniqueId + string Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.StudentUniqueId { get { @@ -187825,7 +195506,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Stu /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation; if (ReferenceEquals(this, compareTo)) return true; @@ -187835,17 +195516,12 @@ public override bool Equals(object obj) // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).IncidentIdentifier, compareTo.IncidentIdentifier)) - return false; - - - // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -187863,13 +195539,10 @@ public override int GetHashCode() var hash = new HashCode(); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).IncidentIdentifier); - - //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).SchoolId); + hash.Add((this as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -187902,41 +195575,41 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociation")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentEducationOrganizationAssessmentAccommodation", "StudentEducationOrganizationAssessmentAccommodation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- - private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes; - private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; + private ICollection _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations; + private ICollection _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsCovariant; [NoDuplicateMembers] - [DataMember(Name="disciplineIncidentParticipationCodes")] - public ICollection StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes + [DataMember(Name="generalAccommodations")] + public ICollection StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { - get { return _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes; } + get { return _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations; } set { if (value == null) return; // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentNonOffenderAssociation = this); - _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = list; + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation)e.Item).StudentEducationOrganizationAssessmentAccommodation = this); + _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations = list; // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)e.Item).StudentDisciplineIncidentNonOffenderAssociation = this; - _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant = covariantList; + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation)e.Item).StudentEducationOrganizationAssessmentAccommodation = this; + _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsCovariant = covariantList; } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes + ICollection Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { - get { return _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; } - set { StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new List(value.Cast()); } + get { return _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsCovariant; } + set { StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations = new List(value.Cast()); } } // ------------------------------------------------------------- @@ -187961,9 +195634,9 @@ public ICollection + public class StudentEducationOrganizationAssessmentAccommodationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentDisciplineIncidentNonOffenderAssociation = new FullName("edfi", "StudentDisciplineIncidentNonOffenderAssociation"); + private static readonly FullName _fullName_edfi_StudentEducationOrganizationAssessmentAccommodation = new FullName("edfi", "StudentEducationOrganizationAssessmentAccommodation"); // Declare collection item validators - private StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesValidator = new (); + private StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationPutPostRequestValidator _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -188117,19 +195790,19 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodeIncluded(x)); + var hasInvalidStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItems = instance.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations.Any(x => !mappingContract.IsStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationIncluded(x)); - if (hasInvalidStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesItems) + if (hasInvalidStudentEducationOrganizationAssessmentAccommodationGeneralAccommodationsItems) { profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes", $"A supplied 'StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + failures.Add(new ValidationFailure("StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations", $"A supplied 'StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } } @@ -188151,16 +195824,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode table of the StudentDisciplineIncidentNonOffenderAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation table of the StudentEducationOrganizationAssessmentAccommodation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode : Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode, IValidatableObject + public class StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation : Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode"); + private static FullName _fullName = new FullName("edfi", "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation"); // Fluent validator instance (threadsafe) - private static StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator _validator = new StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator(); + private static StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationPutPostRequestValidator _validator = new StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -188187,33 +195860,33 @@ public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentPa //============================================================== // Primary Key // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation _studentDisciplineIncidentNonOffenderAssociation; + private Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation _studentEducationOrganizationAssessmentAccommodation; [IgnoreDataMember] - Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentNonOffenderAssociation + Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation.StudentEducationOrganizationAssessmentAccommodation { - get { return _studentDisciplineIncidentNonOffenderAssociation; } - set { SetStudentDisciplineIncidentNonOffenderAssociation(value); } + get { return _studentEducationOrganizationAssessmentAccommodation; } + set { SetStudentEducationOrganizationAssessmentAccommodation(value); } } - public Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation StudentDisciplineIncidentNonOffenderAssociation + public Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation StudentEducationOrganizationAssessmentAccommodation { - set { SetStudentDisciplineIncidentNonOffenderAssociation(value); } + set { SetStudentEducationOrganizationAssessmentAccommodation(value); } } - private void SetStudentDisciplineIncidentNonOffenderAssociation(Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation value) + private void SetStudentEducationOrganizationAssessmentAccommodation(Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation value) { - _studentDisciplineIncidentNonOffenderAssociation = value; + _studentEducationOrganizationAssessmentAccommodation = value; } /// - /// The role or type of participation of a student in a discipline incident. + /// The special variation(s) to be used in how assessments (in general) are presented, how it is administered, or how the test taker is allowed to respond. This generally refers to changes that do not substantially alter what the examination measures. The proper use of accommodations does not substantially change academic level or performance criteria. /// // NOT in a reference, IS a lookup column [RequiredWithNonDefault] [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="disciplineIncidentParticipationCodeDescriptor")][DescriptorExists("DisciplineIncidentParticipationCodeDescriptor")] - public string DisciplineIncidentParticipationCodeDescriptor { get; set; } + [DataMember(Name="accommodationDescriptor")][DescriptorExists("AccommodationDescriptor")] + public string AccommodationDescriptor { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -188228,7 +195901,7 @@ private void SetStudentDisciplineIncidentNonOffenderAssociation(Entities.Common. /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode; + var compareTo = obj as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation; if (ReferenceEquals(this, compareTo)) return true; @@ -188237,12 +195910,12 @@ public override bool Equals(object obj) return false; // Parent Property - if (_studentDisciplineIncidentNonOffenderAssociation == null || !_studentDisciplineIncidentNonOffenderAssociation.Equals(compareTo.StudentDisciplineIncidentNonOffenderAssociation)) + if (_studentEducationOrganizationAssessmentAccommodation == null || !_studentEducationOrganizationAssessmentAccommodation.Equals(compareTo.StudentEducationOrganizationAssessmentAccommodation)) return false; // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor, compareTo.DisciplineIncidentParticipationCodeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation).AccommodationDescriptor, compareTo.AccommodationDescriptor)) return false; @@ -188259,11 +195932,11 @@ public override int GetHashCode() { var hash = new HashCode(); //Parent Property - if (_studentDisciplineIncidentNonOffenderAssociation != null) - hash.Add(_studentDisciplineIncidentNonOffenderAssociation); + if (_studentEducationOrganizationAssessmentAccommodation != null) + hash.Add(_studentEducationOrganizationAssessmentAccommodation); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode).DisciplineIncidentParticipationCodeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation).AccommodationDescriptor); return hash.ToHashCode(); } @@ -188297,7 +195970,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentEducationOrganizationAssessmentAccommodation", "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -188321,12 +195994,12 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodeMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)target); + return Entities.Common.EdFi.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodeMapper.MapTo(this, (Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode)target, null); + Entities.Common.EdFi.StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationMapper.MapTo(this, (Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation)target, null); } // ------------------------------------------------------------- @@ -188401,9 +196074,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodePutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentEducationOrganizationAssessmentAccommodationGeneralAccommodationPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -212917,9 +220590,715 @@ public override int GetHashCode() // ------------------------------------------------------------- // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentSchoolAssociation", "StudentSchoolAssociationEducationPlan")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StudentSchoolAssociationEducationPlanMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolAssociationEducationPlan)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StudentSchoolAssociationEducationPlanMapper.MapTo(this, (Entities.Common.EdFi.IStudentSchoolAssociationEducationPlan)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); + + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) + { + yield return result; + } + } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); + + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } + + // ================================================================= + // Validators + // ----------------------------------------------------------------- + + [ExcludeFromCodeCoverage] + public class StudentSchoolAssociationEducationPlanPutPostRequestValidator : FluentValidation.AbstractValidator + { + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + +} +// Aggregate: StudentSchoolAttendanceEvent + +namespace EdFi.Ods.Api.Common.Models.Resources.StudentSchoolAttendanceEvent.EdFi +{ + /// + /// Represents a reference to the StudentSchoolAttendanceEvent resource. + /// + [DataContract] + [ExcludeFromCodeCoverage] + public class StudentSchoolAttendanceEventReference : IResourceReference + { + [DataMember(Name="attendanceEventCategoryDescriptor")][DescriptorExists("AttendanceEventCategoryDescriptor")] + public string AttendanceEventCategoryDescriptor { get; set; } + + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } + + [DataMember(Name="schoolId")] + public long SchoolId { get; set; } + + [DataMember(Name="schoolYear")] + public short SchoolYear { get; set; } + + [DataMember(Name="sessionName")] + public string SessionName { get; set; } + + [DataMember(Name="studentUniqueId")] + public string StudentUniqueId + { + get => _studentUniqueId; + set + { + _studentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + private string _studentUniqueId; + + /// + /// Gets or sets the resource identifier of the referenced resource. + /// + public Guid ResourceId { get; set; } + + /// + /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource + /// when the referenced resource has been derived; otherwise null. + /// + public string Discriminator { get; set; } + + + private Link _link; + + [DataMember(Name="link")] + public Link Link + { + get + { + if (_link == null) + { + // Only generate links when all values are present + if (IsReferenceFullyDefined()) + _link = CreateLink(); + } + + return _link; + } + } + + /// + /// Indicates whether the reference has been fully defined (all key values are currently assigned non-default values). + /// + /// true if the reference's properties are all set to non-default values; otherwise false. + public bool IsReferenceFullyDefined() + { + return AttendanceEventCategoryDescriptor != default(string) && EventDate != default(DateTime) && SchoolId != default(long) && SchoolYear != default(short) && SessionName != default(string) && StudentUniqueId != default(string); + } + + IEnumerable IResourceReference.GetUndefinedProperties() + { + if (AttendanceEventCategoryDescriptor == default) + { + yield return "AttendanceEventCategoryDescriptor"; + } + + if (EventDate == default) + { + yield return "EventDate"; + } + + if (SchoolId == default) + { + yield return "SchoolId"; + } + + if (SchoolYear == default) + { + yield return "SchoolYear"; + } + + if (SessionName == default) + { + yield return "SessionName"; + } + + if (StudentUniqueId == default) + { + yield return "StudentUniqueId"; + } + + } + + private Link CreateLink() + { + var link = new Link + { + Rel = "StudentSchoolAttendanceEvent", + Href = $"/ed-fi/studentSchoolAttendanceEvents/{ResourceId:n}" + }; + + if (string.IsNullOrEmpty(Discriminator)) + return link; + + string[] linkParts = Discriminator.Split('.'); + + if (linkParts.Length < 2) + return link; + + var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() + .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); + + // return the default link if the relationship is already correct, and/or if the resource is not found. + if (resource == null || link.Rel == resource.Name) + return link; + + return new Link + { + Rel = resource.Name, + Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" + }; + } + } // Aggregate reference + + /// + /// A class which represents the edfi.StudentSchoolAttendanceEvent table of the StudentSchoolAttendanceEvent aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StudentSchoolAttendanceEvent : Entities.Common.EdFi.IStudentSchoolAttendanceEvent, IHasETag, IDateVersionedEntity, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StudentSchoolAttendanceEvent"); + + // Fluent validator instance (threadsafe) + private static StudentSchoolAttendanceEventPutPostRequestValidator _validator = new StudentSchoolAttendanceEventPutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + + /// + /// The unique identifier for the StudentSchoolAttendanceEvent resource. + /// + [DataMember(Name="id")] + [JsonConverter(typeof(GuidConverter))] + public Guid Id { get; set; } + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + + private bool _schoolReferenceExplicitlyAssigned; + private School.EdFi.SchoolReference _schoolReference; + private School.EdFi.SchoolReference ImplicitSchoolReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) + _schoolReference = new School.EdFi.SchoolReference(); + + return _schoolReference; + } + } + + [DataMember(Name="schoolReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public School.EdFi.SchoolReference SchoolReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSchoolReference != null + && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference; + + return null; + } + set + { + _schoolReferenceExplicitlyAssigned = true; + _schoolReference = value; + } + } + private bool _sessionReferenceExplicitlyAssigned; + private Session.EdFi.SessionReference _sessionReference; + private Session.EdFi.SessionReference ImplicitSessionReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_sessionReference == null && !_sessionReferenceExplicitlyAssigned) + _sessionReference = new Session.EdFi.SessionReference(); + + return _sessionReference; + } + } + + [DataMember(Name="sessionReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Session.EdFi.SessionReference SessionReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitSessionReference != null + && (_sessionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) + return ImplicitSessionReference; + + return null; + } + set + { + _sessionReferenceExplicitlyAssigned = true; + _sessionReference = value; + } + } + private bool _studentReferenceExplicitlyAssigned; + private Student.EdFi.StudentReference _studentReference; + private Student.EdFi.StudentReference ImplicitStudentReference + { + get + { + // if the Reference is null, it is instantiated unless it has been explicitly assigned to null + if (_studentReference == null && !_studentReferenceExplicitlyAssigned) + _studentReference = new Student.EdFi.StudentReference(); + + return _studentReference; + } + } + + [DataMember(Name="studentReference")] + [FullyDefinedReference][RequiredReference(isIdentifying: true)] + public Student.EdFi.StudentReference StudentReference + { + get + { + // Only return the reference if it's non-null, and all its properties have non-default values assigned + if (ImplicitStudentReference != null + && (_studentReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference; + + return null; + } + set + { + _studentReferenceExplicitlyAssigned = true; + _studentReference = value; + } + } + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + + /// + /// A code describing the attendance event, for example: Present Unexcused absence Excused absence Tardy. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="attendanceEventCategoryDescriptor")][DescriptorExists("AttendanceEventCategoryDescriptor")] + public string AttendanceEventCategoryDescriptor { get; set; } + + /// + /// Date for this attendance event. + /// + // NOT in a reference, NOT a lookup column + [RequiredWithNonDefault] + [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime EventDate { get; set; } + + /// + /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SchoolId + { + get + { + if (ImplicitSchoolReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) + return ImplicitSchoolReference.SchoolId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // School + _schoolReferenceExplicitlyAssigned = false; + ImplicitSchoolReference.SchoolId = value; + + // Session + _sessionReferenceExplicitlyAssigned = false; + ImplicitSessionReference.SchoolId = value; + } + } + + /// + /// The identifier for the school year. + /// + // IS in a reference, NOT a lookup column + short Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SchoolYear + { + get + { + if (ImplicitSessionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) + return ImplicitSessionReference.SchoolYear; + + return default(short); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Session + _sessionReferenceExplicitlyAssigned = false; + ImplicitSessionReference.SchoolYear = value; + } + } + + /// + /// The identifier for the calendar for the academic session. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionName + { + get + { + if (ImplicitSessionReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) + return ImplicitSessionReference.SessionName; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Session + _sessionReferenceExplicitlyAssigned = false; + ImplicitSessionReference.SessionName = value; + } + } + + /// + /// A unique alphanumeric code assigned to a student. + /// + // IS in a reference, NOT a lookup column + string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentUniqueId + { + get + { + if (ImplicitStudentReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitStudentReference.IsReferenceFullyDefined())) + return ImplicitStudentReference.StudentUniqueId; + + return default(string); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced + + // Student + _studentReferenceExplicitlyAssigned = false; + ImplicitStudentReference.StudentUniqueId = value; + GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().AddLookup("Student", value); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStudentSchoolAttendanceEvent; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).AttendanceEventCategoryDescriptor, compareTo.AttendanceEventCategoryDescriptor)) + return false; + + + // Standard Property + if (!(this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).EventDate.Equals(compareTo.EventDate)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolId.Equals(compareTo.SchoolId)) + return false; + + + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolYear.Equals(compareTo.SchoolYear)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SessionName, compareTo.SessionName)) + return false; + + + // Referenced Property + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).StudentUniqueId, compareTo.StudentUniqueId)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).AttendanceEventCategoryDescriptor); + + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).EventDate); + + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolId); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolYear); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SessionName); + + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).StudentUniqueId); + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// The time of day the student arrived for the attendance event in ISO 8601 format. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="arrivalTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan? ArrivalTime { get; set; } + + /// + /// The reported reason for a student's absence. + /// + // NOT in a reference, NOT a lookup column + [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="attendanceEventReason")] + public string AttendanceEventReason { get; set; } + + /// + /// The time of day the student departed for the attendance event in ISO 8601 format. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="departureTime")][JsonConverter(typeof(UtcTimeConverter))] + public TimeSpan? DepartureTime { get; set; } + + /// + /// The setting in which a child receives education and related services. This attribute is only used if it differs from the EducationalEnvironment of the Section. This is only used in the AttendanceEvent if different from the associated Section. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="educationalEnvironmentDescriptor")][DescriptorExists("EducationalEnvironmentDescriptor")] + public string EducationalEnvironmentDescriptor { get; set; } + + /// + /// The amount of time in days for the event as recognized by the school: 1 day = 1, 1/2 day = 0.5, 1/3 day = 0.33. + /// + // NOT in a reference, NOT a lookup column + [Range(typeof(decimal), "0", "1", ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="eventDuration")] + public decimal? EventDuration { get; set; } + + /// + /// The duration in minutes of the school attendance event. + /// + // NOT in a reference, NOT a lookup column + [Range(0, 1440, ErrorMessage=ValidationHelpers.RangeMessageFormat)] + [DataMember(Name="schoolAttendanceDuration")] + public int? SchoolAttendanceDuration { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -212940,7 +221319,7 @@ public override int GetHashCode() // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentSchoolAssociation", "StudentSchoolAssociationEducationPlan")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentSchoolAttendanceEvent", "StudentSchoolAttendanceEvent")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- @@ -212952,6 +221331,13 @@ public override int GetHashCode() // ============================================================= // Versioning // ------------------------------------------------------------- + + [DataMember(Name="_etag")] + public virtual string ETag { get; set; } + + [DataMember(Name="_lastModifiedDate")] + public virtual DateTime LastModifiedDate { get; set; } + // ------------------------------------------------------------- // ------------------------------------------------------------- @@ -212964,18 +221350,53 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentSchoolAssociationEducationPlanMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolAssociationEducationPlan)target); + return Entities.Common.EdFi.StudentSchoolAttendanceEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolAttendanceEvent)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentSchoolAssociationEducationPlanMapper.MapTo(this, (Entities.Common.EdFi.IStudentSchoolAssociationEducationPlan)target, null); + Entities.Common.EdFi.StudentSchoolAttendanceEventMapper.MapTo(this, (Entities.Common.EdFi.IStudentSchoolAttendanceEvent)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- + Guid? Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SchoolResourceId + { + get { return null; } + set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + } + + + Guid? Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionResourceId + { + get { return null; } + set { ImplicitSessionReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitSessionReference.Discriminator = value; } + } + + + Guid? Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentResourceId + { + get { return null; } + set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } + } + + string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitStudentReference.Discriminator = value; } + } + + // ----------------------------------------------------------------- // ================================== @@ -212993,7 +221414,6 @@ void IMappable.Map(object target) try { // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); int dotLength = pathBuilder.Length; // ---------------------- @@ -213018,6 +221438,45 @@ void IMappable.Map(object target) yield return result; } } + + // ----------------------- + // Validate unified keys + // ----------------------- + pathBuilder.Length = dotLength; + string pathPrefix = null; + + var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + + if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) + { + pathPrefix ??= pathBuilder.ToString(); + + string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); + string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + + yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", + sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + } + + IEnumerable<(string path, long value)> GetSchoolIdSources() + { + // Obtain value from other references + var valueFromSchoolReference = this.SchoolReference?.SchoolId; + + if (valueFromSchoolReference != null) + { + yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); + } + + // Obtain value from other references + var valueFromSessionReference = this.SessionReference?.SchoolId; + + if (valueFromSessionReference != null) + { + yield return ("sessionReference.schoolId", this.SessionReference.SchoolId); + } + + } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); @@ -213044,9 +221503,9 @@ void IMappable.Map(object target) // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentSchoolAssociationEducationPlanPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentSchoolAttendanceEventPutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -213075,31 +221534,31 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentSchoolAttendanceEvent resource. + /// Represents a reference to the StudentSchoolFoodServiceProgramAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentSchoolAttendanceEventReference : IResourceReference + public class StudentSchoolFoodServiceProgramAssociationReference : IResourceReference { - [DataMember(Name="attendanceEventCategoryDescriptor")][DescriptorExists("AttendanceEventCategoryDescriptor")] - public string AttendanceEventCategoryDescriptor { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } + [DataMember(Name="educationOrganizationId")] + public long EducationOrganizationId { get; set; } - [DataMember(Name="schoolId")] - public long SchoolId { get; set; } + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } - [DataMember(Name="schoolYear")] - public short SchoolYear { get; set; } + [DataMember(Name="programName")] + public string ProgramName { get; set; } - [DataMember(Name="sessionName")] - public string SessionName { get; set; } + [DataMember(Name="programTypeDescriptor")][DescriptorExists("ProgramTypeDescriptor")] + public string ProgramTypeDescriptor { get; set; } [DataMember(Name="studentUniqueId")] public string StudentUniqueId @@ -213118,12 +221577,6 @@ public string StudentUniqueId /// public Guid ResourceId { get; set; } - /// - /// Gets or sets the discriminator value which identifies the concrete sub-type of the referenced resource - /// when the referenced resource has been derived; otherwise null. - /// - public string Discriminator { get; set; } - private Link _link; @@ -213149,34 +221602,34 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return AttendanceEventCategoryDescriptor != default(string) && EventDate != default(DateTime) && SchoolId != default(long) && SchoolYear != default(short) && SessionName != default(string) && StudentUniqueId != default(string); + return BeginDate != default(DateTime) && EducationOrganizationId != default(long) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() { - if (AttendanceEventCategoryDescriptor == default) + if (BeginDate == default) { - yield return "AttendanceEventCategoryDescriptor"; + yield return "BeginDate"; } - if (EventDate == default) + if (EducationOrganizationId == default) { - yield return "EventDate"; + yield return "EducationOrganizationId"; } - if (SchoolId == default) + if (ProgramEducationOrganizationId == default) { - yield return "SchoolId"; + yield return "ProgramEducationOrganizationId"; } - if (SchoolYear == default) + if (ProgramName == default) { - yield return "SchoolYear"; + yield return "ProgramName"; } - if (SessionName == default) + if (ProgramTypeDescriptor == default) { - yield return "SessionName"; + yield return "ProgramTypeDescriptor"; } if (StudentUniqueId == default) @@ -213190,44 +221643,25 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentSchoolAttendanceEvent", - Href = $"/ed-fi/studentSchoolAttendanceEvents/{ResourceId:n}" + Rel = "StudentSchoolFoodServiceProgramAssociation", + Href = $"/ed-fi/studentSchoolFoodServiceProgramAssociations/{ResourceId:n}" }; - if (string.IsNullOrEmpty(Discriminator)) - return link; - - string[] linkParts = Discriminator.Split('.'); - - if (linkParts.Length < 2) - return link; - - var resource = GeneratedArtifactStaticDependencies.ResourceModelProvider.GetResourceModel() - .GetResourceByFullName(new FullName(linkParts[0], linkParts[1])); - - // return the default link if the relationship is already correct, and/or if the resource is not found. - if (resource == null || link.Rel == resource.Name) - return link; - - return new Link - { - Rel = resource.Name, - Href = $"/{resource.SchemaUriSegment()}/{resource.PluralName.ToCamelCase()}/{ResourceId:n}" - }; + return link; } } // Aggregate reference /// - /// A class which represents the edfi.StudentSchoolAttendanceEvent table of the StudentSchoolAttendanceEvent aggregate in the ODS Database. + /// A class which represents the edfi.StudentSchoolFoodServiceProgramAssociation table of the StudentSchoolFoodServiceProgramAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentSchoolAttendanceEvent : Entities.Common.EdFi.IStudentSchoolAttendanceEvent, IHasETag, IDateVersionedEntity, IValidatableObject + public class StudentSchoolFoodServiceProgramAssociation : Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation, Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasETag, IDateVersionedEntity, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentSchoolAttendanceEvent"); + private static FullName _fullName = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociation"); // Fluent validator instance (threadsafe) - private static StudentSchoolAttendanceEventPutPostRequestValidator _validator = new StudentSchoolAttendanceEventPutPostRequestValidator(); + private static StudentSchoolFoodServiceProgramAssociationPutPostRequestValidator _validator = new StudentSchoolFoodServiceProgramAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -213238,6 +221672,13 @@ public class StudentSchoolAttendanceEvent : Entities.Common.EdFi.IStudentSchoolA // Constructor // ------------------------------------------------------------- + public StudentSchoolFoodServiceProgramAssociation() + { + StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices = new List(); + + // Inherited lists + GeneralStudentProgramAssociationProgramParticipationStatuses = new List(); + } // ------------------------------------------------------------ @@ -213246,7 +221687,7 @@ public class StudentSchoolAttendanceEvent : Entities.Common.EdFi.IStudentSchoolA // ------------------------------------------------------------ /// - /// The unique identifier for the StudentSchoolAttendanceEvent resource. + /// The unique identifier for the StudentSchoolFoodServiceProgramAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -213257,70 +221698,70 @@ public class StudentSchoolAttendanceEvent : Entities.Common.EdFi.IStudentSchoolA // References // ------------------------------------------------------------- - private bool _schoolReferenceExplicitlyAssigned; - private School.EdFi.SchoolReference _schoolReference; - private School.EdFi.SchoolReference ImplicitSchoolReference + private bool _educationOrganizationReferenceExplicitlyAssigned; + private EducationOrganization.EdFi.EducationOrganizationReference _educationOrganizationReference; + private EducationOrganization.EdFi.EducationOrganizationReference ImplicitEducationOrganizationReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_schoolReference == null && !_schoolReferenceExplicitlyAssigned) - _schoolReference = new School.EdFi.SchoolReference(); + if (_educationOrganizationReference == null && !_educationOrganizationReferenceExplicitlyAssigned) + _educationOrganizationReference = new EducationOrganization.EdFi.EducationOrganizationReference(); - return _schoolReference; + return _educationOrganizationReference; } } - [DataMember(Name="schoolReference")] + [DataMember(Name="educationOrganizationReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public School.EdFi.SchoolReference SchoolReference + public EducationOrganization.EdFi.EducationOrganizationReference EducationOrganizationReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSchoolReference != null - && (_schoolReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference; + if (ImplicitEducationOrganizationReference != null + && (_educationOrganizationReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference; return null; } set { - _schoolReferenceExplicitlyAssigned = true; - _schoolReference = value; + _educationOrganizationReferenceExplicitlyAssigned = true; + _educationOrganizationReference = value; } } - private bool _sessionReferenceExplicitlyAssigned; - private Session.EdFi.SessionReference _sessionReference; - private Session.EdFi.SessionReference ImplicitSessionReference + private bool _programReferenceExplicitlyAssigned; + private Program.EdFi.ProgramReference _programReference; + private Program.EdFi.ProgramReference ImplicitProgramReference { get { // if the Reference is null, it is instantiated unless it has been explicitly assigned to null - if (_sessionReference == null && !_sessionReferenceExplicitlyAssigned) - _sessionReference = new Session.EdFi.SessionReference(); + if (_programReference == null && !_programReferenceExplicitlyAssigned) + _programReference = new Program.EdFi.ProgramReference(); - return _sessionReference; + return _programReference; } } - [DataMember(Name="sessionReference")] + [DataMember(Name="programReference")] [FullyDefinedReference][RequiredReference(isIdentifying: true)] - public Session.EdFi.SessionReference SessionReference + public Program.EdFi.ProgramReference ProgramReference { get { // Only return the reference if it's non-null, and all its properties have non-default values assigned - if (ImplicitSessionReference != null - && (_sessionReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) - return ImplicitSessionReference; + if (ImplicitProgramReference != null + && (_programReferenceExplicitlyAssigned || _SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference; return null; } set { - _sessionReferenceExplicitlyAssigned = true; - _sessionReference = value; + _programReferenceExplicitlyAssigned = true; + _programReference = value; } } private bool _studentReferenceExplicitlyAssigned; @@ -213363,33 +221804,24 @@ public Student.EdFi.StudentReference StudentReference // ------------------------------------------------------------- /// - /// A code describing the attendance event, for example: Present Unexcused absence Excused absence Tardy. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="attendanceEventCategoryDescriptor")][DescriptorExists("AttendanceEventCategoryDescriptor")] - public string AttendanceEventCategoryDescriptor { get; set; } - - /// - /// Date for this attendance event. + /// The earliest date the student is involved with the program. Typically, this is the date the student becomes eligible for the program. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column [RequiredWithNonDefault] - [DataMember(Name="eventDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime EventDate { get; set; } + [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime BeginDate { get; set; } /// - /// The identifier assigned to a school. It must be distinct from any other identifier assigned to educational organizations, such as a LocalEducationAgencyId, to prevent duplication. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - long Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SchoolId + long Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationId { get { - if (ImplicitSchoolReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSchoolReference.IsReferenceFullyDefined())) - return ImplicitSchoolReference.SchoolId; + if (ImplicitEducationOrganizationReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitEducationOrganizationReference.IsReferenceFullyDefined())) + return ImplicitEducationOrganizationReference.EducationOrganizationId; return default(long); } @@ -213398,52 +221830,48 @@ long Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SchoolId // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // School - _schoolReferenceExplicitlyAssigned = false; - ImplicitSchoolReference.SchoolId = value; - - // Session - _sessionReferenceExplicitlyAssigned = false; - ImplicitSessionReference.SchoolId = value; + // EducationOrganization + _educationOrganizationReferenceExplicitlyAssigned = false; + ImplicitEducationOrganizationReference.EducationOrganizationId = value; } } /// - /// The identifier for the school year. + /// The identifier assigned to an education organization. /// // IS in a reference, NOT a lookup column - short Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SchoolYear + long Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramEducationOrganizationId { get { - if (ImplicitSessionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) - return ImplicitSessionReference.SchoolYear; + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; - return default(short); + return default(long); } set { // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Session - _sessionReferenceExplicitlyAssigned = false; - ImplicitSessionReference.SchoolYear = value; + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.EducationOrganizationId = value; } } /// - /// The identifier for the calendar for the academic session. + /// The formal name of the program of instruction, training, services, or benefits available through federal, state, or local agencies. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionName + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramName { get { - if (ImplicitSessionReference != null - && (_SuspendReferenceAssignmentCheck || ImplicitSessionReference.IsReferenceFullyDefined())) - return ImplicitSessionReference.SessionName; + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramName; return default(string); } @@ -213452,9 +221880,30 @@ string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionName // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. // All ExplicitlyAssigned are reset to false in advanced - // Session - _sessionReferenceExplicitlyAssigned = false; - ImplicitSessionReference.SessionName = value; + // Program + _programReferenceExplicitlyAssigned = false; + ImplicitProgramReference.ProgramName = value; + } + } + + /// + /// The type of program. + /// + + // IS in a reference (StudentSchoolFoodServiceProgramAssociation.ProgramTypeDescriptorId), IS a lookup column + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramTypeDescriptor + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.ProgramTypeDescriptor; + + return null; + } + set + { + ImplicitProgramReference.ProgramTypeDescriptor = value; } } @@ -213462,7 +221911,7 @@ string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionName /// A unique alphanumeric code assigned to a student. /// // IS in a reference, NOT a lookup column - string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentUniqueId + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentUniqueId { get { @@ -213497,7 +221946,7 @@ string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentSchoolAttendanceEvent; + var compareTo = obj as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -213507,32 +221956,32 @@ public override bool Equals(object obj) // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).AttendanceEventCategoryDescriptor, compareTo.AttendanceEventCategoryDescriptor)) + if (!(this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; - // Standard Property - if (!(this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).EventDate.Equals(compareTo.EventDate)) + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolId.Equals(compareTo.SchoolId)) + if (!(this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolYear.Equals(compareTo.SchoolYear)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramName, compareTo.ProgramName)) return false; - // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SessionName, compareTo.SessionName)) + // Unified Type Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -213550,24 +221999,24 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).AttendanceEventCategoryDescriptor); - - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).EventDate); + hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).BeginDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolId); + hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SchoolYear); + hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramEducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).SessionName); + hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramName); + + //Unified Type Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramTypeDescriptor); + //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolAttendanceEvent).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -213575,57 +222024,40 @@ public override int GetHashCode() // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// The time of day the student arrived for the attendance event in ISO 8601 format. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="arrivalTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan? ArrivalTime { get; set; } - - /// - /// The reported reason for a student's absence. - /// - // NOT in a reference, NOT a lookup column - [NonDefaultStringLength(255, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="attendanceEventReason")] - public string AttendanceEventReason { get; set; } /// - /// The time of day the student departed for the attendance event in ISO 8601 format. + /// The month, day, and year on which the student exited the program or stopped receiving services. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="departureTime")][JsonConverter(typeof(UtcTimeConverter))] - public TimeSpan? DepartureTime { get; set; } + [DataMember(Name="endDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? EndDate { get; set; } /// - /// The setting in which a child receives education and related services. This attribute is only used if it differs from the EducationalEnvironment of the Section. This is only used in the AttendanceEvent if different from the associated Section. + /// The reason the student left the program within a school or district. /// // NOT in a reference, IS a lookup column [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] - [DataMember(Name="educationalEnvironmentDescriptor")][DescriptorExists("EducationalEnvironmentDescriptor")] - public string EducationalEnvironmentDescriptor { get; set; } + [DataMember(Name="reasonExitedDescriptor")][DescriptorExists("ReasonExitedDescriptor")] + public string ReasonExitedDescriptor { get; set; } /// - /// The amount of time in days for the event as recognized by the school: 1 day = 1, 1/2 day = 0.5, 1/3 day = 0.33. + /// Indicates whether the student received services during the summer session or between sessions. /// // NOT in a reference, NOT a lookup column - [Range(typeof(decimal), "0", "1", ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="eventDuration")] - public decimal? EventDuration { get; set; } + [DataMember(Name="servedOutsideOfRegularSession")] + public bool? ServedOutsideOfRegularSession { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- /// - /// The duration in minutes of the school attendance event. + /// Indicates that the student's National School Lunch Program (NSLP) eligibility has been determined through direct certification. /// // NOT in a reference, NOT a lookup column - [Range(0, 1440, ErrorMessage=ValidationHelpers.RangeMessageFormat)] - [DataMember(Name="schoolAttendanceDuration")] - public int? SchoolAttendanceDuration { get; set; } + [DataMember(Name="directCertification")] + public bool? DirectCertification { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -213641,18 +222073,69 @@ public override int GetHashCode() // ============================================================= // Inherited Collections // ------------------------------------------------------------- + private ICollection _generalStudentProgramAssociationProgramParticipationStatuses; + private ICollection _generalStudentProgramAssociationProgramParticipationStatusesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="programParticipationStatuses")] + public ICollection GeneralStudentProgramAssociationProgramParticipationStatuses + { + get { return _generalStudentProgramAssociationProgramParticipationStatuses; } + set + { + _generalStudentProgramAssociationProgramParticipationStatuses = value; + _generalStudentProgramAssociationProgramParticipationStatusesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGeneralStudentProgramAssociation.GeneralStudentProgramAssociationProgramParticipationStatuses + { + get { return _generalStudentProgramAssociationProgramParticipationStatusesCovariant; } + set { GeneralStudentProgramAssociationProgramParticipationStatuses = new List(value.Cast()); } + } // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentSchoolAttendanceEvent", "StudentSchoolAttendanceEvent")] + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentSchoolFoodServiceProgramAssociation", "StudentSchoolFoodServiceProgramAssociation")] public System.Collections.IDictionary Extensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Collections // ------------------------------------------------------------- + private ICollection _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices; + private ICollection _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesCovariant; + + [NoDuplicateMembers] + [DataMember(Name="schoolFoodServiceProgramServices")] + public ICollection StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices + { + get { return _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices; } + set + { + if (value == null) return; + // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent + var list = new CollectionAdapterWithAddNotifications(value, + (s, e) => ((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)e.Item).StudentSchoolFoodServiceProgramAssociation = this); + _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices = list; + + // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) + var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); + covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)e.Item).StudentSchoolFoodServiceProgramAssociation = this; + _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesCovariant = covariantList; + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices + { + get { return _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesCovariant; } + set { StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices = new List(value.Cast()); } + } + // ------------------------------------------------------------- // ============================================================= @@ -213670,6 +222153,22 @@ public override int GetHashCode() // ------------------------------------------------------------- // OnDeserialize // ------------------------------------------------------------- + + [OnDeserialized] + internal void OnDeserialized(StreamingContext context) + { + // Reconnect collection item parent references on deserialization + if (_generalStudentProgramAssociationProgramParticipationStatuses != null) foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) + { + item.GeneralStudentProgramAssociation = this; + } + + if (_studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices != null) foreach (var item in _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices) + { + item.StudentSchoolFoodServiceProgramAssociation = this; + } + + } // ------------------------------------------------------------ // ============================================================ @@ -213677,46 +222176,53 @@ public override int GetHashCode() // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentSchoolAttendanceEventMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolAttendanceEvent)target); + return Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentSchoolAttendanceEventMapper.MapTo(this, (Entities.Common.EdFi.IStudentSchoolAttendanceEvent)target, null); + Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationMapper.MapDerivedTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation)target, null); } // ------------------------------------------------------------- // ================================================================= // Resource Reference Data // ----------------------------------------------------------------- - Guid? Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SchoolResourceId + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationResourceId { get { return null; } - set { ImplicitSchoolReference.ResourceId = value ?? default(Guid); } + set { ImplicitEducationOrganizationReference.ResourceId = value ?? default(Guid); } } + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationDiscriminator + { + // Not supported for Resources + get { return null; } + set { ImplicitEducationOrganizationReference.Discriminator = value; } + } - Guid? Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionResourceId + + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramResourceId { get { return null; } - set { ImplicitSessionReference.ResourceId = value ?? default(Guid); } + set { ImplicitProgramReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionDiscriminator + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramDiscriminator { // Not supported for Resources get { return null; } - set { ImplicitSessionReference.Discriminator = value; } + set { ImplicitProgramReference.Discriminator = value; } } - Guid? Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentResourceId + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentResourceId { get { return null; } set { ImplicitStudentReference.ResourceId = value ?? default(Guid); } } - string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentDiscriminator + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminator { // Not supported for Resources get { return null; } @@ -213746,6 +222252,30 @@ string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentDiscriminator // ---------------------- // Validate collections // ---------------------- + if (GeneralStudentProgramAssociationProgramParticipationStatuses.Any() && mappingContract?.IsMemberSupported("GeneralStudentProgramAssociationProgramParticipationStatuses") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("GeneralStudentProgramAssociationProgramParticipationStatuses"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(GeneralStudentProgramAssociationProgramParticipationStatuses, validationContext, validationContext.Items.ForCollection("GeneralStudentProgramAssociationProgramParticipationStatuses")))) + { + yield return result; + } + } + + if (StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices.Any() && mappingContract?.IsMemberSupported("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices") != false) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices"); + + foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices, validationContext, validationContext.Items.ForCollection("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices")))) + { + yield return result; + } + } + // --------------------------- // Validate embedded objects @@ -213765,44 +222295,346 @@ string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentDiscriminator yield return result; } } + + // Execute the resource's fluent validator + var fluentValidationResult = _validator.Validate(this); - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; + if (!fluentValidationResult.IsValid) + { + foreach (var error in fluentValidationResult.Errors) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); + } + } + } + finally + { + // Restore original length + pathBuilder.Length = originalLength; + } + // ---------------------------------- + } + } - var sourcesForSchoolId = GetSchoolIdSources().ToArray(); + // ================================================================= + // Validators + // ----------------------------------------------------------------- - if (!sourcesForSchoolId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); + [ExcludeFromCodeCoverage] + public class StudentSchoolFoodServiceProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + { + private static readonly FullName _fullName_edfi_StudentSchoolFoodServiceProgramAssociation = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociation"); - string values = string.Join("', '", sourcesForSchoolId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForSchoolId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; + // Declare collection item validators + private StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesValidator = new (); + private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator _generalStudentProgramAssociationProgramParticipationStatusesValidator = new (); - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'schoolId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForSchoolId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + { + if (context.InstanceToValidate == null) + { + result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); + + return false; + } + + var instance = context.InstanceToValidate; + + var failures = new List(); + + // Profile-based collection item filter validation + string profileName = null; + + // Get the current mapping contract + var mappingContract = (StudentSchoolFoodServiceProgramAssociationMappingContract) GeneratedArtifactStaticDependencies.MappingContractProvider + .GetMappingContract(_fullName_edfi_StudentSchoolFoodServiceProgramAssociation); + + if (mappingContract != null) + { + if (mappingContract.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceIncluded != null) + { + var hasInvalidStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesItems = instance.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices.Any(x => !mappingContract.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceIncluded(x)); + + if (hasInvalidStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesItems) + { + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices", $"A supplied 'StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); + } } - - IEnumerable<(string path, long value)> GetSchoolIdSources() + + if (mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded != null) { - // Obtain value from other references - var valueFromSchoolReference = this.SchoolReference?.SchoolId; - - if (valueFromSchoolReference != null) + var hasInvalidGeneralStudentProgramAssociationProgramParticipationStatusesItems = instance.GeneralStudentProgramAssociationProgramParticipationStatuses.Any(x => !mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded(x)); + + if (hasInvalidGeneralStudentProgramAssociationProgramParticipationStatusesItems) { - yield return ("schoolReference.schoolId", this.SchoolReference.SchoolId); + profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; + failures.Add(new ValidationFailure("GeneralStudentProgramAssociationProgramParticipationStatuses", $"A supplied 'GeneralStudentProgramAssociationProgramParticipationStatus' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); } + } + + } + + if (failures.Any()) + { + foreach (var failure in failures) + { + result.Errors.Add(failure); + } + + return false; + } + + return true; + } + } + // ----------------------------------------------------------------- + + /// + /// A class which represents the edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService table of the StudentSchoolFoodServiceProgramAssociation aggregate in the ODS Database. + /// + [Serializable, DataContract] + [ExcludeFromCodeCoverage] + public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService : Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService, IValidatableObject + { + private static FullName _fullName = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService"); + + // Fluent validator instance (threadsafe) + private static StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator _validator = new StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator(); + +#pragma warning disable 414 + private bool _SuspendReferenceAssignmentCheck = false; + public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } +#pragma warning restore 414 + + // ============================================================= + // Constructor + // ------------------------------------------------------------- + + + // ------------------------------------------------------------ + + // ============================================================ + // Unique Identifier + // ------------------------------------------------------------ + // ------------------------------------------------------------ + + // ============================================================= + // References + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================== + // Primary Key + // ------------------------------------------------------------- + private Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation _studentSchoolFoodServiceProgramAssociation; + + [IgnoreDataMember] + Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService.StudentSchoolFoodServiceProgramAssociation + { + get { return _studentSchoolFoodServiceProgramAssociation; } + set { SetStudentSchoolFoodServiceProgramAssociation(value); } + } + + public Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation StudentSchoolFoodServiceProgramAssociation + { + set { SetStudentSchoolFoodServiceProgramAssociation(value); } + } + + private void SetStudentSchoolFoodServiceProgramAssociation(Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation value) + { + _studentSchoolFoodServiceProgramAssociation = value; + } + + /// + /// Indicates the service being provided to the student by the school food service program. + /// + // NOT in a reference, IS a lookup column + [RequiredWithNonDefault] + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] + [DataMember(Name="schoolFoodServiceProgramServiceDescriptor")][DescriptorExists("SchoolFoodServiceProgramServiceDescriptor")] + public string SchoolFoodServiceProgramServiceDescriptor { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Equality + // ------------------------------------------------------------- + + /// + /// Determines equality based on the natural key properties of the resource. + /// + /// + /// A boolean value indicating equality result of the compared resources. + /// + public override bool Equals(object obj) + { + var compareTo = obj as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + // Parent Property + if (_studentSchoolFoodServiceProgramAssociation == null || !_studentSchoolFoodServiceProgramAssociation.Equals(compareTo.StudentSchoolFoodServiceProgramAssociation)) + return false; + + + // Standard Property + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService).SchoolFoodServiceProgramServiceDescriptor, compareTo.SchoolFoodServiceProgramServiceDescriptor)) + return false; + + + return true; + } + + /// + /// Builds the hash code based on the unique identifying values. + /// + /// + /// A hash code for the resource. + /// + public override int GetHashCode() + { + var hash = new HashCode(); + //Parent Property + if (_studentSchoolFoodServiceProgramAssociation != null) + hash.Add(_studentSchoolFoodServiceProgramAssociation); + + // Standard Property + hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService).SchoolFoodServiceProgramServiceDescriptor); + + return hash.ToHashCode(); + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + + /// + /// True if service is a primary service. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="primaryIndicator")] + public bool? PrimaryIndicator { get; set; } + + /// + /// First date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="serviceBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? ServiceBeginDate { get; set; } + + /// + /// Last date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="serviceEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? ServiceEndDate { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentSchoolFoodServiceProgramAssociation", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService")] + public System.Collections.IDictionary Extensions { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Versioning + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ------------------------------------------------------------- + // OnDeserialize + // ------------------------------------------------------------- + // ------------------------------------------------------------ + + // ============================================================ + // Data Synchronization + // ------------------------------------------------------------ + bool ISynchronizable.Synchronize(object target) + { + return Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)target); + } + + void IMappable.Map(object target) + { + Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMapper.MapTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)target, null); + } + // ------------------------------------------------------------- + + // ================================================================= + // Resource Reference Data + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + // ================================== + // Validation + // ---------------------------------- + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; + var mappingContract = mappingContractProvider.GetMappingContract(_fullName); + + var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); + + int originalLength = pathBuilder.Length; + + try + { + // Prepare builders for validating members + pathBuilder.Append(ValidationHelpers.JsonPathSeparator); + int dotLength = pathBuilder.Length; + + // ---------------------- + // Validate collections + // ---------------------- + + // --------------------------- + // Validate embedded objects + // --------------------------- + + // --------------------- + // Validate Extensions + // --------------------- + if (Extensions != null) + { + // Reset path builder + pathBuilder.Length = dotLength; + pathBuilder.Append(nameof(Extensions)); - // Obtain value from other references - var valueFromSessionReference = this.SessionReference?.SchoolId; - - if (valueFromSessionReference != null) + foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) { - yield return ("sessionReference.schoolId", this.SessionReference.SchoolId); + yield return result; } - } // Execute the resource's fluent validator @@ -213830,9 +222662,9 @@ string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.StudentDiscriminator // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentSchoolAttendanceEventPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator : FluentValidation.AbstractValidator { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -213861,16 +222693,16 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// Represents a reference to the StudentSchoolFoodServiceProgramAssociation resource. + /// Represents a reference to the StudentSection504ProgramAssociation resource. /// [DataContract] [ExcludeFromCodeCoverage] - public class StudentSchoolFoodServiceProgramAssociationReference : IResourceReference + public class StudentSection504ProgramAssociationReference : IResourceReference { [DataMember(Name="beginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] public DateTime BeginDate { get; set; } @@ -213970,8 +222802,8 @@ private Link CreateLink() { var link = new Link { - Rel = "StudentSchoolFoodServiceProgramAssociation", - Href = $"/ed-fi/studentSchoolFoodServiceProgramAssociations/{ResourceId:n}" + Rel = "StudentSection504ProgramAssociation", + Href = $"/ed-fi/studentSection504ProgramAssociations/{ResourceId:n}" }; return link; @@ -213979,16 +222811,17 @@ private Link CreateLink() } // Aggregate reference /// - /// A class which represents the edfi.StudentSchoolFoodServiceProgramAssociation table of the StudentSchoolFoodServiceProgramAssociation aggregate in the ODS Database. + /// A class which represents the edfi.StudentSection504ProgramAssociation table of the StudentSection504ProgramAssociation aggregate in the ODS Database. /// [Serializable, DataContract] [ExcludeFromCodeCoverage] - public class StudentSchoolFoodServiceProgramAssociation : Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation, Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasETag, IDateVersionedEntity, IValidatableObject + [NoUnsuppliedRequiredMembersWithMeaningfulDefaults] + public class StudentSection504ProgramAssociation : Entities.Common.EdFi.IStudentSection504ProgramAssociation, Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasETag, IDateVersionedEntity, IHasRequiredMembersWithMeaningfulDefaultValues, IValidatableObject { - private static FullName _fullName = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociation"); + private static FullName _fullName = new FullName("edfi", "StudentSection504ProgramAssociation"); // Fluent validator instance (threadsafe) - private static StudentSchoolFoodServiceProgramAssociationPutPostRequestValidator _validator = new StudentSchoolFoodServiceProgramAssociationPutPostRequestValidator(); + private static StudentSection504ProgramAssociationPutPostRequestValidator _validator = new StudentSection504ProgramAssociationPutPostRequestValidator(); #pragma warning disable 414 private bool _SuspendReferenceAssignmentCheck = false; @@ -213999,9 +222832,8 @@ public class StudentSchoolFoodServiceProgramAssociation : Entities.Common.EdFi.I // Constructor // ------------------------------------------------------------- - public StudentSchoolFoodServiceProgramAssociation() + public StudentSection504ProgramAssociation() { - StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices = new List(); // Inherited lists GeneralStudentProgramAssociationProgramParticipationStatuses = new List(); @@ -214014,7 +222846,7 @@ public StudentSchoolFoodServiceProgramAssociation() // ------------------------------------------------------------ /// - /// The unique identifier for the StudentSchoolFoodServiceProgramAssociation resource. + /// The unique identifier for the StudentSection504ProgramAssociation resource. /// [DataMember(Name="id")] [JsonConverter(typeof(GuidConverter))] @@ -214217,7 +223049,7 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramName /// The type of program. /// - // IS in a reference (StudentSchoolFoodServiceProgramAssociation.ProgramTypeDescriptorId), IS a lookup column + // IS in a reference (StudentSection504ProgramAssociation.ProgramTypeDescriptorId), IS a lookup column string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramTypeDescriptor { get @@ -214273,7 +223105,7 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentUniqueId /// public override bool Equals(object obj) { - var compareTo = obj as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation; + var compareTo = obj as Entities.Common.EdFi.IStudentSection504ProgramAssociation; if (ReferenceEquals(this, compareTo)) return true; @@ -214283,32 +223115,32 @@ public override bool Equals(object obj) // Standard Property - if (!(this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) + if (!(this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).BeginDate.Equals(compareTo.BeginDate)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) + if (!(this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).EducationOrganizationId.Equals(compareTo.EducationOrganizationId)) return false; // Referenced Property - if (!(this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + if (!(this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramName, compareTo.ProgramName)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).ProgramName, compareTo.ProgramName)) return false; // Unified Type Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) + if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).ProgramTypeDescriptor, compareTo.ProgramTypeDescriptor)) return false; // Referenced Property - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).StudentUniqueId, compareTo.StudentUniqueId)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).StudentUniqueId, compareTo.StudentUniqueId)) return false; @@ -214326,24 +223158,24 @@ public override int GetHashCode() var hash = new HashCode(); // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).BeginDate); + hash.Add((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).BeginDate); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).EducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).EducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramEducationOrganizationId); + hash.Add((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).ProgramEducationOrganizationId); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramName); + hash.Add((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).ProgramName); //Unified Type Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).ProgramTypeDescriptor); + hash.Add((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).ProgramTypeDescriptor); //Referenced Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation).StudentUniqueId); + hash.Add((this as Entities.Common.EdFi.IStudentSection504ProgramAssociation).StudentUniqueId); return hash.ToHashCode(); } // ------------------------------------------------------------- @@ -214380,13 +223212,62 @@ public override int GetHashCode() // ------------------------------------------------------------- /// - /// Indicates that the student's National School Lunch Program (NSLP) eligibility has been determined through direct certification. + /// Indicates whether student has a Section 504 accommodation plan. /// // NOT in a reference, NOT a lookup column - [DataMember(Name="directCertification")] - public bool? DirectCertification { get; set; } + [DataMember(Name="accommodationPlan")] + public bool? AccommodationPlan { get; set; } + + /// + /// Defines one or more disabilities student has that qualifies them for a Section 504 plan. + /// + // NOT in a reference, IS a lookup column + [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText] + [DataMember(Name="section504DisabilityTypeDescriptor")][DescriptorExists("Section504DisabilityTypeDescriptor")] + public string Section504DisabilityTypeDescriptor { get; set; } + + private bool _section504EligibilityExplicitlyAssigned = false; + private bool _section504Eligibility; + + /// + /// Indicates whether student has a disability, either temporary or permenant, that qualifies student for Section 504 consideration. Selection of FALSE for this boolean is equivalent to marking student as 'Did Not Qualify'. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="section504Eligibility")] + public bool Section504Eligibility + { + get => _section504Eligibility; + set + { + _section504Eligibility = value; + _section504EligibilityExplicitlyAssigned = true; + } + } + + + /// + /// The month, day, and year on which the Section 504 eligibility decision is made. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="section504EligibilityDecisionDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? Section504EligibilityDecisionDate { get; set; } + + /// + /// The month, day, and year on which the meeting with student's parent/guardian held to discuss the 504 eligibility of the student. + /// + // NOT in a reference, NOT a lookup column + [DataMember(Name="section504MeetingDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] + public DateTime? Section504MeetingDate { get; set; } // ------------------------------------------------------------- + IEnumerable IHasRequiredMembersWithMeaningfulDefaultValues.GetUnassignedMemberNames() + { + if (!_section504EligibilityExplicitlyAssigned) + { + yield return "Section504Eligibility"; + } + } + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -214426,43 +223307,13 @@ public ICollection _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices; - private ICollection _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesCovariant; - - [NoDuplicateMembers] - [DataMember(Name="schoolFoodServiceProgramServices")] - public ICollection StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices - { - get { return _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices; } - set - { - if (value == null) return; - // Initialize primary list with notifying adapter immediately wired up so existing items are associated with the parent - var list = new CollectionAdapterWithAddNotifications(value, - (s, e) => ((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)e.Item).StudentSchoolFoodServiceProgramAssociation = this); - _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices = list; - - // Initialize covariant list with notifying adapter with deferred wire up so only new items are processed (optimization) - var covariantList = new CovariantCollectionAdapterWithAddNotifications(value); - covariantList.ItemAdded += (s, e) => ((Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)e.Item).StudentSchoolFoodServiceProgramAssociation = this; - _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesCovariant = covariantList; - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices - { - get { return _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesCovariant; } - set { StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices = new List(value.Cast()); } - } - // ------------------------------------------------------------- // ============================================================= @@ -214490,11 +223341,6 @@ internal void OnDeserialized(StreamingContext context) item.GeneralStudentProgramAssociation = this; } - if (_studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices != null) foreach (var item in _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices) - { - item.StudentSchoolFoodServiceProgramAssociation = this; - } - } // ------------------------------------------------------------ @@ -214503,12 +223349,12 @@ internal void OnDeserialized(StreamingContext context) // ------------------------------------------------------------ bool ISynchronizable.Synchronize(object target) { - return Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation)target); + return Entities.Common.EdFi.StudentSection504ProgramAssociationMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSection504ProgramAssociation)target); } void IMappable.Map(object target) { - Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationMapper.MapDerivedTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation)target, null); + Entities.Common.EdFi.StudentSection504ProgramAssociationMapper.MapDerivedTo(this, (Entities.Common.EdFi.IStudentSection504ProgramAssociation)target, null); } // ------------------------------------------------------------- @@ -214591,18 +223437,6 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminat } } - if (StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices.Any() && mappingContract?.IsMemberSupported("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices") != false) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices"); - - foreach (var result in ValidationHelpers.ValidateCollection(new ValidationContext(StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices, validationContext, validationContext.Items.ForCollection("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices")))) - { - yield return result; - } - } - // --------------------------- // Validate embedded objects @@ -214648,15 +223482,14 @@ string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminat // ----------------------------------------------------------------- [ExcludeFromCodeCoverage] - public class StudentSchoolFoodServiceProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator + public class StudentSection504ProgramAssociationPutPostRequestValidator : FluentValidation.AbstractValidator { - private static readonly FullName _fullName_edfi_StudentSchoolFoodServiceProgramAssociation = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociation"); + private static readonly FullName _fullName_edfi_StudentSection504ProgramAssociation = new FullName("edfi", "StudentSection504ProgramAssociation"); // Declare collection item validators - private StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesValidator = new (); private GeneralStudentProgramAssociation.EdFi.GeneralStudentProgramAssociationProgramParticipationStatusPutPostRequestValidator _generalStudentProgramAssociationProgramParticipationStatusesValidator = new (); - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) + protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) { if (context.InstanceToValidate == null) { @@ -214673,22 +223506,11 @@ protected override bool PreValidate(FluentValidation.ValidationContext !mappingContract.IsStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceIncluded(x)); - - if (hasInvalidStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesItems) - { - profileName ??= GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName; - failures.Add(new ValidationFailure("StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices", $"A supplied 'StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService' has a descriptor value that does not conform with the filter values defined by profile '{profileName}'.")); - } - } - if (mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded != null) { var hasInvalidGeneralStudentProgramAssociationProgramParticipationStatusesItems = instance.GeneralStudentProgramAssociationProgramParticipationStatuses.Any(x => !mappingContract.IsGeneralStudentProgramAssociationProgramParticipationStatusIncluded(x)); @@ -214717,308 +223539,6 @@ protected override bool PreValidate(FluentValidation.ValidationContext - /// A class which represents the edfi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService table of the StudentSchoolFoodServiceProgramAssociation aggregate in the ODS Database. - /// - [Serializable, DataContract] - [ExcludeFromCodeCoverage] - public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService : Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService, IValidatableObject - { - private static FullName _fullName = new FullName("edfi", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService"); - - // Fluent validator instance (threadsafe) - private static StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator _validator = new StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator(); - -#pragma warning disable 414 - private bool _SuspendReferenceAssignmentCheck = false; - public void SuspendReferenceAssignmentCheck() { _SuspendReferenceAssignmentCheck = true; } -#pragma warning restore 414 - - // ============================================================= - // Constructor - // ------------------------------------------------------------- - - - // ------------------------------------------------------------ - - // ============================================================ - // Unique Identifier - // ------------------------------------------------------------ - // ------------------------------------------------------------ - - // ============================================================= - // References - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================== - // Primary Key - // ------------------------------------------------------------- - private Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation _studentSchoolFoodServiceProgramAssociation; - - [IgnoreDataMember] - Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService.StudentSchoolFoodServiceProgramAssociation - { - get { return _studentSchoolFoodServiceProgramAssociation; } - set { SetStudentSchoolFoodServiceProgramAssociation(value); } - } - - public Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation StudentSchoolFoodServiceProgramAssociation - { - set { SetStudentSchoolFoodServiceProgramAssociation(value); } - } - - private void SetStudentSchoolFoodServiceProgramAssociation(Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation value) - { - _studentSchoolFoodServiceProgramAssociation = value; - } - - /// - /// Indicates the service being provided to the student by the school food service program. - /// - // NOT in a reference, IS a lookup column - [RequiredWithNonDefault] - [NonDefaultStringLength(306, ErrorMessage=ValidationHelpers.StringLengthMessageFormat), NoDangerousText, NoWhitespace] - [DataMember(Name="schoolFoodServiceProgramServiceDescriptor")][DescriptorExists("SchoolFoodServiceProgramServiceDescriptor")] - public string SchoolFoodServiceProgramServiceDescriptor { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Equality - // ------------------------------------------------------------- - - /// - /// Determines equality based on the natural key properties of the resource. - /// - /// - /// A boolean value indicating equality result of the compared resources. - /// - public override bool Equals(object obj) - { - var compareTo = obj as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - // Parent Property - if (_studentSchoolFoodServiceProgramAssociation == null || !_studentSchoolFoodServiceProgramAssociation.Equals(compareTo.StudentSchoolFoodServiceProgramAssociation)) - return false; - - - // Standard Property - if (!StringComparer.OrdinalIgnoreCase.Equals((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService).SchoolFoodServiceProgramServiceDescriptor, compareTo.SchoolFoodServiceProgramServiceDescriptor)) - return false; - - - return true; - } - - /// - /// Builds the hash code based on the unique identifying values. - /// - /// - /// A hash code for the resource. - /// - public override int GetHashCode() - { - var hash = new HashCode(); - //Parent Property - if (_studentSchoolFoodServiceProgramAssociation != null) - hash.Add(_studentSchoolFoodServiceProgramAssociation); - - // Standard Property - hash.Add((this as Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService).SchoolFoodServiceProgramServiceDescriptor); - - return hash.ToHashCode(); - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - - /// - /// True if service is a primary service. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="primaryIndicator")] - public bool? PrimaryIndicator { get; set; } - - /// - /// First date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="serviceBeginDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? ServiceBeginDate { get; set; } - - /// - /// Last date the student was in this option for the current school year. Note: Date interpretation may vary. Ed-Fi recommends inclusive dates, but states may define dates as inclusive or exclusive. For calculations, align with local guidelines. - /// - // NOT in a reference, NOT a lookup column - [DataMember(Name="serviceEndDate")][JsonConverter(typeof(Iso8601UtcDateOnlyConverter))] - public DateTime? ServiceEndDate { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - [JsonProperty("_ext")][JsonConverter(typeof(ExtensionsConverter), "StudentSchoolFoodServiceProgramAssociation", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService")] - public System.Collections.IDictionary Extensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Versioning - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ------------------------------------------------------------- - // OnDeserialize - // ------------------------------------------------------------- - // ------------------------------------------------------------ - - // ============================================================ - // Data Synchronization - // ------------------------------------------------------------ - bool ISynchronizable.Synchronize(object target) - { - return Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMapper.SynchronizeTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)target); - } - - void IMappable.Map(object target) - { - Entities.Common.EdFi.StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServiceMapper.MapTo(this, (Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService)target, null); - } - // ------------------------------------------------------------- - - // ================================================================= - // Resource Reference Data - // ----------------------------------------------------------------- - // ----------------------------------------------------------------- - - // ================================== - // Validation - // ---------------------------------- - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - var mappingContractProvider = GeneratedArtifactStaticDependencies.MappingContractProvider; - var mappingContract = mappingContractProvider.GetMappingContract(_fullName); - - var pathBuilder = ValidationHelpers.GetPathBuilder(validationContext); - - int originalLength = pathBuilder.Length; - - try - { - // Prepare builders for validating members - pathBuilder.Append(ValidationHelpers.JsonPathSeparator); - int dotLength = pathBuilder.Length; - - // ---------------------- - // Validate collections - // ---------------------- - - // --------------------------- - // Validate embedded objects - // --------------------------- - - // --------------------- - // Validate Extensions - // --------------------- - if (Extensions != null) - { - // Reset path builder - pathBuilder.Length = dotLength; - pathBuilder.Append(nameof(Extensions)); - - foreach (var result in ValidationHelpers.ValidateExtensions(validationContext, mappingContract)) - { - yield return result; - } - } - - // Execute the resource's fluent validator - var fluentValidationResult = _validator.Validate(this); - - if (!fluentValidationResult.IsValid) - { - foreach (var error in fluentValidationResult.Errors) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult(error.ErrorMessage, new[] { error.PropertyName }); - } - } - } - finally - { - // Restore original length - pathBuilder.Length = originalLength; - } - // ---------------------------------- - } - } - - // ================================================================= - // Validators - // ----------------------------------------------------------------- - - [ExcludeFromCodeCoverage] - public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicePutPostRequestValidator : FluentValidation.AbstractValidator - { - protected override bool PreValidate(FluentValidation.ValidationContext context, FluentValidation.Results.ValidationResult result) - { - if (context.InstanceToValidate == null) - { - result.Errors.Add(new ValidationFailure("", "Please ensure a model was supplied.")); - - return false; - } - - var instance = context.InstanceToValidate; - - var failures = new List(); - - if (failures.Any()) - { - foreach (var failure in failures) - { - result.Errors.Add(failure); - } - - return false; - } - - return true; - } - } - // ----------------------------------------------------------------- - } // Aggregate: StudentSectionAssociation @@ -220362,6 +228882,9 @@ public class StudentSpecialEducationProgramEligibilityAssociationReference : IRe [DataMember(Name="educationOrganizationId")] public long EducationOrganizationId { get; set; } + [DataMember(Name="programEducationOrganizationId")] + public long ProgramEducationOrganizationId { get; set; } + [DataMember(Name="programName")] public string ProgramName { get; set; } @@ -220416,7 +228939,7 @@ public Link Link /// true if the reference's properties are all set to non-default values; otherwise false. public bool IsReferenceFullyDefined() { - return ConsentToEvaluationReceivedDate != default(DateTime) && EducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StudentUniqueId != default(string); + return ConsentToEvaluationReceivedDate != default(DateTime) && EducationOrganizationId != default(long) && ProgramEducationOrganizationId != default(long) && ProgramName != default(string) && ProgramTypeDescriptor != default(string) && StudentUniqueId != default(string); } IEnumerable IResourceReference.GetUndefinedProperties() @@ -220431,6 +228954,11 @@ IEnumerable IResourceReference.GetUndefinedProperties() yield return "EducationOrganizationId"; } + if (ProgramEducationOrganizationId == default) + { + yield return "ProgramEducationOrganizationId"; + } + if (ProgramName == default) { yield return "ProgramName"; @@ -220654,6 +229182,27 @@ long Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation. // EducationOrganization _educationOrganizationReferenceExplicitlyAssigned = false; ImplicitEducationOrganizationReference.EducationOrganizationId = value; + } + } + + /// + /// The identifier assigned to an education organization. + /// + // IS in a reference, NOT a lookup column + long Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation.ProgramEducationOrganizationId + { + get + { + if (ImplicitProgramReference != null + && (_SuspendReferenceAssignmentCheck || ImplicitProgramReference.IsReferenceFullyDefined())) + return ImplicitProgramReference.EducationOrganizationId; + + return default(long); + } + set + { + // When a property is assigned, Reference should not be null even if it has been explicitly assigned to null. + // All ExplicitlyAssigned are reset to false in advanced // Program _programReferenceExplicitlyAssigned = false; @@ -220765,6 +229314,11 @@ public override bool Equals(object obj) return false; + // Referenced Property + if (!(this as Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation).ProgramEducationOrganizationId.Equals(compareTo.ProgramEducationOrganizationId)) + return false; + + // Referenced Property if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((this as Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation).ProgramName, compareTo.ProgramName)) return false; @@ -220800,6 +229354,9 @@ public override int GetHashCode() //Referenced Property hash.Add((this as Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation).EducationOrganizationId); + //Referenced Property + hash.Add((this as Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation).ProgramEducationOrganizationId); + //Referenced Property hash.Add((this as Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation).ProgramName); @@ -221078,45 +229635,6 @@ string Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociatio yield return result; } } - - // ----------------------- - // Validate unified keys - // ----------------------- - pathBuilder.Length = dotLength; - string pathPrefix = null; - - var sourcesForEducationOrganizationId = GetEducationOrganizationIdSources().ToArray(); - - if (!sourcesForEducationOrganizationId.Select(t => t.Item2).Where(v => !v.IsDefaultValue()).AllEqual()) - { - pathPrefix ??= pathBuilder.ToString(); - - string values = string.Join("', '", sourcesForEducationOrganizationId.Select(src => src.value.ToString().TrimAt(50, true))); - string parentContextNote = sourcesForEducationOrganizationId.Any(src => src.path == null) ? " (including those higher up in the resource's data)" : null; - - yield return new System.ComponentModel.DataAnnotations.ValidationResult($"All values supplied for 'educationOrganizationId' must match. Review all references{parentContextNote} and align the following conflicting values: '{values}'", - sourcesForEducationOrganizationId.Where(src => src.path != null).Select(src => $"{pathPrefix}{src.path}").ToArray()); - } - - IEnumerable<(string path, long value)> GetEducationOrganizationIdSources() - { - // Obtain value from other references - var valueFromEducationOrganizationReference = this.EducationOrganizationReference?.EducationOrganizationId; - - if (valueFromEducationOrganizationReference != null) - { - yield return ("educationOrganizationReference.educationOrganizationId", this.EducationOrganizationReference.EducationOrganizationId); - } - - // Obtain value from other references - var valueFromProgramReference = this.ProgramReference?.EducationOrganizationId; - - if (valueFromProgramReference != null) - { - yield return ("programReference.educationOrganizationId", this.ProgramReference.EducationOrganizationId); - } - - } // Execute the resource's fluent validator var fluentValidationResult = _validator.Validate(this); diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Security_Authorization_EntityAuthorizationContextProviders.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Security_Authorization_EntityAuthorizationContextProviders.generated.approved.cs index a9c60c925a..16cbf16a9e 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Security_Authorization_EntityAuthorizationContextProviders.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Security_Authorization_EntityAuthorizationContextProviders.generated.approved.cs @@ -10,6 +10,8 @@ using EdFi.Ods.Entities.NHibernate.AcademicWeekAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.AccountabilityRatingAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.AssessmentAggregate.EdFi; +using EdFi.Ods.Entities.NHibernate.AssessmentAdministrationAggregate.EdFi; +using EdFi.Ods.Entities.NHibernate.AssesssmentAdministrationParticipationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.BellScheduleAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.CalendarAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.CalendarDateAggregate.EdFi; @@ -80,12 +82,15 @@ using EdFi.Ods.Entities.NHibernate.StudentAcademicRecordAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentAssessmentAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentAssessmentEducationOrganizationAssociationAggregate.EdFi; +using EdFi.Ods.Entities.NHibernate.StudentAssessmentRegistrationAggregate.EdFi; +using EdFi.Ods.Entities.NHibernate.StudentAssessmentRegistrationBatteryPartAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentCohortAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentCompetencyObjectiveAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentContactAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentCTEProgramAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentBehaviorAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentNonOffenderAssociationAggregate.EdFi; +using EdFi.Ods.Entities.NHibernate.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentEducationOrganizationAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentEducationOrganizationResponsibilityAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentGradebookEntryAggregate.EdFi; @@ -102,6 +107,7 @@ using EdFi.Ods.Entities.NHibernate.StudentSchoolAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentSchoolAttendanceEventAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentSchoolFoodServiceProgramAssociationAggregate.EdFi; +using EdFi.Ods.Entities.NHibernate.StudentSection504ProgramAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentSectionAssociationAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentSectionAttendanceEventAggregate.EdFi; using EdFi.Ods.Entities.NHibernate.StudentSpecialEducationProgramAssociationAggregate.EdFi; @@ -251,6 +257,94 @@ public RelationshipsAuthorizationContextData GetContextData(object resource) } } + /// + /// Creates and returns an instance for making authorization decisions for access to the edfi.AssessmentAdministration table of the AssessmentAdministration aggregate in the Ods Database. + /// + [ExcludeFromCodeCoverage] + public class AssessmentAdministrationRelationshipsAuthorizationContextDataProvider : IRelationshipsAuthorizationContextDataProvider + { + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(IAssessmentAdministration resource) + { + if (resource == null) + throw new ArgumentNullException("resource", "The 'assessmentAdministration' resource for obtaining authorization context data cannot be null."); + + var entity = resource as AssessmentAdministration; + + var contextData = new RelationshipsAuthorizationContextData(); + // AssigningEducationOrganizationId = entity.AssigningEducationOrganizationId, // Primary key property, Role name applied + return contextData; + } + + /// + /// Creates and returns a signature key based on the resource, which can then be used to get and instance of IEdFiSignatureAuthorizationProvider + /// + public string[] GetAuthorizationContextPropertyNames() + { + var properties = new string[] + { + // "AssigningEducationOrganizationId", + }; + + return properties; + } + + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(object resource) + { + return GetContextData((AssessmentAdministration) resource); + } + } + + /// + /// Creates and returns an instance for making authorization decisions for access to the edfi.AssesssmentAdministrationParticipation table of the AssesssmentAdministrationParticipation aggregate in the Ods Database. + /// + [ExcludeFromCodeCoverage] + public class AssesssmentAdministrationParticipationRelationshipsAuthorizationContextDataProvider : IRelationshipsAuthorizationContextDataProvider + { + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(IAssesssmentAdministrationParticipation resource) + { + if (resource == null) + throw new ArgumentNullException("resource", "The 'assesssmentAdministrationParticipation' resource for obtaining authorization context data cannot be null."); + + var entity = resource as AssesssmentAdministrationParticipation; + + var contextData = new RelationshipsAuthorizationContextData(); + // AssigningEducationOrganizationId = entity.AssigningEducationOrganizationId, // Primary key property, Role name applied + // ParticipatingEducationOrganizationId = entity.ParticipatingEducationOrganizationId, // Primary key property, Role name applied + return contextData; + } + + /// + /// Creates and returns a signature key based on the resource, which can then be used to get and instance of IEdFiSignatureAuthorizationProvider + /// + public string[] GetAuthorizationContextPropertyNames() + { + var properties = new string[] + { + // "AssigningEducationOrganizationId", + // "ParticipatingEducationOrganizationId", + }; + + return properties; + } + + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(object resource) + { + return GetContextData((AssesssmentAdministrationParticipation) resource); + } + } + /// /// Creates and returns an instance for making authorization decisions for access to the edfi.BellSchedule table of the BellSchedule aggregate in the Ods Database. /// @@ -3347,6 +3441,106 @@ public RelationshipsAuthorizationContextData GetContextData(object resource) } } + /// + /// Creates and returns an instance for making authorization decisions for access to the edfi.StudentAssessmentRegistration table of the StudentAssessmentRegistration aggregate in the Ods Database. + /// + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationRelationshipsAuthorizationContextDataProvider : IRelationshipsAuthorizationContextDataProvider + { + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(IStudentAssessmentRegistration resource) + { + if (resource == null) + throw new ArgumentNullException("resource", "The 'studentAssessmentRegistration' resource for obtaining authorization context data cannot be null."); + + var entity = resource as StudentAssessmentRegistration; + + var contextData = new RelationshipsAuthorizationContextData(); + // AssigningEducationOrganizationId = entity.AssigningEducationOrganizationId, // Primary key property, Role name applied + contextData.EducationOrganizationId = entity.EducationOrganizationId == default(long) ? null as long? : entity.EducationOrganizationId; // Primary key property, Only Education Organization Id present + // ReportingEducationOrganizationId = entity.ReportingEducationOrganizationId, // Role name applied and not part of primary key + // SchoolId = entity.SchoolId, // Not part of primary key + contextData.StudentUSI = entity.StudentUSI == default(int) ? null as int? : entity.StudentUSI; // Primary key property, USI + // TestingEducationOrganizationId = entity.TestingEducationOrganizationId, // Role name applied and not part of primary key + return contextData; + } + + /// + /// Creates and returns a signature key based on the resource, which can then be used to get and instance of IEdFiSignatureAuthorizationProvider + /// + public string[] GetAuthorizationContextPropertyNames() + { + var properties = new string[] + { + // "AssigningEducationOrganizationId", + "EducationOrganizationId", + // "ReportingEducationOrganizationId", + // "SchoolId", + "StudentUSI", + // "TestingEducationOrganizationId", + }; + + return properties; + } + + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(object resource) + { + return GetContextData((StudentAssessmentRegistration) resource); + } + } + + /// + /// Creates and returns an instance for making authorization decisions for access to the edfi.StudentAssessmentRegistrationBatteryPartAssociation table of the StudentAssessmentRegistrationBatteryPartAssociation aggregate in the Ods Database. + /// + [ExcludeFromCodeCoverage] + public class StudentAssessmentRegistrationBatteryPartAssociationRelationshipsAuthorizationContextDataProvider : IRelationshipsAuthorizationContextDataProvider + { + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(IStudentAssessmentRegistrationBatteryPartAssociation resource) + { + if (resource == null) + throw new ArgumentNullException("resource", "The 'studentAssessmentRegistrationBatteryPartAssociation' resource for obtaining authorization context data cannot be null."); + + var entity = resource as StudentAssessmentRegistrationBatteryPartAssociation; + + var contextData = new RelationshipsAuthorizationContextData(); + // AssigningEducationOrganizationId = entity.AssigningEducationOrganizationId, // Primary key property, Role name applied + contextData.EducationOrganizationId = entity.EducationOrganizationId == default(long) ? null as long? : entity.EducationOrganizationId; // Primary key property, Only Education Organization Id present + contextData.StudentUSI = entity.StudentUSI == default(int) ? null as int? : entity.StudentUSI; // Primary key property, USI + return contextData; + } + + /// + /// Creates and returns a signature key based on the resource, which can then be used to get and instance of IEdFiSignatureAuthorizationProvider + /// + public string[] GetAuthorizationContextPropertyNames() + { + var properties = new string[] + { + // "AssigningEducationOrganizationId", + "EducationOrganizationId", + "StudentUSI", + }; + + return properties; + } + + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(object resource) + { + return GetContextData((StudentAssessmentRegistrationBatteryPartAssociation) resource); + } + } + /// /// Creates and returns an instance for making authorization decisions for access to the edfi.StudentCohortAssociation table of the StudentCohortAssociation aggregate in the Ods Database. /// @@ -3621,6 +3815,51 @@ public RelationshipsAuthorizationContextData GetContextData(object resource) } } + /// + /// Creates and returns an instance for making authorization decisions for access to the edfi.StudentEducationOrganizationAssessmentAccommodation table of the StudentEducationOrganizationAssessmentAccommodation aggregate in the Ods Database. + /// + [ExcludeFromCodeCoverage] + public class StudentEducationOrganizationAssessmentAccommodationRelationshipsAuthorizationContextDataProvider : IRelationshipsAuthorizationContextDataProvider + { + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(IStudentEducationOrganizationAssessmentAccommodation resource) + { + if (resource == null) + throw new ArgumentNullException("resource", "The 'studentEducationOrganizationAssessmentAccommodation' resource for obtaining authorization context data cannot be null."); + + var entity = resource as StudentEducationOrganizationAssessmentAccommodation; + + var contextData = new RelationshipsAuthorizationContextData(); + contextData.EducationOrganizationId = entity.EducationOrganizationId == default(long) ? null as long? : entity.EducationOrganizationId; // Primary key property, Only Education Organization Id present + contextData.StudentUSI = entity.StudentUSI == default(int) ? null as int? : entity.StudentUSI; // Primary key property, USI + return contextData; + } + + /// + /// Creates and returns a signature key based on the resource, which can then be used to get and instance of IEdFiSignatureAuthorizationProvider + /// + public string[] GetAuthorizationContextPropertyNames() + { + var properties = new string[] + { + "EducationOrganizationId", + "StudentUSI", + }; + + return properties; + } + + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(object resource) + { + return GetContextData((StudentEducationOrganizationAssessmentAccommodation) resource); + } + } + /// /// Creates and returns an instance for making authorization decisions for access to the edfi.StudentEducationOrganizationAssociation table of the StudentEducationOrganizationAssociation aggregate in the Ods Database. /// @@ -4363,6 +4602,53 @@ public RelationshipsAuthorizationContextData GetContextData(object resource) } } + /// + /// Creates and returns an instance for making authorization decisions for access to the edfi.StudentSection504ProgramAssociation table of the StudentSection504ProgramAssociation aggregate in the Ods Database. + /// + [ExcludeFromCodeCoverage] + public class StudentSection504ProgramAssociationRelationshipsAuthorizationContextDataProvider : IRelationshipsAuthorizationContextDataProvider + { + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(IStudentSection504ProgramAssociation resource) + { + if (resource == null) + throw new ArgumentNullException("resource", "The 'studentSection504ProgramAssociation' resource for obtaining authorization context data cannot be null."); + + var entity = resource as StudentSection504ProgramAssociation; + + var contextData = new RelationshipsAuthorizationContextData(); + contextData.EducationOrganizationId = entity.EducationOrganizationId == default(long) ? null as long? : entity.EducationOrganizationId; // Primary key property, Only Education Organization Id present + // ProgramEducationOrganizationId = entity.ProgramEducationOrganizationId, // Primary key property, Role name applied + contextData.StudentUSI = entity.StudentUSI == default(int) ? null as int? : entity.StudentUSI; // Primary key property, USI + return contextData; + } + + /// + /// Creates and returns a signature key based on the resource, which can then be used to get and instance of IEdFiSignatureAuthorizationProvider + /// + public string[] GetAuthorizationContextPropertyNames() + { + var properties = new string[] + { + "EducationOrganizationId", + // "ProgramEducationOrganizationId", + "StudentUSI", + }; + + return properties; + } + + /// + /// Creates and returns an instance based on the supplied resource. + /// + public RelationshipsAuthorizationContextData GetContextData(object resource) + { + return GetContextData((StudentSection504ProgramAssociation) resource); + } + } + /// /// Creates and returns an instance for making authorization decisions for access to the edfi.StudentSectionAssociation table of the StudentSectionAssociation aggregate in the Ods Database. /// @@ -4518,6 +4804,7 @@ public RelationshipsAuthorizationContextData GetContextData(IStudentSpecialEduca var contextData = new RelationshipsAuthorizationContextData(); contextData.EducationOrganizationId = entity.EducationOrganizationId == default(long) ? null as long? : entity.EducationOrganizationId; // Primary key property, Only Education Organization Id present + // ProgramEducationOrganizationId = entity.ProgramEducationOrganizationId, // Primary key property, Role name applied contextData.StudentUSI = entity.StudentUSI == default(int) ? null as int? : entity.StudentUSI; // Primary key property, USI return contextData; } @@ -4530,6 +4817,7 @@ public string[] GetAuthorizationContextPropertyNames() var properties = new string[] { "EducationOrganizationId", + // "ProgramEducationOrganizationId", "StudentUSI", }; diff --git a/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies.approved.txt b/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies.approved.txt index b025a64db3..8c45387fa2 100644 --- a/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies.approved.txt +++ b/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies.approved.txt @@ -1383,6 +1383,14 @@ "Update" ] }, + { + "resource": "/ed-fi/section504DisabilityTypeDescriptors", + "order": 1, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/sectionCharacteristicDescriptors", "order": 1, @@ -2362,6 +2370,14 @@ "Update" ] }, + { + "resource": "/ed-fi/assessmentBatteryParts", + "order": 14, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/assessmentScoreRangeLearningStandards", "order": 14, @@ -2434,6 +2450,14 @@ "Update" ] }, + { + "resource": "/ed-fi/studentEducationOrganizationAssessmentAccommodations", + "order": 14, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/studentEducationOrganizationAssociations", "order": 14, @@ -2554,6 +2578,14 @@ "Update" ] }, + { + "resource": "/ed-fi/studentSection504ProgramAssociations", + "order": 14, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/studentSectionAssociations", "order": 14, @@ -2609,6 +2641,14 @@ "Update" ] }, + { + "resource": "/ed-fi/assessmentAdministrations", + "order": 15, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/disciplineActions", "order": 15, @@ -2649,6 +2689,14 @@ "Update" ] }, + { + "resource": "/ed-fi/assesssmentAdministrationParticipations", + "order": 16, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/reportCards", "order": 16, @@ -2657,6 +2705,14 @@ "Update" ] }, + { + "resource": "/ed-fi/studentAssessmentRegistrations", + "order": 16, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/surveyQuestionResponses", "order": 16, @@ -2697,6 +2753,14 @@ "Update" ] }, + { + "resource": "/ed-fi/studentAssessmentRegistrationBatteryPartAssociations", + "order": 17, + "operations": [ + "Create", + "Update" + ] + }, { "resource": "/ed-fi/surveySectionResponseEducationOrganizationTargetAssociations", "order": 17, diff --git a/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies_GraphML.approved.txt b/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies_GraphML.approved.txt index 38ebc6ab13..5b36c2bff7 100644 --- a/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies_GraphML.approved.txt +++ b/tests/EdFi.Ods.WebApi.IntegrationTests/Controllers/Standard/5.2.0/AggregateDependencyControllerTests.Should_Get_Dependencies_GraphML.approved.txt @@ -14,6 +14,8 @@ + + @@ -23,6 +25,7 @@ + @@ -244,6 +247,7 @@ + @@ -277,6 +281,8 @@ + + @@ -285,6 +291,7 @@ + @@ -304,6 +311,7 @@ + @@ -356,7 +364,10 @@ + + + @@ -379,6 +390,10 @@ + + + + @@ -392,6 +407,8 @@ + + @@ -432,7 +449,9 @@ + + @@ -457,7 +476,9 @@ + + @@ -469,6 +490,7 @@ + @@ -477,7 +499,9 @@ + + @@ -502,7 +526,9 @@ + + @@ -514,6 +540,7 @@ + @@ -629,7 +656,9 @@ + + @@ -653,7 +682,9 @@ + + @@ -665,6 +696,7 @@ + @@ -674,7 +706,9 @@ + + @@ -699,7 +733,9 @@ + + @@ -711,6 +747,7 @@ + @@ -758,6 +795,7 @@ + @@ -879,7 +917,9 @@ + + @@ -904,7 +944,9 @@ + + @@ -916,6 +958,7 @@ + @@ -937,6 +980,7 @@ + @@ -950,7 +994,9 @@ + + @@ -973,7 +1019,9 @@ + + @@ -985,6 +1033,7 @@ + @@ -1003,6 +1052,7 @@ + @@ -1017,6 +1067,7 @@ + @@ -1027,7 +1078,9 @@ + + @@ -1052,7 +1105,9 @@ + + @@ -1064,6 +1119,7 @@ + @@ -1103,6 +1159,7 @@ + @@ -1133,6 +1190,7 @@ + @@ -1167,7 +1225,9 @@ + + @@ -1204,8 +1264,10 @@ + + @@ -1219,6 +1281,7 @@ + @@ -1227,6 +1290,7 @@ + @@ -1301,7 +1365,9 @@ + + @@ -1327,7 +1393,9 @@ + + @@ -1339,6 +1407,7 @@ + @@ -1347,12 +1416,15 @@ + + + @@ -1365,6 +1437,7 @@ + @@ -1372,6 +1445,7 @@ + @@ -1387,6 +1461,7 @@ + @@ -1396,6 +1471,7 @@ +